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
from django.db.models.sql import compiler class SQLCompiler(compiler.SQLCompiler): def resolve_columns(self, row, fields=()): values = [] index_extra_select = len(self.query.extra_select.keys()) for value, field in map(None, row[index_extra_select:], fields): if (field and field.get_internal_type() in ("BooleanField", "NullBooleanField") and value in (0, 1)): value = bool(value) values.append(value) return row[:index_extra_select] + tuple(values) class SQLInsertCompiler(compiler.SQLInsertCompiler, SQLCompiler): pass class SQLDeleteCompiler(compiler.SQLDeleteCompiler, SQLCompiler): pass class SQLUpdateCompiler(compiler.SQLUpdateCompiler, SQLCompiler): pass class SQLAggregateCompiler(compiler.SQLAggregateCompiler, SQLCompiler): pass class SQLDateCompiler(compiler.SQLDateCompiler, SQLCompiler): pass
ajibawa-2023/Python-Code-Large/train/row_99037
15
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_99037:ImportFrom_L1_C0", "label": "from django.db.models.sql import compiler", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.037, 0.037, 0, 0.66, 0.0, 841, 0, 1, 0, 0, 841, 0, 0], "semantic": {"name": "django.db.models.sql", "arg_names": [], "import_names": ["compiler"], "rhs_call_name": "", "annotation": ""}, "snippet": "from django.db.models.sql import compiler"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99037:ClassDef_L3_C0", "label": "SQLCompiler", "type": "class", "loc": [3, 12], "level": 0, "parent": null, "vector": [3, 0, 0.2778, 0.3704, 0, 0.66, 0.1667, 718, 0, 1, 0, 0, 749, 0, 7], "semantic": {"name": "SQLCompiler", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class SQLCompiler(compiler.SQLCompiler):\n def resolve_columns(self, row, fields=()):\n values = []\n index_extra_select = len(self.query.extra_select.keys())\n for value, field in map(None, row[index_extra_select:], fields):\n if (field and field.get_internal_type() in (\"BooleanField\", \"NullBooleanField\") and\n value in (0, 1)):\n value = bool(value)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99037:FunctionDef_L4_C4", "label": "resolve_columns", "type": "function", "loc": [4, 12], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99037:ClassDef_L3_C0", "vector": [2, 1, 0.2963, 0.3333, 1, 0.77, 0.0, 224, 0, 3, 1, 0, 0, 0, 7], "semantic": {"name": "resolve_columns", "arg_names": ["self", "row", "fields"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def resolve_columns(self, row, fields=()):\n values = []\n index_extra_select = len(self.query.extra_select.keys())\n for value, field in map(None, row[index_extra_select:], fields):\n if (field and field.get_internal_type() in (\"BooleanField\", \"NullBooleanField\") and\n value in (0, 1)):\n value = bool(value)\n values.append(value)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99037:Assign_L5_C8", "label": "values =", "type": "assigned_variable", "loc": [5, 5], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99037:FunctionDef_L4_C4", "vector": [14, 2, 0.1852, 0.037, 2, 0.7, 0.0, 721, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "values", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " values = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99037:Assign_L6_C8", "label": "index_extra_select = len()", "type": "assigned_variable", "loc": [6, 6], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99037:FunctionDef_L4_C4", "vector": [14, 2, 0.2222, 0.037, 2, 0.7, 0.3333, 407, 3, 1, 0, 0, 890, 10, 2], "semantic": {"name": "index_extra_select", "arg_names": [], "import_names": [], "rhs_call_name": "len", "annotation": ""}, "snippet": " index_extra_select = len(self.query.extra_select.keys())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99037:For_L7_C8", "label": "for value, field", "type": "for", "loc": [7, 11], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99037:FunctionDef_L4_C4", "vector": [6, 2, 0.3333, 0.1852, 2, 0.7, 0.6667, 261, 3, 0, 0, 0, 0, 0, 4], "semantic": {"name": "value, field", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for value, field in map(None, row[index_extra_select:], fields):\n if (field and field.get_internal_type() in (\"BooleanField\", \"NullBooleanField\") and\n value in (0, 1)):\n value = bool(value)\n values.append(value)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99037:If_L8_C12", "label": "if", "type": "if", "loc": [8, 10], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99037:For_L7_C8", "vector": [4, 3, 0.3333, 0.1111, 3, 0.12, 0.0, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if (field and field.get_internal_type() in (\"BooleanField\", \"NullBooleanField\") and\n value in (0, 1)):\n value = bool(value)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99037:Assign_L10_C16", "label": "value = bool()", "type": "assigned_variable", "loc": [10, 10], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99037:If_L8_C12", "vector": [14, 4, 0.3704, 0.037, 4, 0.74, 0.0, 441, 3, 1, 0, 0, 337, 10, 1], "semantic": {"name": "value", "arg_names": [], "import_names": [], "rhs_call_name": "bool", "annotation": ""}, "snippet": " value = bool(value)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99037:Expr_L11_C12", "label": "append()", "type": "expression", "loc": [11, 11], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99037:For_L7_C8", "vector": [8, 3, 0.4074, 0.037, 3, 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": " values.append(value)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99037:Return_L12_C8", "label": "return", "type": "return", "loc": [12, 12], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99037:FunctionDef_L4_C4", "vector": [13, 2, 0.4444, 0.037, 2, 0.7, 1.0, 0, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return row[:index_extra_select] + tuple(values)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99037:ClassDef_L14_C0", "label": "SQLInsertCompiler", "type": "class", "loc": [14, 15], "level": 0, "parent": null, "vector": [3, 0, 0.537, 0.0741, 0, 0.66, 0.3333, 217, 0, 0, 0, 0, 928, 0, 0], "semantic": {"name": "SQLInsertCompiler", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class SQLInsertCompiler(compiler.SQLInsertCompiler, SQLCompiler):\n pass"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99037:ClassDef_L17_C0", "label": "SQLDeleteCompiler", "type": "class", "loc": [17, 18], "level": 0, "parent": null, "vector": [3, 0, 0.6481, 0.0741, 0, 0.66, 0.5, 715, 0, 0, 0, 0, 754, 0, 0], "semantic": {"name": "SQLDeleteCompiler", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class SQLDeleteCompiler(compiler.SQLDeleteCompiler, SQLCompiler):\n pass"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99037:ClassDef_L20_C0", "label": "SQLUpdateCompiler", "type": "class", "loc": [20, 21], "level": 0, "parent": null, "vector": [3, 0, 0.7593, 0.0741, 0, 0.66, 0.6667, 756, 0, 0, 0, 0, 592, 0, 0], "semantic": {"name": "SQLUpdateCompiler", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class SQLUpdateCompiler(compiler.SQLUpdateCompiler, SQLCompiler):\n pass"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99037:ClassDef_L23_C0", "label": "SQLAggregateCompiler", "type": "class", "loc": [23, 24], "level": 0, "parent": null, "vector": [3, 0, 0.8704, 0.0741, 0, 0.66, 0.8333, 216, 0, 0, 0, 0, 742, 0, 0], "semantic": {"name": "SQLAggregateCompiler", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class SQLAggregateCompiler(compiler.SQLAggregateCompiler, SQLCompiler):\n pass"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99037:ClassDef_L26_C0", "label": "SQLDateCompiler", "type": "class", "loc": [26, 27], "level": 0, "parent": null, "vector": [3, 0, 0.9815, 0.0741, 0, 0.66, 1.0, 583, 0, 0, 0, 0, 171, 0, 0], "semantic": {"name": "SQLDateCompiler", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class SQLDateCompiler(compiler.SQLDateCompiler, SQLCompiler):\n pass"}]
[{"f": "ajibawa-2023/Python-Code-Large/train/row_99037:ClassDef_L3_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99037:FunctionDef_L4_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99037:FunctionDef_L4_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99037:Assign_L5_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99037:FunctionDef_L4_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99037:Assign_L6_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99037:FunctionDef_L4_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99037:For_L7_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99037:For_L7_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99037:If_L8_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99037:If_L8_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99037:Assign_L10_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99037:For_L7_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99037:Expr_L11_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99037:FunctionDef_L4_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99037:Return_L12_C8"}]
import os import sys from django.db.backends import BaseDatabaseClient class DatabaseClient(BaseDatabaseClient): executable_name = 'mysql' def runshell(self): settings_dict = self.connection.settings_dict args = [self.executable_name] db = settings_dict['OPTIONS'].get('db', settings_dict['NAME']) user = settings_dict['OPTIONS'].get('user', settings_dict['USER']) passwd = settings_dict['OPTIONS'].get('passwd', settings_dict['PASSWORD']) host = settings_dict['OPTIONS'].get('host', settings_dict['HOST']) port = settings_dict['OPTIONS'].get('port', settings_dict['PORT']) defaults_file = settings_dict['OPTIONS'].get('read_default_file') # Seems to be no good way to set sql_mode with CLI. if defaults_file: args += ["--defaults-file=%s" % defaults_file] if user: args += ["--user=%s" % user] if passwd: args += ["--password=%s" % passwd] if host: if '/' in host: args += ["--socket=%s" % host] else: args += ["--host=%s" % host] if port: args += ["--port=%s" % port] if db: args += [db] if os.name == 'nt': sys.exit(os.system(" ".join(args))) else: os.execvp(self.executable_name, args)
ajibawa-2023/Python-Code-Large/train/row_99038
24
40
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_99038:Import_L1_C0", "label": "os import os", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.025, 0.025, 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_99038:Import_L2_C0", "label": "sys import sys", "type": "import", "loc": [2, 2], "level": 0, "parent": null, "vector": [1, 0, 0.05, 0.025, 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_99038:ImportFrom_L4_C0", "label": "from django.db.backends import BaseDatabaseClient", "type": "import", "loc": [4, 4], "level": 0, "parent": null, "vector": [1, 0, 0.1, 0.025, 0, 0.66, 0.6667, 981, 0, 1, 0, 0, 981, 0, 0], "semantic": {"name": "django.db.backends", "arg_names": [], "import_names": ["BaseDatabaseClient"], "rhs_call_name": "", "annotation": ""}, "snippet": "from django.db.backends import BaseDatabaseClient"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99038:ClassDef_L6_C0", "label": "DatabaseClient", "type": "class", "loc": [6, 39], "level": 0, "parent": null, "vector": [3, 0, 0.5625, 0.85, 0, 0.66, 1.0, 207, 0, 1, 0, 0, 729, 0, 10], "semantic": {"name": "DatabaseClient", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class DatabaseClient(BaseDatabaseClient):\n executable_name = 'mysql'\n\n def runshell(self):\n settings_dict = self.connection.settings_dict\n args = [self.executable_name]\n db = settings_dict['OPTIONS'].get('db', settings_dict['NAME'])\n user = settings_dict['OPTIONS'].get('user', settings_dict['USER'])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99038:Assign_L7_C4", "label": "executable_name =", "type": "assigned_variable", "loc": [7, 7], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99038:ClassDef_L6_C0", "vector": [14, 1, 0.175, 0.025, 1, 0.04, 0.0, 723, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "executable_name", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " executable_name = 'mysql'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99038:FunctionDef_L9_C4", "label": "runshell", "type": "function", "loc": [9, 39], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99038:ClassDef_L6_C0", "vector": [2, 1, 0.6, 0.775, 1, 0.04, 1.0, 795, 0, 1, 0, 0, 0, 0, 10], "semantic": {"name": "runshell", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def runshell(self):\n settings_dict = self.connection.settings_dict\n args = [self.executable_name]\n db = settings_dict['OPTIONS'].get('db', settings_dict['NAME'])\n user = settings_dict['OPTIONS'].get('user', settings_dict['USER'])\n passwd = settings_dict['OPTIONS'].get('passwd', settings_dict['PASSWORD'])\n host = settings_dict['OPTIONS'].get('host', settings_dict['HOST'])\n port = settings_dict['OPTIONS'].get('port', settings_dict['PORT'])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99038:Assign_L10_C8", "label": "settings_dict =", "type": "assigned_variable", "loc": [10, 10], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99038:FunctionDef_L9_C4", "vector": [14, 2, 0.25, 0.025, 2, 0.71, 0.0, 893, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "settings_dict", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " settings_dict = self.connection.settings_dict"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99038:Assign_L11_C8", "label": "args =", "type": "assigned_variable", "loc": [11, 11], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99038:FunctionDef_L9_C4", "vector": [14, 2, 0.275, 0.025, 2, 0.71, 0.0714, 805, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "args", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " args = [self.executable_name]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99038:Assign_L12_C8", "label": "db = get()", "type": "assigned_variable", "loc": [12, 12], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99038:FunctionDef_L9_C4", "vector": [14, 2, 0.3, 0.025, 2, 0.71, 0.1429, 761, 3, 2, 0, 0, 607, 10, 1], "semantic": {"name": "db", "arg_names": [], "import_names": [], "rhs_call_name": "get", "annotation": ""}, "snippet": " db = settings_dict['OPTIONS'].get('db', settings_dict['NAME'])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99038:Assign_L13_C8", "label": "user = get()", "type": "assigned_variable", "loc": [13, 13], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99038:FunctionDef_L9_C4", "vector": [14, 2, 0.325, 0.025, 2, 0.71, 0.2143, 503, 3, 2, 0, 0, 607, 10, 1], "semantic": {"name": "user", "arg_names": [], "import_names": [], "rhs_call_name": "get", "annotation": ""}, "snippet": " user = settings_dict['OPTIONS'].get('user', settings_dict['USER'])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99038:Assign_L14_C8", "label": "passwd = get()", "type": "assigned_variable", "loc": [14, 14], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99038:FunctionDef_L9_C4", "vector": [14, 2, 0.35, 0.025, 2, 0.71, 0.2857, 707, 3, 2, 0, 0, 607, 10, 1], "semantic": {"name": "passwd", "arg_names": [], "import_names": [], "rhs_call_name": "get", "annotation": ""}, "snippet": " passwd = settings_dict['OPTIONS'].get('passwd', settings_dict['PASSWORD'])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99038:Assign_L15_C8", "label": "host = get()", "type": "assigned_variable", "loc": [15, 15], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99038:FunctionDef_L9_C4", "vector": [14, 2, 0.375, 0.025, 2, 0.71, 0.3571, 867, 3, 2, 0, 0, 607, 10, 1], "semantic": {"name": "host", "arg_names": [], "import_names": [], "rhs_call_name": "get", "annotation": ""}, "snippet": " host = settings_dict['OPTIONS'].get('host', settings_dict['HOST'])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99038:Assign_L16_C8", "label": "port = get()", "type": "assigned_variable", "loc": [16, 16], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99038:FunctionDef_L9_C4", "vector": [14, 2, 0.4, 0.025, 2, 0.71, 0.4286, 308, 3, 2, 0, 0, 607, 10, 1], "semantic": {"name": "port", "arg_names": [], "import_names": [], "rhs_call_name": "get", "annotation": ""}, "snippet": " port = settings_dict['OPTIONS'].get('port', settings_dict['PORT'])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99038:Assign_L17_C8", "label": "defaults_file = get()", "type": "assigned_variable", "loc": [17, 17], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99038:FunctionDef_L9_C4", "vector": [14, 2, 0.425, 0.025, 2, 0.71, 0.5, 629, 3, 1, 0, 0, 607, 10, 1], "semantic": {"name": "defaults_file", "arg_names": [], "import_names": [], "rhs_call_name": "get", "annotation": ""}, "snippet": " defaults_file = settings_dict['OPTIONS'].get('read_default_file')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99038:If_L20_C8", "label": "if", "type": "if", "loc": [20, 21], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99038:FunctionDef_L9_C4", "vector": [4, 2, 0.5125, 0.05, 2, 0.71, 0.5714, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if defaults_file:\n args += [\"--defaults-file=%s\" % defaults_file]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99038:If_L22_C8", "label": "if", "type": "if", "loc": [22, 23], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99038:FunctionDef_L9_C4", "vector": [4, 2, 0.5625, 0.05, 2, 0.71, 0.6429, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if user:\n args += [\"--user=%s\" % user]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99038:If_L24_C8", "label": "if", "type": "if", "loc": [24, 25], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99038:FunctionDef_L9_C4", "vector": [4, 2, 0.6125, 0.05, 2, 0.71, 0.7143, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if passwd:\n args += [\"--password=%s\" % passwd]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99038:If_L26_C8", "label": "if", "type": "if", "loc": [26, 30], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99038:FunctionDef_L9_C4", "vector": [4, 2, 0.7, 0.125, 2, 0.71, 0.7857, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if host:\n if '/' in host:\n args += [\"--socket=%s\" % host]\n else:\n \targs += [\"--host=%s\" % host]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99038:If_L27_C12", "label": "if", "type": "if", "loc": [27, 30], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99038:If_L26_C8", "vector": [4, 3, 0.7125, 0.1, 3, 0.63, 0.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if '/' in host:\n args += [\"--socket=%s\" % host]\n else:\n \targs += [\"--host=%s\" % host]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99038:If_L31_C8", "label": "if", "type": "if", "loc": [31, 32], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99038:FunctionDef_L9_C4", "vector": [4, 2, 0.7875, 0.05, 2, 0.71, 0.8571, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if port:\n args += [\"--port=%s\" % port]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99038:If_L33_C8", "label": "if", "type": "if", "loc": [33, 34], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99038:FunctionDef_L9_C4", "vector": [4, 2, 0.8375, 0.05, 2, 0.71, 0.9286, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if db:\n args += [db]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99038:If_L36_C8", "label": "if", "type": "if", "loc": [36, 39], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99038:FunctionDef_L9_C4", "vector": [4, 2, 0.9375, 0.1, 2, 0.71, 1.0, 0, 0, 0, 0, 0, 0, 0, 4], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if os.name == 'nt':\n sys.exit(os.system(\" \".join(args)))\n else:\n os.execvp(self.executable_name, args)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99038:Expr_L37_C12", "label": "exit()", "type": "expression", "loc": [37, 37], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99038:If_L36_C8", "vector": [8, 3, 0.925, 0.025, 3, 0.57, 0.0, 436, 3, 1, 0, 0, 0, 0, 3], "semantic": {"name": "exit", "arg_names": [], "import_names": [], "rhs_call_name": "exit", "annotation": ""}, "snippet": " sys.exit(os.system(\" \".join(args)))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99038:Expr_L39_C12", "label": "execvp()", "type": "expression", "loc": [39, 39], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99038:If_L36_C8", "vector": [8, 3, 0.975, 0.025, 3, 0.57, 1.0, 784, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "execvp", "arg_names": [], "import_names": [], "rhs_call_name": "execvp", "annotation": ""}, "snippet": " os.execvp(self.executable_name, args)"}]
[{"f": "ajibawa-2023/Python-Code-Large/train/row_99038:ClassDef_L6_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99038:Assign_L7_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99038:ClassDef_L6_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99038:FunctionDef_L9_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99038:FunctionDef_L9_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99038:Assign_L10_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99038:FunctionDef_L9_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99038:Assign_L11_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99038:FunctionDef_L9_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99038:Assign_L12_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99038:FunctionDef_L9_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99038:Assign_L13_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99038:FunctionDef_L9_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99038:Assign_L14_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99038:FunctionDef_L9_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99038:Assign_L15_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99038:FunctionDef_L9_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99038:Assign_L16_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99038:FunctionDef_L9_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99038:Assign_L17_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99038:FunctionDef_L9_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99038:If_L20_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99038:FunctionDef_L9_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99038:If_L22_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99038:FunctionDef_L9_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99038:If_L24_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99038:FunctionDef_L9_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99038:If_L26_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99038:If_L26_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99038:If_L27_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99038:FunctionDef_L9_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99038:If_L31_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99038:FunctionDef_L9_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99038:If_L33_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99038:FunctionDef_L9_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99038:If_L36_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99038:If_L36_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99038:Expr_L37_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99038:If_L36_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99038:Expr_L39_C12"}]
from django.db.backends.creation import BaseDatabaseCreation class DatabaseCreation(BaseDatabaseCreation): # This dictionary maps Field objects to their associated MySQL column # types, as strings. Column-type strings can contain format strings; they'll # be interpolated against the values of Field.__dict__ before being output. # If a column type is set to None, it won't be included in the output. data_types = { 'AutoField': 'integer AUTO_INCREMENT', 'BooleanField': 'bool', 'CharField': 'varchar(%(max_length)s)', 'CommaSeparatedIntegerField': 'varchar(%(max_length)s)', 'DateField': 'date', 'DateTimeField': 'datetime', 'DecimalField': 'numeric(%(max_digits)s, %(decimal_places)s)', 'FileField': 'varchar(%(max_length)s)', 'FilePathField': 'varchar(%(max_length)s)', 'FloatField': 'double precision', 'IntegerField': 'integer', 'BigIntegerField': 'bigint', 'IPAddressField': 'char(15)', 'NullBooleanField': 'bool', 'OneToOneField': 'integer', 'PositiveIntegerField': 'integer UNSIGNED', 'PositiveSmallIntegerField': 'smallint UNSIGNED', 'SlugField': 'varchar(%(max_length)s)', 'SmallIntegerField': 'smallint', 'TextField': 'longtext', 'TimeField': 'time', } def sql_table_creation_suffix(self): suffix = [] if self.connection.settings_dict['TEST_CHARSET']: suffix.append('CHARACTER SET %s' % self.connection.settings_dict['TEST_CHARSET']) if self.connection.settings_dict['TEST_COLLATION']: suffix.append('COLLATE %s' % self.connection.settings_dict['TEST_COLLATION']) return ' '.join(suffix) def sql_for_inline_foreign_key_references(self, field, known_models, style): "All inline references are pending under MySQL" return [], True def sql_for_inline_many_to_many_references(self, model, field, style): from django.db import models opts = model._meta qn = self.connection.ops.quote_name table_output = [ ' %s %s %s,' % (style.SQL_FIELD(qn(field.m2m_column_name())), style.SQL_COLTYPE(models.ForeignKey(model).db_type(connection=self.connection)), style.SQL_KEYWORD('NOT NULL')), ' %s %s %s,' % (style.SQL_FIELD(qn(field.m2m_reverse_name())), style.SQL_COLTYPE(models.ForeignKey(field.rel.to).db_type(connection=self.connection)), style.SQL_KEYWORD('NOT NULL')) ] deferred = [ (field.m2m_db_table(), field.m2m_column_name(), opts.db_table, opts.pk.column), (field.m2m_db_table(), field.m2m_reverse_name(), field.rel.to._meta.db_table, field.rel.to._meta.pk.column) ] return table_output, deferred
ajibawa-2023/Python-Code-Large/train/row_99039
20
65
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_99039:ImportFrom_L1_C0", "label": "from django.db.backends.creation import BaseDatabaseCreation", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0154, 0.0154, 0, 0.66, 0.0, 340, 0, 1, 0, 0, 340, 0, 0], "semantic": {"name": "django.db.backends.creation", "arg_names": [], "import_names": ["BaseDatabaseCreation"], "rhs_call_name": "", "annotation": ""}, "snippet": "from django.db.backends.creation import BaseDatabaseCreation"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99039:ClassDef_L3_C0", "label": "DatabaseCreation", "type": "class", "loc": [3, 65], "level": 0, "parent": null, "vector": [3, 0, 0.5231, 0.9692, 0, 0.66, 1.0, 625, 0, 3, 0, 0, 484, 0, 21], "semantic": {"name": "DatabaseCreation", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class DatabaseCreation(BaseDatabaseCreation):\n # This dictionary maps Field objects to their associated MySQL column\n # types, as strings. Column-type strings can contain format strings; they'll\n # be interpolated against the values of Field.__dict__ before being output.\n # If a column type is set to None, it won't be included in the output.\n data_types = {\n 'AutoField': 'integer AUTO_INCREMENT',\n 'BooleanField': 'bool',"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99039:Assign_L8_C4", "label": "data_types =", "type": "assigned_variable", "loc": [8, 30], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99039:ClassDef_L3_C0", "vector": [14, 1, 0.2923, 0.3538, 1, 0.75, 0.0, 835, 0, 0, 0, 0, 0, 6, 0], "semantic": {"name": "data_types", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " data_types = {\n 'AutoField': 'integer AUTO_INCREMENT',\n 'BooleanField': 'bool',\n 'CharField': 'varchar(%(max_length)s)',\n 'CommaSeparatedIntegerField': 'varchar(%(max_length)s)',\n 'DateField': 'date',\n 'DateTimeField': 'datetime',\n 'DecimalField': 'numeric(%(max_digits)s, %(decimal_places)s)',"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99039:FunctionDef_L32_C4", "label": "sql_table_creation_suffix", "type": "function", "loc": [32, 38], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99039:ClassDef_L3_C0", "vector": [2, 1, 0.5385, 0.1077, 1, 0.75, 0.3333, 367, 0, 1, 1, 0, 0, 0, 3], "semantic": {"name": "sql_table_creation_suffix", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def sql_table_creation_suffix(self):\n suffix = []\n if self.connection.settings_dict['TEST_CHARSET']:\n suffix.append('CHARACTER SET %s' % self.connection.settings_dict['TEST_CHARSET'])\n if self.connection.settings_dict['TEST_COLLATION']:\n suffix.append('COLLATE %s' % self.connection.settings_dict['TEST_COLLATION'])\n return ' '.join(suffix)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99039:Assign_L33_C8", "label": "suffix =", "type": "assigned_variable", "loc": [33, 33], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99039:FunctionDef_L32_C4", "vector": [14, 2, 0.5077, 0.0154, 2, 0.87, 0.0, 578, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "suffix", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " suffix = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99039:If_L34_C8", "label": "if", "type": "if", "loc": [34, 35], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99039:FunctionDef_L32_C4", "vector": [4, 2, 0.5308, 0.0308, 2, 0.87, 0.3333, 0, 6, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self.connection.settings_dict['TEST_CHARSET']:\n suffix.append('CHARACTER SET %s' % self.connection.settings_dict['TEST_CHARSET'])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99039:Expr_L35_C12", "label": "append()", "type": "expression", "loc": [35, 35], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99039:If_L34_C8", "vector": [8, 3, 0.5385, 0.0154, 3, 0.62, 0.0, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " suffix.append('CHARACTER SET %s' % self.connection.settings_dict['TEST_CHARSET'])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99039:If_L36_C8", "label": "if", "type": "if", "loc": [36, 37], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99039:FunctionDef_L32_C4", "vector": [4, 2, 0.5615, 0.0308, 2, 0.87, 0.6667, 0, 6, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self.connection.settings_dict['TEST_COLLATION']:\n suffix.append('COLLATE %s' % self.connection.settings_dict['TEST_COLLATION'])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99039:Expr_L37_C12", "label": "append()", "type": "expression", "loc": [37, 37], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99039:If_L36_C8", "vector": [8, 3, 0.5692, 0.0154, 3, 0.7, 0.0, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " suffix.append('COLLATE %s' % self.connection.settings_dict['TEST_COLLATION'])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99039:Return_L38_C8", "label": "return", "type": "return", "loc": [38, 38], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99039:FunctionDef_L32_C4", "vector": [13, 2, 0.5846, 0.0154, 2, 0.87, 1.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return ' '.join(suffix)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99039:FunctionDef_L40_C4", "label": "sql_for_inline_foreign_key_references", "type": "function", "loc": [40, 42], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99039:ClassDef_L3_C0", "vector": [2, 1, 0.6308, 0.0462, 1, 0.75, 0.6667, 263, 0, 4, 1, 0, 0, 0, 0], "semantic": {"name": "sql_for_inline_foreign_key_references", "arg_names": ["self", "field", "known_models", "style"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def sql_for_inline_foreign_key_references(self, field, known_models, style):\n \"All inline references are pending under MySQL\"\n return [], True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99039:Expr_L41_C8", "label": "expression", "type": "expression", "loc": [41, 41], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99039:FunctionDef_L40_C4", "vector": [8, 2, 0.6308, 0.0154, 2, 0.75, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"All inline references are pending under MySQL\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99039:Return_L42_C8", "label": "return", "type": "return", "loc": [42, 42], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99039:FunctionDef_L40_C4", "vector": [13, 2, 0.6462, 0.0154, 2, 0.75, 1.0, 0, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return [], True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99039:FunctionDef_L44_C4", "label": "sql_for_inline_many_to_many_references", "type": "function", "loc": [44, 65], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99039:ClassDef_L3_C0", "vector": [2, 1, 0.8385, 0.3385, 1, 0.75, 1.0, 583, 0, 4, 1, 0, 0, 0, 18], "semantic": {"name": "sql_for_inline_many_to_many_references", "arg_names": ["self", "model", "field", "style"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def sql_for_inline_many_to_many_references(self, model, field, style):\n from django.db import models\n opts = model._meta\n qn = self.connection.ops.quote_name\n\n table_output = [\n ' %s %s %s,' %\n (style.SQL_FIELD(qn(field.m2m_column_name())),"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99039:ImportFrom_L45_C8", "label": "from django.db import models", "type": "import", "loc": [45, 45], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99039:FunctionDef_L44_C4", "vector": [1, 2, 0.6923, 0.0154, 2, 0.71, 0.0, 40, 0, 1, 0, 0, 40, 0, 0], "semantic": {"name": "django.db", "arg_names": [], "import_names": ["models"], "rhs_call_name": "", "annotation": ""}, "snippet": " from django.db import models"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99039:Assign_L46_C8", "label": "opts =", "type": "assigned_variable", "loc": [46, 46], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99039:FunctionDef_L44_C4", "vector": [14, 2, 0.7077, 0.0154, 2, 0.71, 0.2, 631, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "opts", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " opts = model._meta"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99039:Assign_L47_C8", "label": "qn =", "type": "assigned_variable", "loc": [47, 47], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99039:FunctionDef_L44_C4", "vector": [14, 2, 0.7231, 0.0154, 2, 0.71, 0.4, 514, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "qn", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " qn = self.connection.ops.quote_name"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99039:Assign_L49_C8", "label": "table_output =", "type": "assigned_variable", "loc": [49, 58], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99039:FunctionDef_L44_C4", "vector": [14, 2, 0.8231, 0.1538, 2, 0.71, 0.6, 565, 0, 0, 0, 0, 0, 5, 14], "semantic": {"name": "table_output", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " table_output = [\n ' %s %s %s,' %\n (style.SQL_FIELD(qn(field.m2m_column_name())),\n style.SQL_COLTYPE(models.ForeignKey(model).db_type(connection=self.connection)),\n style.SQL_KEYWORD('NOT NULL')),\n ' %s %s %s,' %\n (style.SQL_FIELD(qn(field.m2m_reverse_name())),\n style.SQL_COLTYPE(models.ForeignKey(field.rel.to).db_type(connection=self.connection)),"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99039:Assign_L59_C8", "label": "deferred =", "type": "assigned_variable", "loc": [59, 64], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99039:FunctionDef_L44_C4", "vector": [14, 2, 0.9462, 0.0923, 2, 0.71, 0.8, 840, 0, 0, 0, 0, 0, 5, 4], "semantic": {"name": "deferred", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " deferred = [\n (field.m2m_db_table(), field.m2m_column_name(), opts.db_table,\n opts.pk.column),\n (field.m2m_db_table(), field.m2m_reverse_name(),\n field.rel.to._meta.db_table, field.rel.to._meta.pk.column)\n ]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99039:Return_L65_C8", "label": "return", "type": "return", "loc": [65, 65], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99039:FunctionDef_L44_C4", "vector": [13, 2, 1.0, 0.0154, 2, 0.71, 1.0, 0, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return table_output, deferred"}]
[{"f": "ajibawa-2023/Python-Code-Large/train/row_99039:ClassDef_L3_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99039:Assign_L8_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99039:ClassDef_L3_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99039:FunctionDef_L32_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99039:FunctionDef_L32_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99039:Assign_L33_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99039:FunctionDef_L32_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99039:If_L34_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99039:If_L34_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99039:Expr_L35_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99039:FunctionDef_L32_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99039:If_L36_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99039:If_L36_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99039:Expr_L37_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99039:FunctionDef_L32_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99039:Return_L38_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99039:ClassDef_L3_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99039:FunctionDef_L40_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99039:FunctionDef_L40_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99039:Expr_L41_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99039:FunctionDef_L40_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99039:Return_L42_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99039:ClassDef_L3_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99039:FunctionDef_L44_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99039:FunctionDef_L44_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99039:ImportFrom_L45_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99039:FunctionDef_L44_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99039:Assign_L46_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99039:FunctionDef_L44_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99039:Assign_L47_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99039:FunctionDef_L44_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99039:Assign_L49_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99039:FunctionDef_L44_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99039:Assign_L59_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99039:FunctionDef_L44_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99039:Return_L65_C8"}]
from django.db.backends import BaseDatabaseValidation class DatabaseValidation(BaseDatabaseValidation): def validate_field(self, errors, opts, f): """ There are some field length restrictions for MySQL: - Prior to version 5.0.3, character fields could not exceed 255 characters in length. - No character (varchar) fields can have a length exceeding 255 characters if they have a unique index on them. """ from django.db import models db_version = self.connection.get_server_version() varchar_fields = (models.CharField, models.CommaSeparatedIntegerField, models.SlugField) if isinstance(f, varchar_fields) and f.max_length > 255: if db_version < (5, 0, 3): msg = '"%(name)s": %(cls)s cannot have a "max_length" greater than 255 when you are using a version of MySQL prior to 5.0.3 (you are using %(version)s).' elif f.unique == True: msg = '"%(name)s": %(cls)s cannot have a "max_length" greater than 255 when using "unique=True".' else: msg = None if msg: errors.add(opts, msg % {'name': f.name, 'cls': f.__class__.__name__, 'version': '.'.join([str(n) for n in db_version[:3]])})
ajibawa-2023/Python-Code-Large/train/row_99040
15
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_99040:ImportFrom_L1_C0", "label": "from django.db.backends import BaseDatabaseValidation", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0385, 0.0385, 0, 0.66, 0.0, 981, 0, 1, 0, 0, 981, 0, 0], "semantic": {"name": "django.db.backends", "arg_names": [], "import_names": ["BaseDatabaseValidation"], "rhs_call_name": "", "annotation": ""}, "snippet": "from django.db.backends import BaseDatabaseValidation"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99040:ClassDef_L3_C0", "label": "DatabaseValidation", "type": "class", "loc": [3, 26], "level": 0, "parent": null, "vector": [3, 0, 0.5577, 0.9231, 0, 0.66, 1.0, 249, 0, 1, 0, 0, 818, 0, 5], "semantic": {"name": "DatabaseValidation", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class DatabaseValidation(BaseDatabaseValidation):\n def validate_field(self, errors, opts, f):\n \"\"\"\n There are some field length restrictions for MySQL:\n\n - Prior to version 5.0.3, character fields could not exceed 255\n characters in length.\n - No character (varchar) fields can have a length exceeding 255"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99040:FunctionDef_L4_C4", "label": "validate_field", "type": "function", "loc": [4, 26], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99040:ClassDef_L3_C0", "vector": [2, 1, 0.5769, 0.8846, 1, 0.01, 0.0, 162, 0, 4, 0, 0, 0, 0, 5], "semantic": {"name": "validate_field", "arg_names": ["self", "errors", "opts", "f"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def validate_field(self, errors, opts, f):\n \"\"\"\n There are some field length restrictions for MySQL:\n\n - Prior to version 5.0.3, character fields could not exceed 255\n characters in length.\n - No character (varchar) fields can have a length exceeding 255\n characters if they have a unique index on them."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99040:Expr_L5_C8", "label": "expression", "type": "expression", "loc": [5, 12], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99040:FunctionDef_L4_C4", "vector": [8, 2, 0.3269, 0.3077, 2, 0.57, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"\n There are some field length restrictions for MySQL:\n\n - Prior to version 5.0.3, character fields could not exceed 255\n characters in length.\n - No character (varchar) fields can have a length exceeding 255\n characters if they have a unique index on them.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99040:ImportFrom_L13_C8", "label": "from django.db import models", "type": "import", "loc": [13, 13], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99040:FunctionDef_L4_C4", "vector": [1, 2, 0.5, 0.0385, 2, 0.57, 0.25, 40, 0, 1, 0, 0, 40, 0, 0], "semantic": {"name": "django.db", "arg_names": [], "import_names": ["models"], "rhs_call_name": "", "annotation": ""}, "snippet": " from django.db import models"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99040:Assign_L14_C8", "label": "db_version = get_server_version()", "type": "assigned_variable", "loc": [14, 14], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99040:FunctionDef_L4_C4", "vector": [14, 2, 0.5385, 0.0385, 2, 0.57, 0.5, 34, 3, 0, 0, 0, 169, 10, 1], "semantic": {"name": "db_version", "arg_names": [], "import_names": [], "rhs_call_name": "get_server_version", "annotation": ""}, "snippet": " db_version = self.connection.get_server_version()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99040:Assign_L15_C8", "label": "varchar_fields =", "type": "assigned_variable", "loc": [15, 16], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99040:FunctionDef_L4_C4", "vector": [14, 2, 0.5962, 0.0769, 2, 0.57, 0.75, 955, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "varchar_fields", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " varchar_fields = (models.CharField, models.CommaSeparatedIntegerField,\n models.SlugField)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99040:If_L17_C8", "label": "if", "type": "if", "loc": [17, 26], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99040:FunctionDef_L4_C4", "vector": [4, 2, 0.8269, 0.3846, 2, 0.57, 1.0, 0, 0, 0, 0, 0, 0, 0, 4], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if isinstance(f, varchar_fields) and f.max_length > 255:\n if db_version < (5, 0, 3):\n msg = '\"%(name)s\": %(cls)s cannot have a \"max_length\" greater than 255 when you are using a version of MySQL prior to 5.0.3 (you are using %(version)s).'\n elif f.unique == True:\n msg = '\"%(name)s\": %(cls)s cannot have a \"max_length\" greater than 255 when using \"unique=True\".'\n else:\n msg = None\n"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99040:If_L18_C12", "label": "if", "type": "if", "loc": [18, 23], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99040:If_L17_C8", "vector": [4, 3, 0.7885, 0.2308, 3, 0.23, 0.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if db_version < (5, 0, 3):\n msg = '\"%(name)s\": %(cls)s cannot have a \"max_length\" greater than 255 when you are using a version of MySQL prior to 5.0.3 (you are using %(version)s).'\n elif f.unique == True:\n msg = '\"%(name)s\": %(cls)s cannot have a \"max_length\" greater than 255 when using \"unique=True\".'\n else:\n msg = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99040:Assign_L19_C16", "label": "msg =", "type": "assigned_variable", "loc": [19, 19], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99040:If_L18_C12", "vector": [14, 4, 0.7308, 0.0385, 4, 0.08, 0.0, 712, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "msg", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " msg = '\"%(name)s\": %(cls)s cannot have a \"max_length\" greater than 255 when you are using a version of MySQL prior to 5.0.3 (you are using %(version)s).'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99040:If_L20_C12", "label": "if", "type": "if", "loc": [20, 23], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99040:If_L18_C12", "vector": [4, 4, 0.8269, 0.1538, 4, 0.08, 1.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " elif f.unique == True:\n msg = '\"%(name)s\": %(cls)s cannot have a \"max_length\" greater than 255 when using \"unique=True\".'\n else:\n msg = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99040:Assign_L21_C16", "label": "msg =", "type": "assigned_variable", "loc": [21, 21], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99040:If_L20_C12", "vector": [14, 5, 0.8077, 0.0385, 5, 0.83, 0.0, 712, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "msg", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " msg = '\"%(name)s\": %(cls)s cannot have a \"max_length\" greater than 255 when using \"unique=True\".'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99040:Assign_L23_C16", "label": "msg =", "type": "assigned_variable", "loc": [23, 23], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99040:If_L20_C12", "vector": [14, 5, 0.8846, 0.0385, 5, 0.83, 1.0, 712, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "msg", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " msg = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99040:If_L25_C12", "label": "if", "type": "if", "loc": [25, 26], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99040:If_L17_C8", "vector": [4, 3, 0.9808, 0.0769, 3, 0.23, 1.0, 0, 2, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if msg:\n errors.add(opts, msg % {'name': f.name, 'cls': f.__class__.__name__, 'version': '.'.join([str(n) for n in db_version[:3]])})"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99040:Expr_L26_C16", "label": "add()", "type": "expression", "loc": [26, 26], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99040:If_L25_C12", "vector": [8, 4, 1.0, 0.0385, 4, 0.36, 0.0, 241, 3, 2, 0, 0, 0, 0, 3], "semantic": {"name": "add", "arg_names": [], "import_names": [], "rhs_call_name": "add", "annotation": ""}, "snippet": " errors.add(opts, msg % {'name': f.name, 'cls': f.__class__.__name__, 'version': '.'.join([str(n) for n in db_version[:3]])})"}]
[{"f": "ajibawa-2023/Python-Code-Large/train/row_99040:ClassDef_L3_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99040:FunctionDef_L4_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99040:FunctionDef_L4_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99040:Expr_L5_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99040:FunctionDef_L4_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99040:ImportFrom_L13_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99040:FunctionDef_L4_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99040:Assign_L14_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99040:FunctionDef_L4_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99040:Assign_L15_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99040:FunctionDef_L4_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99040:If_L17_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99040:If_L17_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99040:If_L18_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99040:If_L18_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99040:Assign_L19_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99040:If_L18_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99040:If_L20_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99040:If_L20_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99040:Assign_L21_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99040:If_L20_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99040:Assign_L23_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99040:If_L17_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99040:If_L25_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99040:If_L25_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99040:Expr_L26_C16"}]
from django.dispatch import Signal connection_created = Signal(providing_args=["connection"])
ajibawa-2023/Python-Code-Large/train/row_99042
2
3
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_99042:ImportFrom_L1_C0", "label": "from django.dispatch import Signal", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.3333, 0.3333, 0, 0.66, 0.0, 548, 0, 1, 0, 0, 548, 0, 0], "semantic": {"name": "django.dispatch", "arg_names": [], "import_names": ["Signal"], "rhs_call_name": "", "annotation": ""}, "snippet": "from django.dispatch import Signal"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99042:Assign_L3_C0", "label": "connection_created = Signal()", "type": "assigned_variable", "loc": [3, 3], "level": 0, "parent": null, "vector": [14, 0, 1.0, 0.3333, 0, 0.66, 1.0, 848, 3, 1, 0, 0, 592, 10, 1], "semantic": {"name": "connection_created", "arg_names": [], "import_names": [], "rhs_call_name": "Signal", "annotation": ""}, "snippet": "connection_created = Signal(providing_args=[\"connection\"])"}]
[]
""" Dummy database backend for Django. Django uses this if the database ENGINE setting is empty (None or empty string). Each of these API functions, except connection.close(), raises ImproperlyConfigured. """ from django.core.exceptions import ImproperlyConfigured from django.db.backends import * from django.db.backends.creation import BaseDatabaseCreation def complain(*args, **kwargs): raise ImproperlyConfigured("You haven't set the database ENGINE setting yet.") def ignore(*args, **kwargs): pass class DatabaseError(Exception): pass class IntegrityError(DatabaseError): pass class DatabaseOperations(BaseDatabaseOperations): quote_name = complain class DatabaseClient(BaseDatabaseClient): runshell = complain class DatabaseIntrospection(BaseDatabaseIntrospection): get_table_list = complain get_table_description = complain get_relations = complain get_indexes = complain class DatabaseWrapper(object): operators = {} cursor = complain _commit = complain _rollback = ignore def __init__(self, settings_dict, alias, *args, **kwargs): self.features = BaseDatabaseFeatures(self) self.ops = DatabaseOperations() self.client = DatabaseClient(self) self.creation = BaseDatabaseCreation(self) self.introspection = DatabaseIntrospection(self) self.validation = BaseDatabaseValidation(self) self.settings_dict = settings_dict self.alias = alias def close(self): pass
ajibawa-2023/Python-Code-Large/train/row_99043
32
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_99043:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 8], "level": 0, "parent": null, "vector": [8, 0, 0.0804, 0.1429, 0, 0.66, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\"\"\"\nDummy database backend for Django.\n\nDjango uses this if the database ENGINE setting is empty (None or empty string).\n\nEach of these API functions, except connection.close(), raises\nImproperlyConfigured.\n\"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99043:ImportFrom_L10_C0", "label": "from django.core.exceptions import ImproperlyConfigured", "type": "import", "loc": [10, 10], "level": 0, "parent": null, "vector": [1, 0, 0.1786, 0.0179, 0, 0.66, 0.0909, 160, 0, 1, 0, 0, 160, 0, 0], "semantic": {"name": "django.core.exceptions", "arg_names": [], "import_names": ["ImproperlyConfigured"], "rhs_call_name": "", "annotation": ""}, "snippet": "from django.core.exceptions import ImproperlyConfigured"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99043:ImportFrom_L11_C0", "label": "from django.db.backends import *", "type": "import", "loc": [11, 11], "level": 0, "parent": null, "vector": [1, 0, 0.1964, 0.0179, 0, 0.66, 0.1818, 981, 0, 1, 0, 0, 981, 0, 0], "semantic": {"name": "django.db.backends", "arg_names": [], "import_names": ["*"], "rhs_call_name": "", "annotation": ""}, "snippet": "from django.db.backends import *"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99043:ImportFrom_L12_C0", "label": "from django.db.backends.creation import BaseDatabaseCreation", "type": "import", "loc": [12, 12], "level": 0, "parent": null, "vector": [1, 0, 0.2143, 0.0179, 0, 0.66, 0.2727, 340, 0, 1, 0, 0, 340, 0, 0], "semantic": {"name": "django.db.backends.creation", "arg_names": [], "import_names": ["BaseDatabaseCreation"], "rhs_call_name": "", "annotation": ""}, "snippet": "from django.db.backends.creation import BaseDatabaseCreation"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99043:FunctionDef_L14_C0", "label": "complain", "type": "function", "loc": [14, 15], "level": 0, "parent": null, "vector": [2, 0, 0.2589, 0.0357, 0, 0.66, 0.3636, 928, 0, 2, 0, 0, 0, 0, 1], "semantic": {"name": "complain", "arg_names": ["args", "kwargs"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def complain(*args, **kwargs):\n raise ImproperlyConfigured(\"You haven't set the database ENGINE setting yet.\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99043:FunctionDef_L17_C0", "label": "ignore", "type": "function", "loc": [17, 18], "level": 0, "parent": null, "vector": [2, 0, 0.3125, 0.0357, 0, 0.66, 0.4545, 371, 0, 2, 0, 0, 0, 0, 0], "semantic": {"name": "ignore", "arg_names": ["args", "kwargs"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def ignore(*args, **kwargs):\n pass"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99043:ClassDef_L20_C0", "label": "DatabaseError", "type": "class", "loc": [20, 21], "level": 0, "parent": null, "vector": [3, 0, 0.3661, 0.0357, 0, 0.66, 0.5455, 848, 0, 0, 0, 0, 645, 0, 0], "semantic": {"name": "DatabaseError", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class DatabaseError(Exception):\n pass"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99043:ClassDef_L23_C0", "label": "IntegrityError", "type": "class", "loc": [23, 24], "level": 0, "parent": null, "vector": [3, 0, 0.4196, 0.0357, 0, 0.66, 0.6364, 69, 0, 0, 0, 0, 848, 0, 0], "semantic": {"name": "IntegrityError", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class IntegrityError(DatabaseError):\n pass"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99043:ClassDef_L26_C0", "label": "DatabaseOperations", "type": "class", "loc": [26, 27], "level": 0, "parent": null, "vector": [3, 0, 0.4732, 0.0357, 0, 0.66, 0.7273, 311, 0, 0, 0, 0, 927, 0, 0], "semantic": {"name": "DatabaseOperations", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class DatabaseOperations(BaseDatabaseOperations):\n quote_name = complain"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99043:Assign_L27_C4", "label": "quote_name =", "type": "assigned_variable", "loc": [27, 27], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99043:ClassDef_L26_C0", "vector": [14, 1, 0.4821, 0.0179, 1, 0.11, 0.0, 116, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "quote_name", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " quote_name = complain"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99043:ClassDef_L29_C0", "label": "DatabaseClient", "type": "class", "loc": [29, 30], "level": 0, "parent": null, "vector": [3, 0, 0.5268, 0.0357, 0, 0.66, 0.8182, 207, 0, 0, 0, 0, 729, 0, 0], "semantic": {"name": "DatabaseClient", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class DatabaseClient(BaseDatabaseClient):\n runshell = complain"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99043:Assign_L30_C4", "label": "runshell =", "type": "assigned_variable", "loc": [30, 30], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99043:ClassDef_L29_C0", "vector": [14, 1, 0.5357, 0.0179, 1, 0.61, 0.0, 795, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "runshell", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " runshell = complain"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99043:ClassDef_L32_C0", "label": "DatabaseIntrospection", "type": "class", "loc": [32, 36], "level": 0, "parent": null, "vector": [3, 0, 0.6071, 0.0893, 0, 0.66, 0.9091, 77, 0, 0, 0, 0, 41, 0, 0], "semantic": {"name": "DatabaseIntrospection", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class DatabaseIntrospection(BaseDatabaseIntrospection):\n get_table_list = complain\n get_table_description = complain\n get_relations = complain\n get_indexes = complain"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99043:Assign_L33_C4", "label": "get_table_list =", "type": "assigned_variable", "loc": [33, 33], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99043:ClassDef_L32_C0", "vector": [14, 1, 0.5893, 0.0179, 1, 0.19, 0.0, 878, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "get_table_list", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " get_table_list = complain"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99043:Assign_L34_C4", "label": "get_table_description =", "type": "assigned_variable", "loc": [34, 34], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99043:ClassDef_L32_C0", "vector": [14, 1, 0.6071, 0.0179, 1, 0.19, 0.3333, 876, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "get_table_description", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " get_table_description = complain"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99043:Assign_L35_C4", "label": "get_relations =", "type": "assigned_variable", "loc": [35, 35], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99043:ClassDef_L32_C0", "vector": [14, 1, 0.625, 0.0179, 1, 0.19, 0.6667, 814, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "get_relations", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " get_relations = complain"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99043:Assign_L36_C4", "label": "get_indexes =", "type": "assigned_variable", "loc": [36, 36], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99043:ClassDef_L32_C0", "vector": [14, 1, 0.6429, 0.0179, 1, 0.19, 1.0, 808, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "get_indexes", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " get_indexes = complain"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99043:ClassDef_L38_C0", "label": "DatabaseWrapper", "type": "class", "loc": [38, 56], "level": 0, "parent": null, "vector": [3, 0, 0.8393, 0.3393, 0, 0.66, 1.0, 386, 0, 2, 0, 0, 186, 0, 6], "semantic": {"name": "DatabaseWrapper", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class DatabaseWrapper(object):\n operators = {}\n cursor = complain\n _commit = complain\n _rollback = ignore\n\n def __init__(self, settings_dict, alias, *args, **kwargs):\n self.features = BaseDatabaseFeatures(self)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99043:Assign_L39_C4", "label": "operators =", "type": "assigned_variable", "loc": [39, 39], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99043:ClassDef_L38_C0", "vector": [14, 1, 0.6964, 0.0179, 1, 0.65, 0.0, 195, 0, 0, 0, 0, 0, 6, 0], "semantic": {"name": "operators", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " operators = {}"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99043:Assign_L40_C4", "label": "cursor =", "type": "assigned_variable", "loc": [40, 40], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99043:ClassDef_L38_C0", "vector": [14, 1, 0.7143, 0.0179, 1, 0.65, 0.2, 231, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "cursor", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " cursor = complain"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99043:Assign_L41_C4", "label": "_commit =", "type": "assigned_variable", "loc": [41, 41], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99043:ClassDef_L38_C0", "vector": [14, 1, 0.7321, 0.0179, 1, 0.65, 0.4, 361, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "_commit", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " _commit = complain"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99043:Assign_L42_C4", "label": "_rollback =", "type": "assigned_variable", "loc": [42, 42], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99043:ClassDef_L38_C0", "vector": [14, 1, 0.75, 0.0179, 1, 0.65, 0.6, 47, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "_rollback", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " _rollback = ignore"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99043:FunctionDef_L44_C4", "label": "__init__", "type": "function", "loc": [44, 53], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99043:ClassDef_L38_C0", "vector": [2, 1, 0.8661, 0.1786, 1, 0.65, 0.8, 555, 0, 5, 0, 0, 0, 0, 6], "semantic": {"name": "__init__", "arg_names": ["self", "settings_dict", "alias", "args", "kwargs"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, settings_dict, alias, *args, **kwargs):\n self.features = BaseDatabaseFeatures(self)\n self.ops = DatabaseOperations()\n self.client = DatabaseClient(self)\n self.creation = BaseDatabaseCreation(self)\n self.introspection = DatabaseIntrospection(self)\n self.validation = BaseDatabaseValidation(self)\n"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99043:Assign_L45_C8", "label": "self.features = BaseDatabaseFeatures()", "type": "assigned_variable", "loc": [45, 45], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99043:FunctionDef_L44_C4", "vector": [14, 2, 0.8036, 0.0179, 2, 0.52, 0.0, 164, 3, 1, 0, 0, 581, 10, 1], "semantic": {"name": "self.features", "arg_names": [], "import_names": [], "rhs_call_name": "BaseDatabaseFeatures", "annotation": ""}, "snippet": " self.features = BaseDatabaseFeatures(self)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99043:Assign_L46_C8", "label": "self.ops = DatabaseOperations()", "type": "assigned_variable", "loc": [46, 46], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99043:FunctionDef_L44_C4", "vector": [14, 2, 0.8214, 0.0179, 2, 0.52, 0.1429, 589, 3, 0, 0, 0, 311, 10, 1], "semantic": {"name": "self.ops", "arg_names": [], "import_names": [], "rhs_call_name": "DatabaseOperations", "annotation": ""}, "snippet": " self.ops = DatabaseOperations()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99043:Assign_L47_C8", "label": "self.client = DatabaseClient()", "type": "assigned_variable", "loc": [47, 47], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99043:FunctionDef_L44_C4", "vector": [14, 2, 0.8393, 0.0179, 2, 0.52, 0.2857, 349, 3, 1, 0, 0, 207, 10, 1], "semantic": {"name": "self.client", "arg_names": [], "import_names": [], "rhs_call_name": "DatabaseClient", "annotation": ""}, "snippet": " self.client = DatabaseClient(self)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99043:Assign_L48_C8", "label": "self.creation = BaseDatabaseCreation()", "type": "assigned_variable", "loc": [48, 48], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99043:FunctionDef_L44_C4", "vector": [14, 2, 0.8571, 0.0179, 2, 0.52, 0.4286, 748, 3, 1, 0, 0, 484, 10, 1], "semantic": {"name": "self.creation", "arg_names": [], "import_names": [], "rhs_call_name": "BaseDatabaseCreation", "annotation": ""}, "snippet": " self.creation = BaseDatabaseCreation(self)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99043:Assign_L49_C8", "label": "self.introspection = DatabaseIntrospection()", "type": "assigned_variable", "loc": [49, 49], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99043:FunctionDef_L44_C4", "vector": [14, 2, 0.875, 0.0179, 2, 0.52, 0.5714, 217, 3, 1, 0, 0, 77, 10, 1], "semantic": {"name": "self.introspection", "arg_names": [], "import_names": [], "rhs_call_name": "DatabaseIntrospection", "annotation": ""}, "snippet": " self.introspection = DatabaseIntrospection(self)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99043:Assign_L50_C8", "label": "self.validation = BaseDatabaseValidation()", "type": "assigned_variable", "loc": [50, 50], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99043:FunctionDef_L44_C4", "vector": [14, 2, 0.8929, 0.0179, 2, 0.52, 0.7143, 314, 3, 1, 0, 0, 818, 10, 1], "semantic": {"name": "self.validation", "arg_names": [], "import_names": [], "rhs_call_name": "BaseDatabaseValidation", "annotation": ""}, "snippet": " self.validation = BaseDatabaseValidation(self)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99043:Assign_L52_C8", "label": "self.settings_dict =", "type": "assigned_variable", "loc": [52, 52], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99043:FunctionDef_L44_C4", "vector": [14, 2, 0.9286, 0.0179, 2, 0.52, 0.8571, 559, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.settings_dict", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.settings_dict = settings_dict"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99043:Assign_L53_C8", "label": "self.alias =", "type": "assigned_variable", "loc": [53, 53], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99043:FunctionDef_L44_C4", "vector": [14, 2, 0.9464, 0.0179, 2, 0.52, 1.0, 503, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.alias", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.alias = alias"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99043:FunctionDef_L55_C4", "label": "close", "type": "function", "loc": [55, 56], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99043:ClassDef_L38_C0", "vector": [2, 1, 0.9911, 0.0357, 1, 0.65, 1.0, 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"}]
[{"f": "ajibawa-2023/Python-Code-Large/train/row_99043:ClassDef_L26_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99043:Assign_L27_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99043:ClassDef_L29_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99043:Assign_L30_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99043:ClassDef_L32_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99043:Assign_L33_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99043:ClassDef_L32_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99043:Assign_L34_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99043:ClassDef_L32_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99043:Assign_L35_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99043:ClassDef_L32_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99043:Assign_L36_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99043:ClassDef_L38_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99043:Assign_L39_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99043:ClassDef_L38_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99043:Assign_L40_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99043:ClassDef_L38_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99043:Assign_L41_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99043:ClassDef_L38_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99043:Assign_L42_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99043:ClassDef_L38_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99043:FunctionDef_L44_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99043:FunctionDef_L44_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99043:Assign_L45_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99043:FunctionDef_L44_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99043:Assign_L46_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99043:FunctionDef_L44_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99043:Assign_L47_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99043:FunctionDef_L44_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99043:Assign_L48_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99043:FunctionDef_L44_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99043:Assign_L49_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99043:FunctionDef_L44_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99043:Assign_L50_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99043:FunctionDef_L44_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99043:Assign_L52_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99043:FunctionDef_L44_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99043:Assign_L53_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99043:ClassDef_L38_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99043:FunctionDef_L55_C4"}]
from django.db.backends import BaseDatabaseIntrospection class DatabaseIntrospection(BaseDatabaseIntrospection): # Maps type codes to Django Field types. data_types_reverse = { 16: 'BooleanField', 20: 'BigIntegerField', 21: 'SmallIntegerField', 23: 'IntegerField', 25: 'TextField', 700: 'FloatField', 701: 'FloatField', 869: 'IPAddressField', 1043: 'CharField', 1082: 'DateField', 1083: 'TimeField', 1114: 'DateTimeField', 1184: 'DateTimeField', 1266: 'TimeField', 1700: 'DecimalField', } def get_table_list(self, cursor): "Returns a list of table names in the current database." cursor.execute(""" SELECT c.relname FROM pg_catalog.pg_class c LEFT JOIN pg_catalog.pg_namespace n ON n.oid = c.relnamespace WHERE c.relkind IN ('r', 'v', '') AND n.nspname NOT IN ('pg_catalog', 'pg_toast') AND pg_catalog.pg_table_is_visible(c.oid)""") return [row[0] for row in cursor.fetchall()] def get_table_description(self, cursor, table_name): "Returns a description of the table, with the DB-API cursor.description interface." cursor.execute("SELECT * FROM %s LIMIT 1" % self.connection.ops.quote_name(table_name)) return cursor.description def get_relations(self, cursor, table_name): """ Returns a dictionary of {field_index: (field_index_other_table, other_table)} representing all relationships to the given table. Indexes are 0-based. """ cursor.execute(""" SELECT con.conkey, con.confkey, c2.relname FROM pg_constraint con, pg_class c1, pg_class c2 WHERE c1.oid = con.conrelid AND c2.oid = con.confrelid AND c1.relname = %s AND con.contype = 'f'""", [table_name]) relations = {} for row in cursor.fetchall(): try: # row[0] and row[1] are like "{2}", so strip the curly braces. relations[int(row[0][1:-1]) - 1] = (int(row[1][1:-1]) - 1, row[2]) except ValueError: continue return relations def get_indexes(self, cursor, table_name): """ Returns a dictionary of fieldname -> infodict for the given table, where each infodict is in the format: {'primary_key': boolean representing whether it's the primary key, 'unique': boolean representing whether it's a unique index} """ # This query retrieves each index on the given table, including the # first associated field name cursor.execute(""" SELECT attr.attname, idx.indkey, idx.indisunique, idx.indisprimary FROM pg_catalog.pg_class c, pg_catalog.pg_class c2, pg_catalog.pg_index idx, pg_catalog.pg_attribute attr WHERE c.oid = idx.indrelid AND idx.indexrelid = c2.oid AND attr.attrelid = c.oid AND attr.attnum = idx.indkey[0] AND c.relname = %s""", [table_name]) indexes = {} for row in cursor.fetchall(): # row[1] (idx.indkey) is stored in the DB as an array. It comes out as # a string of space-separated integers. This designates the field # indexes (1-based) of the fields that have indexes on the table. # Here, we skip any indexes across multiple fields. if ' ' in row[1]: continue indexes[row[0]] = {'primary_key': row[3], 'unique': row[2]} return indexes
ajibawa-2023/Python-Code-Large/train/row_99045
27
88
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_99045:ImportFrom_L1_C0", "label": "from django.db.backends import BaseDatabaseIntrospection", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0114, 0.0114, 0, 0.66, 0.0, 981, 0, 1, 0, 0, 981, 0, 0], "semantic": {"name": "django.db.backends", "arg_names": [], "import_names": ["BaseDatabaseIntrospection"], "rhs_call_name": "", "annotation": ""}, "snippet": "from django.db.backends import BaseDatabaseIntrospection"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99045:ClassDef_L3_C0", "label": "DatabaseIntrospection", "type": "class", "loc": [3, 87], "level": 0, "parent": null, "vector": [3, 0, 0.5114, 0.9659, 0, 0.66, 1.0, 77, 0, 4, 0, 0, 41, 0, 10], "semantic": {"name": "DatabaseIntrospection", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class DatabaseIntrospection(BaseDatabaseIntrospection):\n # Maps type codes to Django Field types.\n data_types_reverse = {\n 16: 'BooleanField',\n 20: 'BigIntegerField',\n 21: 'SmallIntegerField',\n 23: 'IntegerField',\n 25: 'TextField',"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99045:Assign_L5_C4", "label": "data_types_reverse =", "type": "assigned_variable", "loc": [5, 21], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99045:ClassDef_L3_C0", "vector": [14, 1, 0.1477, 0.1932, 1, 0.85, 0.0, 403, 0, 0, 0, 0, 0, 6, 0], "semantic": {"name": "data_types_reverse", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " data_types_reverse = {\n 16: 'BooleanField',\n 20: 'BigIntegerField',\n 21: 'SmallIntegerField',\n 23: 'IntegerField',\n 25: 'TextField',\n 700: 'FloatField',\n 701: 'FloatField',"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99045:FunctionDef_L23_C4", "label": "get_table_list", "type": "function", "loc": [23, 32], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99045:ClassDef_L3_C0", "vector": [2, 1, 0.3125, 0.1136, 1, 0.85, 0.25, 878, 0, 2, 1, 0, 0, 0, 2], "semantic": {"name": "get_table_list", "arg_names": ["self", "cursor"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def get_table_list(self, cursor):\n \"Returns a list of table names in the current database.\"\n cursor.execute(\"\"\"\n SELECT c.relname\n FROM pg_catalog.pg_class c\n LEFT JOIN pg_catalog.pg_namespace n ON n.oid = c.relnamespace\n WHERE c.relkind IN ('r', 'v', '')\n AND n.nspname NOT IN ('pg_catalog', 'pg_toast')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99045:Expr_L24_C8", "label": "expression", "type": "expression", "loc": [24, 24], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99045:FunctionDef_L23_C4", "vector": [8, 2, 0.2727, 0.0114, 2, 0.65, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"Returns a list of table names in the current database.\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99045:Expr_L25_C8", "label": "execute()", "type": "expression", "loc": [25, 31], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99045:FunctionDef_L23_C4", "vector": [8, 2, 0.3182, 0.0795, 2, 0.65, 0.5, 569, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "execute", "arg_names": [], "import_names": [], "rhs_call_name": "execute", "annotation": ""}, "snippet": " cursor.execute(\"\"\"\n SELECT c.relname\n FROM pg_catalog.pg_class c\n LEFT JOIN pg_catalog.pg_namespace n ON n.oid = c.relnamespace\n WHERE c.relkind IN ('r', 'v', '')\n AND n.nspname NOT IN ('pg_catalog', 'pg_toast')\n AND pg_catalog.pg_table_is_visible(c.oid)\"\"\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99045:Return_L32_C8", "label": "return", "type": "return", "loc": [32, 32], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99045:FunctionDef_L23_C4", "vector": [13, 2, 0.3636, 0.0114, 2, 0.65, 1.0, 0, 5, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return [row[0] for row in cursor.fetchall()]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99045:FunctionDef_L34_C4", "label": "get_table_description", "type": "function", "loc": [34, 37], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99045:ClassDef_L3_C0", "vector": [2, 1, 0.4034, 0.0455, 1, 0.85, 0.5, 876, 0, 3, 1, 0, 0, 0, 2], "semantic": {"name": "get_table_description", "arg_names": ["self", "cursor", "table_name"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def get_table_description(self, cursor, table_name):\n \"Returns a description of the table, with the DB-API cursor.description interface.\"\n cursor.execute(\"SELECT * FROM %s LIMIT 1\" % self.connection.ops.quote_name(table_name))\n return cursor.description"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99045:Expr_L35_C8", "label": "expression", "type": "expression", "loc": [35, 35], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99045:FunctionDef_L34_C4", "vector": [8, 2, 0.3977, 0.0114, 2, 0.97, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"Returns a description of the table, with the DB-API cursor.description interface.\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99045:Expr_L36_C8", "label": "execute()", "type": "expression", "loc": [36, 36], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99045:FunctionDef_L34_C4", "vector": [8, 2, 0.4091, 0.0114, 2, 0.97, 0.5, 569, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "execute", "arg_names": [], "import_names": [], "rhs_call_name": "execute", "annotation": ""}, "snippet": " cursor.execute(\"SELECT * FROM %s LIMIT 1\" % self.connection.ops.quote_name(table_name))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99045:Return_L37_C8", "label": "return", "type": "return", "loc": [37, 37], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99045:FunctionDef_L34_C4", "vector": [13, 2, 0.4205, 0.0114, 2, 0.97, 1.0, 0, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return cursor.description"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99045:FunctionDef_L39_C4", "label": "get_relations", "type": "function", "loc": [39, 58], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99045:ClassDef_L3_C0", "vector": [2, 1, 0.5511, 0.2273, 1, 0.85, 0.75, 814, 0, 3, 1, 0, 0, 0, 4], "semantic": {"name": "get_relations", "arg_names": ["self", "cursor", "table_name"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def get_relations(self, cursor, table_name):\n \"\"\"\n Returns a dictionary of {field_index: (field_index_other_table, other_table)}\n representing all relationships to the given table. Indexes are 0-based.\n \"\"\"\n cursor.execute(\"\"\"\n SELECT con.conkey, con.confkey, c2.relname\n FROM pg_constraint con, pg_class c1, pg_class c2"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99045:Expr_L40_C8", "label": "expression", "type": "expression", "loc": [40, 43], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99045:FunctionDef_L39_C4", "vector": [8, 2, 0.4716, 0.0455, 2, 0.13, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"\n Returns a dictionary of {field_index: (field_index_other_table, other_table)}\n representing all relationships to the given table. Indexes are 0-based.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99045:Expr_L44_C8", "label": "execute()", "type": "expression", "loc": [44, 50], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99045:FunctionDef_L39_C4", "vector": [8, 2, 0.5341, 0.0795, 2, 0.13, 0.25, 569, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "execute", "arg_names": [], "import_names": [], "rhs_call_name": "execute", "annotation": ""}, "snippet": " cursor.execute(\"\"\"\n SELECT con.conkey, con.confkey, c2.relname\n FROM pg_constraint con, pg_class c1, pg_class c2\n WHERE c1.oid = con.conrelid\n AND c2.oid = con.confrelid\n AND c1.relname = %s\n AND con.contype = 'f'\"\"\", [table_name])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99045:Assign_L51_C8", "label": "relations =", "type": "assigned_variable", "loc": [51, 51], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99045:FunctionDef_L39_C4", "vector": [14, 2, 0.5795, 0.0114, 2, 0.13, 0.5, 900, 0, 0, 0, 0, 0, 6, 0], "semantic": {"name": "relations", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " relations = {}"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99045:For_L52_C8", "label": "for row", "type": "for", "loc": [52, 57], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99045:FunctionDef_L39_C4", "vector": [6, 2, 0.6193, 0.0682, 2, 0.13, 0.75, 767, 3, 0, 0, 0, 0, 0, 3], "semantic": {"name": "row", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for row in cursor.fetchall():\n try:\n # row[0] and row[1] are like \"{2}\", so strip the curly braces.\n relations[int(row[0][1:-1]) - 1] = (int(row[1][1:-1]) - 1, row[2])\n except ValueError:\n continue"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99045:Try_L53_C12", "label": "try", "type": "try", "loc": [53, 57], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99045:For_L52_C8", "vector": [7, 3, 0.625, 0.0568, 3, 0.61, 0.0, 0, 0, 1, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " try:\n # row[0] and row[1] are like \"{2}\", so strip the curly braces.\n relations[int(row[0][1:-1]) - 1] = (int(row[1][1:-1]) - 1, row[2])\n except ValueError:\n continue"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99045:Assign_L55_C16", "label": "assign", "type": "assigned_variable", "loc": [55, 55], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99045:Try_L53_C12", "vector": [14, 4, 0.625, 0.0114, 4, 0.1, 0.0, 0, 0, 0, 0, 0, 0, 8, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " relations[int(row[0][1:-1]) - 1] = (int(row[1][1:-1]) - 1, row[2])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99045:Return_L58_C8", "label": "return", "type": "return", "loc": [58, 58], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99045:FunctionDef_L39_C4", "vector": [13, 2, 0.6591, 0.0114, 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 relations"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99045:FunctionDef_L60_C4", "label": "get_indexes", "type": "function", "loc": [60, 87], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99045:ClassDef_L3_C0", "vector": [2, 1, 0.8352, 0.3182, 1, 0.85, 1.0, 808, 0, 3, 1, 0, 0, 0, 2], "semantic": {"name": "get_indexes", "arg_names": ["self", "cursor", "table_name"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def get_indexes(self, cursor, table_name):\n \"\"\"\n Returns a dictionary of fieldname -> infodict for the given table,\n where each infodict is in the format:\n {'primary_key': boolean representing whether it's the primary key,\n 'unique': boolean representing whether it's a unique index}\n \"\"\"\n # This query retrieves each index on the given table, including the"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99045:Expr_L61_C8", "label": "expression", "type": "expression", "loc": [61, 66], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99045:FunctionDef_L60_C4", "vector": [8, 2, 0.7216, 0.0682, 2, 0.63, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"\n Returns a dictionary of fieldname -> infodict for the given table,\n where each infodict is in the format:\n {'primary_key': boolean representing whether it's the primary key,\n 'unique': boolean representing whether it's a unique index}\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99045:Expr_L69_C8", "label": "execute()", "type": "expression", "loc": [69, 77], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99045:FunctionDef_L60_C4", "vector": [8, 2, 0.8295, 0.1023, 2, 0.63, 0.25, 569, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "execute", "arg_names": [], "import_names": [], "rhs_call_name": "execute", "annotation": ""}, "snippet": " cursor.execute(\"\"\"\n SELECT attr.attname, idx.indkey, idx.indisunique, idx.indisprimary\n FROM pg_catalog.pg_class c, pg_catalog.pg_class c2,\n pg_catalog.pg_index idx, pg_catalog.pg_attribute attr\n WHERE c.oid = idx.indrelid\n AND idx.indexrelid = c2.oid\n AND attr.attrelid = c.oid\n AND attr.attnum = idx.indkey[0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99045:Assign_L78_C8", "label": "indexes =", "type": "assigned_variable", "loc": [78, 78], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99045:FunctionDef_L60_C4", "vector": [14, 2, 0.8864, 0.0114, 2, 0.63, 0.5, 600, 0, 0, 0, 0, 0, 6, 0], "semantic": {"name": "indexes", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " indexes = {}"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99045:For_L79_C8", "label": "for row", "type": "for", "loc": [79, 86], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99045:FunctionDef_L60_C4", "vector": [6, 2, 0.9375, 0.0909, 2, 0.63, 0.75, 767, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "row", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for row in cursor.fetchall():\n # row[1] (idx.indkey) is stored in the DB as an array. It comes out as\n # a string of space-separated integers. This designates the field\n # indexes (1-based) of the fields that have indexes on the table.\n # Here, we skip any indexes across multiple fields.\n if ' ' in row[1]:\n continue\n indexes[row[0]] = {'primary_key': row[3], 'unique': row[2]}"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99045:If_L84_C12", "label": "if", "type": "if", "loc": [84, 85], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99045:For_L79_C8", "vector": [4, 3, 0.9602, 0.0227, 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 ' ' in row[1]:\n continue"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99045:Assign_L86_C12", "label": "assign", "type": "assigned_variable", "loc": [86, 86], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99045:For_L79_C8", "vector": [14, 3, 0.9773, 0.0114, 3, 0.96, 1.0, 0, 0, 0, 0, 0, 0, 6, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " indexes[row[0]] = {'primary_key': row[3], 'unique': row[2]}"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99045:Return_L87_C8", "label": "return", "type": "return", "loc": [87, 87], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99045:FunctionDef_L60_C4", "vector": [13, 2, 0.9886, 0.0114, 2, 0.63, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return indexes"}]
[{"f": "ajibawa-2023/Python-Code-Large/train/row_99045:ClassDef_L3_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99045:Assign_L5_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99045:ClassDef_L3_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99045:FunctionDef_L23_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99045:FunctionDef_L23_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99045:Expr_L24_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99045:FunctionDef_L23_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99045:Expr_L25_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99045:FunctionDef_L23_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99045:Return_L32_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99045:ClassDef_L3_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99045:FunctionDef_L34_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99045:FunctionDef_L34_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99045:Expr_L35_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99045:FunctionDef_L34_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99045:Expr_L36_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99045:FunctionDef_L34_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99045:Return_L37_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99045:ClassDef_L3_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99045:FunctionDef_L39_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99045:FunctionDef_L39_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99045:Expr_L40_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99045:FunctionDef_L39_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99045:Expr_L44_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99045:FunctionDef_L39_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99045:Assign_L51_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99045:FunctionDef_L39_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99045:For_L52_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99045:For_L52_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99045:Try_L53_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99045:Try_L53_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99045:Assign_L55_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99045:FunctionDef_L39_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99045:Return_L58_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99045:ClassDef_L3_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99045:FunctionDef_L60_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99045:FunctionDef_L60_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99045:Expr_L61_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99045:FunctionDef_L60_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99045:Expr_L69_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99045:FunctionDef_L60_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99045:Assign_L78_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99045:FunctionDef_L60_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99045:For_L79_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99045:For_L79_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99045:If_L84_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99045:For_L79_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99045:Assign_L86_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99045:FunctionDef_L60_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99045:Return_L87_C8"}]
import os import sys from django.db.backends import BaseDatabaseClient class DatabaseClient(BaseDatabaseClient): executable_name = 'psql' def runshell(self): settings_dict = self.connection.settings_dict args = [self.executable_name] if settings_dict['USER']: args += ["-U", settings_dict['USER']] if settings_dict['HOST']: args.extend(["-h", settings_dict['HOST']]) if settings_dict['PORT']: args.extend(["-p", str(settings_dict['PORT'])]) args += [settings_dict['NAME']] if os.name == 'nt': sys.exit(os.system(" ".join(args))) else: os.execvp(self.executable_name, args)
ajibawa-2023/Python-Code-Large/train/row_99046
16
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_99046:Import_L1_C0", "label": "os import os", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0435, 0.0435, 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_99046:Import_L2_C0", "label": "sys import sys", "type": "import", "loc": [2, 2], "level": 0, "parent": null, "vector": [1, 0, 0.087, 0.0435, 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_99046:ImportFrom_L4_C0", "label": "from django.db.backends import BaseDatabaseClient", "type": "import", "loc": [4, 4], "level": 0, "parent": null, "vector": [1, 0, 0.1739, 0.0435, 0, 0.66, 0.6667, 981, 0, 1, 0, 0, 981, 0, 0], "semantic": {"name": "django.db.backends", "arg_names": [], "import_names": ["BaseDatabaseClient"], "rhs_call_name": "", "annotation": ""}, "snippet": "from django.db.backends import BaseDatabaseClient"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99046:ClassDef_L6_C0", "label": "DatabaseClient", "type": "class", "loc": [6, 22], "level": 0, "parent": null, "vector": [3, 0, 0.6087, 0.7391, 0, 0.66, 1.0, 207, 0, 1, 0, 0, 729, 0, 7], "semantic": {"name": "DatabaseClient", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class DatabaseClient(BaseDatabaseClient):\n executable_name = 'psql'\n\n def runshell(self):\n settings_dict = self.connection.settings_dict\n args = [self.executable_name]\n if settings_dict['USER']:\n args += [\"-U\", settings_dict['USER']]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99046:Assign_L7_C4", "label": "executable_name =", "type": "assigned_variable", "loc": [7, 7], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99046:ClassDef_L6_C0", "vector": [14, 1, 0.3043, 0.0435, 1, 0.75, 0.0, 723, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "executable_name", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " executable_name = 'psql'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99046:FunctionDef_L9_C4", "label": "runshell", "type": "function", "loc": [9, 22], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99046:ClassDef_L6_C0", "vector": [2, 1, 0.6739, 0.6087, 1, 0.75, 1.0, 795, 0, 1, 0, 0, 0, 0, 7], "semantic": {"name": "runshell", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def runshell(self):\n settings_dict = self.connection.settings_dict\n args = [self.executable_name]\n if settings_dict['USER']:\n args += [\"-U\", settings_dict['USER']]\n if settings_dict['HOST']:\n args.extend([\"-h\", settings_dict['HOST']])\n if settings_dict['PORT']:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99046:Assign_L10_C8", "label": "settings_dict =", "type": "assigned_variable", "loc": [10, 10], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99046:FunctionDef_L9_C4", "vector": [14, 2, 0.4348, 0.0435, 2, 0.77, 0.0, 893, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "settings_dict", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " settings_dict = self.connection.settings_dict"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99046:Assign_L11_C8", "label": "args =", "type": "assigned_variable", "loc": [11, 11], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99046:FunctionDef_L9_C4", "vector": [14, 2, 0.4783, 0.0435, 2, 0.77, 0.2, 805, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "args", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " args = [self.executable_name]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99046:If_L12_C8", "label": "if", "type": "if", "loc": [12, 13], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99046:FunctionDef_L9_C4", "vector": [4, 2, 0.5435, 0.087, 2, 0.77, 0.4, 0, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if settings_dict['USER']:\n args += [\"-U\", settings_dict['USER']]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99046:If_L14_C8", "label": "if", "type": "if", "loc": [14, 15], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99046:FunctionDef_L9_C4", "vector": [4, 2, 0.6304, 0.087, 2, 0.77, 0.6, 0, 6, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if settings_dict['HOST']:\n args.extend([\"-h\", settings_dict['HOST']])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99046:Expr_L15_C12", "label": "extend()", "type": "expression", "loc": [15, 15], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99046:If_L14_C8", "vector": [8, 3, 0.6522, 0.0435, 3, 0.84, 0.0, 660, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "extend", "arg_names": [], "import_names": [], "rhs_call_name": "extend", "annotation": ""}, "snippet": " args.extend([\"-h\", settings_dict['HOST']])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99046:If_L16_C8", "label": "if", "type": "if", "loc": [16, 17], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99046:FunctionDef_L9_C4", "vector": [4, 2, 0.7174, 0.087, 2, 0.77, 0.8, 0, 6, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if settings_dict['PORT']:\n args.extend([\"-p\", str(settings_dict['PORT'])])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99046:Expr_L17_C12", "label": "extend()", "type": "expression", "loc": [17, 17], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99046:If_L16_C8", "vector": [8, 3, 0.7391, 0.0435, 3, 0.02, 0.0, 660, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "extend", "arg_names": [], "import_names": [], "rhs_call_name": "extend", "annotation": ""}, "snippet": " args.extend([\"-p\", str(settings_dict['PORT'])])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99046:If_L19_C8", "label": "if", "type": "if", "loc": [19, 22], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99046:FunctionDef_L9_C4", "vector": [4, 2, 0.8913, 0.1739, 2, 0.77, 1.0, 0, 0, 0, 0, 0, 0, 0, 4], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if os.name == 'nt':\n sys.exit(os.system(\" \".join(args)))\n else:\n os.execvp(self.executable_name, args)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99046:Expr_L20_C12", "label": "exit()", "type": "expression", "loc": [20, 20], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99046:If_L19_C8", "vector": [8, 3, 0.8696, 0.0435, 3, 0.88, 0.0, 436, 3, 1, 0, 0, 0, 0, 3], "semantic": {"name": "exit", "arg_names": [], "import_names": [], "rhs_call_name": "exit", "annotation": ""}, "snippet": " sys.exit(os.system(\" \".join(args)))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99046:Expr_L22_C12", "label": "execvp()", "type": "expression", "loc": [22, 22], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99046:If_L19_C8", "vector": [8, 3, 0.9565, 0.0435, 3, 0.88, 1.0, 784, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "execvp", "arg_names": [], "import_names": [], "rhs_call_name": "execvp", "annotation": ""}, "snippet": " os.execvp(self.executable_name, args)"}]
[{"f": "ajibawa-2023/Python-Code-Large/train/row_99046:ClassDef_L6_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99046:Assign_L7_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99046:ClassDef_L6_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99046:FunctionDef_L9_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99046:FunctionDef_L9_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99046:Assign_L10_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99046:FunctionDef_L9_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99046:Assign_L11_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99046:FunctionDef_L9_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99046:If_L12_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99046:FunctionDef_L9_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99046:If_L14_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99046:If_L14_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99046:Expr_L15_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99046:FunctionDef_L9_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99046:If_L16_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99046:If_L16_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99046:Expr_L17_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99046:FunctionDef_L9_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99046:If_L19_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99046:If_L19_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99046:Expr_L20_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99046:If_L19_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99046:Expr_L22_C12"}]
import re from django.db.backends import BaseDatabaseOperations # This DatabaseOperations class lives in here instead of base.py because it's # used by both the 'postgresql' and 'postgresql_psycopg2' backends. class DatabaseOperations(BaseDatabaseOperations): def __init__(self, connection): super(DatabaseOperations, self).__init__() self._postgres_version = None self.connection = connection def _get_postgres_version(self): if self._postgres_version is None: from django.db.backends.postgresql.version import get_version cursor = self.connection.cursor() self._postgres_version = get_version(cursor) return self._postgres_version postgres_version = property(_get_postgres_version) def date_extract_sql(self, lookup_type, field_name): # http://www.postgresql.org/docs/8.0/static/functions-datetime.html#FUNCTIONS-DATETIME-EXTRACT if lookup_type == 'week_day': # For consistency across backends, we return Sunday=1, Saturday=7. return "EXTRACT('dow' FROM %s) + 1" % field_name else: return "EXTRACT('%s' FROM %s)" % (lookup_type, field_name) def date_trunc_sql(self, lookup_type, field_name): # http://www.postgresql.org/docs/8.0/static/functions-datetime.html#FUNCTIONS-DATETIME-TRUNC return "DATE_TRUNC('%s', %s)" % (lookup_type, field_name) def deferrable_sql(self): return " DEFERRABLE INITIALLY DEFERRED" def lookup_cast(self, lookup_type): lookup = '%s' # Cast text lookups to text to allow things like filter(x__contains=4) if lookup_type in ('iexact', 'contains', 'icontains', 'startswith', 'istartswith', 'endswith', 'iendswith'): lookup = "%s::text" # Use UPPER(x) for case-insensitive lookups; it's faster. if lookup_type in ('iexact', 'icontains', 'istartswith', 'iendswith'): lookup = 'UPPER(%s)' % lookup return lookup def field_cast_sql(self, db_type): if db_type == 'inet': return 'HOST(%s)' return '%s' def last_insert_id(self, cursor, table_name, pk_name): # Use pg_get_serial_sequence to get the underlying sequence name # from the table name and column name (available since PostgreSQL 8) cursor.execute("SELECT CURRVAL(pg_get_serial_sequence('%s','%s'))" % ( self.quote_name(table_name), pk_name)) return cursor.fetchone()[0] def no_limit_value(self): return None def quote_name(self, name): if name.startswith('"') and name.endswith('"'): return name # Quoting once is enough. return '"%s"' % name def sql_flush(self, style, tables, sequences): if tables: if self.postgres_version[0:2] >= (8,1): # Postgres 8.1+ can do 'TRUNCATE x, y, z...;'. In fact, it *has to* # in order to be able to truncate tables referenced by a foreign # key in any other table. The result is a single SQL TRUNCATE # statement. sql = ['%s %s;' % \ (style.SQL_KEYWORD('TRUNCATE'), style.SQL_FIELD(', '.join([self.quote_name(table) for table in tables])) )] else: # Older versions of Postgres can't do TRUNCATE in a single call, so # they must use a simple delete. sql = ['%s %s %s;' % \ (style.SQL_KEYWORD('DELETE'), style.SQL_KEYWORD('FROM'), style.SQL_FIELD(self.quote_name(table)) ) for table in tables] # 'ALTER SEQUENCE sequence_name RESTART WITH 1;'... style SQL statements # to reset sequence indices for sequence_info in sequences: table_name = sequence_info['table'] column_name = sequence_info['column'] if not (column_name and len(column_name) > 0): # This will be the case if it's an m2m using an autogenerated # intermediate table (see BaseDatabaseIntrospection.sequence_list) column_name = 'id' sql.append("%s setval(pg_get_serial_sequence('%s','%s'), 1, false);" % \ (style.SQL_KEYWORD('SELECT'), style.SQL_TABLE(self.quote_name(table_name)), style.SQL_FIELD(column_name)) ) return sql else: return [] def sequence_reset_sql(self, style, model_list): from django.db import models output = [] qn = self.quote_name for model in model_list: # Use `coalesce` to set the sequence for each model to the max pk value if there are records, # or 1 if there are none. Set the `is_called` property (the third argument to `setval`) to true # if there are records (as the max pk value is already in use), otherwise set it to false. # Use pg_get_serial_sequence to get the underlying sequence name from the table name # and column name (available since PostgreSQL 8) for f in model._meta.local_fields: if isinstance(f, models.AutoField): output.append("%s setval(pg_get_serial_sequence('%s','%s'), coalesce(max(%s), 1), max(%s) %s null) %s %s;" % \ (style.SQL_KEYWORD('SELECT'), style.SQL_TABLE(qn(model._meta.db_table)), style.SQL_FIELD(f.column), style.SQL_FIELD(qn(f.column)), style.SQL_FIELD(qn(f.column)), style.SQL_KEYWORD('IS NOT'), style.SQL_KEYWORD('FROM'), style.SQL_TABLE(qn(model._meta.db_table)))) break # Only one AutoField is allowed per model, so don't bother continuing. for f in model._meta.many_to_many: if not f.rel.through: output.append("%s setval(pg_get_serial_sequence('%s','%s'), coalesce(max(%s), 1), max(%s) %s null) %s %s;" % \ (style.SQL_KEYWORD('SELECT'), style.SQL_TABLE(qn(f.m2m_db_table())), style.SQL_FIELD('id'), style.SQL_FIELD(qn('id')), style.SQL_FIELD(qn('id')), style.SQL_KEYWORD('IS NOT'), style.SQL_KEYWORD('FROM'), style.SQL_TABLE(qn(f.m2m_db_table())))) return output def savepoint_create_sql(self, sid): return "SAVEPOINT %s" % sid def savepoint_commit_sql(self, sid): return "RELEASE SAVEPOINT %s" % sid def savepoint_rollback_sql(self, sid): return "ROLLBACK TO SAVEPOINT %s" % sid def prep_for_iexact_query(self, x): return x def check_aggregate_support(self, aggregate): """Check that the backend fully supports the provided aggregate. The population and sample statistics (STDDEV_POP, STDDEV_SAMP, VAR_POP, VAR_SAMP) were first implemented in Postgres 8.2. The implementation of population statistics (STDDEV_POP and VAR_POP) under Postgres 8.2 - 8.2.4 is known to be faulty. Raise NotImplementedError if this is the database in use. """ if aggregate.sql_function in ('STDDEV_POP', 'STDDEV_SAMP', 'VAR_POP', 'VAR_SAMP'): if self.postgres_version[0:2] < (8,2): raise NotImplementedError('PostgreSQL does not support %s prior to version 8.2. Please upgrade your version of PostgreSQL.' % aggregate.sql_function) if aggregate.sql_function in ('STDDEV_POP', 'VAR_POP'): if self.postgres_version[0:2] == (8,2): if self.postgres_version[2] is None or self.postgres_version[2] <= 4: raise NotImplementedError('PostgreSQL 8.2 to 8.2.4 is known to have a faulty implementation of %s. Please upgrade your version of PostgreSQL.' % aggregate.sql_function) def max_name_length(self): """ Returns the maximum length of an identifier. Note that the maximum length of an identifier is 63 by default, but can be changed by recompiling PostgreSQL after editing the NAMEDATALEN macro in src/include/pg_config_manual.h . This implementation simply returns 63, but can easily be overridden by a custom database backend that inherits most of its behavior from this one. """ return 63
ajibawa-2023/Python-Code-Large/train/row_99047
85
188
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_99047:Import_L1_C0", "label": "re import re", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0053, 0.0053, 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_99047:ImportFrom_L3_C0", "label": "from django.db.backends import BaseDatabaseOperations", "type": "import", "loc": [3, 3], "level": 0, "parent": null, "vector": [1, 0, 0.016, 0.0053, 0, 0.66, 0.5, 981, 0, 1, 0, 0, 981, 0, 0], "semantic": {"name": "django.db.backends", "arg_names": [], "import_names": ["BaseDatabaseOperations"], "rhs_call_name": "", "annotation": ""}, "snippet": "from django.db.backends import BaseDatabaseOperations"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99047:ClassDef_L8_C0", "label": "DatabaseOperations", "type": "class", "loc": [8, 188], "level": 0, "parent": null, "vector": [3, 0, 0.5213, 0.9628, 0, 0.66, 1.0, 311, 0, 18, 0, 0, 927, 0, 55], "semantic": {"name": "DatabaseOperations", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class DatabaseOperations(BaseDatabaseOperations):\n def __init__(self, connection):\n super(DatabaseOperations, self).__init__()\n self._postgres_version = None\n self.connection = connection\n\n def _get_postgres_version(self):\n if self._postgres_version is None:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99047:FunctionDef_L9_C4", "label": "__init__", "type": "function", "loc": [9, 12], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99047:ClassDef_L8_C0", "vector": [2, 1, 0.0559, 0.0213, 1, 0.02, 0.0, 555, 0, 2, 0, 0, 0, 0, 2], "semantic": {"name": "__init__", "arg_names": ["self", "connection"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, connection):\n super(DatabaseOperations, self).__init__()\n self._postgres_version = None\n self.connection = connection"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99047:Expr_L10_C8", "label": "__init__()", "type": "expression", "loc": [10, 10], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99047:FunctionDef_L9_C4", "vector": [8, 2, 0.0532, 0.0053, 2, 0.95, 0.0, 555, 3, 0, 0, 0, 0, 0, 2], "semantic": {"name": "__init__", "arg_names": [], "import_names": [], "rhs_call_name": "__init__", "annotation": ""}, "snippet": " super(DatabaseOperations, self).__init__()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99047:Assign_L11_C8", "label": "self._postgres_version =", "type": "assigned_variable", "loc": [11, 11], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99047:FunctionDef_L9_C4", "vector": [14, 2, 0.0585, 0.0053, 2, 0.95, 0.5, 220, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "self._postgres_version", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self._postgres_version = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99047:Assign_L12_C8", "label": "self.connection =", "type": "assigned_variable", "loc": [12, 12], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99047:FunctionDef_L9_C4", "vector": [14, 2, 0.0638, 0.0053, 2, 0.95, 1.0, 685, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.connection", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.connection = connection"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99047:FunctionDef_L14_C4", "label": "_get_postgres_version", "type": "function", "loc": [14, 19], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99047:ClassDef_L8_C0", "vector": [2, 1, 0.0878, 0.0319, 1, 0.02, 0.0556, 502, 0, 1, 1, 0, 0, 0, 2], "semantic": {"name": "_get_postgres_version", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _get_postgres_version(self):\n if self._postgres_version is None:\n from django.db.backends.postgresql.version import get_version\n cursor = self.connection.cursor()\n self._postgres_version = get_version(cursor)\n return self._postgres_version"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99047:If_L15_C8", "label": "if", "type": "if", "loc": [15, 18], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99047:FunctionDef_L14_C4", "vector": [4, 2, 0.0878, 0.0213, 2, 0.39, 0.0, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self._postgres_version is None:\n from django.db.backends.postgresql.version import get_version\n cursor = self.connection.cursor()\n self._postgres_version = get_version(cursor)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99047:ImportFrom_L16_C12", "label": "from django.db.backends.postgresql.version import get_version", "type": "import", "loc": [16, 16], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99047:If_L15_C8", "vector": [1, 3, 0.0851, 0.0053, 3, 0.34, 0.0, 579, 0, 1, 0, 0, 579, 0, 0], "semantic": {"name": "django.db.backends.postgresql.version", "arg_names": [], "import_names": ["get_version"], "rhs_call_name": "", "annotation": ""}, "snippet": " from django.db.backends.postgresql.version import get_version"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99047:Assign_L17_C12", "label": "cursor = cursor()", "type": "assigned_variable", "loc": [17, 17], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99047:If_L15_C8", "vector": [14, 3, 0.0904, 0.0053, 3, 0.34, 0.5, 231, 3, 0, 0, 0, 231, 10, 1], "semantic": {"name": "cursor", "arg_names": [], "import_names": [], "rhs_call_name": "cursor", "annotation": ""}, "snippet": " cursor = self.connection.cursor()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99047:Assign_L18_C12", "label": "self._postgres_version = get_version()", "type": "assigned_variable", "loc": [18, 18], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99047:If_L15_C8", "vector": [14, 3, 0.0957, 0.0053, 3, 0.34, 1.0, 220, 3, 1, 0, 0, 75, 10, 1], "semantic": {"name": "self._postgres_version", "arg_names": [], "import_names": [], "rhs_call_name": "get_version", "annotation": ""}, "snippet": " self._postgres_version = get_version(cursor)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99047:Return_L19_C8", "label": "return", "type": "return", "loc": [19, 19], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99047:FunctionDef_L14_C4", "vector": [13, 2, 0.1011, 0.0053, 2, 0.39, 1.0, 0, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self._postgres_version"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99047:Assign_L20_C4", "label": "postgres_version = property()", "type": "assigned_variable", "loc": [20, 20], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99047:ClassDef_L8_C0", "vector": [14, 1, 0.1064, 0.0053, 1, 0.02, 0.1111, 190, 3, 1, 0, 0, 244, 10, 1], "semantic": {"name": "postgres_version", "arg_names": [], "import_names": [], "rhs_call_name": "property", "annotation": ""}, "snippet": " postgres_version = property(_get_postgres_version)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99047:FunctionDef_L22_C4", "label": "date_extract_sql", "type": "function", "loc": [22, 28], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99047:ClassDef_L8_C0", "vector": [2, 1, 0.133, 0.0372, 1, 0.02, 0.1667, 207, 0, 3, 1, 0, 0, 0, 0], "semantic": {"name": "date_extract_sql", "arg_names": ["self", "lookup_type", "field_name"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def date_extract_sql(self, lookup_type, field_name):\n # http://www.postgresql.org/docs/8.0/static/functions-datetime.html#FUNCTIONS-DATETIME-EXTRACT\n if lookup_type == 'week_day':\n # For consistency across backends, we return Sunday=1, Saturday=7.\n return \"EXTRACT('dow' FROM %s) + 1\" % field_name\n else:\n return \"EXTRACT('%s' FROM %s)\" % (lookup_type, field_name)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99047:If_L24_C8", "label": "if", "type": "if", "loc": [24, 28], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99047:FunctionDef_L22_C4", "vector": [4, 2, 0.1383, 0.0266, 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 lookup_type == 'week_day':\n # For consistency across backends, we return Sunday=1, Saturday=7.\n return \"EXTRACT('dow' FROM %s) + 1\" % field_name\n else:\n return \"EXTRACT('%s' FROM %s)\" % (lookup_type, field_name)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99047:Return_L26_C12", "label": "return", "type": "return", "loc": [26, 26], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99047:If_L24_C8", "vector": [13, 3, 0.1383, 0.0053, 3, 0.71, 0.0, 0, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return \"EXTRACT('dow' FROM %s) + 1\" % field_name"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99047:Return_L28_C12", "label": "return", "type": "return", "loc": [28, 28], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99047:If_L24_C8", "vector": [13, 3, 0.1489, 0.0053, 3, 0.71, 1.0, 0, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return \"EXTRACT('%s' FROM %s)\" % (lookup_type, field_name)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99047:FunctionDef_L30_C4", "label": "date_trunc_sql", "type": "function", "loc": [30, 32], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99047:ClassDef_L8_C0", "vector": [2, 1, 0.1649, 0.016, 1, 0.02, 0.2222, 926, 0, 3, 1, 0, 0, 0, 0], "semantic": {"name": "date_trunc_sql", "arg_names": ["self", "lookup_type", "field_name"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def date_trunc_sql(self, lookup_type, field_name):\n # http://www.postgresql.org/docs/8.0/static/functions-datetime.html#FUNCTIONS-DATETIME-TRUNC\n return \"DATE_TRUNC('%s', %s)\" % (lookup_type, field_name)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99047:Return_L32_C8", "label": "return", "type": "return", "loc": [32, 32], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99047:FunctionDef_L30_C4", "vector": [13, 2, 0.1702, 0.0053, 2, 0.21, 0.0, 0, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return \"DATE_TRUNC('%s', %s)\" % (lookup_type, field_name)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99047:FunctionDef_L34_C4", "label": "deferrable_sql", "type": "function", "loc": [34, 35], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99047:ClassDef_L8_C0", "vector": [2, 1, 0.1835, 0.0106, 1, 0.02, 0.2778, 566, 0, 1, 1, 0, 0, 0, 0], "semantic": {"name": "deferrable_sql", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def deferrable_sql(self):\n return \" DEFERRABLE INITIALLY DEFERRED\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99047:Return_L35_C8", "label": "return", "type": "return", "loc": [35, 35], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99047:FunctionDef_L34_C4", "vector": [13, 2, 0.1862, 0.0053, 2, 0.49, 0.0, 0, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return \" DEFERRABLE INITIALLY DEFERRED\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99047:FunctionDef_L37_C4", "label": "lookup_cast", "type": "function", "loc": [37, 49], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99047:ClassDef_L8_C0", "vector": [2, 1, 0.2287, 0.0691, 1, 0.02, 0.3333, 903, 0, 2, 1, 0, 0, 0, 0], "semantic": {"name": "lookup_cast", "arg_names": ["self", "lookup_type"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def lookup_cast(self, lookup_type):\n lookup = '%s'\n\n # Cast text lookups to text to allow things like filter(x__contains=4)\n if lookup_type in ('iexact', 'contains', 'icontains', 'startswith',\n 'istartswith', 'endswith', 'iendswith'):\n lookup = \"%s::text\"\n"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99047:Assign_L38_C8", "label": "lookup =", "type": "assigned_variable", "loc": [38, 38], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99047:FunctionDef_L37_C4", "vector": [14, 2, 0.2021, 0.0053, 2, 0.53, 0.0, 955, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "lookup", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " lookup = '%s'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99047:If_L41_C8", "label": "if", "type": "if", "loc": [41, 43], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99047:FunctionDef_L37_C4", "vector": [4, 2, 0.2234, 0.016, 2, 0.53, 0.3333, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if lookup_type in ('iexact', 'contains', 'icontains', 'startswith',\n 'istartswith', 'endswith', 'iendswith'):\n lookup = \"%s::text\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99047:Assign_L43_C12", "label": "lookup =", "type": "assigned_variable", "loc": [43, 43], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99047:If_L41_C8", "vector": [14, 3, 0.2287, 0.0053, 3, 0.96, 0.0, 955, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "lookup", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " lookup = \"%s::text\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99047:If_L46_C8", "label": "if", "type": "if", "loc": [46, 47], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99047:FunctionDef_L37_C4", "vector": [4, 2, 0.2473, 0.0106, 2, 0.53, 0.6667, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if lookup_type in ('iexact', 'icontains', 'istartswith', 'iendswith'):\n lookup = 'UPPER(%s)' % lookup"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99047:Assign_L47_C12", "label": "lookup =", "type": "assigned_variable", "loc": [47, 47], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99047:If_L46_C8", "vector": [14, 3, 0.25, 0.0053, 3, 0.85, 0.0, 955, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "lookup", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " lookup = 'UPPER(%s)' % lookup"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99047:Return_L49_C8", "label": "return", "type": "return", "loc": [49, 49], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99047:FunctionDef_L37_C4", "vector": [13, 2, 0.2606, 0.0053, 2, 0.53, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return lookup"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99047:FunctionDef_L51_C4", "label": "field_cast_sql", "type": "function", "loc": [51, 54], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99047:ClassDef_L8_C0", "vector": [2, 1, 0.2793, 0.0213, 1, 0.02, 0.3889, 924, 0, 2, 1, 0, 0, 0, 0], "semantic": {"name": "field_cast_sql", "arg_names": ["self", "db_type"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def field_cast_sql(self, db_type):\n if db_type == 'inet':\n return 'HOST(%s)'\n return '%s'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99047:If_L52_C8", "label": "if", "type": "if", "loc": [52, 53], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99047:FunctionDef_L51_C4", "vector": [4, 2, 0.2793, 0.0106, 2, 0.41, 0.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if db_type == 'inet':\n return 'HOST(%s)'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99047:Return_L53_C12", "label": "return", "type": "return", "loc": [53, 53], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99047:If_L52_C8", "vector": [13, 3, 0.2819, 0.0053, 3, 0.53, 0.0, 0, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return 'HOST(%s)'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99047:Return_L54_C8", "label": "return", "type": "return", "loc": [54, 54], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99047:FunctionDef_L51_C4", "vector": [13, 2, 0.2872, 0.0053, 2, 0.41, 1.0, 0, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return '%s'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99047:FunctionDef_L56_C4", "label": "last_insert_id", "type": "function", "loc": [56, 61], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99047:ClassDef_L8_C0", "vector": [2, 1, 0.3112, 0.0319, 1, 0.02, 0.4444, 956, 0, 4, 1, 0, 0, 0, 3], "semantic": {"name": "last_insert_id", "arg_names": ["self", "cursor", "table_name", "pk_name"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def last_insert_id(self, cursor, table_name, pk_name):\n # Use pg_get_serial_sequence to get the underlying sequence name\n # from the table name and column name (available since PostgreSQL 8)\n cursor.execute(\"SELECT CURRVAL(pg_get_serial_sequence('%s','%s'))\" % (\n self.quote_name(table_name), pk_name))\n return cursor.fetchone()[0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99047:Expr_L59_C8", "label": "execute()", "type": "expression", "loc": [59, 60], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99047:FunctionDef_L56_C4", "vector": [8, 2, 0.3165, 0.0106, 2, 0.72, 0.0, 569, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "execute", "arg_names": [], "import_names": [], "rhs_call_name": "execute", "annotation": ""}, "snippet": " cursor.execute(\"SELECT CURRVAL(pg_get_serial_sequence('%s','%s'))\" % (\n self.quote_name(table_name), pk_name))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99047:Return_L61_C8", "label": "return", "type": "return", "loc": [61, 61], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99047:FunctionDef_L56_C4", "vector": [13, 2, 0.3245, 0.0053, 2, 0.72, 1.0, 0, 6, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return cursor.fetchone()[0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99047:FunctionDef_L63_C4", "label": "no_limit_value", "type": "function", "loc": [63, 64], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99047:ClassDef_L8_C0", "vector": [2, 1, 0.3378, 0.0106, 1, 0.02, 0.5, 407, 0, 1, 1, 0, 0, 0, 0], "semantic": {"name": "no_limit_value", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def no_limit_value(self):\n return None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99047:Return_L64_C8", "label": "return", "type": "return", "loc": [64, 64], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99047:FunctionDef_L63_C4", "vector": [13, 2, 0.3404, 0.0053, 2, 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_99047:FunctionDef_L66_C4", "label": "quote_name", "type": "function", "loc": [66, 69], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99047:ClassDef_L8_C0", "vector": [2, 1, 0.359, 0.0213, 1, 0.02, 0.5556, 116, 0, 2, 1, 0, 0, 0, 2], "semantic": {"name": "quote_name", "arg_names": ["self", "name"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def quote_name(self, name):\n if name.startswith('\"') and name.endswith('\"'):\n return name # Quoting once is enough.\n return '\"%s\"' % name"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99047:If_L67_C8", "label": "if", "type": "if", "loc": [67, 68], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99047:FunctionDef_L66_C4", "vector": [4, 2, 0.359, 0.0106, 2, 0.2, 0.0, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if name.startswith('\"') and name.endswith('\"'):\n return name # Quoting once is enough."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99047:Return_L68_C12", "label": "return", "type": "return", "loc": [68, 68], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99047:If_L67_C8", "vector": [13, 3, 0.3617, 0.0053, 3, 0.4, 0.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return name # Quoting once is enough."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99047:Return_L69_C8", "label": "return", "type": "return", "loc": [69, 69], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99047:FunctionDef_L66_C4", "vector": [13, 2, 0.367, 0.0053, 2, 0.2, 1.0, 0, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return '\"%s\"' % name"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99047:FunctionDef_L71_C4", "label": "sql_flush", "type": "function", "loc": [71, 107], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99047:ClassDef_L8_C0", "vector": [2, 1, 0.4734, 0.1968, 1, 0.02, 0.6111, 914, 0, 4, 1, 0, 0, 0, 14], "semantic": {"name": "sql_flush", "arg_names": ["self", "style", "tables", "sequences"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def sql_flush(self, style, tables, sequences):\n if tables:\n if self.postgres_version[0:2] >= (8,1):\n # Postgres 8.1+ can do 'TRUNCATE x, y, z...;'. In fact, it *has to*\n # in order to be able to truncate tables referenced by a foreign\n # key in any other table. The result is a single SQL TRUNCATE\n # statement.\n sql = ['%s %s;' % \\"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99047:If_L72_C8", "label": "if", "type": "if", "loc": [72, 107], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99047:FunctionDef_L71_C4", "vector": [4, 2, 0.4761, 0.1915, 2, 0.06, 0.0, 0, 2, 0, 0, 0, 0, 0, 14], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if tables:\n if self.postgres_version[0:2] >= (8,1):\n # Postgres 8.1+ can do 'TRUNCATE x, y, z...;'. In fact, it *has to*\n # in order to be able to truncate tables referenced by a foreign\n # key in any other table. The result is a single SQL TRUNCATE\n # statement.\n sql = ['%s %s;' % \\\n (style.SQL_KEYWORD('TRUNCATE'),"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99047:If_L73_C12", "label": "if", "type": "if", "loc": [73, 89], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99047:If_L72_C8", "vector": [4, 3, 0.4309, 0.0904, 3, 0.49, 0.0, 0, 0, 0, 0, 0, 0, 0, 8], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self.postgres_version[0:2] >= (8,1):\n # Postgres 8.1+ can do 'TRUNCATE x, y, z...;'. In fact, it *has to*\n # in order to be able to truncate tables referenced by a foreign\n # key in any other table. The result is a single SQL TRUNCATE\n # statement.\n sql = ['%s %s;' % \\\n (style.SQL_KEYWORD('TRUNCATE'),\n style.SQL_FIELD(', '.join([self.quote_name(table) for table in tables]))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99047:Assign_L78_C16", "label": "sql =", "type": "assigned_variable", "loc": [78, 81], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99047:If_L73_C12", "vector": [14, 4, 0.4229, 0.0213, 4, 0.61, 0.0, 736, 0, 0, 0, 0, 0, 5, 4], "semantic": {"name": "sql", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " sql = ['%s %s;' % \\\n (style.SQL_KEYWORD('TRUNCATE'),\n style.SQL_FIELD(', '.join([self.quote_name(table) for table in tables]))\n )]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99047:Assign_L85_C16", "label": "sql =", "type": "assigned_variable", "loc": [85, 89], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99047:If_L73_C12", "vector": [14, 4, 0.4628, 0.0266, 4, 0.61, 1.0, 736, 5, 0, 0, 0, 0, 0, 4], "semantic": {"name": "sql", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " sql = ['%s %s %s;' % \\\n (style.SQL_KEYWORD('DELETE'),\n style.SQL_KEYWORD('FROM'),\n style.SQL_FIELD(self.quote_name(table))\n ) for table in tables]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99047:For_L93_C12", "label": "for sequence_info", "type": "for", "loc": [93, 104], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99047:If_L72_C8", "vector": [6, 3, 0.5239, 0.0638, 3, 0.49, 0.3333, 336, 2, 0, 0, 0, 0, 0, 6], "semantic": {"name": "sequence_info", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for sequence_info in sequences:\n table_name = sequence_info['table']\n column_name = sequence_info['column']\n if not (column_name and len(column_name) > 0):\n # This will be the case if it's an m2m using an autogenerated\n # intermediate table (see BaseDatabaseIntrospection.sequence_list)\n column_name = 'id'\n sql.append(\"%s setval(pg_get_serial_sequence('%s','%s'), 1, false);\" % \\"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99047:Assign_L94_C16", "label": "table_name =", "type": "assigned_variable", "loc": [94, 94], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99047:For_L93_C12", "vector": [14, 4, 0.5, 0.0053, 4, 0.73, 0.0, 894, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "table_name", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " table_name = sequence_info['table']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99047:Assign_L95_C16", "label": "column_name =", "type": "assigned_variable", "loc": [95, 95], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99047:For_L93_C12", "vector": [14, 4, 0.5053, 0.0053, 4, 0.73, 0.3333, 118, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "column_name", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " column_name = sequence_info['column']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99047:If_L96_C16", "label": "if", "type": "if", "loc": [96, 99], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99047:For_L93_C12", "vector": [4, 4, 0.5186, 0.0213, 4, 0.73, 0.6667, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not (column_name and len(column_name) > 0):\n # This will be the case if it's an m2m using an autogenerated\n # intermediate table (see BaseDatabaseIntrospection.sequence_list)\n column_name = 'id'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99047:Assign_L99_C20", "label": "column_name =", "type": "assigned_variable", "loc": [99, 99], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99047:If_L96_C16", "vector": [14, 5, 0.5266, 0.0053, 5, 0.6, 0.0, 118, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "column_name", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " column_name = 'id'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99047:Expr_L100_C16", "label": "append()", "type": "expression", "loc": [100, 104], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99047:For_L93_C12", "vector": [8, 4, 0.5426, 0.0266, 4, 0.73, 1.0, 243, 3, 1, 0, 0, 0, 0, 5], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " sql.append(\"%s setval(pg_get_serial_sequence('%s','%s'), 1, false);\" % \\\n (style.SQL_KEYWORD('SELECT'),\n style.SQL_TABLE(self.quote_name(table_name)),\n style.SQL_FIELD(column_name))\n )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99047:Return_L105_C12", "label": "return", "type": "return", "loc": [105, 105], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99047:If_L72_C8", "vector": [13, 3, 0.5585, 0.0053, 3, 0.49, 0.6667, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return sql"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99047:Return_L107_C12", "label": "return", "type": "return", "loc": [107, 107], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99047:If_L72_C8", "vector": [13, 3, 0.5691, 0.0053, 3, 0.49, 1.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_99047:FunctionDef_L109_C4", "label": "sequence_reset_sql", "type": "function", "loc": [109, 143], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99047:ClassDef_L8_C0", "vector": [2, 1, 0.6702, 0.1862, 1, 0.02, 0.6667, 235, 0, 3, 1, 0, 0, 0, 29], "semantic": {"name": "sequence_reset_sql", "arg_names": ["self", "style", "model_list"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def sequence_reset_sql(self, style, model_list):\n from django.db import models\n output = []\n qn = self.quote_name\n for model in model_list:\n # Use `coalesce` to set the sequence for each model to the max pk value if there are records,\n # or 1 if there are none. Set the `is_called` property (the third argument to `setval`) to true\n # if there are records (as the max pk value is already in use), otherwise set it to false."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99047:ImportFrom_L110_C8", "label": "from django.db import models", "type": "import", "loc": [110, 110], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99047:FunctionDef_L109_C4", "vector": [1, 2, 0.5851, 0.0053, 2, 0.14, 0.0, 40, 0, 1, 0, 0, 40, 0, 0], "semantic": {"name": "django.db", "arg_names": [], "import_names": ["models"], "rhs_call_name": "", "annotation": ""}, "snippet": " from django.db import models"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99047:Assign_L111_C8", "label": "output =", "type": "assigned_variable", "loc": [111, 111], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99047:FunctionDef_L109_C4", "vector": [14, 2, 0.5904, 0.0053, 2, 0.14, 0.25, 886, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "output", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " output = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99047:Assign_L112_C8", "label": "qn =", "type": "assigned_variable", "loc": [112, 112], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99047:FunctionDef_L109_C4", "vector": [14, 2, 0.5957, 0.0053, 2, 0.14, 0.5, 514, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "qn", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " qn = self.quote_name"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99047:For_L113_C8", "label": "for model", "type": "for", "loc": [113, 142], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99047:FunctionDef_L109_C4", "vector": [6, 2, 0.6782, 0.1596, 2, 0.14, 0.75, 722, 2, 0, 0, 0, 0, 0, 29], "semantic": {"name": "model", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for model in model_list:\n # Use `coalesce` to set the sequence for each model to the max pk value if there are records,\n # or 1 if there are none. Set the `is_called` property (the third argument to `setval`) to true\n # if there are records (as the max pk value is already in use), otherwise set it to false.\n # Use pg_get_serial_sequence to get the underlying sequence name from the table name\n # and column name (available since PostgreSQL 8)\n\n for f in model._meta.local_fields:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99047:For_L120_C12", "label": "for f", "type": "for", "loc": [120, 131], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99047:For_L113_C8", "vector": [6, 3, 0.6676, 0.0638, 3, 0.11, 0.0, 899, 7, 0, 0, 0, 0, 0, 14], "semantic": {"name": "f", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for f in model._meta.local_fields:\n if isinstance(f, models.AutoField):\n output.append(\"%s setval(pg_get_serial_sequence('%s','%s'), coalesce(max(%s), 1), max(%s) %s null) %s %s;\" % \\\n (style.SQL_KEYWORD('SELECT'),\n style.SQL_TABLE(qn(model._meta.db_table)),\n style.SQL_FIELD(f.column),\n style.SQL_FIELD(qn(f.column)),\n style.SQL_FIELD(qn(f.column)),"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99047:If_L121_C16", "label": "if", "type": "if", "loc": [121, 131], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99047:For_L120_C12", "vector": [4, 4, 0.6702, 0.0585, 4, 0.9, 0.0, 0, 3, 0, 0, 0, 0, 0, 14], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if isinstance(f, models.AutoField):\n output.append(\"%s setval(pg_get_serial_sequence('%s','%s'), coalesce(max(%s), 1), max(%s) %s null) %s %s;\" % \\\n (style.SQL_KEYWORD('SELECT'),\n style.SQL_TABLE(qn(model._meta.db_table)),\n style.SQL_FIELD(f.column),\n style.SQL_FIELD(qn(f.column)),\n style.SQL_FIELD(qn(f.column)),\n style.SQL_KEYWORD('IS NOT'),"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99047:Expr_L122_C20", "label": "append()", "type": "expression", "loc": [122, 130], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99047:If_L121_C16", "vector": [8, 5, 0.6702, 0.0479, 5, 0.92, 0.0, 243, 3, 1, 0, 0, 0, 0, 13], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " output.append(\"%s setval(pg_get_serial_sequence('%s','%s'), coalesce(max(%s), 1), max(%s) %s null) %s %s;\" % \\\n (style.SQL_KEYWORD('SELECT'),\n style.SQL_TABLE(qn(model._meta.db_table)),\n style.SQL_FIELD(f.column),\n style.SQL_FIELD(qn(f.column)),\n style.SQL_FIELD(qn(f.column)),\n style.SQL_KEYWORD('IS NOT'),\n style.SQL_KEYWORD('FROM'),"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99047:For_L132_C12", "label": "for f", "type": "for", "loc": [132, 142], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99047:For_L113_C8", "vector": [6, 3, 0.7287, 0.0585, 3, 0.11, 1.0, 899, 7, 0, 0, 0, 0, 0, 15], "semantic": {"name": "f", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for f in model._meta.many_to_many:\n if not f.rel.through:\n output.append(\"%s setval(pg_get_serial_sequence('%s','%s'), coalesce(max(%s), 1), max(%s) %s null) %s %s;\" % \\\n (style.SQL_KEYWORD('SELECT'),\n style.SQL_TABLE(qn(f.m2m_db_table())),\n style.SQL_FIELD('id'),\n style.SQL_FIELD(qn('id')),\n style.SQL_FIELD(qn('id')),"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99047:If_L133_C16", "label": "if", "type": "if", "loc": [133, 142], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99047:For_L132_C12", "vector": [4, 4, 0.7314, 0.0532, 4, 0.43, 0.0, 0, 0, 0, 0, 0, 0, 0, 15], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not f.rel.through:\n output.append(\"%s setval(pg_get_serial_sequence('%s','%s'), coalesce(max(%s), 1), max(%s) %s null) %s %s;\" % \\\n (style.SQL_KEYWORD('SELECT'),\n style.SQL_TABLE(qn(f.m2m_db_table())),\n style.SQL_FIELD('id'),\n style.SQL_FIELD(qn('id')),\n style.SQL_FIELD(qn('id')),\n style.SQL_KEYWORD('IS NOT'),"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99047:Expr_L134_C20", "label": "append()", "type": "expression", "loc": [134, 142], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99047:If_L133_C16", "vector": [8, 5, 0.734, 0.0479, 5, 0.9, 0.0, 243, 3, 1, 0, 0, 0, 0, 15], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " output.append(\"%s setval(pg_get_serial_sequence('%s','%s'), coalesce(max(%s), 1), max(%s) %s null) %s %s;\" % \\\n (style.SQL_KEYWORD('SELECT'),\n style.SQL_TABLE(qn(f.m2m_db_table())),\n style.SQL_FIELD('id'),\n style.SQL_FIELD(qn('id')),\n style.SQL_FIELD(qn('id')),\n style.SQL_KEYWORD('IS NOT'),\n style.SQL_KEYWORD('FROM'),"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99047:Return_L143_C8", "label": "return", "type": "return", "loc": [143, 143], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99047:FunctionDef_L109_C4", "vector": [13, 2, 0.7606, 0.0053, 2, 0.14, 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_99047:FunctionDef_L145_C4", "label": "savepoint_create_sql", "type": "function", "loc": [145, 146], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99047:ClassDef_L8_C0", "vector": [2, 1, 0.7739, 0.0106, 1, 0.02, 0.7222, 479, 0, 2, 1, 0, 0, 0, 0], "semantic": {"name": "savepoint_create_sql", "arg_names": ["self", "sid"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def savepoint_create_sql(self, sid):\n return \"SAVEPOINT %s\" % sid"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99047:Return_L146_C8", "label": "return", "type": "return", "loc": [146, 146], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99047:FunctionDef_L145_C4", "vector": [13, 2, 0.7766, 0.0053, 2, 0.83, 0.0, 0, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return \"SAVEPOINT %s\" % sid"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99047:FunctionDef_L148_C4", "label": "savepoint_commit_sql", "type": "function", "loc": [148, 149], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99047:ClassDef_L8_C0", "vector": [2, 1, 0.7899, 0.0106, 1, 0.02, 0.7778, 45, 0, 2, 1, 0, 0, 0, 0], "semantic": {"name": "savepoint_commit_sql", "arg_names": ["self", "sid"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def savepoint_commit_sql(self, sid):\n return \"RELEASE SAVEPOINT %s\" % sid"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99047:Return_L149_C8", "label": "return", "type": "return", "loc": [149, 149], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99047:FunctionDef_L148_C4", "vector": [13, 2, 0.7926, 0.0053, 2, 0.51, 0.0, 0, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return \"RELEASE SAVEPOINT %s\" % sid"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99047:FunctionDef_L151_C4", "label": "savepoint_rollback_sql", "type": "function", "loc": [151, 152], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99047:ClassDef_L8_C0", "vector": [2, 1, 0.8059, 0.0106, 1, 0.02, 0.8333, 788, 0, 2, 1, 0, 0, 0, 0], "semantic": {"name": "savepoint_rollback_sql", "arg_names": ["self", "sid"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def savepoint_rollback_sql(self, sid):\n return \"ROLLBACK TO SAVEPOINT %s\" % sid"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99047:Return_L152_C8", "label": "return", "type": "return", "loc": [152, 152], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99047:FunctionDef_L151_C4", "vector": [13, 2, 0.8085, 0.0053, 2, 0.96, 0.0, 0, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return \"ROLLBACK TO SAVEPOINT %s\" % sid"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99047:FunctionDef_L154_C4", "label": "prep_for_iexact_query", "type": "function", "loc": [154, 155], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99047:ClassDef_L8_C0", "vector": [2, 1, 0.8218, 0.0106, 1, 0.02, 0.8889, 755, 0, 2, 1, 0, 0, 0, 0], "semantic": {"name": "prep_for_iexact_query", "arg_names": ["self", "x"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def prep_for_iexact_query(self, x):\n return x"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99047:Return_L155_C8", "label": "return", "type": "return", "loc": [155, 155], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99047:FunctionDef_L154_C4", "vector": [13, 2, 0.8245, 0.0053, 2, 0.2, 0.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return x"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99047:FunctionDef_L157_C4", "label": "check_aggregate_support", "type": "function", "loc": [157, 174], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99047:ClassDef_L8_C0", "vector": [2, 1, 0.8803, 0.0957, 1, 0.02, 0.9444, 517, 0, 2, 0, 0, 0, 0, 2], "semantic": {"name": "check_aggregate_support", "arg_names": ["self", "aggregate"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def check_aggregate_support(self, aggregate):\n \"\"\"Check that the backend fully supports the provided aggregate.\n\n The population and sample statistics (STDDEV_POP, STDDEV_SAMP,\n VAR_POP, VAR_SAMP) were first implemented in Postgres 8.2.\n\n The implementation of population statistics (STDDEV_POP and VAR_POP)\n under Postgres 8.2 - 8.2.4 is known to be faulty. Raise"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99047:Expr_L158_C8", "label": "expression", "type": "expression", "loc": [158, 166], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99047:FunctionDef_L157_C4", "vector": [8, 2, 0.8617, 0.0479, 2, 0.33, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Check that the backend fully supports the provided aggregate.\n\n The population and sample statistics (STDDEV_POP, STDDEV_SAMP,\n VAR_POP, VAR_SAMP) were first implemented in Postgres 8.2.\n\n The implementation of population statistics (STDDEV_POP and VAR_POP)\n under Postgres 8.2 - 8.2.4 is known to be faulty. Raise\n NotImplementedError if this is the database in use."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99047:If_L167_C8", "label": "if", "type": "if", "loc": [167, 169], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99047:FunctionDef_L157_C4", "vector": [4, 2, 0.8936, 0.016, 2, 0.33, 0.5, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if aggregate.sql_function in ('STDDEV_POP', 'STDDEV_SAMP', 'VAR_POP', 'VAR_SAMP'):\n if self.postgres_version[0:2] < (8,2):\n raise NotImplementedError('PostgreSQL does not support %s prior to version 8.2. Please upgrade your version of PostgreSQL.' % aggregate.sql_function)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99047:If_L168_C12", "label": "if", "type": "if", "loc": [168, 169], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99047:If_L167_C8", "vector": [4, 3, 0.8963, 0.0106, 3, 0.26, 0.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self.postgres_version[0:2] < (8,2):\n raise NotImplementedError('PostgreSQL does not support %s prior to version 8.2. Please upgrade your version of PostgreSQL.' % aggregate.sql_function)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99047:If_L171_C8", "label": "if", "type": "if", "loc": [171, 174], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99047:FunctionDef_L157_C4", "vector": [4, 2, 0.9176, 0.0213, 2, 0.33, 1.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if aggregate.sql_function in ('STDDEV_POP', 'VAR_POP'):\n if self.postgres_version[0:2] == (8,2):\n if self.postgres_version[2] is None or self.postgres_version[2] <= 4:\n raise NotImplementedError('PostgreSQL 8.2 to 8.2.4 is known to have a faulty implementation of %s. Please upgrade your version of PostgreSQL.' % aggregate.sql_function)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99047:If_L172_C12", "label": "if", "type": "if", "loc": [172, 174], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99047:If_L171_C8", "vector": [4, 3, 0.9202, 0.016, 3, 0.41, 0.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self.postgres_version[0:2] == (8,2):\n if self.postgres_version[2] is None or self.postgres_version[2] <= 4:\n raise NotImplementedError('PostgreSQL 8.2 to 8.2.4 is known to have a faulty implementation of %s. Please upgrade your version of PostgreSQL.' % aggregate.sql_function)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99047:If_L173_C16", "label": "if", "type": "if", "loc": [173, 174], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99047:If_L172_C12", "vector": [4, 4, 0.9229, 0.0106, 4, 0.74, 0.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self.postgres_version[2] is None or self.postgres_version[2] <= 4:\n raise NotImplementedError('PostgreSQL 8.2 to 8.2.4 is known to have a faulty implementation of %s. Please upgrade your version of PostgreSQL.' % aggregate.sql_function)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99047:FunctionDef_L176_C4", "label": "max_name_length", "type": "function", "loc": [176, 188], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99047:ClassDef_L8_C0", "vector": [2, 1, 0.9681, 0.0691, 1, 0.02, 1.0, 680, 0, 1, 1, 0, 0, 0, 0], "semantic": {"name": "max_name_length", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def max_name_length(self):\n \"\"\"\n Returns the maximum length of an identifier.\n\n Note that the maximum length of an identifier is 63 by default, but can\n be changed by recompiling PostgreSQL after editing the NAMEDATALEN\n macro in src/include/pg_config_manual.h .\n"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99047:Expr_L177_C8", "label": "expression", "type": "expression", "loc": [177, 186], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99047:FunctionDef_L176_C4", "vector": [8, 2, 0.9654, 0.0532, 2, 0.22, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"\n Returns the maximum length of an identifier.\n\n Note that the maximum length of an identifier is 63 by default, but can\n be changed by recompiling PostgreSQL after editing the NAMEDATALEN\n macro in src/include/pg_config_manual.h .\n\n This implementation simply returns 63, but can easily be overridden by a"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99047:Return_L188_C8", "label": "return", "type": "return", "loc": [188, 188], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99047:FunctionDef_L176_C4", "vector": [13, 2, 1.0, 0.0053, 2, 0.22, 1.0, 0, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return 63"}]
[{"f": "ajibawa-2023/Python-Code-Large/train/row_99047:ClassDef_L8_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99047:FunctionDef_L9_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99047:FunctionDef_L9_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99047:Expr_L10_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99047:FunctionDef_L9_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99047:Assign_L11_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99047:FunctionDef_L9_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99047:Assign_L12_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99047:ClassDef_L8_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99047:FunctionDef_L14_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99047:FunctionDef_L14_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99047:If_L15_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99047:If_L15_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99047:ImportFrom_L16_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99047:If_L15_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99047:Assign_L17_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99047:If_L15_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99047:Assign_L18_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99047:FunctionDef_L14_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99047:Return_L19_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99047:ClassDef_L8_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99047:Assign_L20_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99047:ClassDef_L8_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99047:FunctionDef_L22_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99047:FunctionDef_L22_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99047:If_L24_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99047:If_L24_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99047:Return_L26_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99047:If_L24_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99047:Return_L28_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99047:ClassDef_L8_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99047:FunctionDef_L30_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99047:FunctionDef_L30_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99047:Return_L32_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99047:ClassDef_L8_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99047:FunctionDef_L34_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99047:FunctionDef_L34_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99047:Return_L35_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99047:ClassDef_L8_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99047:FunctionDef_L37_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99047:FunctionDef_L37_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99047:Assign_L38_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99047:FunctionDef_L37_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99047:If_L41_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99047:If_L41_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99047:Assign_L43_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99047:FunctionDef_L37_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99047:If_L46_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99047:If_L46_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99047:Assign_L47_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99047:FunctionDef_L37_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99047:Return_L49_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99047:ClassDef_L8_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99047:FunctionDef_L51_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99047:FunctionDef_L51_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99047:If_L52_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99047:If_L52_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99047:Return_L53_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99047:FunctionDef_L51_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99047:Return_L54_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99047:ClassDef_L8_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99047:FunctionDef_L56_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99047:FunctionDef_L56_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99047:Expr_L59_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99047:FunctionDef_L56_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99047:Return_L61_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99047:ClassDef_L8_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99047:FunctionDef_L63_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99047:FunctionDef_L63_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99047:Return_L64_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99047:ClassDef_L8_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99047:FunctionDef_L66_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99047:FunctionDef_L66_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99047:If_L67_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99047:If_L67_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99047:Return_L68_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99047:FunctionDef_L66_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99047:Return_L69_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99047:ClassDef_L8_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99047:FunctionDef_L71_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99047:FunctionDef_L71_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99047:If_L72_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99047:If_L72_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99047:If_L73_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99047:If_L73_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99047:Assign_L78_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99047:If_L73_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99047:Assign_L85_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99047:If_L72_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99047:For_L93_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99047:For_L93_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99047:Assign_L94_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99047:For_L93_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99047:Assign_L95_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99047:For_L93_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99047:If_L96_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99047:If_L96_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99047:Assign_L99_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99047:For_L93_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99047:Expr_L100_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99047:If_L72_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99047:Return_L105_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99047:If_L72_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99047:Return_L107_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99047:ClassDef_L8_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99047:FunctionDef_L109_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99047:FunctionDef_L109_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99047:ImportFrom_L110_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99047:FunctionDef_L109_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99047:Assign_L111_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99047:FunctionDef_L109_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99047:Assign_L112_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99047:FunctionDef_L109_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99047:For_L113_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99047:For_L113_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99047:For_L120_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99047:For_L120_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99047:If_L121_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99047:If_L121_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99047:Expr_L122_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99047:For_L113_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99047:For_L132_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99047:For_L132_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99047:If_L133_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99047:If_L133_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99047:Expr_L134_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99047:FunctionDef_L109_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99047:Return_L143_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99047:ClassDef_L8_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99047:FunctionDef_L145_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99047:FunctionDef_L145_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99047:Return_L146_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99047:ClassDef_L8_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99047:FunctionDef_L148_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99047:FunctionDef_L148_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99047:Return_L149_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99047:ClassDef_L8_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99047:FunctionDef_L151_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99047:FunctionDef_L151_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99047:Return_L152_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99047:ClassDef_L8_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99047:FunctionDef_L154_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99047:FunctionDef_L154_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99047:Return_L155_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99047:ClassDef_L8_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99047:FunctionDef_L157_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99047:FunctionDef_L157_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99047:Expr_L158_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99047:FunctionDef_L157_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99047:If_L167_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99047:If_L167_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99047:If_L168_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99047:FunctionDef_L157_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99047:If_L171_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99047:If_L171_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99047:If_L172_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99047:If_L172_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99047:If_L173_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99047:ClassDef_L8_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99047:FunctionDef_L176_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99047:FunctionDef_L176_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99047:Expr_L177_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99047:FunctionDef_L176_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99047:Return_L188_C8"}]
from django.db.backends.creation import BaseDatabaseCreation from django.db.backends.util import truncate_name class DatabaseCreation(BaseDatabaseCreation): # This dictionary maps Field objects to their associated PostgreSQL column # types, as strings. Column-type strings can contain format strings; they'll # be interpolated against the values of Field.__dict__ before being output. # If a column type is set to None, it won't be included in the output. data_types = { 'AutoField': 'serial', 'BooleanField': 'boolean', 'CharField': 'varchar(%(max_length)s)', 'CommaSeparatedIntegerField': 'varchar(%(max_length)s)', 'DateField': 'date', 'DateTimeField': 'timestamp with time zone', 'DecimalField': 'numeric(%(max_digits)s, %(decimal_places)s)', 'FileField': 'varchar(%(max_length)s)', 'FilePathField': 'varchar(%(max_length)s)', 'FloatField': 'double precision', 'IntegerField': 'integer', 'BigIntegerField': 'bigint', 'IPAddressField': 'inet', 'NullBooleanField': 'boolean', 'OneToOneField': 'integer', 'PositiveIntegerField': 'integer CHECK ("%(column)s" >= 0)', 'PositiveSmallIntegerField': 'smallint CHECK ("%(column)s" >= 0)', 'SlugField': 'varchar(%(max_length)s)', 'SmallIntegerField': 'smallint', 'TextField': 'text', 'TimeField': 'time', } def sql_table_creation_suffix(self): assert self.connection.settings_dict['TEST_COLLATION'] is None, "PostgreSQL does not support collation setting at database creation time." if self.connection.settings_dict['TEST_CHARSET']: return "WITH ENCODING '%s'" % self.connection.settings_dict['TEST_CHARSET'] return '' def sql_indexes_for_field(self, model, f, style): if f.db_index and not f.unique: qn = self.connection.ops.quote_name db_table = model._meta.db_table tablespace = f.db_tablespace or model._meta.db_tablespace if tablespace: sql = self.connection.ops.tablespace_sql(tablespace) if sql: tablespace_sql = ' ' + sql else: tablespace_sql = '' else: tablespace_sql = '' def get_index_sql(index_name, opclass=''): return (style.SQL_KEYWORD('CREATE INDEX') + ' ' + style.SQL_TABLE(qn(truncate_name(index_name,self.connection.ops.max_name_length()))) + ' ' + style.SQL_KEYWORD('ON') + ' ' + style.SQL_TABLE(qn(db_table)) + ' ' + "(%s%s)" % (style.SQL_FIELD(qn(f.column)), opclass) + "%s;" % tablespace_sql) output = [get_index_sql('%s_%s' % (db_table, f.column))] # Fields with database column types of `varchar` and `text` need # a second index that specifies their operator class, which is # needed when performing correct LIKE queries outside the # C locale. See #12234. db_type = f.db_type(connection=self.connection) if db_type.startswith('varchar'): output.append(get_index_sql('%s_%s_like' % (db_table, f.column), ' varchar_pattern_ops')) elif db_type.startswith('text'): output.append(get_index_sql('%s_%s_like' % (db_table, f.column), ' text_pattern_ops')) else: output = [] return output
ajibawa-2023/Python-Code-Large/train/row_99048
29
76
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_99048:ImportFrom_L1_C0", "label": "from django.db.backends.creation import BaseDatabaseCreation", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0132, 0.0132, 0, 0.66, 0.0, 340, 0, 1, 0, 0, 340, 0, 0], "semantic": {"name": "django.db.backends.creation", "arg_names": [], "import_names": ["BaseDatabaseCreation"], "rhs_call_name": "", "annotation": ""}, "snippet": "from django.db.backends.creation import BaseDatabaseCreation"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99048:ImportFrom_L2_C0", "label": "from django.db.backends.util import truncate_name", "type": "import", "loc": [2, 2], "level": 0, "parent": null, "vector": [1, 0, 0.0263, 0.0132, 0, 0.66, 0.5, 446, 0, 1, 0, 0, 446, 0, 0], "semantic": {"name": "django.db.backends.util", "arg_names": [], "import_names": ["truncate_name"], "rhs_call_name": "", "annotation": ""}, "snippet": "from django.db.backends.util import truncate_name"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99048:ClassDef_L4_C0", "label": "DatabaseCreation", "type": "class", "loc": [4, 76], "level": 0, "parent": null, "vector": [3, 0, 0.5263, 0.9605, 0, 0.66, 1.0, 625, 0, 3, 0, 0, 484, 0, 19], "semantic": {"name": "DatabaseCreation", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class DatabaseCreation(BaseDatabaseCreation):\n # This dictionary maps Field objects to their associated PostgreSQL column\n # types, as strings. Column-type strings can contain format strings; they'll\n # be interpolated against the values of Field.__dict__ before being output.\n # If a column type is set to None, it won't be included in the output.\n data_types = {\n 'AutoField': 'serial',\n 'BooleanField': 'boolean',"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99048:Assign_L9_C4", "label": "data_types =", "type": "assigned_variable", "loc": [9, 31], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99048:ClassDef_L4_C0", "vector": [14, 1, 0.2632, 0.3026, 1, 0.53, 0.0, 835, 0, 0, 0, 0, 0, 6, 0], "semantic": {"name": "data_types", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " data_types = {\n 'AutoField': 'serial',\n 'BooleanField': 'boolean',\n 'CharField': 'varchar(%(max_length)s)',\n 'CommaSeparatedIntegerField': 'varchar(%(max_length)s)',\n 'DateField': 'date',\n 'DateTimeField': 'timestamp with time zone',\n 'DecimalField': 'numeric(%(max_digits)s, %(decimal_places)s)',"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99048:FunctionDef_L33_C4", "label": "sql_table_creation_suffix", "type": "function", "loc": [33, 37], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99048:ClassDef_L4_C0", "vector": [2, 1, 0.4605, 0.0658, 1, 0.53, 0.5, 367, 0, 1, 1, 0, 0, 0, 0], "semantic": {"name": "sql_table_creation_suffix", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def sql_table_creation_suffix(self):\n assert self.connection.settings_dict['TEST_COLLATION'] is None, \"PostgreSQL does not support collation setting at database creation time.\"\n if self.connection.settings_dict['TEST_CHARSET']:\n return \"WITH ENCODING '%s'\" % self.connection.settings_dict['TEST_CHARSET']\n return ''"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99048:If_L35_C8", "label": "if", "type": "if", "loc": [35, 36], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99048:FunctionDef_L33_C4", "vector": [4, 2, 0.4671, 0.0263, 2, 0.51, 0.0, 0, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self.connection.settings_dict['TEST_CHARSET']:\n return \"WITH ENCODING '%s'\" % self.connection.settings_dict['TEST_CHARSET']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99048:Return_L36_C12", "label": "return", "type": "return", "loc": [36, 36], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99048:If_L35_C8", "vector": [13, 3, 0.4737, 0.0132, 3, 0.02, 0.0, 0, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return \"WITH ENCODING '%s'\" % self.connection.settings_dict['TEST_CHARSET']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99048:Return_L37_C8", "label": "return", "type": "return", "loc": [37, 37], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99048:FunctionDef_L33_C4", "vector": [13, 2, 0.4868, 0.0132, 2, 0.51, 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_99048:FunctionDef_L39_C4", "label": "sql_indexes_for_field", "type": "function", "loc": [39, 76], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99048:ClassDef_L4_C0", "vector": [2, 1, 0.7566, 0.5, 1, 0.53, 1.0, 570, 0, 4, 1, 0, 0, 0, 19], "semantic": {"name": "sql_indexes_for_field", "arg_names": ["self", "model", "f", "style"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def sql_indexes_for_field(self, model, f, style):\n if f.db_index and not f.unique:\n qn = self.connection.ops.quote_name\n db_table = model._meta.db_table\n tablespace = f.db_tablespace or model._meta.db_tablespace\n if tablespace:\n sql = self.connection.ops.tablespace_sql(tablespace)\n if sql:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99048:If_L40_C8", "label": "if", "type": "if", "loc": [40, 75], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99048:FunctionDef_L39_C4", "vector": [4, 2, 0.7566, 0.4737, 2, 0.69, 0.0, 0, 0, 0, 0, 0, 0, 0, 19], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if f.db_index and not f.unique:\n qn = self.connection.ops.quote_name\n db_table = model._meta.db_table\n tablespace = f.db_tablespace or model._meta.db_tablespace\n if tablespace:\n sql = self.connection.ops.tablespace_sql(tablespace)\n if sql:\n tablespace_sql = ' ' + sql"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99048:Assign_L41_C12", "label": "qn =", "type": "assigned_variable", "loc": [41, 41], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99048:If_L40_C8", "vector": [14, 3, 0.5395, 0.0132, 3, 0.9, 0.0, 514, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "qn", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " qn = self.connection.ops.quote_name"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99048:Assign_L42_C12", "label": "db_table =", "type": "assigned_variable", "loc": [42, 42], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99048:If_L40_C8", "vector": [14, 3, 0.5526, 0.0132, 3, 0.9, 0.125, 111, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "db_table", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " db_table = model._meta.db_table"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99048:Assign_L43_C12", "label": "tablespace =", "type": "assigned_variable", "loc": [43, 43], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99048:If_L40_C8", "vector": [14, 3, 0.5658, 0.0132, 3, 0.9, 0.25, 777, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "tablespace", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " tablespace = f.db_tablespace or model._meta.db_tablespace"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99048:If_L44_C12", "label": "if", "type": "if", "loc": [44, 51], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99048:If_L40_C8", "vector": [4, 3, 0.625, 0.1053, 3, 0.9, 0.375, 0, 2, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if tablespace:\n sql = self.connection.ops.tablespace_sql(tablespace)\n if sql:\n tablespace_sql = ' ' + sql\n else:\n tablespace_sql = ''\n else:\n tablespace_sql = ''"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99048:Assign_L45_C16", "label": "sql = tablespace_sql()", "type": "assigned_variable", "loc": [45, 45], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99048:If_L44_C12", "vector": [14, 4, 0.5921, 0.0132, 4, 0.55, 0.0, 736, 3, 1, 0, 0, 652, 10, 1], "semantic": {"name": "sql", "arg_names": [], "import_names": [], "rhs_call_name": "tablespace_sql", "annotation": ""}, "snippet": " sql = self.connection.ops.tablespace_sql(tablespace)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99048:If_L46_C16", "label": "if", "type": "if", "loc": [46, 49], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99048:If_L44_C12", "vector": [4, 4, 0.625, 0.0526, 4, 0.55, 0.5, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if sql:\n tablespace_sql = ' ' + sql\n else:\n tablespace_sql = ''"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99048:Assign_L47_C20", "label": "tablespace_sql =", "type": "assigned_variable", "loc": [47, 47], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99048:If_L46_C16", "vector": [14, 5, 0.6184, 0.0132, 5, 0.92, 0.0, 652, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "tablespace_sql", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " tablespace_sql = ' ' + sql"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99048:Assign_L49_C20", "label": "tablespace_sql =", "type": "assigned_variable", "loc": [49, 49], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99048:If_L46_C16", "vector": [14, 5, 0.6447, 0.0132, 5, 0.92, 1.0, 652, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "tablespace_sql", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " tablespace_sql = ''"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99048:Assign_L51_C16", "label": "tablespace_sql =", "type": "assigned_variable", "loc": [51, 51], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99048:If_L44_C12", "vector": [14, 4, 0.6711, 0.0132, 4, 0.55, 1.0, 652, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "tablespace_sql", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " tablespace_sql = ''"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99048:FunctionDef_L53_C12", "label": "get_index_sql", "type": "function", "loc": [53, 59], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99048:If_L40_C8", "vector": [2, 3, 0.7368, 0.0921, 3, 0.9, 0.5, 783, 0, 2, 1, 0, 0, 0, 10], "semantic": {"name": "get_index_sql", "arg_names": ["index_name", "opclass"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def get_index_sql(index_name, opclass=''):\n return (style.SQL_KEYWORD('CREATE INDEX') + ' ' +\n style.SQL_TABLE(qn(truncate_name(index_name,self.connection.ops.max_name_length()))) + ' ' +\n style.SQL_KEYWORD('ON') + ' ' +\n style.SQL_TABLE(qn(db_table)) + ' ' +\n \"(%s%s)\" % (style.SQL_FIELD(qn(f.column)), opclass) +\n \"%s;\" % tablespace_sql)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99048:Return_L54_C16", "label": "return", "type": "return", "loc": [54, 59], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99048:FunctionDef_L53_C12", "vector": [13, 4, 0.7434, 0.0789, 4, 0.33, 0.0, 0, 4, 0, 0, 0, 0, 0, 10], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return (style.SQL_KEYWORD('CREATE INDEX') + ' ' +\n style.SQL_TABLE(qn(truncate_name(index_name,self.connection.ops.max_name_length()))) + ' ' +\n style.SQL_KEYWORD('ON') + ' ' +\n style.SQL_TABLE(qn(db_table)) + ' ' +\n \"(%s%s)\" % (style.SQL_FIELD(qn(f.column)), opclass) +\n \"%s;\" % tablespace_sql)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99048:Assign_L61_C12", "label": "output =", "type": "assigned_variable", "loc": [61, 61], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99048:If_L40_C8", "vector": [14, 3, 0.8026, 0.0132, 3, 0.9, 0.625, 886, 0, 0, 0, 0, 0, 5, 1], "semantic": {"name": "output", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " output = [get_index_sql('%s_%s' % (db_table, f.column))]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99048:Assign_L67_C12", "label": "db_type = db_type()", "type": "assigned_variable", "loc": [67, 67], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99048:If_L40_C8", "vector": [14, 3, 0.8816, 0.0132, 3, 0.9, 0.75, 976, 3, 1, 0, 0, 976, 10, 1], "semantic": {"name": "db_type", "arg_names": [], "import_names": [], "rhs_call_name": "db_type", "annotation": ""}, "snippet": " db_type = f.db_type(connection=self.connection)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99048:If_L68_C12", "label": "if", "type": "if", "loc": [68, 73], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99048:If_L40_C8", "vector": [4, 3, 0.9276, 0.0789, 3, 0.9, 0.875, 0, 3, 0, 0, 0, 0, 0, 6], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if db_type.startswith('varchar'):\n output.append(get_index_sql('%s_%s_like' % (db_table, f.column),\n ' varchar_pattern_ops'))\n elif db_type.startswith('text'):\n output.append(get_index_sql('%s_%s_like' % (db_table, f.column),\n ' text_pattern_ops'))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99048:Expr_L69_C16", "label": "append()", "type": "expression", "loc": [69, 70], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99048:If_L68_C12", "vector": [8, 4, 0.9145, 0.0263, 4, 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": " output.append(get_index_sql('%s_%s_like' % (db_table, f.column),\n ' varchar_pattern_ops'))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99048:If_L71_C12", "label": "if", "type": "if", "loc": [71, 73], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99048:If_L68_C12", "vector": [4, 4, 0.9474, 0.0395, 4, 0.86, 1.0, 0, 3, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " elif db_type.startswith('text'):\n output.append(get_index_sql('%s_%s_like' % (db_table, f.column),\n ' text_pattern_ops'))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99048:Expr_L72_C16", "label": "append()", "type": "expression", "loc": [72, 73], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99048:If_L71_C12", "vector": [8, 5, 0.9539, 0.0263, 5, 0.49, 0.0, 243, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " output.append(get_index_sql('%s_%s_like' % (db_table, f.column),\n ' text_pattern_ops'))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99048:Assign_L75_C12", "label": "output =", "type": "assigned_variable", "loc": [75, 75], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99048:If_L40_C8", "vector": [14, 3, 0.9868, 0.0132, 3, 0.9, 1.0, 886, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "output", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " output = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99048:Return_L76_C8", "label": "return", "type": "return", "loc": [76, 76], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99048:FunctionDef_L39_C4", "vector": [13, 2, 1.0, 0.0132, 2, 0.69, 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_99048:ClassDef_L4_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99048:Assign_L9_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99048:ClassDef_L4_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99048:FunctionDef_L33_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99048:FunctionDef_L33_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99048:If_L35_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99048:If_L35_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99048:Return_L36_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99048:FunctionDef_L33_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99048:Return_L37_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99048:ClassDef_L4_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99048:FunctionDef_L39_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99048:FunctionDef_L39_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99048:If_L40_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99048:If_L40_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99048:Assign_L41_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99048:If_L40_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99048:Assign_L42_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99048:If_L40_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99048:Assign_L43_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99048:If_L40_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99048:If_L44_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99048:If_L44_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99048:Assign_L45_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99048:If_L44_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99048:If_L46_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99048:If_L46_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99048:Assign_L47_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99048:If_L46_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99048:Assign_L49_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99048:If_L44_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99048:Assign_L51_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99048:If_L40_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99048:FunctionDef_L53_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99048:FunctionDef_L53_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99048:Return_L54_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99048:If_L40_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99048:Assign_L61_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99048:If_L40_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99048:Assign_L67_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99048:If_L40_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99048:If_L68_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99048:If_L68_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99048:Expr_L69_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99048:If_L68_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99048:If_L71_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99048:If_L71_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99048:Expr_L72_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99048:If_L40_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99048:Assign_L75_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99048:FunctionDef_L39_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99048:Return_L76_C8"}]
""" Extracts the version of the PostgreSQL server. """ import re # This reg-exp is intentionally fairly flexible here. # Needs to be able to handle stuff like: # PostgreSQL 8.3.6 # EnterpriseDB 8.3 # PostgreSQL 8.3 beta4 # PostgreSQL 8.4beta1 VERSION_RE = re.compile(r'\S+ (\d+)\.(\d+)\.?(\d+)?') def _parse_version(text): "Internal parsing method. Factored out for testing purposes." major, major2, minor = VERSION_RE.search(text).groups() try: return int(major), int(major2), int(minor) except (ValueError, TypeError): return int(major), int(major2), None def get_version(cursor): """ Returns a tuple representing the major, minor and revision number of the server. For example, (7, 4, 1) or (8, 3, 4). The revision number will be None in the case of initial releases (e.g., 'PostgreSQL 8.3') or in the case of beta and prereleases ('PostgreSQL 8.4beta1'). """ cursor.execute("SELECT version()") return _parse_version(cursor.fetchone()[0])
ajibawa-2023/Python-Code-Large/train/row_99049
13
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_99049:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 3], "level": 0, "parent": null, "vector": [8, 0, 0.0645, 0.0968, 0, 0.66, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\"\"\"\nExtracts the version of the PostgreSQL server.\n\"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99049:Import_L5_C0", "label": "re import re", "type": "import", "loc": [5, 5], "level": 0, "parent": null, "vector": [1, 0, 0.1613, 0.0323, 0, 0.66, 0.25, 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_99049:Assign_L13_C0", "label": "VERSION_RE = compile()", "type": "assigned_variable", "loc": [13, 13], "level": 0, "parent": null, "vector": [14, 0, 0.4194, 0.0323, 0, 0.66, 0.5, 276, 3, 1, 0, 0, 821, 10, 1], "semantic": {"name": "VERSION_RE", "arg_names": [], "import_names": [], "rhs_call_name": "compile", "annotation": ""}, "snippet": "VERSION_RE = re.compile(r'\\S+ (\\d+)\\.(\\d+)\\.?(\\d+)?')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99049:FunctionDef_L15_C0", "label": "_parse_version", "type": "function", "loc": [15, 21], "level": 0, "parent": null, "vector": [2, 0, 0.5806, 0.2258, 0, 0.66, 0.75, 39, 0, 1, 1, 0, 0, 0, 7], "semantic": {"name": "_parse_version", "arg_names": ["text"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def _parse_version(text):\n \"Internal parsing method. Factored out for testing purposes.\"\n major, major2, minor = VERSION_RE.search(text).groups()\n try:\n return int(major), int(major2), int(minor)\n except (ValueError, TypeError):\n return int(major), int(major2), None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99049:Expr_L16_C4", "label": "expression", "type": "expression", "loc": [16, 16], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99049:FunctionDef_L15_C0", "vector": [8, 1, 0.5161, 0.0323, 1, 0.78, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"Internal parsing method. Factored out for testing purposes.\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99049:Assign_L17_C4", "label": "major, major2, minor = groups()", "type": "assigned_variable", "loc": [17, 17], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99049:FunctionDef_L15_C0", "vector": [14, 1, 0.5484, 0.0323, 1, 0.78, 0.5, 478, 3, 0, 0, 0, 161, 10, 2], "semantic": {"name": "major, major2, minor", "arg_names": [], "import_names": [], "rhs_call_name": "groups", "annotation": ""}, "snippet": " major, major2, minor = VERSION_RE.search(text).groups()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99049:Try_L18_C4", "label": "try", "type": "try", "loc": [18, 21], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99049:FunctionDef_L15_C0", "vector": [7, 1, 0.629, 0.129, 1, 0.78, 1.0, 0, 0, 1, 0, 0, 0, 0, 5], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " try:\n return int(major), int(major2), int(minor)\n except (ValueError, TypeError):\n return int(major), int(major2), None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99049:Return_L19_C8", "label": "return", "type": "return", "loc": [19, 19], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99049:Try_L18_C4", "vector": [13, 2, 0.6129, 0.0323, 2, 0.8, 0.0, 0, 0, 0, 0, 0, 0, 8, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return int(major), int(major2), int(minor)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99049:Return_L21_C8", "label": "return", "type": "return", "loc": [21, 21], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99049:Try_L18_C4", "vector": [13, 2, 0.6774, 0.0323, 2, 0.8, 0.0, 0, 0, 0, 0, 0, 0, 8, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return int(major), int(major2), None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99049:FunctionDef_L23_C0", "label": "get_version", "type": "function", "loc": [23, 31], "level": 0, "parent": null, "vector": [2, 0, 0.871, 0.2903, 0, 0.66, 1.0, 75, 0, 1, 1, 0, 0, 0, 3], "semantic": {"name": "get_version", "arg_names": ["cursor"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def get_version(cursor):\n \"\"\"\n Returns a tuple representing the major, minor and revision number of the\n server. For example, (7, 4, 1) or (8, 3, 4). The revision number will be\n None in the case of initial releases (e.g., 'PostgreSQL 8.3') or in the\n case of beta and prereleases ('PostgreSQL 8.4beta1').\n \"\"\"\n cursor.execute(\"SELECT version()\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99049:Expr_L24_C4", "label": "expression", "type": "expression", "loc": [24, 29], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99049:FunctionDef_L23_C0", "vector": [8, 1, 0.8548, 0.1935, 1, 0.34, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"\n Returns a tuple representing the major, minor and revision number of the\n server. For example, (7, 4, 1) or (8, 3, 4). The revision number will be\n None in the case of initial releases (e.g., 'PostgreSQL 8.3') or in the\n case of beta and prereleases ('PostgreSQL 8.4beta1').\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99049:Expr_L30_C4", "label": "execute()", "type": "expression", "loc": [30, 30], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99049:FunctionDef_L23_C0", "vector": [8, 1, 0.9677, 0.0323, 1, 0.34, 0.5, 569, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "execute", "arg_names": [], "import_names": [], "rhs_call_name": "execute", "annotation": ""}, "snippet": " cursor.execute(\"SELECT version()\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99049:Return_L31_C4", "label": "return", "type": "return", "loc": [31, 31], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99049:FunctionDef_L23_C0", "vector": [13, 1, 1.0, 0.0323, 1, 0.34, 1.0, 0, 3, 0, 0, 0, 0, 10, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return _parse_version(cursor.fetchone()[0])"}]
[{"f": "ajibawa-2023/Python-Code-Large/train/row_99049:FunctionDef_L15_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99049:Expr_L16_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99049:FunctionDef_L15_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99049:Assign_L17_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99049:FunctionDef_L15_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99049:Try_L18_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99049:Try_L18_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99049:Return_L19_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99049:Try_L18_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99049:Return_L21_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99049:FunctionDef_L23_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99049:Expr_L24_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99049:FunctionDef_L23_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99049:Expr_L30_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99049:FunctionDef_L23_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99049:Return_L31_C4"}]
import datetime import decimal from time import time from django.utils.hashcompat import md5_constructor from django.utils.log import getLogger logger = getLogger('django.db.backends') class CursorDebugWrapper(object): def __init__(self, cursor, db): self.cursor = cursor self.db = db # Instance of a BaseDatabaseWrapper subclass def execute(self, sql, params=()): start = time() try: return self.cursor.execute(sql, params) finally: stop = time() duration = stop - start sql = self.db.ops.last_executed_query(self.cursor, sql, params) self.db.queries.append({ 'sql': sql, 'time': "%.3f" % duration, }) logger.debug('(%.3f) %s; args=%s' % (duration, sql, params), extra={'duration':duration, 'sql':sql, 'params':params} ) def executemany(self, sql, param_list): start = time() try: return self.cursor.executemany(sql, param_list) finally: stop = time() duration = stop - start self.db.queries.append({ 'sql': '%s times: %s' % (len(param_list), sql), 'time': "%.3f" % duration, }) logger.debug('(%.3f) %s; args=%s' % (duration, sql, param_list), extra={'duration':duration, 'sql':sql, 'params':param_list} ) def __getattr__(self, attr): if attr in self.__dict__: return self.__dict__[attr] else: return getattr(self.cursor, attr) def __iter__(self): return iter(self.cursor) ############################################### # Converters from database (string) to Python # ############################################### def typecast_date(s): return s and datetime.date(*map(int, s.split('-'))) or None # returns None if s is null def typecast_time(s): # does NOT store time zone information if not s: return None hour, minutes, seconds = s.split(':') if '.' in seconds: # check whether seconds have a fractional part seconds, microseconds = seconds.split('.') else: microseconds = '0' return datetime.time(int(hour), int(minutes), int(seconds), int(float('.'+microseconds) * 1000000)) def typecast_timestamp(s): # does NOT store time zone information # "2005-07-29 15:48:00.590358-05" # "2005-07-29 09:56:00-05" if not s: return None if not ' ' in s: return typecast_date(s) d, t = s.split() # Extract timezone information, if it exists. Currently we just throw # it away, but in the future we may make use of it. if '-' in t: t, tz = t.split('-', 1) tz = '-' + tz elif '+' in t: t, tz = t.split('+', 1) tz = '+' + tz else: tz = '' dates = d.split('-') times = t.split(':') seconds = times[2] if '.' in seconds: # check whether seconds have a fractional part seconds, microseconds = seconds.split('.') else: microseconds = '0' return datetime.datetime(int(dates[0]), int(dates[1]), int(dates[2]), int(times[0]), int(times[1]), int(seconds), int(float('.'+microseconds) * 1000000)) def typecast_boolean(s): if s is None: return None if not s: return False return str(s)[0].lower() == 't' def typecast_decimal(s): if s is None or s == '': return None return decimal.Decimal(s) ############################################### # Converters from Python to database (string) # ############################################### def rev_typecast_boolean(obj, d): return obj and '1' or '0' def rev_typecast_decimal(d): if d is None: return None return str(d) def truncate_name(name, length=None, hash_len=4): """Shortens a string to a repeatable mangled version with the given length. """ if length is None or len(name) <= length: return name hash = md5_constructor(name).hexdigest()[:hash_len] return '%s%s' % (name[:length-hash_len], hash) def format_number(value, max_digits, decimal_places): """ Formats a number into a string with the requisite number of digits and decimal places. """ if isinstance(value, decimal.Decimal): context = decimal.getcontext().copy() context.prec = max_digits return u'%s' % str(value.quantize(decimal.Decimal(".1") ** decimal_places, context=context)) else: return u"%.*f" % (decimal_places, value)
ajibawa-2023/Python-Code-Large/train/row_99051
92
139
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_99051:Import_L1_C0", "label": "datetime import datetime", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0072, 0.0072, 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_99051:Import_L2_C0", "label": "decimal import decimal", "type": "import", "loc": [2, 2], "level": 0, "parent": null, "vector": [1, 0, 0.0144, 0.0072, 0, 0.66, 0.0667, 349, 0, 1, 0, 0, 349, 0, 0], "semantic": {"name": "decimal", "arg_names": [], "import_names": ["decimal"], "rhs_call_name": "", "annotation": ""}, "snippet": "import decimal"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99051:ImportFrom_L3_C0", "label": "from time import time", "type": "import", "loc": [3, 3], "level": 0, "parent": null, "vector": [1, 0, 0.0216, 0.0072, 0, 0.66, 0.1333, 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_99051:ImportFrom_L5_C0", "label": "from django.utils.hashcompat import md5_constructor", "type": "import", "loc": [5, 5], "level": 0, "parent": null, "vector": [1, 0, 0.036, 0.0072, 0, 0.66, 0.2, 474, 0, 1, 0, 0, 474, 0, 0], "semantic": {"name": "django.utils.hashcompat", "arg_names": [], "import_names": ["md5_constructor"], "rhs_call_name": "", "annotation": ""}, "snippet": "from django.utils.hashcompat import md5_constructor"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99051:ImportFrom_L6_C0", "label": "from django.utils.log import getLogger", "type": "import", "loc": [6, 6], "level": 0, "parent": null, "vector": [1, 0, 0.0432, 0.0072, 0, 0.66, 0.2667, 174, 0, 1, 0, 0, 174, 0, 0], "semantic": {"name": "django.utils.log", "arg_names": [], "import_names": ["getLogger"], "rhs_call_name": "", "annotation": ""}, "snippet": "from django.utils.log import getLogger"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99051:Assign_L8_C0", "label": "logger = getLogger()", "type": "assigned_variable", "loc": [8, 8], "level": 0, "parent": null, "vector": [14, 0, 0.0576, 0.0072, 0, 0.66, 0.3333, 532, 3, 1, 0, 0, 71, 10, 1], "semantic": {"name": "logger", "arg_names": [], "import_names": [], "rhs_call_name": "getLogger", "annotation": ""}, "snippet": "logger = getLogger('django.db.backends')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99051:ClassDef_L10_C0", "label": "CursorDebugWrapper", "type": "class", "loc": [10, 53], "level": 0, "parent": null, "vector": [3, 0, 0.2266, 0.3165, 0, 0.66, 0.4, 515, 0, 5, 0, 0, 186, 0, 14], "semantic": {"name": "CursorDebugWrapper", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class CursorDebugWrapper(object):\n def __init__(self, cursor, db):\n self.cursor = cursor\n self.db = db # Instance of a BaseDatabaseWrapper subclass\n\n def execute(self, sql, params=()):\n start = time()\n try:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99051:FunctionDef_L11_C4", "label": "__init__", "type": "function", "loc": [11, 13], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99051:ClassDef_L10_C0", "vector": [2, 1, 0.0863, 0.0216, 1, 0.42, 0.0, 555, 0, 3, 0, 0, 0, 0, 0], "semantic": {"name": "__init__", "arg_names": ["self", "cursor", "db"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, cursor, db):\n self.cursor = cursor\n self.db = db # Instance of a BaseDatabaseWrapper subclass"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99051:Assign_L12_C8", "label": "self.cursor =", "type": "assigned_variable", "loc": [12, 12], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99051:FunctionDef_L11_C4", "vector": [14, 2, 0.0863, 0.0072, 2, 0.61, 0.0, 538, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.cursor", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.cursor = cursor"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99051:Assign_L13_C8", "label": "self.db =", "type": "assigned_variable", "loc": [13, 13], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99051:FunctionDef_L11_C4", "vector": [14, 2, 0.0935, 0.0072, 2, 0.61, 1.0, 990, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.db", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.db = db # Instance of a BaseDatabaseWrapper subclass"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99051:FunctionDef_L15_C4", "label": "execute", "type": "function", "loc": [15, 29], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99051:ClassDef_L10_C0", "vector": [2, 1, 0.1583, 0.1079, 1, 0.42, 0.25, 569, 0, 3, 1, 0, 0, 0, 6], "semantic": {"name": "execute", "arg_names": ["self", "sql", "params"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def execute(self, sql, params=()):\n start = time()\n try:\n return self.cursor.execute(sql, params)\n finally:\n stop = time()\n duration = stop - start\n sql = self.db.ops.last_executed_query(self.cursor, sql, params)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99051:Assign_L16_C8", "label": "start = time()", "type": "assigned_variable", "loc": [16, 16], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99051:FunctionDef_L15_C4", "vector": [14, 2, 0.1151, 0.0072, 2, 0.09, 0.0, 511, 3, 0, 0, 0, 654, 10, 1], "semantic": {"name": "start", "arg_names": [], "import_names": [], "rhs_call_name": "time", "annotation": ""}, "snippet": " start = time()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99051:Try_L17_C8", "label": "try", "type": "try", "loc": [17, 29], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99051:FunctionDef_L15_C4", "vector": [7, 2, 0.1655, 0.0935, 2, 0.09, 1.0, 0, 0, 0, 0, 0, 0, 0, 5], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " try:\n return self.cursor.execute(sql, params)\n finally:\n stop = time()\n duration = stop - start\n sql = self.db.ops.last_executed_query(self.cursor, sql, params)\n self.db.queries.append({\n 'sql': sql,"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99051:Return_L18_C12", "label": "return", "type": "return", "loc": [18, 18], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99051:Try_L17_C8", "vector": [13, 3, 0.1295, 0.0072, 3, 0.84, 0.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self.cursor.execute(sql, params)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99051:Assign_L20_C12", "label": "stop = time()", "type": "assigned_variable", "loc": [20, 20], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99051:Try_L17_C8", "vector": [14, 3, 0.1439, 0.0072, 3, 0.84, 0.2, 343, 3, 0, 0, 0, 654, 10, 1], "semantic": {"name": "stop", "arg_names": [], "import_names": [], "rhs_call_name": "time", "annotation": ""}, "snippet": " stop = time()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99051:Assign_L21_C12", "label": "duration =", "type": "assigned_variable", "loc": [21, 21], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99051:Try_L17_C8", "vector": [14, 3, 0.1511, 0.0072, 3, 0.84, 0.4, 242, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "duration", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " duration = stop - start"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99051:Assign_L22_C12", "label": "sql = last_executed_query()", "type": "assigned_variable", "loc": [22, 22], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99051:Try_L17_C8", "vector": [14, 3, 0.1583, 0.0072, 3, 0.84, 0.6, 736, 3, 3, 0, 0, 423, 10, 1], "semantic": {"name": "sql", "arg_names": [], "import_names": [], "rhs_call_name": "last_executed_query", "annotation": ""}, "snippet": " sql = self.db.ops.last_executed_query(self.cursor, sql, params)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99051:Expr_L23_C12", "label": "append()", "type": "expression", "loc": [23, 26], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99051:Try_L17_C8", "vector": [8, 3, 0.1763, 0.0288, 3, 0.84, 0.8, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " self.db.queries.append({\n 'sql': sql,\n 'time': \"%.3f\" % duration,\n })"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99051:Expr_L27_C12", "label": "debug()", "type": "expression", "loc": [27, 29], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99051:Try_L17_C8", "vector": [8, 3, 0.2014, 0.0216, 3, 0.84, 1.0, 924, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "debug", "arg_names": [], "import_names": [], "rhs_call_name": "debug", "annotation": ""}, "snippet": " logger.debug('(%.3f) %s; args=%s' % (duration, sql, params),\n extra={'duration':duration, 'sql':sql, 'params':params}\n )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99051:FunctionDef_L31_C4", "label": "executemany", "type": "function", "loc": [31, 44], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99051:ClassDef_L10_C0", "vector": [2, 1, 0.2698, 0.1007, 1, 0.42, 0.5, 175, 0, 3, 1, 0, 0, 0, 6], "semantic": {"name": "executemany", "arg_names": ["self", "sql", "param_list"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def executemany(self, sql, param_list):\n start = time()\n try:\n return self.cursor.executemany(sql, param_list)\n finally:\n stop = time()\n duration = stop - start\n self.db.queries.append({"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99051:Assign_L32_C8", "label": "start = time()", "type": "assigned_variable", "loc": [32, 32], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99051:FunctionDef_L31_C4", "vector": [14, 2, 0.2302, 0.0072, 2, 0.91, 0.0, 511, 3, 0, 0, 0, 654, 10, 1], "semantic": {"name": "start", "arg_names": [], "import_names": [], "rhs_call_name": "time", "annotation": ""}, "snippet": " start = time()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99051:Try_L33_C8", "label": "try", "type": "try", "loc": [33, 44], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99051:FunctionDef_L31_C4", "vector": [7, 2, 0.277, 0.0863, 2, 0.91, 1.0, 0, 0, 0, 0, 0, 0, 0, 5], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " try:\n return self.cursor.executemany(sql, param_list)\n finally:\n stop = time()\n duration = stop - start\n self.db.queries.append({\n 'sql': '%s times: %s' % (len(param_list), sql),\n 'time': \"%.3f\" % duration,"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99051:Return_L34_C12", "label": "return", "type": "return", "loc": [34, 34], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99051:Try_L33_C8", "vector": [13, 3, 0.2446, 0.0072, 3, 0.6, 0.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self.cursor.executemany(sql, param_list)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99051:Assign_L36_C12", "label": "stop = time()", "type": "assigned_variable", "loc": [36, 36], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99051:Try_L33_C8", "vector": [14, 3, 0.259, 0.0072, 3, 0.6, 0.25, 343, 3, 0, 0, 0, 654, 10, 1], "semantic": {"name": "stop", "arg_names": [], "import_names": [], "rhs_call_name": "time", "annotation": ""}, "snippet": " stop = time()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99051:Assign_L37_C12", "label": "duration =", "type": "assigned_variable", "loc": [37, 37], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99051:Try_L33_C8", "vector": [14, 3, 0.2662, 0.0072, 3, 0.6, 0.5, 242, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "duration", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " duration = stop - start"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99051:Expr_L38_C12", "label": "append()", "type": "expression", "loc": [38, 41], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99051:Try_L33_C8", "vector": [8, 3, 0.2842, 0.0288, 3, 0.6, 0.75, 243, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " self.db.queries.append({\n 'sql': '%s times: %s' % (len(param_list), sql),\n 'time': \"%.3f\" % duration,\n })"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99051:Expr_L42_C12", "label": "debug()", "type": "expression", "loc": [42, 44], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99051:Try_L33_C8", "vector": [8, 3, 0.3094, 0.0216, 3, 0.6, 1.0, 924, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "debug", "arg_names": [], "import_names": [], "rhs_call_name": "debug", "annotation": ""}, "snippet": " logger.debug('(%.3f) %s; args=%s' % (duration, sql, param_list),\n extra={'duration':duration, 'sql':sql, 'params':param_list}\n )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99051:FunctionDef_L46_C4", "label": "__getattr__", "type": "function", "loc": [46, 50], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99051:ClassDef_L10_C0", "vector": [2, 1, 0.3453, 0.036, 1, 0.42, 0.75, 210, 0, 2, 1, 0, 0, 0, 1], "semantic": {"name": "__getattr__", "arg_names": ["self", "attr"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __getattr__(self, attr):\n if attr in self.__dict__:\n return self.__dict__[attr]\n else:\n return getattr(self.cursor, attr)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99051:If_L47_C8", "label": "if", "type": "if", "loc": [47, 50], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99051:FunctionDef_L46_C4", "vector": [4, 2, 0.3489, 0.0288, 2, 0.91, 0.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if attr in self.__dict__:\n return self.__dict__[attr]\n else:\n return getattr(self.cursor, attr)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99051:Return_L48_C12", "label": "return", "type": "return", "loc": [48, 48], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99051:If_L47_C8", "vector": [13, 3, 0.3453, 0.0072, 3, 0.92, 0.0, 0, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self.__dict__[attr]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99051:Return_L50_C12", "label": "return", "type": "return", "loc": [50, 50], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99051:If_L47_C8", "vector": [13, 3, 0.3597, 0.0072, 3, 0.92, 1.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return getattr(self.cursor, attr)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99051:FunctionDef_L52_C4", "label": "__iter__", "type": "function", "loc": [52, 53], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99051:ClassDef_L10_C0", "vector": [2, 1, 0.3777, 0.0144, 1, 0.42, 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.cursor)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99051:Return_L53_C8", "label": "return", "type": "return", "loc": [53, 53], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99051:FunctionDef_L52_C4", "vector": [13, 2, 0.3813, 0.0072, 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 iter(self.cursor)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99051:FunctionDef_L59_C0", "label": "typecast_date", "type": "function", "loc": [59, 60], "level": 0, "parent": null, "vector": [2, 0, 0.4281, 0.0144, 0, 0.66, 0.4667, 389, 0, 1, 1, 0, 0, 0, 3], "semantic": {"name": "typecast_date", "arg_names": ["s"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def typecast_date(s):\n return s and datetime.date(*map(int, s.split('-'))) or None # returns None if s is null"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99051:Return_L60_C4", "label": "return", "type": "return", "loc": [60, 60], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99051:FunctionDef_L59_C0", "vector": [13, 1, 0.4317, 0.0072, 1, 0.08, 0.0, 0, 0, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return s and datetime.date(*map(int, s.split('-'))) or None # returns None if s is null"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99051:FunctionDef_L62_C0", "label": "typecast_time", "type": "function", "loc": [62, 69], "level": 0, "parent": null, "vector": [2, 0, 0.4712, 0.0576, 0, 0.66, 0.5333, 210, 0, 1, 1, 0, 0, 0, 8], "semantic": {"name": "typecast_time", "arg_names": ["s"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def typecast_time(s): # does NOT store time zone information\n if not s: return None\n hour, minutes, seconds = s.split(':')\n if '.' in seconds: # check whether seconds have a fractional part\n seconds, microseconds = seconds.split('.')\n else:\n microseconds = '0'\n return datetime.time(int(hour), int(minutes), int(seconds), int(float('.'+microseconds) * 1000000))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99051:If_L63_C4", "label": "if", "type": "if", "loc": [63, 63], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99051:FunctionDef_L62_C0", "vector": [4, 1, 0.4532, 0.0072, 1, 0.37, 0.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not s: return None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99051:Return_L63_C14", "label": "return", "type": "return", "loc": [63, 63], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99051:If_L63_C4", "vector": [13, 2, 0.4532, 0.0072, 2, 0.71, 0.0, 0, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not s: return None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99051:Assign_L64_C4", "label": "hour, minutes, seconds = split()", "type": "assigned_variable", "loc": [64, 64], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99051:FunctionDef_L62_C0", "vector": [14, 1, 0.4604, 0.0072, 1, 0.37, 0.3333, 126, 3, 1, 0, 0, 908, 10, 1], "semantic": {"name": "hour, minutes, seconds", "arg_names": [], "import_names": [], "rhs_call_name": "split", "annotation": ""}, "snippet": " hour, minutes, seconds = s.split(':')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99051:If_L65_C4", "label": "if", "type": "if", "loc": [65, 68], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99051:FunctionDef_L62_C0", "vector": [4, 1, 0.4784, 0.0288, 1, 0.37, 0.6667, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if '.' in seconds: # check whether seconds have a fractional part\n seconds, microseconds = seconds.split('.')\n else:\n microseconds = '0'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99051:Assign_L66_C8", "label": "seconds, microseconds = split()", "type": "assigned_variable", "loc": [66, 66], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99051:If_L65_C4", "vector": [14, 2, 0.4748, 0.0072, 2, 0.14, 0.0, 950, 3, 1, 0, 0, 908, 10, 1], "semantic": {"name": "seconds, microseconds", "arg_names": [], "import_names": [], "rhs_call_name": "split", "annotation": ""}, "snippet": " seconds, microseconds = seconds.split('.')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99051:Assign_L68_C8", "label": "microseconds =", "type": "assigned_variable", "loc": [68, 68], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99051:If_L65_C4", "vector": [14, 2, 0.4892, 0.0072, 2, 0.14, 1.0, 409, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "microseconds", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " microseconds = '0'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99051:Return_L69_C4", "label": "return", "type": "return", "loc": [69, 69], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99051:FunctionDef_L62_C0", "vector": [13, 1, 0.4964, 0.0072, 1, 0.37, 1.0, 0, 3, 0, 0, 0, 0, 10, 6], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return datetime.time(int(hour), int(minutes), int(seconds), int(float('.'+microseconds) * 1000000))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99051:FunctionDef_L71_C0", "label": "typecast_timestamp", "type": "function", "loc": [71, 95], "level": 0, "parent": null, "vector": [2, 0, 0.5971, 0.1799, 0, 0.66, 0.6, 983, 0, 1, 1, 0, 0, 0, 16], "semantic": {"name": "typecast_timestamp", "arg_names": ["s"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def typecast_timestamp(s): # does NOT store time zone information\n # \"2005-07-29 15:48:00.590358-05\"\n # \"2005-07-29 09:56:00-05\"\n if not s: return None\n if not ' ' in s: return typecast_date(s)\n d, t = s.split()\n # Extract timezone information, if it exists. Currently we just throw\n # it away, but in the future we may make use of it."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99051:If_L74_C4", "label": "if", "type": "if", "loc": [74, 74], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99051:FunctionDef_L71_C0", "vector": [4, 1, 0.5324, 0.0072, 1, 0.22, 0.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not s: return None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99051:Return_L74_C14", "label": "return", "type": "return", "loc": [74, 74], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99051:If_L74_C4", "vector": [13, 2, 0.5324, 0.0072, 2, 0.83, 0.0, 0, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not s: return None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99051:If_L75_C4", "label": "if", "type": "if", "loc": [75, 75], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99051:FunctionDef_L71_C0", "vector": [4, 1, 0.5396, 0.0072, 1, 0.22, 0.125, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not ' ' in s: return typecast_date(s)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99051:Return_L75_C21", "label": "return", "type": "return", "loc": [75, 75], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99051:If_L75_C4", "vector": [13, 2, 0.5396, 0.0072, 2, 0.92, 0.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not ' ' in s: return typecast_date(s)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99051:Assign_L76_C4", "label": "d, t = split()", "type": "assigned_variable", "loc": [76, 76], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99051:FunctionDef_L71_C0", "vector": [14, 1, 0.5468, 0.0072, 1, 0.22, 0.25, 296, 3, 0, 0, 0, 908, 10, 1], "semantic": {"name": "d, t", "arg_names": [], "import_names": [], "rhs_call_name": "split", "annotation": ""}, "snippet": " d, t = s.split()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99051:If_L79_C4", "label": "if", "type": "if", "loc": [79, 86], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99051:FunctionDef_L71_C0", "vector": [4, 1, 0.5935, 0.0576, 1, 0.22, 0.375, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if '-' in t:\n t, tz = t.split('-', 1)\n tz = '-' + tz\n elif '+' in t:\n t, tz = t.split('+', 1)\n tz = '+' + tz\n else:\n tz = ''"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99051:Assign_L80_C8", "label": "t, tz = split()", "type": "assigned_variable", "loc": [80, 80], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99051:If_L79_C4", "vector": [14, 2, 0.5755, 0.0072, 2, 0.51, 0.0, 511, 3, 2, 0, 0, 908, 10, 1], "semantic": {"name": "t, tz", "arg_names": [], "import_names": [], "rhs_call_name": "split", "annotation": ""}, "snippet": " t, tz = t.split('-', 1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99051:Assign_L81_C8", "label": "tz =", "type": "assigned_variable", "loc": [81, 81], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99051:If_L79_C4", "vector": [14, 2, 0.5827, 0.0072, 2, 0.51, 0.5, 946, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "tz", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " tz = '-' + tz"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99051:If_L82_C4", "label": "if", "type": "if", "loc": [82, 86], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99051:If_L79_C4", "vector": [4, 2, 0.6043, 0.036, 2, 0.51, 1.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " elif '+' in t:\n t, tz = t.split('+', 1)\n tz = '+' + tz\n else:\n tz = ''"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99051:Assign_L83_C8", "label": "t, tz = split()", "type": "assigned_variable", "loc": [83, 83], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99051:If_L82_C4", "vector": [14, 3, 0.5971, 0.0072, 3, 0.06, 0.0, 511, 3, 2, 0, 0, 908, 10, 1], "semantic": {"name": "t, tz", "arg_names": [], "import_names": [], "rhs_call_name": "split", "annotation": ""}, "snippet": " t, tz = t.split('+', 1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99051:Assign_L84_C8", "label": "tz =", "type": "assigned_variable", "loc": [84, 84], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99051:If_L82_C4", "vector": [14, 3, 0.6043, 0.0072, 3, 0.06, 0.5, 946, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "tz", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " tz = '+' + tz"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99051:Assign_L86_C8", "label": "tz =", "type": "assigned_variable", "loc": [86, 86], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99051:If_L82_C4", "vector": [14, 3, 0.6187, 0.0072, 3, 0.06, 1.0, 946, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "tz", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " tz = ''"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99051:Assign_L87_C4", "label": "dates = split()", "type": "assigned_variable", "loc": [87, 87], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99051:FunctionDef_L71_C0", "vector": [14, 1, 0.6259, 0.0072, 1, 0.22, 0.5, 253, 3, 1, 0, 0, 908, 10, 1], "semantic": {"name": "dates", "arg_names": [], "import_names": [], "rhs_call_name": "split", "annotation": ""}, "snippet": " dates = d.split('-')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99051:Assign_L88_C4", "label": "times = split()", "type": "assigned_variable", "loc": [88, 88], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99051:FunctionDef_L71_C0", "vector": [14, 1, 0.6331, 0.0072, 1, 0.22, 0.625, 342, 3, 1, 0, 0, 908, 10, 1], "semantic": {"name": "times", "arg_names": [], "import_names": [], "rhs_call_name": "split", "annotation": ""}, "snippet": " times = t.split(':')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99051:Assign_L89_C4", "label": "seconds =", "type": "assigned_variable", "loc": [89, 89], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99051:FunctionDef_L71_C0", "vector": [14, 1, 0.6403, 0.0072, 1, 0.22, 0.75, 862, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "seconds", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " seconds = times[2]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99051:If_L90_C4", "label": "if", "type": "if", "loc": [90, 93], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99051:FunctionDef_L71_C0", "vector": [4, 1, 0.6583, 0.0288, 1, 0.22, 0.875, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if '.' in seconds: # check whether seconds have a fractional part\n seconds, microseconds = seconds.split('.')\n else:\n microseconds = '0'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99051:Assign_L91_C8", "label": "seconds, microseconds = split()", "type": "assigned_variable", "loc": [91, 91], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99051:If_L90_C4", "vector": [14, 2, 0.6547, 0.0072, 2, 0.85, 0.0, 950, 3, 1, 0, 0, 908, 10, 1], "semantic": {"name": "seconds, microseconds", "arg_names": [], "import_names": [], "rhs_call_name": "split", "annotation": ""}, "snippet": " seconds, microseconds = seconds.split('.')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99051:Assign_L93_C8", "label": "microseconds =", "type": "assigned_variable", "loc": [93, 93], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99051:If_L90_C4", "vector": [14, 2, 0.6691, 0.0072, 2, 0.85, 1.0, 409, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "microseconds", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " microseconds = '0'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99051:Return_L94_C4", "label": "return", "type": "return", "loc": [94, 95], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99051:FunctionDef_L71_C0", "vector": [13, 1, 0.6799, 0.0144, 1, 0.22, 1.0, 0, 3, 0, 0, 0, 0, 10, 9], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return datetime.datetime(int(dates[0]), int(dates[1]), int(dates[2]),\n int(times[0]), int(times[1]), int(seconds), int(float('.'+microseconds) * 1000000))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99051:FunctionDef_L97_C0", "label": "typecast_boolean", "type": "function", "loc": [97, 100], "level": 0, "parent": null, "vector": [2, 0, 0.7086, 0.0288, 0, 0.66, 0.6667, 219, 0, 1, 1, 0, 0, 0, 2], "semantic": {"name": "typecast_boolean", "arg_names": ["s"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def typecast_boolean(s):\n if s is None: return None\n if not s: return False\n return str(s)[0].lower() == 't'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99051:If_L98_C4", "label": "if", "type": "if", "loc": [98, 98], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99051:FunctionDef_L97_C0", "vector": [4, 1, 0.705, 0.0072, 1, 0.32, 0.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if s is None: return None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99051:Return_L98_C18", "label": "return", "type": "return", "loc": [98, 98], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99051:If_L98_C4", "vector": [13, 2, 0.705, 0.0072, 2, 0.99, 0.0, 0, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if s is None: return None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99051:If_L99_C4", "label": "if", "type": "if", "loc": [99, 99], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99051:FunctionDef_L97_C0", "vector": [4, 1, 0.7122, 0.0072, 1, 0.32, 0.5, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not s: return False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99051:Return_L99_C14", "label": "return", "type": "return", "loc": [99, 99], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99051:If_L99_C4", "vector": [13, 2, 0.7122, 0.0072, 2, 0.42, 0.0, 0, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not s: return False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99051:Return_L100_C4", "label": "return", "type": "return", "loc": [100, 100], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99051:FunctionDef_L97_C0", "vector": [13, 1, 0.7194, 0.0072, 1, 0.32, 1.0, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return str(s)[0].lower() == 't'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99051:FunctionDef_L102_C0", "label": "typecast_decimal", "type": "function", "loc": [102, 105], "level": 0, "parent": null, "vector": [2, 0, 0.7446, 0.0288, 0, 0.66, 0.7333, 116, 0, 1, 1, 0, 0, 0, 1], "semantic": {"name": "typecast_decimal", "arg_names": ["s"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def typecast_decimal(s):\n if s is None or s == '':\n return None\n return decimal.Decimal(s)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99051:If_L103_C4", "label": "if", "type": "if", "loc": [103, 104], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99051:FunctionDef_L102_C0", "vector": [4, 1, 0.7446, 0.0144, 1, 0.93, 0.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if s is None or s == '':\n return None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99051:Return_L104_C8", "label": "return", "type": "return", "loc": [104, 104], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99051:If_L103_C4", "vector": [13, 2, 0.7482, 0.0072, 2, 0.18, 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_99051:Return_L105_C4", "label": "return", "type": "return", "loc": [105, 105], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99051:FunctionDef_L102_C0", "vector": [13, 1, 0.7554, 0.0072, 1, 0.93, 1.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return decimal.Decimal(s)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99051:FunctionDef_L111_C0", "label": "rev_typecast_boolean", "type": "function", "loc": [111, 112], "level": 0, "parent": null, "vector": [2, 0, 0.8022, 0.0144, 0, 0.66, 0.8, 227, 0, 2, 1, 0, 0, 0, 0], "semantic": {"name": "rev_typecast_boolean", "arg_names": ["obj", "d"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def rev_typecast_boolean(obj, d):\n return obj and '1' or '0'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99051:Return_L112_C4", "label": "return", "type": "return", "loc": [112, 112], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99051:FunctionDef_L111_C0", "vector": [13, 1, 0.8058, 0.0072, 1, 0.32, 0.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return obj and '1' or '0'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99051:FunctionDef_L114_C0", "label": "rev_typecast_decimal", "type": "function", "loc": [114, 117], "level": 0, "parent": null, "vector": [2, 0, 0.8309, 0.0288, 0, 0.66, 0.8667, 590, 0, 1, 1, 0, 0, 0, 1], "semantic": {"name": "rev_typecast_decimal", "arg_names": ["d"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def rev_typecast_decimal(d):\n if d is None:\n return None\n return str(d)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99051:If_L115_C4", "label": "if", "type": "if", "loc": [115, 116], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99051:FunctionDef_L114_C0", "vector": [4, 1, 0.8309, 0.0144, 1, 0.49, 0.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if d is None:\n return None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99051:Return_L116_C8", "label": "return", "type": "return", "loc": [116, 116], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99051:If_L115_C4", "vector": [13, 2, 0.8345, 0.0072, 2, 0.12, 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_99051:Return_L117_C4", "label": "return", "type": "return", "loc": [117, 117], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99051:FunctionDef_L114_C0", "vector": [13, 1, 0.8417, 0.0072, 1, 0.49, 1.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return str(d)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99051:FunctionDef_L119_C0", "label": "truncate_name", "type": "function", "loc": [119, 127], "level": 0, "parent": null, "vector": [2, 0, 0.8849, 0.0647, 0, 0.66, 0.9333, 927, 0, 3, 1, 0, 0, 0, 3], "semantic": {"name": "truncate_name", "arg_names": ["name", "length", "hash_len"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def truncate_name(name, length=None, hash_len=4):\n \"\"\"Shortens a string to a repeatable mangled version with the given length.\n \"\"\"\n if length is None or len(name) <= length:\n return name\n\n hash = md5_constructor(name).hexdigest()[:hash_len]\n"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99051:Expr_L120_C4", "label": "expression", "type": "expression", "loc": [120, 121], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99051:FunctionDef_L119_C0", "vector": [8, 1, 0.8669, 0.0144, 1, 0.95, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Shortens a string to a repeatable mangled version with the given length.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99051:If_L122_C4", "label": "if", "type": "if", "loc": [122, 123], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99051:FunctionDef_L119_C0", "vector": [4, 1, 0.8813, 0.0144, 1, 0.95, 0.3333, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if length is None or len(name) <= length:\n return name"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99051:Return_L123_C8", "label": "return", "type": "return", "loc": [123, 123], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99051:If_L122_C4", "vector": [13, 2, 0.8849, 0.0072, 2, 0.71, 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_99051:Assign_L125_C4", "label": "hash =", "type": "assigned_variable", "loc": [125, 125], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99051:FunctionDef_L119_C0", "vector": [14, 1, 0.8993, 0.0072, 1, 0.95, 0.6667, 58, 6, 0, 0, 0, 0, 0, 2], "semantic": {"name": "hash", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " hash = md5_constructor(name).hexdigest()[:hash_len]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99051:Return_L127_C4", "label": "return", "type": "return", "loc": [127, 127], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99051:FunctionDef_L119_C0", "vector": [13, 1, 0.9137, 0.0072, 1, 0.95, 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[:length-hash_len], hash)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99051:FunctionDef_L129_C0", "label": "format_number", "type": "function", "loc": [129, 139], "level": 0, "parent": null, "vector": [2, 0, 0.964, 0.0791, 0, 0.66, 1.0, 74, 0, 3, 1, 0, 0, 0, 6], "semantic": {"name": "format_number", "arg_names": ["value", "max_digits", "decimal_places"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def format_number(value, max_digits, decimal_places):\n \"\"\"\n Formats a number into a string with the requisite number of digits and\n decimal places.\n \"\"\"\n if isinstance(value, decimal.Decimal):\n context = decimal.getcontext().copy()\n context.prec = max_digits"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99051:Expr_L130_C4", "label": "expression", "type": "expression", "loc": [130, 133], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99051:FunctionDef_L129_C0", "vector": [8, 1, 0.946, 0.0288, 1, 0.53, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"\n Formats a number into a string with the requisite number of digits and\n decimal places.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99051:If_L134_C4", "label": "if", "type": "if", "loc": [134, 139], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99051:FunctionDef_L129_C0", "vector": [4, 1, 0.982, 0.0432, 1, 0.53, 1.0, 0, 3, 0, 0, 0, 0, 0, 6], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if isinstance(value, decimal.Decimal):\n context = decimal.getcontext().copy()\n context.prec = max_digits\n return u'%s' % str(value.quantize(decimal.Decimal(\".1\") ** decimal_places, context=context))\n else:\n return u\"%.*f\" % (decimal_places, value)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99051:Assign_L135_C8", "label": "context = copy()", "type": "assigned_variable", "loc": [135, 135], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99051:If_L134_C4", "vector": [14, 2, 0.9712, 0.0072, 2, 0.55, 0.0, 954, 3, 0, 0, 0, 739, 10, 2], "semantic": {"name": "context", "arg_names": [], "import_names": [], "rhs_call_name": "copy", "annotation": ""}, "snippet": " context = decimal.getcontext().copy()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99051:Assign_L136_C8", "label": "context.prec =", "type": "assigned_variable", "loc": [136, 136], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99051:If_L134_C4", "vector": [14, 2, 0.9784, 0.0072, 2, 0.55, 0.3333, 732, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "context.prec", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " context.prec = max_digits"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99051:Return_L137_C8", "label": "return", "type": "return", "loc": [137, 137], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99051:If_L134_C4", "vector": [13, 2, 0.9856, 0.0072, 2, 0.55, 0.6667, 0, 4, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return u'%s' % str(value.quantize(decimal.Decimal(\".1\") ** decimal_places, context=context))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99051:Return_L139_C8", "label": "return", "type": "return", "loc": [139, 139], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99051:If_L134_C4", "vector": [13, 2, 1.0, 0.0072, 2, 0.55, 1.0, 0, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return u\"%.*f\" % (decimal_places, value)"}]
[{"f": "ajibawa-2023/Python-Code-Large/train/row_99051:ClassDef_L10_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99051:FunctionDef_L11_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99051:FunctionDef_L11_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99051:Assign_L12_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99051:FunctionDef_L11_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99051:Assign_L13_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99051:ClassDef_L10_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99051:FunctionDef_L15_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99051:FunctionDef_L15_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99051:Assign_L16_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99051:FunctionDef_L15_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99051:Try_L17_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99051:Try_L17_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99051:Return_L18_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99051:Try_L17_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99051:Assign_L20_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99051:Try_L17_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99051:Assign_L21_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99051:Try_L17_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99051:Assign_L22_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99051:Try_L17_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99051:Expr_L23_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99051:Try_L17_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99051:Expr_L27_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99051:ClassDef_L10_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99051:FunctionDef_L31_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99051:FunctionDef_L31_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99051:Assign_L32_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99051:FunctionDef_L31_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99051:Try_L33_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99051:Try_L33_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99051:Return_L34_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99051:Try_L33_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99051:Assign_L36_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99051:Try_L33_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99051:Assign_L37_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99051:Try_L33_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99051:Expr_L38_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99051:Try_L33_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99051:Expr_L42_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99051:ClassDef_L10_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99051:FunctionDef_L46_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99051:FunctionDef_L46_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99051:If_L47_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99051:If_L47_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99051:Return_L48_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99051:If_L47_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99051:Return_L50_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99051:ClassDef_L10_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99051:FunctionDef_L52_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99051:FunctionDef_L52_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99051:Return_L53_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99051:FunctionDef_L59_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99051:Return_L60_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99051:FunctionDef_L62_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99051:If_L63_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99051:If_L63_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99051:Return_L63_C14"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99051:FunctionDef_L62_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99051:Assign_L64_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99051:FunctionDef_L62_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99051:If_L65_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99051:If_L65_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99051:Assign_L66_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99051:If_L65_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99051:Assign_L68_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99051:FunctionDef_L62_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99051:Return_L69_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99051:FunctionDef_L71_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99051:If_L74_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99051:If_L74_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99051:Return_L74_C14"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99051:FunctionDef_L71_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99051:If_L75_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99051:If_L75_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99051:Return_L75_C21"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99051:FunctionDef_L71_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99051:Assign_L76_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99051:FunctionDef_L71_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99051:If_L79_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99051:If_L79_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99051:Assign_L80_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99051:If_L79_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99051:Assign_L81_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99051:If_L79_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99051:If_L82_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99051:If_L82_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99051:Assign_L83_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99051:If_L82_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99051:Assign_L84_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99051:If_L82_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99051:Assign_L86_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99051:FunctionDef_L71_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99051:Assign_L87_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99051:FunctionDef_L71_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99051:Assign_L88_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99051:FunctionDef_L71_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99051:Assign_L89_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99051:FunctionDef_L71_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99051:If_L90_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99051:If_L90_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99051:Assign_L91_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99051:If_L90_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99051:Assign_L93_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99051:FunctionDef_L71_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99051:Return_L94_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99051:FunctionDef_L97_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99051:If_L98_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99051:If_L98_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99051:Return_L98_C18"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99051:FunctionDef_L97_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99051:If_L99_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99051:If_L99_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99051:Return_L99_C14"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99051:FunctionDef_L97_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99051:Return_L100_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99051:FunctionDef_L102_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99051:If_L103_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99051:If_L103_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99051:Return_L104_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99051:FunctionDef_L102_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99051:Return_L105_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99051:FunctionDef_L111_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99051:Return_L112_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99051:FunctionDef_L114_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99051:If_L115_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99051:If_L115_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99051:Return_L116_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99051:FunctionDef_L114_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99051:Return_L117_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99051:FunctionDef_L119_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99051:Expr_L120_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99051:FunctionDef_L119_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99051:If_L122_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99051:If_L122_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99051:Return_L123_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99051:FunctionDef_L119_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99051:Assign_L125_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99051:FunctionDef_L119_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99051:Return_L127_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99051:FunctionDef_L129_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99051:Expr_L130_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99051:FunctionDef_L129_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99051:If_L134_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99051:If_L134_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99051:Assign_L135_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99051:If_L134_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99051:Assign_L136_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99051:If_L134_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99051:Return_L137_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99051:If_L134_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99051:Return_L139_C8"}]
import re from django.db.backends import BaseDatabaseIntrospection # This light wrapper "fakes" a dictionary interface, because some SQLite data # types include variables in them -- e.g. "varchar(30)" -- and can't be matched # as a simple dictionary lookup. class FlexibleFieldLookupDict(object): # Maps SQL types to Django Field types. Some of the SQL types have multiple # entries here because SQLite allows for anything and doesn't normalize the # field type; it uses whatever was given. base_data_types_reverse = { 'bool': 'BooleanField', 'boolean': 'BooleanField', 'smallint': 'SmallIntegerField', 'smallint unsigned': 'PositiveSmallIntegerField', 'smallinteger': 'SmallIntegerField', 'int': 'IntegerField', 'integer': 'IntegerField', 'bigint': 'BigIntegerField', 'integer unsigned': 'PositiveIntegerField', 'decimal': 'DecimalField', 'real': 'FloatField', 'text': 'TextField', 'char': 'CharField', 'date': 'DateField', 'datetime': 'DateTimeField', 'time': 'TimeField', } def __getitem__(self, key): key = key.lower() try: return self.base_data_types_reverse[key] except KeyError: import re m = re.search(r'^\s*(?:var)?char\s*\(\s*(\d+)\s*\)\s*$', key) if m: return ('CharField', {'max_length': int(m.group(1))}) raise KeyError class DatabaseIntrospection(BaseDatabaseIntrospection): data_types_reverse = FlexibleFieldLookupDict() def get_table_list(self, cursor): "Returns a list of table names in the current database." # Skip the sqlite_sequence system table used for autoincrement key # generation. cursor.execute(""" SELECT name FROM sqlite_master WHERE type='table' AND NOT name='sqlite_sequence' ORDER BY name""") return [row[0] for row in cursor.fetchall()] def get_table_description(self, cursor, table_name): "Returns a description of the table, with the DB-API cursor.description interface." return [(info['name'], info['type'], None, None, None, None, info['null_ok']) for info in self._table_info(cursor, table_name)] def get_relations(self, cursor, table_name): """ Returns a dictionary of {field_index: (field_index_other_table, other_table)} representing all relationships to the given table. Indexes are 0-based. """ # Dictionary of relations to return relations = {} # Schema for this table cursor.execute("SELECT sql FROM sqlite_master WHERE tbl_name = %s AND type = %s", [table_name, "table"]) results = cursor.fetchone()[0].strip() results = results[results.index('(')+1:results.rindex(')')] # Walk through and look for references to other tables. SQLite doesn't # really have enforced references, but since it echoes out the SQL used # to create the table we can look for REFERENCES statements used there. for field_index, field_desc in enumerate(results.split(',')): field_desc = field_desc.strip() if field_desc.startswith("UNIQUE"): continue m = re.search('references (.*) \(["|](.*)["|]\)', field_desc, re.I) if not m: continue table, column = [s.strip('"') for s in m.groups()] cursor.execute("SELECT sql FROM sqlite_master WHERE tbl_name = %s", [table]) result = cursor.fetchone() if not result: continue other_table_results = result[0].strip() li, ri = other_table_results.index('('), other_table_results.rindex(')') other_table_results = other_table_results[li+1:ri] for other_index, other_desc in enumerate(other_table_results.split(',')): other_desc = other_desc.strip() if other_desc.startswith('UNIQUE'): continue name = other_desc.split(' ', 1)[0].strip('"') if name == column: relations[field_index] = (other_index, table) break return relations def get_indexes(self, cursor, table_name): """ Returns a dictionary of fieldname -> infodict for the given table, where each infodict is in the format: {'primary_key': boolean representing whether it's the primary key, 'unique': boolean representing whether it's a unique index} """ indexes = {} for info in self._table_info(cursor, table_name): indexes[info['name']] = {'primary_key': info['pk'] != 0, 'unique': False} cursor.execute('PRAGMA index_list(%s)' % self.connection.ops.quote_name(table_name)) # seq, name, unique for index, unique in [(field[1], field[2]) for field in cursor.fetchall()]: if not unique: continue cursor.execute('PRAGMA index_info(%s)' % self.connection.ops.quote_name(index)) info = cursor.fetchall() # Skip indexes across multiple fields if len(info) != 1: continue name = info[0][2] # seqno, cid, name indexes[name]['unique'] = True return indexes def _table_info(self, cursor, name): cursor.execute('PRAGMA table_info(%s)' % self.connection.ops.quote_name(name)) # cid, name, type, notnull, dflt_value, pk return [{'name': field[1], 'type': field[2], 'null_ok': not field[3], 'pk': field[5] # undocumented } for field in cursor.fetchall()]
ajibawa-2023/Python-Code-Large/train/row_99052
63
140
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_99052:Import_L1_C0", "label": "re import re", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0071, 0.0071, 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_99052:ImportFrom_L2_C0", "label": "from django.db.backends import BaseDatabaseIntrospection", "type": "import", "loc": [2, 2], "level": 0, "parent": null, "vector": [1, 0, 0.0143, 0.0071, 0, 0.66, 0.3333, 981, 0, 1, 0, 0, 981, 0, 0], "semantic": {"name": "django.db.backends", "arg_names": [], "import_names": ["BaseDatabaseIntrospection"], "rhs_call_name": "", "annotation": ""}, "snippet": "from django.db.backends import BaseDatabaseIntrospection"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99052:ClassDef_L7_C0", "label": "FlexibleFieldLookupDict", "type": "class", "loc": [7, 39], "level": 0, "parent": null, "vector": [3, 0, 0.1643, 0.2357, 0, 0.66, 0.6667, 319, 0, 1, 0, 0, 186, 0, 4], "semantic": {"name": "FlexibleFieldLookupDict", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class FlexibleFieldLookupDict(object):\n # Maps SQL types to Django Field types. Some of the SQL types have multiple\n # entries here because SQLite allows for anything and doesn't normalize the\n # field type; it uses whatever was given.\n base_data_types_reverse = {\n 'bool': 'BooleanField',\n 'boolean': 'BooleanField',\n 'smallint': 'SmallIntegerField',"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99052:Assign_L11_C4", "label": "base_data_types_reverse =", "type": "assigned_variable", "loc": [11, 28], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99052:ClassDef_L7_C0", "vector": [14, 1, 0.1393, 0.1286, 1, 0.67, 0.0, 509, 0, 0, 0, 0, 0, 6, 0], "semantic": {"name": "base_data_types_reverse", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " base_data_types_reverse = {\n 'bool': 'BooleanField',\n 'boolean': 'BooleanField',\n 'smallint': 'SmallIntegerField',\n 'smallint unsigned': 'PositiveSmallIntegerField',\n 'smallinteger': 'SmallIntegerField',\n 'int': 'IntegerField',\n 'integer': 'IntegerField',"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99052:FunctionDef_L30_C4", "label": "__getitem__", "type": "function", "loc": [30, 39], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99052:ClassDef_L7_C0", "vector": [2, 1, 0.2464, 0.0714, 1, 0.67, 1.0, 698, 0, 2, 1, 0, 0, 0, 4], "semantic": {"name": "__getitem__", "arg_names": ["self", "key"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __getitem__(self, key):\n key = key.lower()\n try:\n return self.base_data_types_reverse[key]\n except KeyError:\n import re\n m = re.search(r'^\\s*(?:var)?char\\s*\\(\\s*(\\d+)\\s*\\)\\s*$', key)\n if m:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99052:Assign_L31_C8", "label": "key = lower()", "type": "assigned_variable", "loc": [31, 31], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99052:FunctionDef_L30_C4", "vector": [14, 2, 0.2214, 0.0071, 2, 0.36, 0.0, 230, 3, 0, 0, 0, 432, 10, 1], "semantic": {"name": "key", "arg_names": [], "import_names": [], "rhs_call_name": "lower", "annotation": ""}, "snippet": " key = key.lower()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99052:Try_L32_C8", "label": "try", "type": "try", "loc": [32, 39], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99052:FunctionDef_L30_C4", "vector": [7, 2, 0.2536, 0.0571, 2, 0.36, 1.0, 0, 0, 1, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " try:\n return self.base_data_types_reverse[key]\n except KeyError:\n import re\n m = re.search(r'^\\s*(?:var)?char\\s*\\(\\s*(\\d+)\\s*\\)\\s*$', key)\n if m:\n return ('CharField', {'max_length': int(m.group(1))})\n raise KeyError"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99052:Return_L33_C12", "label": "return", "type": "return", "loc": [33, 33], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99052:Try_L32_C8", "vector": [13, 3, 0.2357, 0.0071, 3, 0.29, 0.0, 0, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self.base_data_types_reverse[key]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99052:Import_L35_C12", "label": "re import re", "type": "import", "loc": [35, 35], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99052:Try_L32_C8", "vector": [1, 3, 0.25, 0.0071, 3, 0.29, 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_99052:Assign_L36_C12", "label": "m = search()", "type": "assigned_variable", "loc": [36, 36], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99052:Try_L32_C8", "vector": [14, 3, 0.2571, 0.0071, 3, 0.29, 0.5, 711, 3, 2, 0, 0, 163, 10, 1], "semantic": {"name": "m", "arg_names": [], "import_names": [], "rhs_call_name": "search", "annotation": ""}, "snippet": " m = re.search(r'^\\s*(?:var)?char\\s*\\(\\s*(\\d+)\\s*\\)\\s*$', key)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99052:If_L37_C12", "label": "if", "type": "if", "loc": [37, 38], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99052:Try_L32_C8", "vector": [4, 3, 0.2679, 0.0143, 3, 0.29, 1.0, 0, 2, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if m:\n return ('CharField', {'max_length': int(m.group(1))})"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99052:Return_L38_C16", "label": "return", "type": "return", "loc": [38, 38], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99052:If_L37_C12", "vector": [13, 4, 0.2714, 0.0071, 4, 0.75, 0.0, 0, 0, 0, 0, 0, 0, 8, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return ('CharField', {'max_length': int(m.group(1))})"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99052:ClassDef_L41_C0", "label": "DatabaseIntrospection", "type": "class", "loc": [41, 140], "level": 0, "parent": null, "vector": [3, 0, 0.6464, 0.7143, 0, 0.66, 1.0, 77, 0, 5, 0, 0, 41, 0, 38], "semantic": {"name": "DatabaseIntrospection", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class DatabaseIntrospection(BaseDatabaseIntrospection):\n data_types_reverse = FlexibleFieldLookupDict()\n\n def get_table_list(self, cursor):\n \"Returns a list of table names in the current database.\"\n # Skip the sqlite_sequence system table used for autoincrement key\n # generation.\n cursor.execute(\"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99052:Assign_L42_C4", "label": "data_types_reverse = FlexibleFieldLookupDict()", "type": "assigned_variable", "loc": [42, 42], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99052:ClassDef_L41_C0", "vector": [14, 1, 0.3, 0.0071, 1, 0.33, 0.0, 403, 3, 0, 0, 0, 319, 10, 1], "semantic": {"name": "data_types_reverse", "arg_names": [], "import_names": [], "rhs_call_name": "FlexibleFieldLookupDict", "annotation": ""}, "snippet": " data_types_reverse = FlexibleFieldLookupDict()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99052:FunctionDef_L44_C4", "label": "get_table_list", "type": "function", "loc": [44, 52], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99052:ClassDef_L41_C0", "vector": [2, 1, 0.3429, 0.0643, 1, 0.33, 0.2, 878, 0, 2, 1, 0, 0, 0, 2], "semantic": {"name": "get_table_list", "arg_names": ["self", "cursor"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def get_table_list(self, cursor):\n \"Returns a list of table names in the current database.\"\n # Skip the sqlite_sequence system table used for autoincrement key\n # generation.\n cursor.execute(\"\"\"\n SELECT name FROM sqlite_master\n WHERE type='table' AND NOT name='sqlite_sequence'\n ORDER BY name\"\"\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99052:Expr_L45_C8", "label": "expression", "type": "expression", "loc": [45, 45], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99052:FunctionDef_L44_C4", "vector": [8, 2, 0.3214, 0.0071, 2, 0.51, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"Returns a list of table names in the current database.\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99052:Expr_L48_C8", "label": "execute()", "type": "expression", "loc": [48, 51], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99052:FunctionDef_L44_C4", "vector": [8, 2, 0.3536, 0.0286, 2, 0.51, 0.5, 569, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "execute", "arg_names": [], "import_names": [], "rhs_call_name": "execute", "annotation": ""}, "snippet": " cursor.execute(\"\"\"\n SELECT name FROM sqlite_master\n WHERE type='table' AND NOT name='sqlite_sequence'\n ORDER BY name\"\"\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99052:Return_L52_C8", "label": "return", "type": "return", "loc": [52, 52], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99052:FunctionDef_L44_C4", "vector": [13, 2, 0.3714, 0.0071, 2, 0.51, 1.0, 0, 5, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return [row[0] for row in cursor.fetchall()]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99052:FunctionDef_L54_C4", "label": "get_table_description", "type": "function", "loc": [54, 57], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99052:ClassDef_L41_C0", "vector": [2, 1, 0.3964, 0.0286, 1, 0.33, 0.4, 876, 0, 3, 1, 0, 0, 0, 1], "semantic": {"name": "get_table_description", "arg_names": ["self", "cursor", "table_name"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def get_table_description(self, cursor, table_name):\n \"Returns a description of the table, with the DB-API cursor.description interface.\"\n return [(info['name'], info['type'], None, None, None, None,\n info['null_ok']) for info in self._table_info(cursor, table_name)]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99052:Expr_L55_C8", "label": "expression", "type": "expression", "loc": [55, 55], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99052:FunctionDef_L54_C4", "vector": [8, 2, 0.3929, 0.0071, 2, 0.38, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"Returns a description of the table, with the DB-API cursor.description interface.\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99052:Return_L56_C8", "label": "return", "type": "return", "loc": [56, 57], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99052:FunctionDef_L54_C4", "vector": [13, 2, 0.4036, 0.0143, 2, 0.38, 1.0, 0, 5, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return [(info['name'], info['type'], None, None, None, None,\n info['null_ok']) for info in self._table_info(cursor, table_name)]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99052:FunctionDef_L59_C4", "label": "get_relations", "type": "function", "loc": [59, 106], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99052:ClassDef_L41_C0", "vector": [2, 1, 0.5893, 0.3429, 1, 0.33, 0.6, 814, 0, 3, 1, 0, 0, 0, 23], "semantic": {"name": "get_relations", "arg_names": ["self", "cursor", "table_name"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def get_relations(self, cursor, table_name):\n \"\"\"\n Returns a dictionary of {field_index: (field_index_other_table, other_table)}\n representing all relationships to the given table. Indexes are 0-based.\n \"\"\"\n\n # Dictionary of relations to return\n relations = {}"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99052:Expr_L60_C8", "label": "expression", "type": "expression", "loc": [60, 63], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99052:FunctionDef_L59_C4", "vector": [8, 2, 0.4393, 0.0286, 2, 0.72, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"\n Returns a dictionary of {field_index: (field_index_other_table, other_table)}\n representing all relationships to the given table. Indexes are 0-based.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99052:Assign_L66_C8", "label": "relations =", "type": "assigned_variable", "loc": [66, 66], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99052:FunctionDef_L59_C4", "vector": [14, 2, 0.4714, 0.0071, 2, 0.72, 0.1667, 900, 0, 0, 0, 0, 0, 6, 0], "semantic": {"name": "relations", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " relations = {}"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99052:Expr_L69_C8", "label": "execute()", "type": "expression", "loc": [69, 69], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99052:FunctionDef_L59_C4", "vector": [8, 2, 0.4929, 0.0071, 2, 0.72, 0.3333, 569, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "execute", "arg_names": [], "import_names": [], "rhs_call_name": "execute", "annotation": ""}, "snippet": " cursor.execute(\"SELECT sql FROM sqlite_master WHERE tbl_name = %s AND type = %s\", [table_name, \"table\"])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99052:Assign_L70_C8", "label": "results = strip()", "type": "assigned_variable", "loc": [70, 70], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99052:FunctionDef_L59_C4", "vector": [14, 2, 0.5, 0.0071, 2, 0.72, 0.5, 143, 3, 0, 0, 0, 973, 10, 2], "semantic": {"name": "results", "arg_names": [], "import_names": [], "rhs_call_name": "strip", "annotation": ""}, "snippet": " results = cursor.fetchone()[0].strip()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99052:Assign_L71_C8", "label": "results =", "type": "assigned_variable", "loc": [71, 71], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99052:FunctionDef_L59_C4", "vector": [14, 2, 0.5071, 0.0071, 2, 0.72, 0.6667, 143, 6, 0, 0, 0, 0, 0, 2], "semantic": {"name": "results", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " results = results[results.index('(')+1:results.rindex(')')]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99052:For_L76_C8", "label": "for field_index, field_desc", "type": "for", "loc": [76, 104], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99052:FunctionDef_L59_C4", "vector": [6, 2, 0.6429, 0.2071, 2, 0.72, 0.8333, 884, 3, 0, 0, 0, 0, 0, 18], "semantic": {"name": "field_index, field_desc", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for field_index, field_desc in enumerate(results.split(',')):\n field_desc = field_desc.strip()\n if field_desc.startswith(\"UNIQUE\"):\n continue\n\n m = re.search('references (.*) \\([\"|](.*)[\"|]\\)', field_desc, re.I)\n if not m:\n continue"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99052:Assign_L77_C12", "label": "field_desc = strip()", "type": "assigned_variable", "loc": [77, 77], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99052:For_L76_C8", "vector": [14, 3, 0.55, 0.0071, 3, 0.83, 0.0, 921, 3, 0, 0, 0, 973, 10, 1], "semantic": {"name": "field_desc", "arg_names": [], "import_names": [], "rhs_call_name": "strip", "annotation": ""}, "snippet": " field_desc = field_desc.strip()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99052:If_L78_C12", "label": "if", "type": "if", "loc": [78, 79], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99052:For_L76_C8", "vector": [4, 3, 0.5607, 0.0143, 3, 0.83, 0.0909, 0, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if field_desc.startswith(\"UNIQUE\"):\n continue"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99052:Assign_L81_C12", "label": "m = search()", "type": "assigned_variable", "loc": [81, 81], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99052:For_L76_C8", "vector": [14, 3, 0.5786, 0.0071, 3, 0.83, 0.1818, 711, 3, 3, 0, 0, 163, 10, 1], "semantic": {"name": "m", "arg_names": [], "import_names": [], "rhs_call_name": "search", "annotation": ""}, "snippet": " m = re.search('references (.*) \\([\"|](.*)[\"|]\\)', field_desc, re.I)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99052:If_L82_C12", "label": "if", "type": "if", "loc": [82, 83], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99052:For_L76_C8", "vector": [4, 3, 0.5893, 0.0143, 3, 0.83, 0.2727, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not m:\n continue"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99052:Assign_L85_C12", "label": "table, column =", "type": "assigned_variable", "loc": [85, 85], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99052:For_L76_C8", "vector": [14, 3, 0.6071, 0.0071, 3, 0.83, 0.3636, 820, 5, 0, 0, 0, 0, 0, 2], "semantic": {"name": "table, column", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " table, column = [s.strip('\"') for s in m.groups()]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99052:Expr_L87_C12", "label": "execute()", "type": "expression", "loc": [87, 87], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99052:For_L76_C8", "vector": [8, 3, 0.6214, 0.0071, 3, 0.83, 0.4545, 569, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "execute", "arg_names": [], "import_names": [], "rhs_call_name": "execute", "annotation": ""}, "snippet": " cursor.execute(\"SELECT sql FROM sqlite_master WHERE tbl_name = %s\", [table])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99052:Assign_L88_C12", "label": "result = fetchone()", "type": "assigned_variable", "loc": [88, 88], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99052:For_L76_C8", "vector": [14, 3, 0.6286, 0.0071, 3, 0.83, 0.5455, 51, 3, 0, 0, 0, 561, 10, 1], "semantic": {"name": "result", "arg_names": [], "import_names": [], "rhs_call_name": "fetchone", "annotation": ""}, "snippet": " result = cursor.fetchone()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99052:If_L89_C12", "label": "if", "type": "if", "loc": [89, 90], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99052:For_L76_C8", "vector": [4, 3, 0.6393, 0.0143, 3, 0.83, 0.6364, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not result:\n continue"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99052:Assign_L91_C12", "label": "other_table_results = strip()", "type": "assigned_variable", "loc": [91, 91], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99052:For_L76_C8", "vector": [14, 3, 0.65, 0.0071, 3, 0.83, 0.7273, 845, 3, 0, 0, 0, 973, 10, 1], "semantic": {"name": "other_table_results", "arg_names": [], "import_names": [], "rhs_call_name": "strip", "annotation": ""}, "snippet": " other_table_results = result[0].strip()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99052:Assign_L92_C12", "label": "li, ri =", "type": "assigned_variable", "loc": [92, 92], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99052:For_L76_C8", "vector": [14, 3, 0.6571, 0.0071, 3, 0.83, 0.8182, 96, 0, 0, 0, 0, 0, 8, 2], "semantic": {"name": "li, ri", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " li, ri = other_table_results.index('('), other_table_results.rindex(')')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99052:Assign_L93_C12", "label": "other_table_results =", "type": "assigned_variable", "loc": [93, 93], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99052:For_L76_C8", "vector": [14, 3, 0.6643, 0.0071, 3, 0.83, 0.9091, 845, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "other_table_results", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " other_table_results = other_table_results[li+1:ri]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99052:For_L96_C12", "label": "for other_index, other_desc", "type": "for", "loc": [96, 104], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99052:For_L76_C8", "vector": [6, 3, 0.7143, 0.0643, 3, 0.83, 1.0, 242, 3, 0, 0, 0, 0, 0, 6], "semantic": {"name": "other_index, other_desc", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for other_index, other_desc in enumerate(other_table_results.split(',')):\n other_desc = other_desc.strip()\n if other_desc.startswith('UNIQUE'):\n continue\n\n name = other_desc.split(' ', 1)[0].strip('\"')\n if name == column:\n relations[field_index] = (other_index, table)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99052:Assign_L97_C16", "label": "other_desc = strip()", "type": "assigned_variable", "loc": [97, 97], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99052:For_L96_C12", "vector": [14, 4, 0.6929, 0.0071, 4, 0.37, 0.0, 249, 3, 0, 0, 0, 973, 10, 1], "semantic": {"name": "other_desc", "arg_names": [], "import_names": [], "rhs_call_name": "strip", "annotation": ""}, "snippet": " other_desc = other_desc.strip()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99052:If_L98_C16", "label": "if", "type": "if", "loc": [98, 99], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99052:For_L96_C12", "vector": [4, 4, 0.7036, 0.0143, 4, 0.37, 0.3333, 0, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if other_desc.startswith('UNIQUE'):\n continue"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99052:Assign_L101_C16", "label": "name = strip()", "type": "assigned_variable", "loc": [101, 101], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99052:For_L96_C12", "vector": [14, 4, 0.7214, 0.0071, 4, 0.37, 0.6667, 57, 3, 1, 0, 0, 973, 10, 2], "semantic": {"name": "name", "arg_names": [], "import_names": [], "rhs_call_name": "strip", "annotation": ""}, "snippet": " name = other_desc.split(' ', 1)[0].strip('\"')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99052:If_L102_C16", "label": "if", "type": "if", "loc": [102, 104], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99052:For_L96_C12", "vector": [4, 4, 0.7357, 0.0214, 4, 0.37, 1.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if name == column:\n relations[field_index] = (other_index, table)\n break"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99052:Assign_L103_C20", "label": "assign", "type": "assigned_variable", "loc": [103, 103], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99052:If_L102_C16", "vector": [14, 5, 0.7357, 0.0071, 5, 0.87, 0.0, 0, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " relations[field_index] = (other_index, table)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99052:Return_L106_C8", "label": "return", "type": "return", "loc": [106, 106], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99052:FunctionDef_L59_C4", "vector": [13, 2, 0.7571, 0.0071, 2, 0.72, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return relations"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99052:FunctionDef_L108_C4", "label": "get_indexes", "type": "function", "loc": [108, 131], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99052:ClassDef_L41_C0", "vector": [2, 1, 0.8536, 0.1714, 1, 0.33, 0.8, 808, 0, 3, 1, 0, 0, 0, 8], "semantic": {"name": "get_indexes", "arg_names": ["self", "cursor", "table_name"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def get_indexes(self, cursor, table_name):\n \"\"\"\n Returns a dictionary of fieldname -> infodict for the given table,\n where each infodict is in the format:\n {'primary_key': boolean representing whether it's the primary key,\n 'unique': boolean representing whether it's a unique index}\n \"\"\"\n indexes = {}"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99052:Expr_L109_C8", "label": "expression", "type": "expression", "loc": [109, 114], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99052:FunctionDef_L108_C4", "vector": [8, 2, 0.7964, 0.0429, 2, 0.72, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"\n Returns a dictionary of fieldname -> infodict for the given table,\n where each infodict is in the format:\n {'primary_key': boolean representing whether it's the primary key,\n 'unique': boolean representing whether it's a unique index}\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99052:Assign_L115_C8", "label": "indexes =", "type": "assigned_variable", "loc": [115, 115], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99052:FunctionDef_L108_C4", "vector": [14, 2, 0.8214, 0.0071, 2, 0.72, 0.2, 600, 0, 0, 0, 0, 0, 6, 0], "semantic": {"name": "indexes", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " indexes = {}"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99052:For_L116_C8", "label": "for info", "type": "for", "loc": [116, 118], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99052:FunctionDef_L108_C4", "vector": [6, 2, 0.8357, 0.0214, 2, 0.72, 0.4, 730, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "info", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for info in self._table_info(cursor, table_name):\n indexes[info['name']] = {'primary_key': info['pk'] != 0,\n 'unique': False}"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99052:Assign_L117_C12", "label": "assign", "type": "assigned_variable", "loc": [117, 118], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99052:For_L116_C8", "vector": [14, 3, 0.8393, 0.0143, 3, 0.27, 0.0, 0, 0, 0, 0, 0, 0, 6, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " indexes[info['name']] = {'primary_key': info['pk'] != 0,\n 'unique': False}"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99052:Expr_L119_C8", "label": "execute()", "type": "expression", "loc": [119, 119], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99052:FunctionDef_L108_C4", "vector": [8, 2, 0.85, 0.0071, 2, 0.72, 0.6, 569, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "execute", "arg_names": [], "import_names": [], "rhs_call_name": "execute", "annotation": ""}, "snippet": " cursor.execute('PRAGMA index_list(%s)' % self.connection.ops.quote_name(table_name))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99052:For_L121_C8", "label": "for index, unique", "type": "for", "loc": [121, 130], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99052:FunctionDef_L108_C4", "vector": [6, 2, 0.8964, 0.0714, 2, 0.72, 0.8, 554, 5, 0, 0, 0, 0, 0, 5], "semantic": {"name": "index, unique", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for index, unique in [(field[1], field[2]) for field in cursor.fetchall()]:\n if not unique:\n continue\n cursor.execute('PRAGMA index_info(%s)' % self.connection.ops.quote_name(index))\n info = cursor.fetchall()\n # Skip indexes across multiple fields\n if len(info) != 1:\n continue"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99052:If_L122_C12", "label": "if", "type": "if", "loc": [122, 123], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99052:For_L121_C8", "vector": [4, 3, 0.875, 0.0143, 3, 0.86, 0.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not unique:\n continue"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99052:Expr_L124_C12", "label": "execute()", "type": "expression", "loc": [124, 124], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99052:For_L121_C8", "vector": [8, 3, 0.8857, 0.0071, 3, 0.86, 0.2, 569, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "execute", "arg_names": [], "import_names": [], "rhs_call_name": "execute", "annotation": ""}, "snippet": " cursor.execute('PRAGMA index_info(%s)' % self.connection.ops.quote_name(index))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99052:Assign_L125_C12", "label": "info = fetchall()", "type": "assigned_variable", "loc": [125, 125], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99052:For_L121_C8", "vector": [14, 3, 0.8929, 0.0071, 3, 0.86, 0.4, 730, 3, 0, 0, 0, 133, 10, 1], "semantic": {"name": "info", "arg_names": [], "import_names": [], "rhs_call_name": "fetchall", "annotation": ""}, "snippet": " info = cursor.fetchall()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99052:If_L127_C12", "label": "if", "type": "if", "loc": [127, 128], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99052:For_L121_C8", "vector": [4, 3, 0.9107, 0.0143, 3, 0.86, 0.6, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if len(info) != 1:\n continue"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99052:Assign_L129_C12", "label": "name =", "type": "assigned_variable", "loc": [129, 129], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99052:For_L121_C8", "vector": [14, 3, 0.9214, 0.0071, 3, 0.86, 0.8, 57, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "name", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " name = info[0][2] # seqno, cid, name"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99052:Assign_L130_C12", "label": "assign", "type": "assigned_variable", "loc": [130, 130], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99052:For_L121_C8", "vector": [14, 3, 0.9286, 0.0071, 3, 0.86, 1.0, 0, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " indexes[name]['unique'] = True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99052:Return_L131_C8", "label": "return", "type": "return", "loc": [131, 131], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99052:FunctionDef_L108_C4", "vector": [13, 2, 0.9357, 0.0071, 2, 0.72, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return indexes"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99052:FunctionDef_L133_C4", "label": "_table_info", "type": "function", "loc": [133, 140], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99052:ClassDef_L41_C0", "vector": [2, 1, 0.975, 0.0571, 1, 0.33, 1.0, 929, 0, 3, 1, 0, 0, 0, 3], "semantic": {"name": "_table_info", "arg_names": ["self", "cursor", "name"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _table_info(self, cursor, name):\n cursor.execute('PRAGMA table_info(%s)' % self.connection.ops.quote_name(name))\n # cid, name, type, notnull, dflt_value, pk\n return [{'name': field[1],\n 'type': field[2],\n 'null_ok': not field[3],\n 'pk': field[5] # undocumented\n } for field in cursor.fetchall()]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99052:Expr_L134_C8", "label": "execute()", "type": "expression", "loc": [134, 134], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99052:FunctionDef_L133_C4", "vector": [8, 2, 0.9571, 0.0071, 2, 0.71, 0.0, 569, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "execute", "arg_names": [], "import_names": [], "rhs_call_name": "execute", "annotation": ""}, "snippet": " cursor.execute('PRAGMA table_info(%s)' % self.connection.ops.quote_name(name))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99052:Return_L136_C8", "label": "return", "type": "return", "loc": [136, 140], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99052:FunctionDef_L133_C4", "vector": [13, 2, 0.9857, 0.0357, 2, 0.71, 1.0, 0, 5, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return [{'name': field[1],\n 'type': field[2],\n 'null_ok': not field[3],\n 'pk': field[5] # undocumented\n } for field in cursor.fetchall()]"}]
[{"f": "ajibawa-2023/Python-Code-Large/train/row_99052:ClassDef_L7_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99052:Assign_L11_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99052:ClassDef_L7_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99052:FunctionDef_L30_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99052:FunctionDef_L30_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99052:Assign_L31_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99052:FunctionDef_L30_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99052:Try_L32_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99052:Try_L32_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99052:Return_L33_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99052:Try_L32_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99052:Import_L35_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99052:Try_L32_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99052:Assign_L36_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99052:Try_L32_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99052:If_L37_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99052:If_L37_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99052:Return_L38_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99052:ClassDef_L41_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99052:Assign_L42_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99052:ClassDef_L41_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99052:FunctionDef_L44_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99052:FunctionDef_L44_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99052:Expr_L45_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99052:FunctionDef_L44_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99052:Expr_L48_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99052:FunctionDef_L44_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99052:Return_L52_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99052:ClassDef_L41_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99052:FunctionDef_L54_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99052:FunctionDef_L54_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99052:Expr_L55_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99052:FunctionDef_L54_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99052:Return_L56_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99052:ClassDef_L41_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99052:FunctionDef_L59_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99052:FunctionDef_L59_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99052:Expr_L60_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99052:FunctionDef_L59_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99052:Assign_L66_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99052:FunctionDef_L59_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99052:Expr_L69_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99052:FunctionDef_L59_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99052:Assign_L70_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99052:FunctionDef_L59_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99052:Assign_L71_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99052:FunctionDef_L59_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99052:For_L76_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99052:For_L76_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99052:Assign_L77_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99052:For_L76_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99052:If_L78_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99052:For_L76_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99052:Assign_L81_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99052:For_L76_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99052:If_L82_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99052:For_L76_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99052:Assign_L85_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99052:For_L76_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99052:Expr_L87_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99052:For_L76_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99052:Assign_L88_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99052:For_L76_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99052:If_L89_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99052:For_L76_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99052:Assign_L91_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99052:For_L76_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99052:Assign_L92_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99052:For_L76_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99052:Assign_L93_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99052:For_L76_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99052:For_L96_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99052:For_L96_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99052:Assign_L97_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99052:For_L96_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99052:If_L98_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99052:For_L96_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99052:Assign_L101_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99052:For_L96_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99052:If_L102_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99052:If_L102_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99052:Assign_L103_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99052:FunctionDef_L59_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99052:Return_L106_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99052:ClassDef_L41_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99052:FunctionDef_L108_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99052:FunctionDef_L108_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99052:Expr_L109_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99052:FunctionDef_L108_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99052:Assign_L115_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99052:FunctionDef_L108_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99052:For_L116_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99052:For_L116_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99052:Assign_L117_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99052:FunctionDef_L108_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99052:Expr_L119_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99052:FunctionDef_L108_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99052:For_L121_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99052:For_L121_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99052:If_L122_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99052:For_L121_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99052:Expr_L124_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99052:For_L121_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99052:Assign_L125_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99052:For_L121_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99052:If_L127_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99052:For_L121_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99052:Assign_L129_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99052:For_L121_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99052:Assign_L130_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99052:FunctionDef_L108_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99052:Return_L131_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99052:ClassDef_L41_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99052:FunctionDef_L133_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99052:FunctionDef_L133_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99052:Expr_L134_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99052:FunctionDef_L133_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99052:Return_L136_C8"}]
import os import sys from django.db.backends import BaseDatabaseClient class DatabaseClient(BaseDatabaseClient): executable_name = 'sqlite3' def runshell(self): args = [self.executable_name, self.connection.settings_dict['NAME']] if os.name == 'nt': sys.exit(os.system(" ".join(args))) else: os.execvp(self.executable_name, args)
ajibawa-2023/Python-Code-Large/train/row_99053
10
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_99053:Import_L1_C0", "label": "os import os", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0625, 0.0625, 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_99053:Import_L2_C0", "label": "sys import sys", "type": "import", "loc": [2, 2], "level": 0, "parent": null, "vector": [1, 0, 0.125, 0.0625, 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_99053:ImportFrom_L4_C0", "label": "from django.db.backends import BaseDatabaseClient", "type": "import", "loc": [4, 4], "level": 0, "parent": null, "vector": [1, 0, 0.25, 0.0625, 0, 0.66, 0.6667, 981, 0, 1, 0, 0, 981, 0, 0], "semantic": {"name": "django.db.backends", "arg_names": [], "import_names": ["BaseDatabaseClient"], "rhs_call_name": "", "annotation": ""}, "snippet": "from django.db.backends import BaseDatabaseClient"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99053:ClassDef_L6_C0", "label": "DatabaseClient", "type": "class", "loc": [6, 15], "level": 0, "parent": null, "vector": [3, 0, 0.6562, 0.625, 0, 0.66, 1.0, 207, 0, 1, 0, 0, 729, 0, 4], "semantic": {"name": "DatabaseClient", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class DatabaseClient(BaseDatabaseClient):\n executable_name = 'sqlite3'\n\n def runshell(self):\n args = [self.executable_name,\n self.connection.settings_dict['NAME']]\n if os.name == 'nt':\n sys.exit(os.system(\" \".join(args)))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99053:Assign_L7_C4", "label": "executable_name =", "type": "assigned_variable", "loc": [7, 7], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99053:ClassDef_L6_C0", "vector": [14, 1, 0.4375, 0.0625, 1, 0.5, 0.0, 723, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "executable_name", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " executable_name = 'sqlite3'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99053:FunctionDef_L9_C4", "label": "runshell", "type": "function", "loc": [9, 15], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99053:ClassDef_L6_C0", "vector": [2, 1, 0.75, 0.4375, 1, 0.5, 1.0, 795, 0, 1, 0, 0, 0, 0, 4], "semantic": {"name": "runshell", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def runshell(self):\n args = [self.executable_name,\n self.connection.settings_dict['NAME']]\n if os.name == 'nt':\n sys.exit(os.system(\" \".join(args)))\n else:\n os.execvp(self.executable_name, args)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99053:Assign_L10_C8", "label": "args =", "type": "assigned_variable", "loc": [10, 11], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99053:FunctionDef_L9_C4", "vector": [14, 2, 0.6562, 0.125, 2, 0.14, 0.0, 805, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "args", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " args = [self.executable_name,\n self.connection.settings_dict['NAME']]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99053:If_L12_C8", "label": "if", "type": "if", "loc": [12, 15], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99053:FunctionDef_L9_C4", "vector": [4, 2, 0.8438, 0.25, 2, 0.14, 1.0, 0, 0, 0, 0, 0, 0, 0, 4], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if os.name == 'nt':\n sys.exit(os.system(\" \".join(args)))\n else:\n os.execvp(self.executable_name, args)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99053:Expr_L13_C12", "label": "exit()", "type": "expression", "loc": [13, 13], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99053:If_L12_C8", "vector": [8, 3, 0.8125, 0.0625, 3, 0.9, 0.0, 436, 3, 1, 0, 0, 0, 0, 3], "semantic": {"name": "exit", "arg_names": [], "import_names": [], "rhs_call_name": "exit", "annotation": ""}, "snippet": " sys.exit(os.system(\" \".join(args)))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99053:Expr_L15_C12", "label": "execvp()", "type": "expression", "loc": [15, 15], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99053:If_L12_C8", "vector": [8, 3, 0.9375, 0.0625, 3, 0.9, 1.0, 784, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "execvp", "arg_names": [], "import_names": [], "rhs_call_name": "execvp", "annotation": ""}, "snippet": " os.execvp(self.executable_name, args)"}]
[{"f": "ajibawa-2023/Python-Code-Large/train/row_99053:ClassDef_L6_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99053:Assign_L7_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99053:ClassDef_L6_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99053:FunctionDef_L9_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99053:FunctionDef_L9_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99053:Assign_L10_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99053:FunctionDef_L9_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99053:If_L12_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99053:If_L12_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99053:Expr_L13_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99053:If_L12_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99053:Expr_L15_C12"}]
import decimal from threading import local from django.db import DEFAULT_DB_ALIAS from django.db.backends import util from django.utils import datetime_safe from django.utils.importlib import import_module class BaseDatabaseWrapper(local): """ Represents a database connection. """ ops = None def __init__(self, settings_dict, alias=DEFAULT_DB_ALIAS): # `settings_dict` should be a dictionary containing keys such as # NAME, USER, etc. It's called `settings_dict` instead of `settings` # to disambiguate it from Django settings modules. self.connection = None self.queries = [] self.settings_dict = settings_dict self.alias = alias self.vendor = 'unknown' self.use_debug_cursor = None def __eq__(self, other): return self.settings_dict == other.settings_dict def __ne__(self, other): return not self == other def _commit(self): if self.connection is not None: return self.connection.commit() def _rollback(self): if self.connection is not None: return self.connection.rollback() def _enter_transaction_management(self, managed): """ A hook for backend-specific changes required when entering manual transaction handling. """ pass def _leave_transaction_management(self, managed): """ A hook for backend-specific changes required when leaving manual transaction handling. Will usually be implemented only when _enter_transaction_management() is also required. """ pass def _savepoint(self, sid): if not self.features.uses_savepoints: return self.cursor().execute(self.ops.savepoint_create_sql(sid)) def _savepoint_rollback(self, sid): if not self.features.uses_savepoints: return self.cursor().execute(self.ops.savepoint_rollback_sql(sid)) def _savepoint_commit(self, sid): if not self.features.uses_savepoints: return self.cursor().execute(self.ops.savepoint_commit_sql(sid)) def close(self): if self.connection is not None: self.connection.close() self.connection = None def cursor(self): from django.conf import settings cursor = self._cursor() if (self.use_debug_cursor or (self.use_debug_cursor is None and settings.DEBUG)): return self.make_debug_cursor(cursor) return cursor def make_debug_cursor(self, cursor): return util.CursorDebugWrapper(cursor, self) class BaseDatabaseFeatures(object): allows_group_by_pk = False # True if django.db.backend.utils.typecast_timestamp is used on values # returned from dates() calls. needs_datetime_string_cast = True empty_fetchmany_value = [] update_can_self_select = True # Does the backend distinguish between '' and None? interprets_empty_strings_as_nulls = False can_use_chunked_reads = True can_return_id_from_insert = False uses_autocommit = False uses_savepoints = False # If True, don't use integer foreign keys referring to, e.g., positive # integer primary keys. related_fields_match_type = False allow_sliced_subqueries = True distinguishes_insert_from_update = True supports_deleting_related_objects = True # Does the default test database allow multiple connections? # Usually an indication that the test database is in-memory test_db_allows_multiple_connections = True # Can an object be saved without an explicit primary key? supports_unspecified_pk = False # Can a fixture contain forward references? i.e., are # FK constraints checked at the end of transaction, or # at the end of each save operation? supports_forward_references = True # Does a dirty transaction need to be rolled back # before the cursor can be used again? requires_rollback_on_dirty_transaction = False # Does the backend allow very long model names without error? supports_long_model_names = True # Is there a REAL datatype in addition to floats/doubles? has_real_datatype = False supports_subqueries_in_group_by = True supports_bitwise_or = True # Do time/datetime fields have microsecond precision? supports_microsecond_precision = True # Does the __regex lookup support backreferencing and grouping? supports_regex_backreferencing = True # Can date/datetime lookups be performed using a string? supports_date_lookup_using_string = True # Can datetimes with timezones be used? supports_timezones = True # When performing a GROUP BY, is an ORDER BY NULL required # to remove any ordering? requires_explicit_null_ordering_when_grouping = False # Is there a 1000 item limit on query parameters? supports_1000_query_parameters = True # Can an object have a primary key of 0? MySQL says No. allows_primary_key_0 = True # Do we need to NULL a ForeignKey out, or can the constraint check be # deferred can_defer_constraint_checks = False # Features that need to be confirmed at runtime # Cache whether the confirmation has been performed. _confirmed = False supports_transactions = None supports_stddev = None def __init__(self, connection): self.connection = connection def confirm(self): "Perform manual checks of any database features that might vary between installs" self._confirmed = True self.supports_transactions = self._supports_transactions() self.supports_stddev = self._supports_stddev() def _supports_transactions(self): "Confirm support for transactions" cursor = self.connection.cursor() cursor.execute('CREATE TABLE ROLLBACK_TEST (X INT)') self.connection._commit() cursor.execute('INSERT INTO ROLLBACK_TEST (X) VALUES (8)') self.connection._rollback() cursor.execute('SELECT COUNT(X) FROM ROLLBACK_TEST') count, = cursor.fetchone() cursor.execute('DROP TABLE ROLLBACK_TEST') self.connection._commit() return count == 0 def _supports_stddev(self): "Confirm support for STDDEV and related stats functions" class StdDevPop(object): sql_function = 'STDDEV_POP' try: self.connection.ops.check_aggregate_support(StdDevPop()) except NotImplementedError: self.supports_stddev = False class BaseDatabaseOperations(object): """ This class encapsulates all backend-specific differences, such as the way a backend performs ordering or calculates the ID of a recently-inserted row. """ compiler_module = "django.db.models.sql.compiler" def __init__(self): self._cache = {} def autoinc_sql(self, table, column): """ Returns any SQL needed to support auto-incrementing primary keys, or None if no SQL is necessary. This SQL is executed when a table is created. """ return None def date_extract_sql(self, lookup_type, field_name): """ Given a lookup_type of 'year', 'month' or 'day', returns the SQL that extracts a value from the given date field field_name. """ raise NotImplementedError() def date_trunc_sql(self, lookup_type, field_name): """ Given a lookup_type of 'year', 'month' or 'day', returns the SQL that truncates the given date field field_name to a DATE object with only the given specificity. """ raise NotImplementedError() def datetime_cast_sql(self): """ Returns the SQL necessary to cast a datetime value so that it will be retrieved as a Python datetime object instead of a string. This SQL should include a '%s' in place of the field's name. """ return "%s" def deferrable_sql(self): """ Returns the SQL necessary to make a constraint "initially deferred" during a CREATE TABLE statement. """ return '' def drop_foreignkey_sql(self): """ Returns the SQL command that drops a foreign key. """ return "DROP CONSTRAINT" def drop_sequence_sql(self, table): """ Returns any SQL necessary to drop the sequence for the given table. Returns None if no SQL is necessary. """ return None def fetch_returned_insert_id(self, cursor): """ Given a cursor object that has just performed an INSERT...RETURNING statement into a table that has an auto-incrementing ID, returns the newly created ID. """ return cursor.fetchone()[0] def field_cast_sql(self, db_type): """ Given a column type (e.g. 'BLOB', 'VARCHAR'), returns the SQL necessary to cast it before using it in a WHERE statement. Note that the resulting string should contain a '%s' placeholder for the column being searched against. """ return '%s' def force_no_ordering(self): """ Returns a list used in the "ORDER BY" clause to force no ordering at all. Returning an empty list means that nothing will be included in the ordering. """ return [] def fulltext_search_sql(self, field_name): """ Returns the SQL WHERE clause to use in order to perform a full-text search of the given field_name. Note that the resulting string should contain a '%s' placeholder for the value being searched against. """ raise NotImplementedError('Full-text search is not implemented for this database backend') def last_executed_query(self, cursor, sql, params): """ Returns a string of the query last executed by the given cursor, with placeholders replaced with actual values. `sql` is the raw query containing placeholders, and `params` is the sequence of parameters. These are used by default, but this method exists for database backends to provide a better implementation according to their own quoting schemes. """ from django.utils.encoding import smart_unicode, force_unicode # Convert params to contain Unicode values. to_unicode = lambda s: force_unicode(s, strings_only=True, errors='replace') if isinstance(params, (list, tuple)): u_params = tuple([to_unicode(val) for val in params]) else: u_params = dict([(to_unicode(k), to_unicode(v)) for k, v in params.items()]) return smart_unicode(sql) % u_params def last_insert_id(self, cursor, table_name, pk_name): """ Given a cursor object that has just performed an INSERT statement into a table that has an auto-incrementing ID, returns the newly created ID. This method also receives the table name and the name of the primary-key column. """ return cursor.lastrowid def lookup_cast(self, lookup_type): """ Returns the string to use in a query when performing lookups ("contains", "like", etc). The resulting string should contain a '%s' placeholder for the column being searched against. """ return "%s" def max_in_list_size(self): """ Returns the maximum number of items that can be passed in a single 'IN' list condition, or None if the backend does not impose a limit. """ return None def max_name_length(self): """ Returns the maximum length of table and column names, or None if there is no limit. """ return None def no_limit_value(self): """ Returns the value to use for the LIMIT when we are wanting "LIMIT infinity". Returns None if the limit clause can be omitted in this case. """ raise NotImplementedError def pk_default_value(self): """ Returns the value to use during an INSERT statement to specify that the field should use its default value. """ return 'DEFAULT' def process_clob(self, value): """ Returns the value of a CLOB column, for backends that return a locator object that requires additional processing. """ return value def return_insert_id(self): """ For backends that support returning the last insert ID as part of an insert query, this method returns the SQL and params to append to the INSERT query. The returned fragment should contain a format string to hold the appropriate column. """ pass def compiler(self, compiler_name): """ Returns the SQLCompiler class corresponding to the given name, in the namespace corresponding to the `compiler_module` attribute on this backend. """ if compiler_name not in self._cache: self._cache[compiler_name] = getattr( import_module(self.compiler_module), compiler_name ) return self._cache[compiler_name] def quote_name(self, name): """ Returns a quoted version of the given table, index or column name. Does not quote the given name if it's already been quoted. """ raise NotImplementedError() def random_function_sql(self): """ Returns a SQL expression that returns a random value. """ return 'RANDOM()' def regex_lookup(self, lookup_type): """ Returns the string to use in a query when performing regular expression lookups (using "regex" or "iregex"). The resulting string should contain a '%s' placeholder for the column being searched against. If the feature is not supported (or part of it is not supported), a NotImplementedError exception can be raised. """ raise NotImplementedError def savepoint_create_sql(self, sid): """ Returns the SQL for starting a new savepoint. Only required if the "uses_savepoints" feature is True. The "sid" parameter is a string for the savepoint id. """ raise NotImplementedError def savepoint_commit_sql(self, sid): """ Returns the SQL for committing the given savepoint. """ raise NotImplementedError def savepoint_rollback_sql(self, sid): """ Returns the SQL for rolling back the given savepoint. """ raise NotImplementedError def sql_flush(self, style, tables, sequences): """ Returns a list of SQL statements required to remove all data from the given database tables (without actually removing the tables themselves). The `style` argument is a Style object as returned by either color_style() or no_style() in django.core.management.color. """ raise NotImplementedError() def sequence_reset_sql(self, style, model_list): """ Returns a list of the SQL statements required to reset sequences for the given models. The `style` argument is a Style object as returned by either color_style() or no_style() in django.core.management.color. """ return [] # No sequence reset required by default. def start_transaction_sql(self): """ Returns the SQL statement required to start a transaction. """ return "BEGIN;" def end_transaction_sql(self, success=True): if not success: return "ROLLBACK;" return "COMMIT;" def tablespace_sql(self, tablespace, inline=False): """ Returns the SQL that will be appended to tables or rows to define a tablespace. Returns '' if the backend doesn't use tablespaces. """ return '' def prep_for_like_query(self, x): """Prepares a value for use in a LIKE query.""" from django.utils.encoding import smart_unicode return smart_unicode(x).replace("\\", "\\\\").replace("%", "\%").replace("_", "\_") # Same as prep_for_like_query(), but called for "iexact" matches, which # need not necessarily be implemented using "LIKE" in the backend. prep_for_iexact_query = prep_for_like_query def value_to_db_auto(self, value): """ Transform a value to an object compatible with the auto field required by the backend driver for auto columns. """ if value is None: return None return int(value) def value_to_db_date(self, value): """ Transform a date value to an object compatible with what is expected by the backend driver for date columns. """ if value is None: return None return datetime_safe.new_date(value).strftime('%Y-%m-%d') def value_to_db_datetime(self, value): """ Transform a datetime value to an object compatible with what is expected by the backend driver for datetime columns. """ if value is None: return None return unicode(value) def value_to_db_time(self, value): """ Transform a datetime value to an object compatible with what is expected by the backend driver for time columns. """ if value is None: return None return unicode(value) def value_to_db_decimal(self, value, max_digits, decimal_places): """ Transform a decimal.Decimal value to an object compatible with what is expected by the backend driver for decimal (numeric) columns. """ if value is None: return None return util.format_number(value, max_digits, decimal_places) def year_lookup_bounds(self, value): """ Returns a two-elements list with the lower and upper bound to be used with a BETWEEN operator to query a field value using a year lookup `value` is an int, containing the looked-up year. """ first = '%s-01-01 00:00:00' second = '%s-12-31 23:59:59.999999' return [first % value, second % value] def year_lookup_bounds_for_date_field(self, value): """ Returns a two-elements list with the lower and upper bound to be used with a BETWEEN operator to query a DateField value using a year lookup `value` is an int, containing the looked-up year. By default, it just calls `self.year_lookup_bounds`. Some backends need this hook because on their DB date fields can't be compared to values which include a time part. """ return self.year_lookup_bounds(value) def convert_values(self, value, field): """Coerce the value returned by the database backend into a consistent type that is compatible with the field type. """ internal_type = field.get_internal_type() if internal_type == 'DecimalField': return value elif internal_type and internal_type.endswith('IntegerField') or internal_type == 'AutoField': return int(value) elif internal_type in ('DateField', 'DateTimeField', 'TimeField'): return value # No field, or the field isn't known to be a decimal or integer # Default to a float return float(value) def check_aggregate_support(self, aggregate_func): """Check that the backend supports the provided aggregate This is used on specific backends to rule out known aggregates that are known to have faulty implementations. If the named aggregate function has a known problem, the backend should raise NotImplemented. """ pass def combine_expression(self, connector, sub_expressions): """Combine a list of subexpressions into a single expression, using the provided connecting operator. This is required because operators can vary between backends (e.g., Oracle with %% and &) and between subexpression types (e.g., date expressions) """ conn = ' %s ' % connector return conn.join(sub_expressions) class BaseDatabaseIntrospection(object): """ This class encapsulates all backend-specific introspection utilities """ data_types_reverse = {} def __init__(self, connection): self.connection = connection def get_field_type(self, data_type, description): """Hook for a database backend to use the cursor description to match a Django field type to a database column. For Oracle, the column data_type on its own is insufficient to distinguish between a FloatField and IntegerField, for example.""" return self.data_types_reverse[data_type] def table_name_converter(self, name): """Apply a conversion to the name for the purposes of comparison. The default table name converter is for case sensitive comparison. """ return name def table_names(self): "Returns a list of names of all tables that exist in the database." cursor = self.connection.cursor() return self.get_table_list(cursor) def django_table_names(self, only_existing=False): """ Returns a list of all table names that have associated Django models and are in INSTALLED_APPS. If only_existing is True, the resulting list will only include the tables that actually exist in the database. """ from django.db import models, router tables = set() for app in models.get_apps(): for model in models.get_models(app): if not model._meta.managed: continue if not router.allow_syncdb(self.connection.alias, model): continue tables.add(model._meta.db_table) tables.update([f.m2m_db_table() for f in model._meta.local_many_to_many]) if only_existing: existing_tables = self.table_names() tables = [ t for t in tables if self.table_name_converter(t) in existing_tables ] return tables def installed_models(self, tables): "Returns a set of all models represented by the provided list of table names." from django.db import models, router all_models = [] for app in models.get_apps(): for model in models.get_models(app): if router.allow_syncdb(self.connection.alias, model): all_models.append(model) tables = map(self.table_name_converter, tables) return set([ m for m in all_models if self.table_name_converter(m._meta.db_table) in tables ]) def sequence_list(self): "Returns a list of information about all DB sequences for all models in all apps." from django.db import models, router apps = models.get_apps() sequence_list = [] for app in apps: for model in models.get_models(app): if not model._meta.managed: continue if not router.allow_syncdb(self.connection.alias, model): continue for f in model._meta.local_fields: if isinstance(f, models.AutoField): sequence_list.append({'table': model._meta.db_table, 'column': f.column}) break # Only one AutoField is allowed per model, so don't bother continuing. for f in model._meta.local_many_to_many: # If this is an m2m using an intermediate table, # we don't need to reset the sequence. if f.rel.through is None: sequence_list.append({'table': f.m2m_db_table(), 'column': None}) return sequence_list class BaseDatabaseClient(object): """ This class encapsulates all backend-specific methods for opening a client shell. """ # This should be a string representing the name of the executable # (e.g., "psql"). Subclasses must override this. executable_name = None def __init__(self, connection): # connection is an instance of BaseDatabaseWrapper. self.connection = connection def runshell(self): raise NotImplementedError() class BaseDatabaseValidation(object): """ This class encapsualtes all backend-specific model validation. """ def __init__(self, connection): self.connection = connection def validate_field(self, errors, opts, f): "By default, there is no backend-specific validation" pass
ajibawa-2023/Python-Code-Large/train/row_99056
332
706
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_99056:Import_L1_C0", "label": "decimal import decimal", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0014, 0.0014, 0, 0.66, 0.0, 349, 0, 1, 0, 0, 349, 0, 0], "semantic": {"name": "decimal", "arg_names": [], "import_names": ["decimal"], "rhs_call_name": "", "annotation": ""}, "snippet": "import decimal"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99056:ImportFrom_L2_C0", "label": "from threading import local", "type": "import", "loc": [2, 2], "level": 0, "parent": null, "vector": [1, 0, 0.0028, 0.0014, 0, 0.66, 0.0909, 83, 0, 1, 0, 0, 83, 0, 0], "semantic": {"name": "threading", "arg_names": [], "import_names": ["local"], "rhs_call_name": "", "annotation": ""}, "snippet": "from threading import local"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99056:ImportFrom_L4_C0", "label": "from django.db import DEFAULT_DB_ALIAS", "type": "import", "loc": [4, 4], "level": 0, "parent": null, "vector": [1, 0, 0.0057, 0.0014, 0, 0.66, 0.1818, 40, 0, 1, 0, 0, 40, 0, 0], "semantic": {"name": "django.db", "arg_names": [], "import_names": ["DEFAULT_DB_ALIAS"], "rhs_call_name": "", "annotation": ""}, "snippet": "from django.db import DEFAULT_DB_ALIAS"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99056:ImportFrom_L5_C0", "label": "from django.db.backends import util", "type": "import", "loc": [5, 5], "level": 0, "parent": null, "vector": [1, 0, 0.0071, 0.0014, 0, 0.66, 0.2727, 981, 0, 1, 0, 0, 981, 0, 0], "semantic": {"name": "django.db.backends", "arg_names": [], "import_names": ["util"], "rhs_call_name": "", "annotation": ""}, "snippet": "from django.db.backends import util"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99056:ImportFrom_L6_C0", "label": "from django.utils import datetime_safe", "type": "import", "loc": [6, 6], "level": 0, "parent": null, "vector": [1, 0, 0.0085, 0.0014, 0, 0.66, 0.3636, 944, 0, 1, 0, 0, 944, 0, 0], "semantic": {"name": "django.utils", "arg_names": [], "import_names": ["datetime_safe"], "rhs_call_name": "", "annotation": ""}, "snippet": "from django.utils import datetime_safe"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99056:ImportFrom_L7_C0", "label": "from django.utils.importlib import import_module", "type": "import", "loc": [7, 7], "level": 0, "parent": null, "vector": [1, 0, 0.0099, 0.0014, 0, 0.66, 0.4545, 118, 0, 1, 0, 0, 118, 0, 0], "semantic": {"name": "django.utils.importlib", "arg_names": [], "import_names": ["import_module"], "rhs_call_name": "", "annotation": ""}, "snippet": "from django.utils.importlib import import_module"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99056:ClassDef_L9_C0", "label": "BaseDatabaseWrapper", "type": "class", "loc": [9, 84], "level": 0, "parent": null, "vector": [3, 0, 0.0659, 0.1076, 0, 0.66, 0.5455, 720, 0, 13, 0, 0, 605, 0, 15], "semantic": {"name": "BaseDatabaseWrapper", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class BaseDatabaseWrapper(local):\n \"\"\"\n Represents a database connection.\n \"\"\"\n ops = None\n\n def __init__(self, settings_dict, alias=DEFAULT_DB_ALIAS):\n # `settings_dict` should be a dictionary containing keys such as"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99056:Expr_L10_C4", "label": "expression", "type": "expression", "loc": [10, 12], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99056:ClassDef_L9_C0", "vector": [8, 1, 0.0156, 0.0042, 1, 0.72, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"\n Represents a database connection.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99056:Assign_L13_C4", "label": "ops =", "type": "assigned_variable", "loc": [13, 13], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99056:ClassDef_L9_C0", "vector": [14, 1, 0.0184, 0.0014, 1, 0.72, 0.0714, 212, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "ops", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ops = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99056:FunctionDef_L15_C4", "label": "__init__", "type": "function", "loc": [15, 24], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99056:ClassDef_L9_C0", "vector": [2, 1, 0.0276, 0.0142, 1, 0.72, 0.1429, 555, 0, 3, 0, 0, 0, 0, 0], "semantic": {"name": "__init__", "arg_names": ["self", "settings_dict", "alias"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, settings_dict, alias=DEFAULT_DB_ALIAS):\n # `settings_dict` should be a dictionary containing keys such as\n # NAME, USER, etc. It's called `settings_dict` instead of `settings`\n # to disambiguate it from Django settings modules.\n self.connection = None\n self.queries = []\n self.settings_dict = settings_dict\n self.alias = alias"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99056:Assign_L19_C8", "label": "self.connection =", "type": "assigned_variable", "loc": [19, 19], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99056:FunctionDef_L15_C4", "vector": [14, 2, 0.0269, 0.0014, 2, 0.56, 0.0, 685, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "self.connection", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.connection = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99056:Assign_L20_C8", "label": "self.queries =", "type": "assigned_variable", "loc": [20, 20], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99056:FunctionDef_L15_C4", "vector": [14, 2, 0.0283, 0.0014, 2, 0.56, 0.2, 239, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "self.queries", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.queries = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99056:Assign_L21_C8", "label": "self.settings_dict =", "type": "assigned_variable", "loc": [21, 21], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99056:FunctionDef_L15_C4", "vector": [14, 2, 0.0297, 0.0014, 2, 0.56, 0.4, 559, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.settings_dict", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.settings_dict = settings_dict"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99056:Assign_L22_C8", "label": "self.alias =", "type": "assigned_variable", "loc": [22, 22], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99056:FunctionDef_L15_C4", "vector": [14, 2, 0.0312, 0.0014, 2, 0.56, 0.6, 503, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.alias", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.alias = alias"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99056:Assign_L23_C8", "label": "self.vendor =", "type": "assigned_variable", "loc": [23, 23], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99056:FunctionDef_L15_C4", "vector": [14, 2, 0.0326, 0.0014, 2, 0.56, 0.8, 933, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "self.vendor", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.vendor = 'unknown'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99056:Assign_L24_C8", "label": "self.use_debug_cursor =", "type": "assigned_variable", "loc": [24, 24], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99056:FunctionDef_L15_C4", "vector": [14, 2, 0.034, 0.0014, 2, 0.56, 1.0, 318, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "self.use_debug_cursor", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.use_debug_cursor = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99056:FunctionDef_L26_C4", "label": "__eq__", "type": "function", "loc": [26, 27], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99056:ClassDef_L9_C0", "vector": [2, 1, 0.0375, 0.0028, 1, 0.72, 0.2143, 763, 0, 2, 1, 0, 0, 0, 0], "semantic": {"name": "__eq__", "arg_names": ["self", "other"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __eq__(self, other):\n return self.settings_dict == other.settings_dict"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99056:Return_L27_C8", "label": "return", "type": "return", "loc": [27, 27], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99056:FunctionDef_L26_C4", "vector": [13, 2, 0.0382, 0.0014, 2, 0.6, 0.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self.settings_dict == other.settings_dict"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99056:FunctionDef_L29_C4", "label": "__ne__", "type": "function", "loc": [29, 30], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99056:ClassDef_L9_C0", "vector": [2, 1, 0.0418, 0.0028, 1, 0.72, 0.2857, 254, 0, 2, 1, 0, 0, 0, 0], "semantic": {"name": "__ne__", "arg_names": ["self", "other"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __ne__(self, other):\n return not self == other"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99056:Return_L30_C8", "label": "return", "type": "return", "loc": [30, 30], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99056:FunctionDef_L29_C4", "vector": [13, 2, 0.0425, 0.0014, 2, 0.1, 0.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return not self == other"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99056:FunctionDef_L32_C4", "label": "_commit", "type": "function", "loc": [32, 34], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99056:ClassDef_L9_C0", "vector": [2, 1, 0.0467, 0.0042, 1, 0.72, 0.3571, 361, 0, 1, 1, 0, 0, 0, 1], "semantic": {"name": "_commit", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _commit(self):\n if self.connection is not None:\n return self.connection.commit()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99056:If_L33_C8", "label": "if", "type": "if", "loc": [33, 34], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99056:FunctionDef_L32_C4", "vector": [4, 2, 0.0475, 0.0028, 2, 0.77, 0.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self.connection is not None:\n return self.connection.commit()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99056:Return_L34_C12", "label": "return", "type": "return", "loc": [34, 34], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99056:If_L33_C8", "vector": [13, 3, 0.0482, 0.0014, 3, 0.98, 0.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self.connection.commit()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99056:FunctionDef_L36_C4", "label": "_rollback", "type": "function", "loc": [36, 38], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99056:ClassDef_L9_C0", "vector": [2, 1, 0.0524, 0.0042, 1, 0.72, 0.4286, 47, 0, 1, 1, 0, 0, 0, 1], "semantic": {"name": "_rollback", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _rollback(self):\n if self.connection is not None:\n return self.connection.rollback()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99056:If_L37_C8", "label": "if", "type": "if", "loc": [37, 38], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99056:FunctionDef_L36_C4", "vector": [4, 2, 0.0531, 0.0028, 2, 0.03, 0.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self.connection is not None:\n return self.connection.rollback()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99056:Return_L38_C12", "label": "return", "type": "return", "loc": [38, 38], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99056:If_L37_C8", "vector": [13, 3, 0.0538, 0.0014, 3, 0.24, 0.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self.connection.rollback()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99056:FunctionDef_L40_C4", "label": "_enter_transaction_management", "type": "function", "loc": [40, 45], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99056:ClassDef_L9_C0", "vector": [2, 1, 0.0602, 0.0085, 1, 0.72, 0.5, 53, 0, 2, 0, 0, 0, 0, 0], "semantic": {"name": "_enter_transaction_management", "arg_names": ["self", "managed"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _enter_transaction_management(self, managed):\n \"\"\"\n A hook for backend-specific changes required when entering manual\n transaction handling.\n \"\"\"\n pass"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99056:Expr_L41_C8", "label": "expression", "type": "expression", "loc": [41, 44], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99056:FunctionDef_L40_C4", "vector": [8, 2, 0.0602, 0.0057, 2, 0.75, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"\n A hook for backend-specific changes required when entering manual\n transaction handling.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99056:FunctionDef_L47_C4", "label": "_leave_transaction_management", "type": "function", "loc": [47, 53], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99056:ClassDef_L9_C0", "vector": [2, 1, 0.0708, 0.0099, 1, 0.72, 0.5714, 337, 0, 2, 0, 0, 0, 0, 0], "semantic": {"name": "_leave_transaction_management", "arg_names": ["self", "managed"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _leave_transaction_management(self, managed):\n \"\"\"\n A hook for backend-specific changes required when leaving manual\n transaction handling. Will usually be implemented only when\n _enter_transaction_management() is also required.\n \"\"\"\n pass"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99056:Expr_L48_C8", "label": "expression", "type": "expression", "loc": [48, 52], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99056:FunctionDef_L47_C4", "vector": [8, 2, 0.0708, 0.0071, 2, 0.94, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"\n A hook for backend-specific changes required when leaving manual\n transaction handling. Will usually be implemented only when\n _enter_transaction_management() is also required.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99056:FunctionDef_L55_C4", "label": "_savepoint", "type": "function", "loc": [55, 58], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99056:ClassDef_L9_C0", "vector": [2, 1, 0.08, 0.0057, 1, 0.72, 0.6429, 801, 0, 2, 0, 0, 0, 0, 3], "semantic": {"name": "_savepoint", "arg_names": ["self", "sid"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _savepoint(self, sid):\n if not self.features.uses_savepoints:\n return\n self.cursor().execute(self.ops.savepoint_create_sql(sid))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99056:If_L56_C8", "label": "if", "type": "if", "loc": [56, 57], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99056:FunctionDef_L55_C4", "vector": [4, 2, 0.08, 0.0028, 2, 0.22, 0.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not self.features.uses_savepoints:\n return"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99056:Return_L57_C12", "label": "return", "type": "return", "loc": [57, 57], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99056:If_L56_C8", "vector": [13, 3, 0.0807, 0.0014, 3, 0.7, 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_99056:Expr_L58_C8", "label": "execute()", "type": "expression", "loc": [58, 58], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99056:FunctionDef_L55_C4", "vector": [8, 2, 0.0822, 0.0014, 2, 0.22, 1.0, 569, 3, 1, 0, 0, 0, 0, 3], "semantic": {"name": "execute", "arg_names": [], "import_names": [], "rhs_call_name": "execute", "annotation": ""}, "snippet": " self.cursor().execute(self.ops.savepoint_create_sql(sid))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99056:FunctionDef_L60_C4", "label": "_savepoint_rollback", "type": "function", "loc": [60, 63], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99056:ClassDef_L9_C0", "vector": [2, 1, 0.0871, 0.0057, 1, 0.72, 0.7143, 508, 0, 2, 0, 0, 0, 0, 3], "semantic": {"name": "_savepoint_rollback", "arg_names": ["self", "sid"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _savepoint_rollback(self, sid):\n if not self.features.uses_savepoints:\n return\n self.cursor().execute(self.ops.savepoint_rollback_sql(sid))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99056:If_L61_C8", "label": "if", "type": "if", "loc": [61, 62], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99056:FunctionDef_L60_C4", "vector": [4, 2, 0.0871, 0.0028, 2, 0.05, 0.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not self.features.uses_savepoints:\n return"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99056:Return_L62_C12", "label": "return", "type": "return", "loc": [62, 62], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99056:If_L61_C8", "vector": [13, 3, 0.0878, 0.0014, 3, 0.13, 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_99056:Expr_L63_C8", "label": "execute()", "type": "expression", "loc": [63, 63], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99056:FunctionDef_L60_C4", "vector": [8, 2, 0.0892, 0.0014, 2, 0.05, 1.0, 569, 3, 1, 0, 0, 0, 0, 3], "semantic": {"name": "execute", "arg_names": [], "import_names": [], "rhs_call_name": "execute", "annotation": ""}, "snippet": " self.cursor().execute(self.ops.savepoint_rollback_sql(sid))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99056:FunctionDef_L65_C4", "label": "_savepoint_commit", "type": "function", "loc": [65, 68], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99056:ClassDef_L9_C0", "vector": [2, 1, 0.0942, 0.0057, 1, 0.72, 0.7857, 735, 0, 2, 0, 0, 0, 0, 3], "semantic": {"name": "_savepoint_commit", "arg_names": ["self", "sid"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _savepoint_commit(self, sid):\n if not self.features.uses_savepoints:\n return\n self.cursor().execute(self.ops.savepoint_commit_sql(sid))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99056:If_L66_C8", "label": "if", "type": "if", "loc": [66, 67], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99056:FunctionDef_L65_C4", "vector": [4, 2, 0.0942, 0.0028, 2, 0.92, 0.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not self.features.uses_savepoints:\n return"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99056:Return_L67_C12", "label": "return", "type": "return", "loc": [67, 67], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99056:If_L66_C8", "vector": [13, 3, 0.0949, 0.0014, 3, 0.33, 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_99056:Expr_L68_C8", "label": "execute()", "type": "expression", "loc": [68, 68], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99056:FunctionDef_L65_C4", "vector": [8, 2, 0.0963, 0.0014, 2, 0.92, 1.0, 569, 3, 1, 0, 0, 0, 0, 3], "semantic": {"name": "execute", "arg_names": [], "import_names": [], "rhs_call_name": "execute", "annotation": ""}, "snippet": " self.cursor().execute(self.ops.savepoint_commit_sql(sid))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99056:FunctionDef_L70_C4", "label": "close", "type": "function", "loc": [70, 73], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99056:ClassDef_L9_C0", "vector": [2, 1, 0.1013, 0.0057, 1, 0.72, 0.8571, 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 self.connection is not None:\n self.connection.close()\n self.connection = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99056:If_L71_C8", "label": "if", "type": "if", "loc": [71, 73], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99056:FunctionDef_L70_C4", "vector": [4, 2, 0.102, 0.0042, 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.connection is not None:\n self.connection.close()\n self.connection = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99056:Expr_L72_C12", "label": "close()", "type": "expression", "loc": [72, 72], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99056:If_L71_C8", "vector": [8, 3, 0.102, 0.0014, 3, 0.57, 0.0, 77, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "close", "arg_names": [], "import_names": [], "rhs_call_name": "close", "annotation": ""}, "snippet": " self.connection.close()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99056:Assign_L73_C12", "label": "self.connection =", "type": "assigned_variable", "loc": [73, 73], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99056:If_L71_C8", "vector": [14, 3, 0.1034, 0.0014, 3, 0.57, 1.0, 685, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "self.connection", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.connection = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99056:FunctionDef_L75_C4", "label": "cursor", "type": "function", "loc": [75, 81], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99056:ClassDef_L9_C0", "vector": [2, 1, 0.1105, 0.0099, 1, 0.72, 0.9286, 231, 0, 1, 1, 0, 0, 0, 2], "semantic": {"name": "cursor", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def cursor(self):\n from django.conf import settings\n cursor = self._cursor()\n if (self.use_debug_cursor or\n (self.use_debug_cursor is None and settings.DEBUG)):\n return self.make_debug_cursor(cursor)\n return cursor"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99056:ImportFrom_L76_C8", "label": "from django.conf import settings", "type": "import", "loc": [76, 76], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99056:FunctionDef_L75_C4", "vector": [1, 2, 0.1076, 0.0014, 2, 0.79, 0.0, 128, 0, 1, 0, 0, 128, 0, 0], "semantic": {"name": "django.conf", "arg_names": [], "import_names": ["settings"], "rhs_call_name": "", "annotation": ""}, "snippet": " from django.conf import settings"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99056:Assign_L77_C8", "label": "cursor = _cursor()", "type": "assigned_variable", "loc": [77, 77], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99056:FunctionDef_L75_C4", "vector": [14, 2, 0.1091, 0.0014, 2, 0.79, 0.3333, 231, 3, 0, 0, 0, 670, 10, 1], "semantic": {"name": "cursor", "arg_names": [], "import_names": [], "rhs_call_name": "_cursor", "annotation": ""}, "snippet": " cursor = self._cursor()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99056:If_L78_C8", "label": "if", "type": "if", "loc": [78, 80], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99056:FunctionDef_L75_C4", "vector": [4, 2, 0.1119, 0.0042, 2, 0.79, 0.6667, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if (self.use_debug_cursor or\n (self.use_debug_cursor is None and settings.DEBUG)):\n return self.make_debug_cursor(cursor)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99056:Return_L80_C12", "label": "return", "type": "return", "loc": [80, 80], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99056:If_L78_C8", "vector": [13, 3, 0.1133, 0.0014, 3, 0.32, 0.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self.make_debug_cursor(cursor)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99056:Return_L81_C8", "label": "return", "type": "return", "loc": [81, 81], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99056:FunctionDef_L75_C4", "vector": [13, 2, 0.1147, 0.0014, 2, 0.79, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return cursor"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99056:FunctionDef_L83_C4", "label": "make_debug_cursor", "type": "function", "loc": [83, 84], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99056:ClassDef_L9_C0", "vector": [2, 1, 0.1183, 0.0028, 1, 0.72, 1.0, 475, 0, 2, 1, 0, 0, 0, 1], "semantic": {"name": "make_debug_cursor", "arg_names": ["self", "cursor"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def make_debug_cursor(self, cursor):\n return util.CursorDebugWrapper(cursor, self)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99056:Return_L84_C8", "label": "return", "type": "return", "loc": [84, 84], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99056:FunctionDef_L83_C4", "vector": [13, 2, 0.119, 0.0014, 2, 0.72, 0.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return util.CursorDebugWrapper(cursor, self)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99056:ClassDef_L86_C0", "label": "BaseDatabaseFeatures", "type": "class", "loc": [86, 195], "level": 0, "parent": null, "vector": [3, 0, 0.199, 0.1558, 0, 0.66, 0.6364, 581, 0, 4, 0, 0, 186, 0, 13], "semantic": {"name": "BaseDatabaseFeatures", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class BaseDatabaseFeatures(object):\n allows_group_by_pk = False\n # True if django.db.backend.utils.typecast_timestamp is used on values\n # returned from dates() calls.\n needs_datetime_string_cast = True\n empty_fetchmany_value = []\n update_can_self_select = True\n"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99056:Assign_L87_C4", "label": "allows_group_by_pk =", "type": "assigned_variable", "loc": [87, 87], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99056:ClassDef_L86_C0", "vector": [14, 1, 0.1232, 0.0014, 1, 0.29, 0.0, 508, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "allows_group_by_pk", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " allows_group_by_pk = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99056:Assign_L90_C4", "label": "needs_datetime_string_cast =", "type": "assigned_variable", "loc": [90, 90], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99056:ClassDef_L86_C0", "vector": [14, 1, 0.1275, 0.0014, 1, 0.29, 0.0286, 93, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "needs_datetime_string_cast", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " needs_datetime_string_cast = True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99056:Assign_L91_C4", "label": "empty_fetchmany_value =", "type": "assigned_variable", "loc": [91, 91], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99056:ClassDef_L86_C0", "vector": [14, 1, 0.1289, 0.0014, 1, 0.29, 0.0571, 614, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "empty_fetchmany_value", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " empty_fetchmany_value = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99056:Assign_L92_C4", "label": "update_can_self_select =", "type": "assigned_variable", "loc": [92, 92], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99056:ClassDef_L86_C0", "vector": [14, 1, 0.1303, 0.0014, 1, 0.29, 0.0857, 953, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "update_can_self_select", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " update_can_self_select = True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99056:Assign_L95_C4", "label": "interprets_empty_strings_as_nulls =", "type": "assigned_variable", "loc": [95, 95], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99056:ClassDef_L86_C0", "vector": [14, 1, 0.1346, 0.0014, 1, 0.29, 0.1143, 861, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "interprets_empty_strings_as_nulls", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " interprets_empty_strings_as_nulls = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99056:Assign_L97_C4", "label": "can_use_chunked_reads =", "type": "assigned_variable", "loc": [97, 97], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99056:ClassDef_L86_C0", "vector": [14, 1, 0.1374, 0.0014, 1, 0.29, 0.1429, 397, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "can_use_chunked_reads", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " can_use_chunked_reads = True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99056:Assign_L98_C4", "label": "can_return_id_from_insert =", "type": "assigned_variable", "loc": [98, 98], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99056:ClassDef_L86_C0", "vector": [14, 1, 0.1388, 0.0014, 1, 0.29, 0.1714, 689, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "can_return_id_from_insert", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " can_return_id_from_insert = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99056:Assign_L99_C4", "label": "uses_autocommit =", "type": "assigned_variable", "loc": [99, 99], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99056:ClassDef_L86_C0", "vector": [14, 1, 0.1402, 0.0014, 1, 0.29, 0.2, 914, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "uses_autocommit", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " uses_autocommit = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99056:Assign_L100_C4", "label": "uses_savepoints =", "type": "assigned_variable", "loc": [100, 100], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99056:ClassDef_L86_C0", "vector": [14, 1, 0.1416, 0.0014, 1, 0.29, 0.2286, 666, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "uses_savepoints", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " uses_savepoints = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99056:Assign_L104_C4", "label": "related_fields_match_type =", "type": "assigned_variable", "loc": [104, 104], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99056:ClassDef_L86_C0", "vector": [14, 1, 0.1473, 0.0014, 1, 0.29, 0.2571, 512, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "related_fields_match_type", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " related_fields_match_type = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99056:Assign_L105_C4", "label": "allow_sliced_subqueries =", "type": "assigned_variable", "loc": [105, 105], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99056:ClassDef_L86_C0", "vector": [14, 1, 0.1487, 0.0014, 1, 0.29, 0.2857, 819, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "allow_sliced_subqueries", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " allow_sliced_subqueries = True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99056:Assign_L106_C4", "label": "distinguishes_insert_from_update =", "type": "assigned_variable", "loc": [106, 106], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99056:ClassDef_L86_C0", "vector": [14, 1, 0.1501, 0.0014, 1, 0.29, 0.3143, 659, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "distinguishes_insert_from_update", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " distinguishes_insert_from_update = True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99056:Assign_L107_C4", "label": "supports_deleting_related_objects =", "type": "assigned_variable", "loc": [107, 107], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99056:ClassDef_L86_C0", "vector": [14, 1, 0.1516, 0.0014, 1, 0.29, 0.3429, 150, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "supports_deleting_related_objects", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " supports_deleting_related_objects = True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99056:Assign_L111_C4", "label": "test_db_allows_multiple_connections =", "type": "assigned_variable", "loc": [111, 111], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99056:ClassDef_L86_C0", "vector": [14, 1, 0.1572, 0.0014, 1, 0.29, 0.3714, 571, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "test_db_allows_multiple_connections", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " test_db_allows_multiple_connections = True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99056:Assign_L114_C4", "label": "supports_unspecified_pk =", "type": "assigned_variable", "loc": [114, 114], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99056:ClassDef_L86_C0", "vector": [14, 1, 0.1615, 0.0014, 1, 0.29, 0.4, 49, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "supports_unspecified_pk", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " supports_unspecified_pk = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99056:Assign_L119_C4", "label": "supports_forward_references =", "type": "assigned_variable", "loc": [119, 119], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99056:ClassDef_L86_C0", "vector": [14, 1, 0.1686, 0.0014, 1, 0.29, 0.4286, 742, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "supports_forward_references", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " supports_forward_references = True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99056:Assign_L123_C4", "label": "requires_rollback_on_dirty_transaction =", "type": "assigned_variable", "loc": [123, 123], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99056:ClassDef_L86_C0", "vector": [14, 1, 0.1742, 0.0014, 1, 0.29, 0.4571, 492, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "requires_rollback_on_dirty_transaction", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " requires_rollback_on_dirty_transaction = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99056:Assign_L126_C4", "label": "supports_long_model_names =", "type": "assigned_variable", "loc": [126, 126], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99056:ClassDef_L86_C0", "vector": [14, 1, 0.1785, 0.0014, 1, 0.29, 0.4857, 942, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "supports_long_model_names", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " supports_long_model_names = True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99056:Assign_L129_C4", "label": "has_real_datatype =", "type": "assigned_variable", "loc": [129, 129], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99056:ClassDef_L86_C0", "vector": [14, 1, 0.1827, 0.0014, 1, 0.29, 0.5143, 419, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "has_real_datatype", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " has_real_datatype = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99056:Assign_L130_C4", "label": "supports_subqueries_in_group_by =", "type": "assigned_variable", "loc": [130, 130], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99056:ClassDef_L86_C0", "vector": [14, 1, 0.1841, 0.0014, 1, 0.29, 0.5429, 225, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "supports_subqueries_in_group_by", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " supports_subqueries_in_group_by = True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99056:Assign_L131_C4", "label": "supports_bitwise_or =", "type": "assigned_variable", "loc": [131, 131], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99056:ClassDef_L86_C0", "vector": [14, 1, 0.1856, 0.0014, 1, 0.29, 0.5714, 224, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "supports_bitwise_or", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " supports_bitwise_or = True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99056:Assign_L134_C4", "label": "supports_microsecond_precision =", "type": "assigned_variable", "loc": [134, 134], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99056:ClassDef_L86_C0", "vector": [14, 1, 0.1898, 0.0014, 1, 0.29, 0.6, 965, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "supports_microsecond_precision", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " supports_microsecond_precision = True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99056:Assign_L137_C4", "label": "supports_regex_backreferencing =", "type": "assigned_variable", "loc": [137, 137], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99056:ClassDef_L86_C0", "vector": [14, 1, 0.1941, 0.0014, 1, 0.29, 0.6286, 752, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "supports_regex_backreferencing", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " supports_regex_backreferencing = True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99056:Assign_L140_C4", "label": "supports_date_lookup_using_string =", "type": "assigned_variable", "loc": [140, 140], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99056:ClassDef_L86_C0", "vector": [14, 1, 0.1983, 0.0014, 1, 0.29, 0.6571, 725, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "supports_date_lookup_using_string", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " supports_date_lookup_using_string = True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99056:Assign_L143_C4", "label": "supports_timezones =", "type": "assigned_variable", "loc": [143, 143], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99056:ClassDef_L86_C0", "vector": [14, 1, 0.2025, 0.0014, 1, 0.29, 0.6857, 543, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "supports_timezones", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " supports_timezones = True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99056:Assign_L147_C4", "label": "requires_explicit_null_ordering_when_grouping =", "type": "assigned_variable", "loc": [147, 147], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99056:ClassDef_L86_C0", "vector": [14, 1, 0.2082, 0.0014, 1, 0.29, 0.7143, 603, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "requires_explicit_null_ordering_when_grouping", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " requires_explicit_null_ordering_when_grouping = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99056:Assign_L150_C4", "label": "supports_1000_query_parameters =", "type": "assigned_variable", "loc": [150, 150], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99056:ClassDef_L86_C0", "vector": [14, 1, 0.2125, 0.0014, 1, 0.29, 0.7429, 251, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "supports_1000_query_parameters", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " supports_1000_query_parameters = True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99056:Assign_L153_C4", "label": "allows_primary_key_0 =", "type": "assigned_variable", "loc": [153, 153], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99056:ClassDef_L86_C0", "vector": [14, 1, 0.2167, 0.0014, 1, 0.29, 0.7714, 807, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "allows_primary_key_0", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " allows_primary_key_0 = True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99056:Assign_L157_C4", "label": "can_defer_constraint_checks =", "type": "assigned_variable", "loc": [157, 157], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99056:ClassDef_L86_C0", "vector": [14, 1, 0.2224, 0.0014, 1, 0.29, 0.8, 637, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "can_defer_constraint_checks", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " can_defer_constraint_checks = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99056:Assign_L161_C4", "label": "_confirmed =", "type": "assigned_variable", "loc": [161, 161], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99056:ClassDef_L86_C0", "vector": [14, 1, 0.228, 0.0014, 1, 0.29, 0.8286, 614, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "_confirmed", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " _confirmed = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99056:Assign_L162_C4", "label": "supports_transactions =", "type": "assigned_variable", "loc": [162, 162], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99056:ClassDef_L86_C0", "vector": [14, 1, 0.2295, 0.0014, 1, 0.29, 0.8571, 4, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "supports_transactions", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " supports_transactions = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99056:Assign_L163_C4", "label": "supports_stddev =", "type": "assigned_variable", "loc": [163, 163], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99056:ClassDef_L86_C0", "vector": [14, 1, 0.2309, 0.0014, 1, 0.29, 0.8857, 352, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "supports_stddev", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " supports_stddev = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99056:FunctionDef_L165_C4", "label": "__init__", "type": "function", "loc": [165, 166], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99056:ClassDef_L86_C0", "vector": [2, 1, 0.2344, 0.0028, 1, 0.29, 0.9143, 555, 0, 2, 0, 0, 0, 0, 0], "semantic": {"name": "__init__", "arg_names": ["self", "connection"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, connection):\n self.connection = connection"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99056:Assign_L166_C8", "label": "self.connection =", "type": "assigned_variable", "loc": [166, 166], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99056:FunctionDef_L165_C4", "vector": [14, 2, 0.2351, 0.0014, 2, 0.28, 0.0, 685, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.connection", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.connection = connection"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99056:FunctionDef_L168_C4", "label": "confirm", "type": "function", "loc": [168, 172], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99056:ClassDef_L86_C0", "vector": [2, 1, 0.2408, 0.0071, 1, 0.29, 0.9429, 488, 0, 1, 0, 0, 0, 0, 2], "semantic": {"name": "confirm", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def confirm(self):\n \"Perform manual checks of any database features that might vary between installs\"\n self._confirmed = True\n self.supports_transactions = self._supports_transactions()\n self.supports_stddev = self._supports_stddev()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99056:Expr_L169_C8", "label": "expression", "type": "expression", "loc": [169, 169], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99056:FunctionDef_L168_C4", "vector": [8, 2, 0.2394, 0.0014, 2, 0.58, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"Perform manual checks of any database features that might vary between installs\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99056:Assign_L170_C8", "label": "self._confirmed =", "type": "assigned_variable", "loc": [170, 170], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99056:FunctionDef_L168_C4", "vector": [14, 2, 0.2408, 0.0014, 2, 0.58, 0.3333, 747, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "self._confirmed", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self._confirmed = True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99056:Assign_L171_C8", "label": "self.supports_transactions = _supports_transactions()", "type": "assigned_variable", "loc": [171, 171], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99056:FunctionDef_L168_C4", "vector": [14, 2, 0.2422, 0.0014, 2, 0.58, 0.6667, 120, 3, 0, 0, 0, 565, 10, 1], "semantic": {"name": "self.supports_transactions", "arg_names": [], "import_names": [], "rhs_call_name": "_supports_transactions", "annotation": ""}, "snippet": " self.supports_transactions = self._supports_transactions()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99056:Assign_L172_C8", "label": "self.supports_stddev = _supports_stddev()", "type": "assigned_variable", "loc": [172, 172], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99056:FunctionDef_L168_C4", "vector": [14, 2, 0.2436, 0.0014, 2, 0.58, 1.0, 167, 3, 0, 0, 0, 955, 10, 1], "semantic": {"name": "self.supports_stddev", "arg_names": [], "import_names": [], "rhs_call_name": "_supports_stddev", "annotation": ""}, "snippet": " self.supports_stddev = self._supports_stddev()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99056:FunctionDef_L174_C4", "label": "_supports_transactions", "type": "function", "loc": [174, 185], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99056:ClassDef_L86_C0", "vector": [2, 1, 0.2542, 0.017, 1, 0.29, 0.9714, 565, 0, 1, 1, 0, 0, 0, 9], "semantic": {"name": "_supports_transactions", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _supports_transactions(self):\n \"Confirm support for transactions\"\n cursor = self.connection.cursor()\n cursor.execute('CREATE TABLE ROLLBACK_TEST (X INT)')\n self.connection._commit()\n cursor.execute('INSERT INTO ROLLBACK_TEST (X) VALUES (8)')\n self.connection._rollback()\n cursor.execute('SELECT COUNT(X) FROM ROLLBACK_TEST')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99056:Expr_L175_C8", "label": "expression", "type": "expression", "loc": [175, 175], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99056:FunctionDef_L174_C4", "vector": [8, 2, 0.2479, 0.0014, 2, 0.82, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"Confirm support for transactions\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99056:Assign_L176_C8", "label": "cursor = cursor()", "type": "assigned_variable", "loc": [176, 176], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99056:FunctionDef_L174_C4", "vector": [14, 2, 0.2493, 0.0014, 2, 0.82, 0.1, 231, 3, 0, 0, 0, 231, 10, 1], "semantic": {"name": "cursor", "arg_names": [], "import_names": [], "rhs_call_name": "cursor", "annotation": ""}, "snippet": " cursor = self.connection.cursor()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99056:Expr_L177_C8", "label": "execute()", "type": "expression", "loc": [177, 177], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99056:FunctionDef_L174_C4", "vector": [8, 2, 0.2507, 0.0014, 2, 0.82, 0.2, 569, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "execute", "arg_names": [], "import_names": [], "rhs_call_name": "execute", "annotation": ""}, "snippet": " cursor.execute('CREATE TABLE ROLLBACK_TEST (X INT)')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99056:Expr_L178_C8", "label": "_commit()", "type": "expression", "loc": [178, 178], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99056:FunctionDef_L174_C4", "vector": [8, 2, 0.2521, 0.0014, 2, 0.82, 0.3, 361, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "_commit", "arg_names": [], "import_names": [], "rhs_call_name": "_commit", "annotation": ""}, "snippet": " self.connection._commit()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99056:Expr_L179_C8", "label": "execute()", "type": "expression", "loc": [179, 179], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99056:FunctionDef_L174_C4", "vector": [8, 2, 0.2535, 0.0014, 2, 0.82, 0.4, 569, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "execute", "arg_names": [], "import_names": [], "rhs_call_name": "execute", "annotation": ""}, "snippet": " cursor.execute('INSERT INTO ROLLBACK_TEST (X) VALUES (8)')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99056:Expr_L180_C8", "label": "_rollback()", "type": "expression", "loc": [180, 180], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99056:FunctionDef_L174_C4", "vector": [8, 2, 0.255, 0.0014, 2, 0.82, 0.5, 47, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "_rollback", "arg_names": [], "import_names": [], "rhs_call_name": "_rollback", "annotation": ""}, "snippet": " self.connection._rollback()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99056:Expr_L181_C8", "label": "execute()", "type": "expression", "loc": [181, 181], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99056:FunctionDef_L174_C4", "vector": [8, 2, 0.2564, 0.0014, 2, 0.82, 0.6, 569, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "execute", "arg_names": [], "import_names": [], "rhs_call_name": "execute", "annotation": ""}, "snippet": " cursor.execute('SELECT COUNT(X) FROM ROLLBACK_TEST')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99056:Assign_L182_C8", "label": "count = fetchone()", "type": "assigned_variable", "loc": [182, 182], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99056:FunctionDef_L174_C4", "vector": [14, 2, 0.2578, 0.0014, 2, 0.82, 0.7, 778, 3, 0, 0, 0, 561, 10, 1], "semantic": {"name": "count", "arg_names": [], "import_names": [], "rhs_call_name": "fetchone", "annotation": ""}, "snippet": " count, = cursor.fetchone()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99056:Expr_L183_C8", "label": "execute()", "type": "expression", "loc": [183, 183], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99056:FunctionDef_L174_C4", "vector": [8, 2, 0.2592, 0.0014, 2, 0.82, 0.8, 569, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "execute", "arg_names": [], "import_names": [], "rhs_call_name": "execute", "annotation": ""}, "snippet": " cursor.execute('DROP TABLE ROLLBACK_TEST')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99056:Expr_L184_C8", "label": "_commit()", "type": "expression", "loc": [184, 184], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99056:FunctionDef_L174_C4", "vector": [8, 2, 0.2606, 0.0014, 2, 0.82, 0.9, 361, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "_commit", "arg_names": [], "import_names": [], "rhs_call_name": "_commit", "annotation": ""}, "snippet": " self.connection._commit()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99056:Return_L185_C8", "label": "return", "type": "return", "loc": [185, 185], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99056:FunctionDef_L174_C4", "vector": [13, 2, 0.262, 0.0014, 2, 0.82, 1.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return count == 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99056:FunctionDef_L187_C4", "label": "_supports_stddev", "type": "function", "loc": [187, 195], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99056:ClassDef_L86_C0", "vector": [2, 1, 0.2705, 0.0127, 1, 0.29, 1.0, 955, 0, 1, 0, 0, 0, 0, 2], "semantic": {"name": "_supports_stddev", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _supports_stddev(self):\n \"Confirm support for STDDEV and related stats functions\"\n class StdDevPop(object):\n sql_function = 'STDDEV_POP'\n\n try:\n self.connection.ops.check_aggregate_support(StdDevPop())\n except NotImplementedError:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99056:Expr_L188_C8", "label": "expression", "type": "expression", "loc": [188, 188], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99056:FunctionDef_L187_C4", "vector": [8, 2, 0.2663, 0.0014, 2, 0.88, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"Confirm support for STDDEV and related stats functions\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99056:ClassDef_L189_C8", "label": "StdDevPop", "type": "class", "loc": [189, 190], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99056:FunctionDef_L187_C4", "vector": [3, 2, 0.2684, 0.0028, 2, 0.88, 0.5, 137, 0, 0, 0, 0, 186, 0, 0], "semantic": {"name": "StdDevPop", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " class StdDevPop(object):\n sql_function = 'STDDEV_POP'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99056:Assign_L190_C12", "label": "sql_function =", "type": "assigned_variable", "loc": [190, 190], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99056:ClassDef_L189_C8", "vector": [14, 3, 0.2691, 0.0014, 3, 0.97, 0.0, 586, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "sql_function", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " sql_function = 'STDDEV_POP'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99056:Try_L192_C8", "label": "try", "type": "try", "loc": [192, 195], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99056:FunctionDef_L187_C4", "vector": [7, 2, 0.2741, 0.0057, 2, 0.88, 1.0, 0, 0, 1, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " try:\n self.connection.ops.check_aggregate_support(StdDevPop())\n except NotImplementedError:\n self.supports_stddev = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99056:Expr_L193_C12", "label": "check_aggregate_support()", "type": "expression", "loc": [193, 193], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99056:Try_L192_C8", "vector": [8, 3, 0.2734, 0.0014, 3, 0.14, 0.0, 517, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "check_aggregate_support", "arg_names": [], "import_names": [], "rhs_call_name": "check_aggregate_support", "annotation": ""}, "snippet": " self.connection.ops.check_aggregate_support(StdDevPop())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99056:Assign_L195_C12", "label": "self.supports_stddev =", "type": "assigned_variable", "loc": [195, 195], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99056:Try_L192_C8", "vector": [14, 3, 0.2762, 0.0014, 3, 0.14, 0.0, 167, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "self.supports_stddev", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.supports_stddev = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99056:ClassDef_L198_C0", "label": "BaseDatabaseOperations", "type": "class", "loc": [198, 583], "level": 0, "parent": null, "vector": [3, 0, 0.5531, 0.5467, 0, 0.66, 0.7273, 927, 0, 44, 0, 0, 186, 0, 33], "semantic": {"name": "BaseDatabaseOperations", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class BaseDatabaseOperations(object):\n \"\"\"\n This class encapsulates all backend-specific differences, such as the way\n a backend performs ordering or calculates the ID of a recently-inserted\n row.\n \"\"\"\n compiler_module = \"django.db.models.sql.compiler\"\n"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99056:Expr_L199_C4", "label": "expression", "type": "expression", "loc": [199, 203], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99056:ClassDef_L198_C0", "vector": [8, 1, 0.2847, 0.0071, 1, 0.41, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"\n This class encapsulates all backend-specific differences, such as the way\n a backend performs ordering or calculates the ID of a recently-inserted\n row.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99056:Assign_L204_C4", "label": "compiler_module =", "type": "assigned_variable", "loc": [204, 204], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99056:ClassDef_L198_C0", "vector": [14, 1, 0.289, 0.0014, 1, 0.41, 0.0217, 902, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "compiler_module", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " compiler_module = \"django.db.models.sql.compiler\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99056:FunctionDef_L206_C4", "label": "__init__", "type": "function", "loc": [206, 207], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99056:ClassDef_L198_C0", "vector": [2, 1, 0.2925, 0.0028, 1, 0.41, 0.0435, 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._cache = {}"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99056:Assign_L207_C8", "label": "self._cache =", "type": "assigned_variable", "loc": [207, 207], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99056:FunctionDef_L206_C4", "vector": [14, 2, 0.2932, 0.0014, 2, 0.54, 0.0, 723, 0, 0, 0, 0, 0, 6, 0], "semantic": {"name": "self._cache", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self._cache = {}"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99056:FunctionDef_L209_C4", "label": "autoinc_sql", "type": "function", "loc": [209, 216], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99056:ClassDef_L198_C0", "vector": [2, 1, 0.301, 0.0113, 1, 0.41, 0.0652, 543, 0, 3, 1, 0, 0, 0, 0], "semantic": {"name": "autoinc_sql", "arg_names": ["self", "table", "column"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def autoinc_sql(self, table, column):\n \"\"\"\n Returns any SQL needed to support auto-incrementing primary keys, or\n None if no SQL is necessary.\n\n This SQL is executed when a table is created.\n \"\"\"\n return None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99056:Expr_L210_C8", "label": "expression", "type": "expression", "loc": [210, 215], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99056:FunctionDef_L209_C4", "vector": [8, 2, 0.301, 0.0085, 2, 0.65, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"\n Returns any SQL needed to support auto-incrementing primary keys, or\n None if no SQL is necessary.\n\n This SQL is executed when a table is created.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99056:Return_L216_C8", "label": "return", "type": "return", "loc": [216, 216], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99056:FunctionDef_L209_C4", "vector": [13, 2, 0.3059, 0.0014, 2, 0.65, 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_99056:FunctionDef_L218_C4", "label": "date_extract_sql", "type": "function", "loc": [218, 223], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99056:ClassDef_L198_C0", "vector": [2, 1, 0.3123, 0.0085, 1, 0.41, 0.087, 207, 0, 3, 0, 0, 0, 0, 1], "semantic": {"name": "date_extract_sql", "arg_names": ["self", "lookup_type", "field_name"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def date_extract_sql(self, lookup_type, field_name):\n \"\"\"\n Given a lookup_type of 'year', 'month' or 'day', returns the SQL that\n extracts a value from the given date field field_name.\n \"\"\"\n raise NotImplementedError()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99056:Expr_L219_C8", "label": "expression", "type": "expression", "loc": [219, 222], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99056:FunctionDef_L218_C4", "vector": [8, 2, 0.3123, 0.0057, 2, 0.25, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"\n Given a lookup_type of 'year', 'month' or 'day', returns the SQL that\n extracts a value from the given date field field_name.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99056:FunctionDef_L225_C4", "label": "date_trunc_sql", "type": "function", "loc": [225, 231], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99056:ClassDef_L198_C0", "vector": [2, 1, 0.3229, 0.0099, 1, 0.41, 0.1087, 926, 0, 3, 0, 0, 0, 0, 1], "semantic": {"name": "date_trunc_sql", "arg_names": ["self", "lookup_type", "field_name"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def date_trunc_sql(self, lookup_type, field_name):\n \"\"\"\n Given a lookup_type of 'year', 'month' or 'day', returns the SQL that\n truncates the given date field field_name to a DATE object with only\n the given specificity.\n \"\"\"\n raise NotImplementedError()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99056:Expr_L226_C8", "label": "expression", "type": "expression", "loc": [226, 230], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99056:FunctionDef_L225_C4", "vector": [8, 2, 0.3229, 0.0071, 2, 0.07, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"\n Given a lookup_type of 'year', 'month' or 'day', returns the SQL that\n truncates the given date field field_name to a DATE object with only\n the given specificity.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99056:FunctionDef_L233_C4", "label": "datetime_cast_sql", "type": "function", "loc": [233, 240], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99056:ClassDef_L198_C0", "vector": [2, 1, 0.335, 0.0113, 1, 0.41, 0.1304, 252, 0, 1, 1, 0, 0, 0, 0], "semantic": {"name": "datetime_cast_sql", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def datetime_cast_sql(self):\n \"\"\"\n Returns the SQL necessary to cast a datetime value so that it will be\n retrieved as a Python datetime object instead of a string.\n\n This SQL should include a '%s' in place of the field's name.\n \"\"\"\n return \"%s\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99056:Expr_L234_C8", "label": "expression", "type": "expression", "loc": [234, 239], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99056:FunctionDef_L233_C4", "vector": [8, 2, 0.335, 0.0085, 2, 0.78, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"\n Returns the SQL necessary to cast a datetime value so that it will be\n retrieved as a Python datetime object instead of a string.\n\n This SQL should include a '%s' in place of the field's name.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99056:Return_L240_C8", "label": "return", "type": "return", "loc": [240, 240], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99056:FunctionDef_L233_C4", "vector": [13, 2, 0.3399, 0.0014, 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 \"%s\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99056:FunctionDef_L242_C4", "label": "deferrable_sql", "type": "function", "loc": [242, 247], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99056:ClassDef_L198_C0", "vector": [2, 1, 0.3463, 0.0085, 1, 0.41, 0.1522, 566, 0, 1, 1, 0, 0, 0, 0], "semantic": {"name": "deferrable_sql", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def deferrable_sql(self):\n \"\"\"\n Returns the SQL necessary to make a constraint \"initially deferred\"\n during a CREATE TABLE statement.\n \"\"\"\n return ''"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99056:Expr_L243_C8", "label": "expression", "type": "expression", "loc": [243, 246], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99056:FunctionDef_L242_C4", "vector": [8, 2, 0.3463, 0.0057, 2, 0.14, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"\n Returns the SQL necessary to make a constraint \"initially deferred\"\n during a CREATE TABLE statement.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99056:Return_L247_C8", "label": "return", "type": "return", "loc": [247, 247], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99056:FunctionDef_L242_C4", "vector": [13, 2, 0.3499, 0.0014, 2, 0.14, 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_99056:FunctionDef_L249_C4", "label": "drop_foreignkey_sql", "type": "function", "loc": [249, 253], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99056:ClassDef_L198_C0", "vector": [2, 1, 0.3555, 0.0071, 1, 0.41, 0.1739, 184, 0, 1, 1, 0, 0, 0, 0], "semantic": {"name": "drop_foreignkey_sql", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def drop_foreignkey_sql(self):\n \"\"\"\n Returns the SQL command that drops a foreign key.\n \"\"\"\n return \"DROP CONSTRAINT\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99056:Expr_L250_C8", "label": "expression", "type": "expression", "loc": [250, 252], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99056:FunctionDef_L249_C4", "vector": [8, 2, 0.3555, 0.0042, 2, 0.97, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"\n Returns the SQL command that drops a foreign key.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99056:Return_L253_C8", "label": "return", "type": "return", "loc": [253, 253], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99056:FunctionDef_L249_C4", "vector": [13, 2, 0.3584, 0.0014, 2, 0.97, 1.0, 0, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return \"DROP CONSTRAINT\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99056:FunctionDef_L255_C4", "label": "drop_sequence_sql", "type": "function", "loc": [255, 260], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99056:ClassDef_L198_C0", "vector": [2, 1, 0.3647, 0.0085, 1, 0.41, 0.1957, 939, 0, 2, 1, 0, 0, 0, 0], "semantic": {"name": "drop_sequence_sql", "arg_names": ["self", "table"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def drop_sequence_sql(self, table):\n \"\"\"\n Returns any SQL necessary to drop the sequence for the given table.\n Returns None if no SQL is necessary.\n \"\"\"\n return None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99056:Expr_L256_C8", "label": "expression", "type": "expression", "loc": [256, 259], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99056:FunctionDef_L255_C4", "vector": [8, 2, 0.3647, 0.0057, 2, 0.55, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"\n Returns any SQL necessary to drop the sequence for the given table.\n Returns None if no SQL is necessary.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99056:Return_L260_C8", "label": "return", "type": "return", "loc": [260, 260], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99056:FunctionDef_L255_C4", "vector": [13, 2, 0.3683, 0.0014, 2, 0.55, 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_99056:FunctionDef_L262_C4", "label": "fetch_returned_insert_id", "type": "function", "loc": [262, 268], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99056:ClassDef_L198_C0", "vector": [2, 1, 0.3754, 0.0099, 1, 0.41, 0.2174, 589, 0, 2, 1, 0, 0, 0, 1], "semantic": {"name": "fetch_returned_insert_id", "arg_names": ["self", "cursor"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def fetch_returned_insert_id(self, cursor):\n \"\"\"\n Given a cursor object that has just performed an INSERT...RETURNING\n statement into a table that has an auto-incrementing ID, returns the\n newly created ID.\n \"\"\"\n return cursor.fetchone()[0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99056:Expr_L263_C8", "label": "expression", "type": "expression", "loc": [263, 267], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99056:FunctionDef_L262_C4", "vector": [8, 2, 0.3754, 0.0071, 2, 0.45, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"\n Given a cursor object that has just performed an INSERT...RETURNING\n statement into a table that has an auto-incrementing ID, returns the\n newly created ID.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99056:Return_L268_C8", "label": "return", "type": "return", "loc": [268, 268], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99056:FunctionDef_L262_C4", "vector": [13, 2, 0.3796, 0.0014, 2, 0.45, 1.0, 0, 6, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return cursor.fetchone()[0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99056:FunctionDef_L270_C4", "label": "field_cast_sql", "type": "function", "loc": [270, 277], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99056:ClassDef_L198_C0", "vector": [2, 1, 0.3874, 0.0113, 1, 0.41, 0.2391, 924, 0, 2, 1, 0, 0, 0, 0], "semantic": {"name": "field_cast_sql", "arg_names": ["self", "db_type"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def field_cast_sql(self, db_type):\n \"\"\"\n Given a column type (e.g. 'BLOB', 'VARCHAR'), returns the SQL necessary\n to cast it before using it in a WHERE statement. Note that the\n resulting string should contain a '%s' placeholder for the column being\n searched against.\n \"\"\"\n return '%s'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99056:Expr_L271_C8", "label": "expression", "type": "expression", "loc": [271, 276], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99056:FunctionDef_L270_C4", "vector": [8, 2, 0.3874, 0.0085, 2, 0.06, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"\n Given a column type (e.g. 'BLOB', 'VARCHAR'), returns the SQL necessary\n to cast it before using it in a WHERE statement. Note that the\n resulting string should contain a '%s' placeholder for the column being\n searched against.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99056:Return_L277_C8", "label": "return", "type": "return", "loc": [277, 277], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99056:FunctionDef_L270_C4", "vector": [13, 2, 0.3924, 0.0014, 2, 0.06, 1.0, 0, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return '%s'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99056:FunctionDef_L279_C4", "label": "force_no_ordering", "type": "function", "loc": [279, 285], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99056:ClassDef_L198_C0", "vector": [2, 1, 0.3994, 0.0099, 1, 0.41, 0.2609, 947, 0, 1, 1, 0, 0, 0, 0], "semantic": {"name": "force_no_ordering", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def force_no_ordering(self):\n \"\"\"\n Returns a list used in the \"ORDER BY\" clause to force no ordering at\n all. Returning an empty list means that nothing will be included in the\n ordering.\n \"\"\"\n return []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99056:Expr_L280_C8", "label": "expression", "type": "expression", "loc": [280, 284], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99056:FunctionDef_L279_C4", "vector": [8, 2, 0.3994, 0.0071, 2, 0.74, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"\n Returns a list used in the \"ORDER BY\" clause to force no ordering at\n all. Returning an empty list means that nothing will be included in the\n ordering.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99056:Return_L285_C8", "label": "return", "type": "return", "loc": [285, 285], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99056:FunctionDef_L279_C4", "vector": [13, 2, 0.4037, 0.0014, 2, 0.74, 1.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_99056:FunctionDef_L287_C4", "label": "fulltext_search_sql", "type": "function", "loc": [287, 293], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99056:ClassDef_L198_C0", "vector": [2, 1, 0.4108, 0.0099, 1, 0.41, 0.2826, 297, 0, 2, 0, 0, 0, 0, 1], "semantic": {"name": "fulltext_search_sql", "arg_names": ["self", "field_name"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def fulltext_search_sql(self, field_name):\n \"\"\"\n Returns the SQL WHERE clause to use in order to perform a full-text\n search of the given field_name. Note that the resulting string should\n contain a '%s' placeholder for the value being searched against.\n \"\"\"\n raise NotImplementedError('Full-text search is not implemented for this database backend')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99056:Expr_L288_C8", "label": "expression", "type": "expression", "loc": [288, 292], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99056:FunctionDef_L287_C4", "vector": [8, 2, 0.4108, 0.0071, 2, 0.09, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"\n Returns the SQL WHERE clause to use in order to perform a full-text\n search of the given field_name. Note that the resulting string should\n contain a '%s' placeholder for the value being searched against.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99056:FunctionDef_L295_C4", "label": "last_executed_query", "type": "function", "loc": [295, 314], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99056:ClassDef_L198_C0", "vector": [2, 1, 0.4313, 0.0283, 1, 0.41, 0.3043, 423, 0, 4, 1, 0, 0, 0, 9], "semantic": {"name": "last_executed_query", "arg_names": ["self", "cursor", "sql", "params"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def last_executed_query(self, cursor, sql, params):\n \"\"\"\n Returns a string of the query last executed by the given cursor, with\n placeholders replaced with actual values.\n\n `sql` is the raw query containing placeholders, and `params` is the\n sequence of parameters. These are used by default, but this method\n exists for database backends to provide a better implementation"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99056:Expr_L296_C8", "label": "expression", "type": "expression", "loc": [296, 304], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99056:FunctionDef_L295_C4", "vector": [8, 2, 0.4249, 0.0127, 2, 0.42, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"\n Returns a string of the query last executed by the given cursor, with\n placeholders replaced with actual values.\n\n `sql` is the raw query containing placeholders, and `params` is the\n sequence of parameters. These are used by default, but this method\n exists for database backends to provide a better implementation\n according to their own quoting schemes."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99056:ImportFrom_L305_C8", "label": "from django.utils.encoding import smart_unicode, force_unicode", "type": "import", "loc": [305, 305], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99056:FunctionDef_L295_C4", "vector": [1, 2, 0.432, 0.0014, 2, 0.42, 0.25, 96, 0, 2, 0, 0, 96, 0, 0], "semantic": {"name": "django.utils.encoding", "arg_names": [], "import_names": ["smart_unicode", "force_unicode"], "rhs_call_name": "", "annotation": ""}, "snippet": " from django.utils.encoding import smart_unicode, force_unicode"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99056:Assign_L308_C8", "label": "to_unicode =", "type": "assigned_variable", "loc": [308, 308], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99056:FunctionDef_L295_C4", "vector": [14, 2, 0.4363, 0.0014, 2, 0.42, 0.5, 586, 9, 0, 0, 0, 0, 0, 1], "semantic": {"name": "to_unicode", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " to_unicode = lambda s: force_unicode(s, strings_only=True, errors='replace')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99056:If_L309_C8", "label": "if", "type": "if", "loc": [309, 312], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99056:FunctionDef_L295_C4", "vector": [4, 2, 0.4398, 0.0057, 2, 0.42, 0.75, 0, 3, 0, 0, 0, 0, 0, 7], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if isinstance(params, (list, tuple)):\n u_params = tuple([to_unicode(val) for val in params])\n else:\n u_params = dict([(to_unicode(k), to_unicode(v)) for k, v in params.items()])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99056:Assign_L310_C12", "label": "u_params = tuple()", "type": "assigned_variable", "loc": [310, 310], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99056:If_L309_C8", "vector": [14, 3, 0.4391, 0.0014, 3, 0.94, 0.0, 794, 3, 1, 0, 0, 259, 10, 2], "semantic": {"name": "u_params", "arg_names": [], "import_names": [], "rhs_call_name": "tuple", "annotation": ""}, "snippet": " u_params = tuple([to_unicode(val) for val in params])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99056:Assign_L312_C12", "label": "u_params = dict()", "type": "assigned_variable", "loc": [312, 312], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99056:If_L309_C8", "vector": [14, 3, 0.4419, 0.0014, 3, 0.94, 1.0, 794, 3, 1, 0, 0, 827, 10, 4], "semantic": {"name": "u_params", "arg_names": [], "import_names": [], "rhs_call_name": "dict", "annotation": ""}, "snippet": " u_params = dict([(to_unicode(k), to_unicode(v)) for k, v in params.items()])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99056:Return_L314_C8", "label": "return", "type": "return", "loc": [314, 314], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99056:FunctionDef_L295_C4", "vector": [13, 2, 0.4448, 0.0014, 2, 0.42, 1.0, 0, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return smart_unicode(sql) % u_params"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99056:FunctionDef_L316_C4", "label": "last_insert_id", "type": "function", "loc": [316, 324], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99056:ClassDef_L198_C0", "vector": [2, 1, 0.4533, 0.0127, 1, 0.41, 0.3261, 956, 0, 4, 1, 0, 0, 0, 0], "semantic": {"name": "last_insert_id", "arg_names": ["self", "cursor", "table_name", "pk_name"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def last_insert_id(self, cursor, table_name, pk_name):\n \"\"\"\n Given a cursor object that has just performed an INSERT statement into\n a table that has an auto-incrementing ID, returns the newly created ID.\n\n This method also receives the table name and the name of the primary-key\n column.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99056:Expr_L317_C8", "label": "expression", "type": "expression", "loc": [317, 323], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99056:FunctionDef_L316_C4", "vector": [8, 2, 0.4533, 0.0099, 2, 0.79, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"\n Given a cursor object that has just performed an INSERT statement into\n a table that has an auto-incrementing ID, returns the newly created ID.\n\n This method also receives the table name and the name of the primary-key\n column.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99056:Return_L324_C8", "label": "return", "type": "return", "loc": [324, 324], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99056:FunctionDef_L316_C4", "vector": [13, 2, 0.4589, 0.0014, 2, 0.79, 1.0, 0, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return cursor.lastrowid"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99056:FunctionDef_L326_C4", "label": "lookup_cast", "type": "function", "loc": [326, 332], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99056:ClassDef_L198_C0", "vector": [2, 1, 0.466, 0.0099, 1, 0.41, 0.3478, 903, 0, 2, 1, 0, 0, 0, 0], "semantic": {"name": "lookup_cast", "arg_names": ["self", "lookup_type"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def lookup_cast(self, lookup_type):\n \"\"\"\n Returns the string to use in a query when performing lookups\n (\"contains\", \"like\", etc). The resulting string should contain a '%s'\n placeholder for the column being searched against.\n \"\"\"\n return \"%s\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99056:Expr_L327_C8", "label": "expression", "type": "expression", "loc": [327, 331], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99056:FunctionDef_L326_C4", "vector": [8, 2, 0.466, 0.0071, 2, 0.69, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"\n Returns the string to use in a query when performing lookups\n (\"contains\", \"like\", etc). The resulting string should contain a '%s'\n placeholder for the column being searched against.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99056:Return_L332_C8", "label": "return", "type": "return", "loc": [332, 332], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99056:FunctionDef_L326_C4", "vector": [13, 2, 0.4703, 0.0014, 2, 0.69, 1.0, 0, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return \"%s\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99056:FunctionDef_L334_C4", "label": "max_in_list_size", "type": "function", "loc": [334, 339], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99056:ClassDef_L198_C0", "vector": [2, 1, 0.4766, 0.0085, 1, 0.41, 0.3696, 516, 0, 1, 1, 0, 0, 0, 0], "semantic": {"name": "max_in_list_size", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def max_in_list_size(self):\n \"\"\"\n Returns the maximum number of items that can be passed in a single 'IN'\n list condition, or None if the backend does not impose a limit.\n \"\"\"\n return None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99056:Expr_L335_C8", "label": "expression", "type": "expression", "loc": [335, 338], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99056:FunctionDef_L334_C4", "vector": [8, 2, 0.4766, 0.0057, 2, 0.24, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"\n Returns the maximum number of items that can be passed in a single 'IN'\n list condition, or None if the backend does not impose a limit.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99056:Return_L339_C8", "label": "return", "type": "return", "loc": [339, 339], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99056:FunctionDef_L334_C4", "vector": [13, 2, 0.4802, 0.0014, 2, 0.24, 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_99056:FunctionDef_L341_C4", "label": "max_name_length", "type": "function", "loc": [341, 346], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99056:ClassDef_L198_C0", "vector": [2, 1, 0.4865, 0.0085, 1, 0.41, 0.3913, 680, 0, 1, 1, 0, 0, 0, 0], "semantic": {"name": "max_name_length", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def max_name_length(self):\n \"\"\"\n Returns the maximum length of table and column names, or None if there\n is no limit.\n \"\"\"\n return None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99056:Expr_L342_C8", "label": "expression", "type": "expression", "loc": [342, 345], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99056:FunctionDef_L341_C4", "vector": [8, 2, 0.4865, 0.0057, 2, 0.86, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"\n Returns the maximum length of table and column names, or None if there\n is no limit.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99056:Return_L346_C8", "label": "return", "type": "return", "loc": [346, 346], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99056:FunctionDef_L341_C4", "vector": [13, 2, 0.4901, 0.0014, 2, 0.86, 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_99056:FunctionDef_L348_C4", "label": "no_limit_value", "type": "function", "loc": [348, 353], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99056:ClassDef_L198_C0", "vector": [2, 1, 0.4965, 0.0085, 1, 0.41, 0.413, 407, 0, 1, 0, 0, 0, 0, 0], "semantic": {"name": "no_limit_value", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def no_limit_value(self):\n \"\"\"\n Returns the value to use for the LIMIT when we are wanting \"LIMIT\n infinity\". Returns None if the limit clause can be omitted in this case.\n \"\"\"\n raise NotImplementedError"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99056:Expr_L349_C8", "label": "expression", "type": "expression", "loc": [349, 352], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99056:FunctionDef_L348_C4", "vector": [8, 2, 0.4965, 0.0057, 2, 0.95, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"\n Returns the value to use for the LIMIT when we are wanting \"LIMIT\n infinity\". Returns None if the limit clause can be omitted in this case.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99056:FunctionDef_L355_C4", "label": "pk_default_value", "type": "function", "loc": [355, 360], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99056:ClassDef_L198_C0", "vector": [2, 1, 0.5064, 0.0085, 1, 0.41, 0.4348, 891, 0, 1, 1, 0, 0, 0, 0], "semantic": {"name": "pk_default_value", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def pk_default_value(self):\n \"\"\"\n Returns the value to use during an INSERT statement to specify that\n the field should use its default value.\n \"\"\"\n return 'DEFAULT'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99056:Expr_L356_C8", "label": "expression", "type": "expression", "loc": [356, 359], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99056:FunctionDef_L355_C4", "vector": [8, 2, 0.5064, 0.0057, 2, 0.46, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"\n Returns the value to use during an INSERT statement to specify that\n the field should use its default value.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99056:Return_L360_C8", "label": "return", "type": "return", "loc": [360, 360], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99056:FunctionDef_L355_C4", "vector": [13, 2, 0.5099, 0.0014, 2, 0.46, 1.0, 0, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return 'DEFAULT'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99056:FunctionDef_L362_C4", "label": "process_clob", "type": "function", "loc": [362, 367], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99056:ClassDef_L198_C0", "vector": [2, 1, 0.5163, 0.0085, 1, 0.41, 0.4565, 82, 0, 2, 1, 0, 0, 0, 0], "semantic": {"name": "process_clob", "arg_names": ["self", "value"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def process_clob(self, value):\n \"\"\"\n Returns the value of a CLOB column, for backends that return a locator\n object that requires additional processing.\n \"\"\"\n return value"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99056:Expr_L363_C8", "label": "expression", "type": "expression", "loc": [363, 366], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99056:FunctionDef_L362_C4", "vector": [8, 2, 0.5163, 0.0057, 2, 0.71, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"\n Returns the value of a CLOB column, for backends that return a locator\n object that requires additional processing.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99056:Return_L367_C8", "label": "return", "type": "return", "loc": [367, 367], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99056:FunctionDef_L362_C4", "vector": [13, 2, 0.5198, 0.0014, 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 value"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99056:FunctionDef_L369_C4", "label": "return_insert_id", "type": "function", "loc": [369, 376], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99056:ClassDef_L198_C0", "vector": [2, 1, 0.5276, 0.0113, 1, 0.41, 0.4783, 195, 0, 1, 0, 0, 0, 0, 0], "semantic": {"name": "return_insert_id", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def return_insert_id(self):\n \"\"\"\n For backends that support returning the last insert ID as part\n of an insert query, this method returns the SQL and params to\n append to the INSERT query. The returned fragment should\n contain a format string to hold the appropriate column.\n \"\"\"\n pass"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99056:Expr_L370_C8", "label": "expression", "type": "expression", "loc": [370, 375], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99056:FunctionDef_L369_C4", "vector": [8, 2, 0.5276, 0.0085, 2, 0.47, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"\n For backends that support returning the last insert ID as part\n of an insert query, this method returns the SQL and params to\n append to the INSERT query. The returned fragment should\n contain a format string to hold the appropriate column.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99056:FunctionDef_L378_C4", "label": "compiler", "type": "function", "loc": [378, 388], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99056:ClassDef_L198_C0", "vector": [2, 1, 0.5425, 0.0156, 1, 0.41, 0.5, 738, 0, 2, 1, 0, 0, 0, 2], "semantic": {"name": "compiler", "arg_names": ["self", "compiler_name"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def compiler(self, compiler_name):\n \"\"\"\n Returns the SQLCompiler class corresponding to the given name,\n in the namespace corresponding to the `compiler_module` attribute\n on this backend.\n \"\"\"\n if compiler_name not in self._cache:\n self._cache[compiler_name] = getattr("}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99056:Expr_L379_C8", "label": "expression", "type": "expression", "loc": [379, 383], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99056:FunctionDef_L378_C4", "vector": [8, 2, 0.5397, 0.0071, 2, 0.25, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"\n Returns the SQLCompiler class corresponding to the given name,\n in the namespace corresponding to the `compiler_module` attribute\n on this backend.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99056:If_L384_C8", "label": "if", "type": "if", "loc": [384, 387], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99056:FunctionDef_L378_C4", "vector": [4, 2, 0.546, 0.0057, 2, 0.25, 0.5, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if compiler_name not in self._cache:\n self._cache[compiler_name] = getattr(\n import_module(self.compiler_module), compiler_name\n )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99056:Assign_L385_C12", "label": " = getattr()", "type": "assigned_variable", "loc": [385, 387], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99056:If_L384_C8", "vector": [14, 3, 0.5467, 0.0042, 3, 0.01, 0.0, 0, 3, 2, 0, 0, 121, 10, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "getattr", "annotation": ""}, "snippet": " self._cache[compiler_name] = getattr(\n import_module(self.compiler_module), compiler_name\n )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99056:Return_L388_C8", "label": "return", "type": "return", "loc": [388, 388], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99056:FunctionDef_L378_C4", "vector": [13, 2, 0.5496, 0.0014, 2, 0.25, 1.0, 0, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self._cache[compiler_name]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99056:FunctionDef_L390_C4", "label": "quote_name", "type": "function", "loc": [390, 395], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99056:ClassDef_L198_C0", "vector": [2, 1, 0.5559, 0.0085, 1, 0.41, 0.5217, 116, 0, 2, 0, 0, 0, 0, 1], "semantic": {"name": "quote_name", "arg_names": ["self", "name"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def quote_name(self, name):\n \"\"\"\n Returns a quoted version of the given table, index or column name. Does\n not quote the given name if it's already been quoted.\n \"\"\"\n raise NotImplementedError()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99056:Expr_L391_C8", "label": "expression", "type": "expression", "loc": [391, 394], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99056:FunctionDef_L390_C4", "vector": [8, 2, 0.5559, 0.0057, 2, 0.67, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"\n Returns a quoted version of the given table, index or column name. Does\n not quote the given name if it's already been quoted.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99056:FunctionDef_L397_C4", "label": "random_function_sql", "type": "function", "loc": [397, 401], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99056:ClassDef_L198_C0", "vector": [2, 1, 0.5652, 0.0071, 1, 0.41, 0.5435, 756, 0, 1, 1, 0, 0, 0, 0], "semantic": {"name": "random_function_sql", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def random_function_sql(self):\n \"\"\"\n Returns a SQL expression that returns a random value.\n \"\"\"\n return 'RANDOM()'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99056:Expr_L398_C8", "label": "expression", "type": "expression", "loc": [398, 400], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99056:FunctionDef_L397_C4", "vector": [8, 2, 0.5652, 0.0042, 2, 0.02, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"\n Returns a SQL expression that returns a random value.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99056:Return_L401_C8", "label": "return", "type": "return", "loc": [401, 401], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99056:FunctionDef_L397_C4", "vector": [13, 2, 0.568, 0.0014, 2, 0.02, 1.0, 0, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return 'RANDOM()'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99056:FunctionDef_L403_C4", "label": "regex_lookup", "type": "function", "loc": [403, 412], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99056:ClassDef_L198_C0", "vector": [2, 1, 0.5772, 0.0142, 1, 0.41, 0.5652, 522, 0, 2, 0, 0, 0, 0, 0], "semantic": {"name": "regex_lookup", "arg_names": ["self", "lookup_type"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def regex_lookup(self, lookup_type):\n \"\"\"\n Returns the string to use in a query when performing regular expression\n lookups (using \"regex\" or \"iregex\"). The resulting string should\n contain a '%s' placeholder for the column being searched against.\n\n If the feature is not supported (or part of it is not supported), a\n NotImplementedError exception can be raised."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99056:Expr_L404_C8", "label": "expression", "type": "expression", "loc": [404, 411], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99056:FunctionDef_L403_C4", "vector": [8, 2, 0.5772, 0.0113, 2, 0.55, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"\n Returns the string to use in a query when performing regular expression\n lookups (using \"regex\" or \"iregex\"). The resulting string should\n contain a '%s' placeholder for the column being searched against.\n\n If the feature is not supported (or part of it is not supported), a\n NotImplementedError exception can be raised.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99056:FunctionDef_L414_C4", "label": "savepoint_create_sql", "type": "function", "loc": [414, 420], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99056:ClassDef_L198_C0", "vector": [2, 1, 0.5907, 0.0099, 1, 0.41, 0.587, 479, 0, 2, 0, 0, 0, 0, 0], "semantic": {"name": "savepoint_create_sql", "arg_names": ["self", "sid"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def savepoint_create_sql(self, sid):\n \"\"\"\n Returns the SQL for starting a new savepoint. Only required if the\n \"uses_savepoints\" feature is True. The \"sid\" parameter is a string\n for the savepoint id.\n \"\"\"\n raise NotImplementedError"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99056:Expr_L415_C8", "label": "expression", "type": "expression", "loc": [415, 419], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99056:FunctionDef_L414_C4", "vector": [8, 2, 0.5907, 0.0071, 2, 0.04, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"\n Returns the SQL for starting a new savepoint. Only required if the\n \"uses_savepoints\" feature is True. The \"sid\" parameter is a string\n for the savepoint id.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99056:FunctionDef_L422_C4", "label": "savepoint_commit_sql", "type": "function", "loc": [422, 426], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99056:ClassDef_L198_C0", "vector": [2, 1, 0.6006, 0.0071, 1, 0.41, 0.6087, 45, 0, 2, 0, 0, 0, 0, 0], "semantic": {"name": "savepoint_commit_sql", "arg_names": ["self", "sid"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def savepoint_commit_sql(self, sid):\n \"\"\"\n Returns the SQL for committing the given savepoint.\n \"\"\"\n raise NotImplementedError"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99056:Expr_L423_C8", "label": "expression", "type": "expression", "loc": [423, 425], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99056:FunctionDef_L422_C4", "vector": [8, 2, 0.6006, 0.0042, 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 Returns the SQL for committing the given savepoint.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99056:FunctionDef_L428_C4", "label": "savepoint_rollback_sql", "type": "function", "loc": [428, 432], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99056:ClassDef_L198_C0", "vector": [2, 1, 0.6091, 0.0071, 1, 0.41, 0.6304, 788, 0, 2, 0, 0, 0, 0, 0], "semantic": {"name": "savepoint_rollback_sql", "arg_names": ["self", "sid"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def savepoint_rollback_sql(self, sid):\n \"\"\"\n Returns the SQL for rolling back the given savepoint.\n \"\"\"\n raise NotImplementedError"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99056:Expr_L429_C8", "label": "expression", "type": "expression", "loc": [429, 431], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99056:FunctionDef_L428_C4", "vector": [8, 2, 0.6091, 0.0042, 2, 0.9, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"\n Returns the SQL for rolling back the given savepoint.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99056:FunctionDef_L434_C4", "label": "sql_flush", "type": "function", "loc": [434, 443], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99056:ClassDef_L198_C0", "vector": [2, 1, 0.6211, 0.0142, 1, 0.41, 0.6522, 914, 0, 4, 0, 0, 0, 0, 1], "semantic": {"name": "sql_flush", "arg_names": ["self", "style", "tables", "sequences"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def sql_flush(self, style, tables, sequences):\n \"\"\"\n Returns a list of SQL statements required to remove all data from\n the given database tables (without actually removing the tables\n themselves).\n\n The `style` argument is a Style object as returned by either\n color_style() or no_style() in django.core.management.color."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99056:Expr_L435_C8", "label": "expression", "type": "expression", "loc": [435, 442], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99056:FunctionDef_L434_C4", "vector": [8, 2, 0.6211, 0.0113, 2, 0.02, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"\n Returns a list of SQL statements required to remove all data from\n the given database tables (without actually removing the tables\n themselves).\n\n The `style` argument is a Style object as returned by either\n color_style() or no_style() in django.core.management.color.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99056:FunctionDef_L445_C4", "label": "sequence_reset_sql", "type": "function", "loc": [445, 453], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99056:ClassDef_L198_C0", "vector": [2, 1, 0.636, 0.0127, 1, 0.41, 0.6739, 235, 0, 3, 1, 0, 0, 0, 0], "semantic": {"name": "sequence_reset_sql", "arg_names": ["self", "style", "model_list"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def sequence_reset_sql(self, style, model_list):\n \"\"\"\n Returns a list of the SQL statements required to reset sequences for\n the given models.\n\n The `style` argument is a Style object as returned by either\n color_style() or no_style() in django.core.management.color.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99056:Expr_L446_C8", "label": "expression", "type": "expression", "loc": [446, 452], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99056:FunctionDef_L445_C4", "vector": [8, 2, 0.636, 0.0099, 2, 0.53, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"\n Returns a list of the SQL statements required to reset sequences for\n the given models.\n\n The `style` argument is a Style object as returned by either\n color_style() or no_style() in django.core.management.color.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99056:Return_L453_C8", "label": "return", "type": "return", "loc": [453, 453], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99056:FunctionDef_L445_C4", "vector": [13, 2, 0.6416, 0.0014, 2, 0.53, 1.0, 0, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return [] # No sequence reset required by default."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99056:FunctionDef_L455_C4", "label": "start_transaction_sql", "type": "function", "loc": [455, 459], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99056:ClassDef_L198_C0", "vector": [2, 1, 0.6473, 0.0071, 1, 0.41, 0.6957, 768, 0, 1, 1, 0, 0, 0, 0], "semantic": {"name": "start_transaction_sql", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def start_transaction_sql(self):\n \"\"\"\n Returns the SQL statement required to start a transaction.\n \"\"\"\n return \"BEGIN;\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99056:Expr_L456_C8", "label": "expression", "type": "expression", "loc": [456, 458], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99056:FunctionDef_L455_C4", "vector": [8, 2, 0.6473, 0.0042, 2, 0.04, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"\n Returns the SQL statement required to start a transaction.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99056:Return_L459_C8", "label": "return", "type": "return", "loc": [459, 459], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99056:FunctionDef_L455_C4", "vector": [13, 2, 0.6501, 0.0014, 2, 0.04, 1.0, 0, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return \"BEGIN;\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99056:FunctionDef_L461_C4", "label": "end_transaction_sql", "type": "function", "loc": [461, 464], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99056:ClassDef_L198_C0", "vector": [2, 1, 0.6551, 0.0057, 1, 0.41, 0.7174, 538, 0, 2, 1, 0, 0, 0, 0], "semantic": {"name": "end_transaction_sql", "arg_names": ["self", "success"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def end_transaction_sql(self, success=True):\n if not success:\n return \"ROLLBACK;\"\n return \"COMMIT;\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99056:If_L462_C8", "label": "if", "type": "if", "loc": [462, 463], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99056:FunctionDef_L461_C4", "vector": [4, 2, 0.6551, 0.0028, 2, 0.89, 0.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not success:\n return \"ROLLBACK;\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99056:Return_L463_C12", "label": "return", "type": "return", "loc": [463, 463], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99056:If_L462_C8", "vector": [13, 3, 0.6558, 0.0014, 3, 0.53, 0.0, 0, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return \"ROLLBACK;\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99056:Return_L464_C8", "label": "return", "type": "return", "loc": [464, 464], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99056:FunctionDef_L461_C4", "vector": [13, 2, 0.6572, 0.0014, 2, 0.89, 1.0, 0, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return \"COMMIT;\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99056:FunctionDef_L466_C4", "label": "tablespace_sql", "type": "function", "loc": [466, 471], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99056:ClassDef_L198_C0", "vector": [2, 1, 0.6636, 0.0085, 1, 0.41, 0.7391, 652, 0, 3, 1, 0, 0, 0, 0], "semantic": {"name": "tablespace_sql", "arg_names": ["self", "tablespace", "inline"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def tablespace_sql(self, tablespace, inline=False):\n \"\"\"\n Returns the SQL that will be appended to tables or rows to define\n a tablespace. Returns '' if the backend doesn't use tablespaces.\n \"\"\"\n return ''"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99056:Expr_L467_C8", "label": "expression", "type": "expression", "loc": [467, 470], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99056:FunctionDef_L466_C4", "vector": [8, 2, 0.6636, 0.0057, 2, 0.58, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"\n Returns the SQL that will be appended to tables or rows to define\n a tablespace. Returns '' if the backend doesn't use tablespaces.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99056:Return_L471_C8", "label": "return", "type": "return", "loc": [471, 471], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99056:FunctionDef_L466_C4", "vector": [13, 2, 0.6671, 0.0014, 2, 0.58, 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_99056:FunctionDef_L473_C4", "label": "prep_for_like_query", "type": "function", "loc": [473, 476], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99056:ClassDef_L198_C0", "vector": [2, 1, 0.6721, 0.0057, 1, 0.41, 0.7609, 140, 0, 2, 1, 0, 0, 0, 4], "semantic": {"name": "prep_for_like_query", "arg_names": ["self", "x"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def prep_for_like_query(self, x):\n \"\"\"Prepares a value for use in a LIKE query.\"\"\"\n from django.utils.encoding import smart_unicode\n return smart_unicode(x).replace(\"\\\\\", \"\\\\\\\\\").replace(\"%\", \"\\%\").replace(\"_\", \"\\_\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99056:Expr_L474_C8", "label": "expression", "type": "expression", "loc": [474, 474], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99056:FunctionDef_L473_C4", "vector": [8, 2, 0.6714, 0.0014, 2, 0.82, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Prepares a value for use in a LIKE query.\"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99056:ImportFrom_L475_C8", "label": "from django.utils.encoding import smart_unicode", "type": "import", "loc": [475, 475], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99056:FunctionDef_L473_C4", "vector": [1, 2, 0.6728, 0.0014, 2, 0.82, 0.5, 96, 0, 1, 0, 0, 96, 0, 0], "semantic": {"name": "django.utils.encoding", "arg_names": [], "import_names": ["smart_unicode"], "rhs_call_name": "", "annotation": ""}, "snippet": " from django.utils.encoding import smart_unicode"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99056:Return_L476_C8", "label": "return", "type": "return", "loc": [476, 476], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99056:FunctionDef_L473_C4", "vector": [13, 2, 0.6742, 0.0014, 2, 0.82, 1.0, 0, 3, 0, 0, 0, 0, 10, 4], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return smart_unicode(x).replace(\"\\\\\", \"\\\\\\\\\").replace(\"%\", \"\\%\").replace(\"_\", \"\\_\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99056:Assign_L480_C4", "label": "prep_for_iexact_query =", "type": "assigned_variable", "loc": [480, 480], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99056:ClassDef_L198_C0", "vector": [14, 1, 0.6799, 0.0014, 1, 0.41, 0.7826, 755, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "prep_for_iexact_query", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " prep_for_iexact_query = prep_for_like_query"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99056:FunctionDef_L482_C4", "label": "value_to_db_auto", "type": "function", "loc": [482, 489], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99056:ClassDef_L198_C0", "vector": [2, 1, 0.6877, 0.0113, 1, 0.41, 0.8043, 318, 0, 2, 1, 0, 0, 0, 1], "semantic": {"name": "value_to_db_auto", "arg_names": ["self", "value"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def value_to_db_auto(self, value):\n \"\"\"\n Transform a value to an object compatible with the auto field required\n by the backend driver for auto columns.\n \"\"\"\n if value is None:\n return None\n return int(value)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99056:Expr_L483_C8", "label": "expression", "type": "expression", "loc": [483, 486], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99056:FunctionDef_L482_C4", "vector": [8, 2, 0.6863, 0.0057, 2, 0.58, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"\n Transform a value to an object compatible with the auto field required\n by the backend driver for auto columns.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99056:If_L487_C8", "label": "if", "type": "if", "loc": [487, 488], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99056:FunctionDef_L482_C4", "vector": [4, 2, 0.6905, 0.0028, 2, 0.58, 0.5, 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_99056:Return_L488_C12", "label": "return", "type": "return", "loc": [488, 488], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99056:If_L487_C8", "vector": [13, 3, 0.6912, 0.0014, 3, 0.73, 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_99056:Return_L489_C8", "label": "return", "type": "return", "loc": [489, 489], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99056:FunctionDef_L482_C4", "vector": [13, 2, 0.6926, 0.0014, 2, 0.58, 1.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_99056:FunctionDef_L491_C4", "label": "value_to_db_date", "type": "function", "loc": [491, 498], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99056:ClassDef_L198_C0", "vector": [2, 1, 0.7004, 0.0113, 1, 0.41, 0.8261, 67, 0, 2, 1, 0, 0, 0, 2], "semantic": {"name": "value_to_db_date", "arg_names": ["self", "value"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def value_to_db_date(self, value):\n \"\"\"\n Transform a date value to an object compatible with what is expected\n by the backend driver for date columns.\n \"\"\"\n if value is None:\n return None\n return datetime_safe.new_date(value).strftime('%Y-%m-%d')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99056:Expr_L492_C8", "label": "expression", "type": "expression", "loc": [492, 495], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99056:FunctionDef_L491_C4", "vector": [8, 2, 0.699, 0.0057, 2, 0.1, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"\n Transform a date value to an object compatible with what is expected\n by the backend driver for date columns.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99056:If_L496_C8", "label": "if", "type": "if", "loc": [496, 497], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99056:FunctionDef_L491_C4", "vector": [4, 2, 0.7033, 0.0028, 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 value is None:\n return None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99056:Return_L497_C12", "label": "return", "type": "return", "loc": [497, 497], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99056:If_L496_C8", "vector": [13, 3, 0.704, 0.0014, 3, 0.38, 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_99056:Return_L498_C8", "label": "return", "type": "return", "loc": [498, 498], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99056:FunctionDef_L491_C4", "vector": [13, 2, 0.7054, 0.0014, 2, 0.1, 1.0, 0, 3, 0, 0, 0, 0, 10, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return datetime_safe.new_date(value).strftime('%Y-%m-%d')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99056:FunctionDef_L500_C4", "label": "value_to_db_datetime", "type": "function", "loc": [500, 507], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99056:ClassDef_L198_C0", "vector": [2, 1, 0.7132, 0.0113, 1, 0.41, 0.8478, 223, 0, 2, 1, 0, 0, 0, 1], "semantic": {"name": "value_to_db_datetime", "arg_names": ["self", "value"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def value_to_db_datetime(self, value):\n \"\"\"\n Transform a datetime value to an object compatible with what is expected\n by the backend driver for datetime columns.\n \"\"\"\n if value is None:\n return None\n return unicode(value)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99056:Expr_L501_C8", "label": "expression", "type": "expression", "loc": [501, 504], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99056:FunctionDef_L500_C4", "vector": [8, 2, 0.7118, 0.0057, 2, 0.44, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"\n Transform a datetime value to an object compatible with what is expected\n by the backend driver for datetime columns.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99056:If_L505_C8", "label": "if", "type": "if", "loc": [505, 506], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99056:FunctionDef_L500_C4", "vector": [4, 2, 0.716, 0.0028, 2, 0.44, 0.5, 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_99056:Return_L506_C12", "label": "return", "type": "return", "loc": [506, 506], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99056:If_L505_C8", "vector": [13, 3, 0.7167, 0.0014, 3, 0.89, 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_99056:Return_L507_C8", "label": "return", "type": "return", "loc": [507, 507], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99056:FunctionDef_L500_C4", "vector": [13, 2, 0.7181, 0.0014, 2, 0.44, 1.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return unicode(value)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99056:FunctionDef_L509_C4", "label": "value_to_db_time", "type": "function", "loc": [509, 516], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99056:ClassDef_L198_C0", "vector": [2, 1, 0.7259, 0.0113, 1, 0.41, 0.8696, 929, 0, 2, 1, 0, 0, 0, 1], "semantic": {"name": "value_to_db_time", "arg_names": ["self", "value"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def value_to_db_time(self, value):\n \"\"\"\n Transform a datetime value to an object compatible with what is expected\n by the backend driver for time columns.\n \"\"\"\n if value is None:\n return None\n return unicode(value)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99056:Expr_L510_C8", "label": "expression", "type": "expression", "loc": [510, 513], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99056:FunctionDef_L509_C4", "vector": [8, 2, 0.7245, 0.0057, 2, 0.97, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"\n Transform a datetime value to an object compatible with what is expected\n by the backend driver for time columns.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99056:If_L514_C8", "label": "if", "type": "if", "loc": [514, 515], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99056:FunctionDef_L509_C4", "vector": [4, 2, 0.7288, 0.0028, 2, 0.97, 0.5, 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_99056:Return_L515_C12", "label": "return", "type": "return", "loc": [515, 515], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99056:If_L514_C8", "vector": [13, 3, 0.7295, 0.0014, 3, 0.67, 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_99056:Return_L516_C8", "label": "return", "type": "return", "loc": [516, 516], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99056:FunctionDef_L509_C4", "vector": [13, 2, 0.7309, 0.0014, 2, 0.97, 1.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return unicode(value)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99056:FunctionDef_L518_C4", "label": "value_to_db_decimal", "type": "function", "loc": [518, 525], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99056:ClassDef_L198_C0", "vector": [2, 1, 0.7387, 0.0113, 1, 0.41, 0.8913, 343, 0, 4, 1, 0, 0, 0, 1], "semantic": {"name": "value_to_db_decimal", "arg_names": ["self", "value", "max_digits", "decimal_places"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def value_to_db_decimal(self, value, max_digits, decimal_places):\n \"\"\"\n Transform a decimal.Decimal value to an object compatible with what is\n expected by the backend driver for decimal (numeric) columns.\n \"\"\"\n if value is None:\n return None\n return util.format_number(value, max_digits, decimal_places)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99056:Expr_L519_C8", "label": "expression", "type": "expression", "loc": [519, 522], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99056:FunctionDef_L518_C4", "vector": [8, 2, 0.7373, 0.0057, 2, 0.67, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"\n Transform a decimal.Decimal value to an object compatible with what is\n expected by the backend driver for decimal (numeric) columns.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99056:If_L523_C8", "label": "if", "type": "if", "loc": [523, 524], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99056:FunctionDef_L518_C4", "vector": [4, 2, 0.7415, 0.0028, 2, 0.67, 0.5, 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_99056:Return_L524_C12", "label": "return", "type": "return", "loc": [524, 524], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99056:If_L523_C8", "vector": [13, 3, 0.7422, 0.0014, 3, 0.29, 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_99056:Return_L525_C8", "label": "return", "type": "return", "loc": [525, 525], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99056:FunctionDef_L518_C4", "vector": [13, 2, 0.7436, 0.0014, 2, 0.67, 1.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return util.format_number(value, max_digits, decimal_places)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99056:FunctionDef_L527_C4", "label": "year_lookup_bounds", "type": "function", "loc": [527, 536], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99056:ClassDef_L198_C0", "vector": [2, 1, 0.7528, 0.0142, 1, 0.41, 0.913, 768, 0, 2, 1, 0, 0, 0, 0], "semantic": {"name": "year_lookup_bounds", "arg_names": ["self", "value"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def year_lookup_bounds(self, value):\n \"\"\"\n Returns a two-elements list with the lower and upper bound to be used\n with a BETWEEN operator to query a field value using a year lookup\n\n `value` is an int, containing the looked-up year.\n \"\"\"\n first = '%s-01-01 00:00:00'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99056:Expr_L528_C8", "label": "expression", "type": "expression", "loc": [528, 533], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99056:FunctionDef_L527_C4", "vector": [8, 2, 0.7514, 0.0085, 2, 0.48, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"\n Returns a two-elements list with the lower and upper bound to be used\n with a BETWEEN operator to query a field value using a year lookup\n\n `value` is an int, containing the looked-up year.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99056:Assign_L534_C8", "label": "first =", "type": "assigned_variable", "loc": [534, 534], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99056:FunctionDef_L527_C4", "vector": [14, 2, 0.7564, 0.0014, 2, 0.48, 0.3333, 199, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "first", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " first = '%s-01-01 00:00:00'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99056:Assign_L535_C8", "label": "second =", "type": "assigned_variable", "loc": [535, 535], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99056:FunctionDef_L527_C4", "vector": [14, 2, 0.7578, 0.0014, 2, 0.48, 0.6667, 822, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "second", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " second = '%s-12-31 23:59:59.999999'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99056:Return_L536_C8", "label": "return", "type": "return", "loc": [536, 536], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99056:FunctionDef_L527_C4", "vector": [13, 2, 0.7592, 0.0014, 2, 0.48, 1.0, 0, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return [first % value, second % value]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99056:FunctionDef_L538_C4", "label": "year_lookup_bounds_for_date_field", "type": "function", "loc": [538, 549], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99056:ClassDef_L198_C0", "vector": [2, 1, 0.7698, 0.017, 1, 0.41, 0.9348, 672, 0, 2, 1, 0, 0, 0, 1], "semantic": {"name": "year_lookup_bounds_for_date_field", "arg_names": ["self", "value"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def year_lookup_bounds_for_date_field(self, value):\n \"\"\"\n Returns a two-elements list with the lower and upper bound to be used\n with a BETWEEN operator to query a DateField value using a year lookup\n\n `value` is an int, containing the looked-up year.\n\n By default, it just calls `self.year_lookup_bounds`. Some backends need"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99056:Expr_L539_C8", "label": "expression", "type": "expression", "loc": [539, 548], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99056:FunctionDef_L538_C4", "vector": [8, 2, 0.7698, 0.0142, 2, 0.16, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"\n Returns a two-elements list with the lower and upper bound to be used\n with a BETWEEN operator to query a DateField value using a year lookup\n\n `value` is an int, containing the looked-up year.\n\n By default, it just calls `self.year_lookup_bounds`. Some backends need\n this hook because on their DB date fields can't be compared to values"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99056:Return_L549_C8", "label": "return", "type": "return", "loc": [549, 549], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99056:FunctionDef_L538_C4", "vector": [13, 2, 0.7776, 0.0014, 2, 0.16, 1.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self.year_lookup_bounds(value)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99056:FunctionDef_L551_C4", "label": "convert_values", "type": "function", "loc": [551, 564], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99056:ClassDef_L198_C0", "vector": [2, 1, 0.7897, 0.0198, 1, 0.41, 0.9565, 870, 0, 3, 1, 0, 0, 0, 4], "semantic": {"name": "convert_values", "arg_names": ["self", "value", "field"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def convert_values(self, value, field):\n \"\"\"Coerce the value returned by the database backend into a consistent type that\n is compatible with the field type.\n \"\"\"\n internal_type = field.get_internal_type()\n if internal_type == 'DecimalField':\n return value\n elif internal_type and internal_type.endswith('IntegerField') or internal_type == 'AutoField':"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99056:Expr_L552_C8", "label": "expression", "type": "expression", "loc": [552, 554], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99056:FunctionDef_L551_C4", "vector": [8, 2, 0.7833, 0.0042, 2, 0.55, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Coerce the value returned by the database backend into a consistent type that\n is compatible with the field type.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99056:Assign_L555_C8", "label": "internal_type = get_internal_type()", "type": "assigned_variable", "loc": [555, 555], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99056:FunctionDef_L551_C4", "vector": [14, 2, 0.7861, 0.0014, 2, 0.55, 0.3333, 386, 3, 0, 0, 0, 291, 10, 1], "semantic": {"name": "internal_type", "arg_names": [], "import_names": [], "rhs_call_name": "get_internal_type", "annotation": ""}, "snippet": " internal_type = field.get_internal_type()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99056:If_L556_C8", "label": "if", "type": "if", "loc": [556, 561], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99056:FunctionDef_L551_C4", "vector": [4, 2, 0.7911, 0.0085, 2, 0.55, 0.6667, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if internal_type == 'DecimalField':\n return value\n elif internal_type and internal_type.endswith('IntegerField') or internal_type == 'AutoField':\n return int(value)\n elif internal_type in ('DateField', 'DateTimeField', 'TimeField'):\n return value"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99056:Return_L557_C12", "label": "return", "type": "return", "loc": [557, 557], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99056:If_L556_C8", "vector": [13, 3, 0.789, 0.0014, 3, 0.19, 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_99056:If_L558_C8", "label": "if", "type": "if", "loc": [558, 561], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99056:If_L556_C8", "vector": [4, 3, 0.7925, 0.0057, 3, 0.19, 1.0, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " elif internal_type and internal_type.endswith('IntegerField') or internal_type == 'AutoField':\n return int(value)\n elif internal_type in ('DateField', 'DateTimeField', 'TimeField'):\n return value"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99056:Return_L559_C12", "label": "return", "type": "return", "loc": [559, 559], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99056:If_L558_C8", "vector": [13, 4, 0.7918, 0.0014, 4, 0.11, 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_99056:If_L560_C8", "label": "if", "type": "if", "loc": [560, 561], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99056:If_L558_C8", "vector": [4, 4, 0.7939, 0.0028, 4, 0.11, 1.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " elif internal_type in ('DateField', 'DateTimeField', 'TimeField'):\n return value"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99056:Return_L561_C12", "label": "return", "type": "return", "loc": [561, 561], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99056:If_L560_C8", "vector": [13, 5, 0.7946, 0.0014, 5, 0.74, 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_99056:Return_L564_C8", "label": "return", "type": "return", "loc": [564, 564], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99056:FunctionDef_L551_C4", "vector": [13, 2, 0.7989, 0.0014, 2, 0.55, 1.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return float(value)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99056:FunctionDef_L566_C4", "label": "check_aggregate_support", "type": "function", "loc": [566, 574], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99056:ClassDef_L198_C0", "vector": [2, 1, 0.8074, 0.0127, 1, 0.41, 0.9783, 517, 0, 2, 0, 0, 0, 0, 0], "semantic": {"name": "check_aggregate_support", "arg_names": ["self", "aggregate_func"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def check_aggregate_support(self, aggregate_func):\n \"\"\"Check that the backend supports the provided aggregate\n\n This is used on specific backends to rule out known aggregates\n that are known to have faulty implementations. If the named\n aggregate function has a known problem, the backend should\n raise NotImplemented.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99056:Expr_L567_C8", "label": "expression", "type": "expression", "loc": [567, 573], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99056:FunctionDef_L566_C4", "vector": [8, 2, 0.8074, 0.0099, 2, 0.35, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Check that the backend supports the provided aggregate\n\n This is used on specific backends to rule out known aggregates\n that are known to have faulty implementations. If the named\n aggregate function has a known problem, the backend should\n raise NotImplemented.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99056:FunctionDef_L576_C4", "label": "combine_expression", "type": "function", "loc": [576, 583], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99056:ClassDef_L198_C0", "vector": [2, 1, 0.8208, 0.0113, 1, 0.41, 1.0, 771, 0, 3, 1, 0, 0, 0, 1], "semantic": {"name": "combine_expression", "arg_names": ["self", "connector", "sub_expressions"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def combine_expression(self, connector, sub_expressions):\n \"\"\"Combine a list of subexpressions into a single expression, using\n the provided connecting operator. This is required because operators\n can vary between backends (e.g., Oracle with %% and &) and between\n subexpression types (e.g., date expressions)\n \"\"\"\n conn = ' %s ' % connector\n return conn.join(sub_expressions)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99056:Expr_L577_C8", "label": "expression", "type": "expression", "loc": [577, 581], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99056:FunctionDef_L576_C4", "vector": [8, 2, 0.8201, 0.0071, 2, 0.94, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Combine a list of subexpressions into a single expression, using\n the provided connecting operator. This is required because operators\n can vary between backends (e.g., Oracle with %% and &) and between\n subexpression types (e.g., date expressions)\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99056:Assign_L582_C8", "label": "conn =", "type": "assigned_variable", "loc": [582, 582], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99056:FunctionDef_L576_C4", "vector": [14, 2, 0.8244, 0.0014, 2, 0.94, 0.5, 345, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "conn", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " conn = ' %s ' % connector"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99056:Return_L583_C8", "label": "return", "type": "return", "loc": [583, 583], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99056:FunctionDef_L576_C4", "vector": [13, 2, 0.8258, 0.0014, 2, 0.94, 1.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return conn.join(sub_expressions)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99056:ClassDef_L585_C0", "label": "BaseDatabaseIntrospection", "type": "class", "loc": [585, 679], "level": 0, "parent": null, "vector": [3, 0, 0.8952, 0.1346, 0, 0.66, 0.8182, 41, 0, 7, 0, 0, 186, 0, 25], "semantic": {"name": "BaseDatabaseIntrospection", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class BaseDatabaseIntrospection(object):\n \"\"\"\n This class encapsulates all backend-specific introspection utilities\n \"\"\"\n data_types_reverse = {}\n\n def __init__(self, connection):\n self.connection = connection"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99056:Expr_L586_C4", "label": "expression", "type": "expression", "loc": [586, 588], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99056:ClassDef_L585_C0", "vector": [8, 1, 0.8314, 0.0042, 1, 0.39, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"\n This class encapsulates all backend-specific introspection utilities\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99056:Assign_L589_C4", "label": "data_types_reverse =", "type": "assigned_variable", "loc": [589, 589], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99056:ClassDef_L585_C0", "vector": [14, 1, 0.8343, 0.0014, 1, 0.39, 0.125, 403, 0, 0, 0, 0, 0, 6, 0], "semantic": {"name": "data_types_reverse", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " data_types_reverse = {}"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99056:FunctionDef_L591_C4", "label": "__init__", "type": "function", "loc": [591, 592], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99056:ClassDef_L585_C0", "vector": [2, 1, 0.8378, 0.0028, 1, 0.39, 0.25, 555, 0, 2, 0, 0, 0, 0, 0], "semantic": {"name": "__init__", "arg_names": ["self", "connection"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, connection):\n self.connection = connection"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99056:Assign_L592_C8", "label": "self.connection =", "type": "assigned_variable", "loc": [592, 592], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99056:FunctionDef_L591_C4", "vector": [14, 2, 0.8385, 0.0014, 2, 0.77, 0.0, 685, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.connection", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.connection = connection"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99056:FunctionDef_L594_C4", "label": "get_field_type", "type": "function", "loc": [594, 600], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99056:ClassDef_L585_C0", "vector": [2, 1, 0.8456, 0.0099, 1, 0.39, 0.375, 691, 0, 3, 1, 0, 0, 0, 0], "semantic": {"name": "get_field_type", "arg_names": ["self", "data_type", "description"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def get_field_type(self, data_type, description):\n \"\"\"Hook for a database backend to use the cursor description to\n match a Django field type to a database column.\n\n For Oracle, the column data_type on its own is insufficient to\n distinguish between a FloatField and IntegerField, for example.\"\"\"\n return self.data_types_reverse[data_type]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99056:Expr_L595_C8", "label": "expression", "type": "expression", "loc": [595, 599], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99056:FunctionDef_L594_C4", "vector": [8, 2, 0.8456, 0.0071, 2, 0.84, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Hook for a database backend to use the cursor description to\n match a Django field type to a database column.\n\n For Oracle, the column data_type on its own is insufficient to\n distinguish between a FloatField and IntegerField, for example.\"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99056:Return_L600_C8", "label": "return", "type": "return", "loc": [600, 600], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99056:FunctionDef_L594_C4", "vector": [13, 2, 0.8499, 0.0014, 2, 0.84, 1.0, 0, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self.data_types_reverse[data_type]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99056:FunctionDef_L602_C4", "label": "table_name_converter", "type": "function", "loc": [602, 607], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99056:ClassDef_L585_C0", "vector": [2, 1, 0.8562, 0.0085, 1, 0.39, 0.5, 438, 0, 2, 1, 0, 0, 0, 0], "semantic": {"name": "table_name_converter", "arg_names": ["self", "name"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def table_name_converter(self, name):\n \"\"\"Apply a conversion to the name for the purposes of comparison.\n\n The default table name converter is for case sensitive comparison.\n \"\"\"\n return name"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99056:Expr_L603_C8", "label": "expression", "type": "expression", "loc": [603, 606], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99056:FunctionDef_L602_C4", "vector": [8, 2, 0.8562, 0.0057, 2, 0.97, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Apply a conversion to the name for the purposes of comparison.\n\n The default table name converter is for case sensitive comparison.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99056:Return_L607_C8", "label": "return", "type": "return", "loc": [607, 607], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99056:FunctionDef_L602_C4", "vector": [13, 2, 0.8598, 0.0014, 2, 0.97, 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_99056:FunctionDef_L609_C4", "label": "table_names", "type": "function", "loc": [609, 612], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99056:ClassDef_L585_C0", "vector": [2, 1, 0.8647, 0.0057, 1, 0.39, 0.625, 480, 0, 1, 1, 0, 0, 0, 2], "semantic": {"name": "table_names", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def table_names(self):\n \"Returns a list of names of all tables that exist in the database.\"\n cursor = self.connection.cursor()\n return self.get_table_list(cursor)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99056:Expr_L610_C8", "label": "expression", "type": "expression", "loc": [610, 610], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99056:FunctionDef_L609_C4", "vector": [8, 2, 0.864, 0.0014, 2, 0.47, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"Returns a list of names of all tables that exist in the database.\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99056:Assign_L611_C8", "label": "cursor = cursor()", "type": "assigned_variable", "loc": [611, 611], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99056:FunctionDef_L609_C4", "vector": [14, 2, 0.8654, 0.0014, 2, 0.47, 0.5, 231, 3, 0, 0, 0, 231, 10, 1], "semantic": {"name": "cursor", "arg_names": [], "import_names": [], "rhs_call_name": "cursor", "annotation": ""}, "snippet": " cursor = self.connection.cursor()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99056:Return_L612_C8", "label": "return", "type": "return", "loc": [612, 612], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99056:FunctionDef_L609_C4", "vector": [13, 2, 0.8669, 0.0014, 2, 0.47, 1.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self.get_table_list(cursor)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99056:FunctionDef_L614_C4", "label": "django_table_names", "type": "function", "loc": [614, 639], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99056:ClassDef_L585_C0", "vector": [2, 1, 0.8874, 0.0368, 1, 0.39, 0.75, 189, 0, 2, 1, 0, 0, 0, 9], "semantic": {"name": "django_table_names", "arg_names": ["self", "only_existing"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def django_table_names(self, only_existing=False):\n \"\"\"\n Returns a list of all table names that have associated Django models and\n are in INSTALLED_APPS.\n\n If only_existing is True, the resulting list will only include the tables\n that actually exist in the database.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99056:Expr_L615_C8", "label": "expression", "type": "expression", "loc": [615, 621], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99056:FunctionDef_L614_C4", "vector": [8, 2, 0.8754, 0.0099, 2, 0.23, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"\n Returns a list of all table names that have associated Django models and\n are in INSTALLED_APPS.\n\n If only_existing is True, the resulting list will only include the tables\n that actually exist in the database.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99056:ImportFrom_L622_C8", "label": "from django.db import models, router", "type": "import", "loc": [622, 622], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99056:FunctionDef_L614_C4", "vector": [1, 2, 0.881, 0.0014, 2, 0.23, 0.2, 40, 0, 2, 0, 0, 40, 0, 0], "semantic": {"name": "django.db", "arg_names": [], "import_names": ["models", "router"], "rhs_call_name": "", "annotation": ""}, "snippet": " from django.db import models, router"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99056:Assign_L623_C8", "label": "tables = set()", "type": "assigned_variable", "loc": [623, 623], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99056:FunctionDef_L614_C4", "vector": [14, 2, 0.8824, 0.0014, 2, 0.23, 0.4, 475, 3, 0, 0, 0, 21, 10, 1], "semantic": {"name": "tables", "arg_names": [], "import_names": [], "rhs_call_name": "set", "annotation": ""}, "snippet": " tables = set()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99056:For_L624_C8", "label": "for app", "type": "for", "loc": [624, 631], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99056:FunctionDef_L614_C4", "vector": [6, 2, 0.8888, 0.0113, 2, 0.23, 0.6, 494, 3, 0, 0, 0, 0, 0, 6], "semantic": {"name": "app", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for app in models.get_apps():\n for model in models.get_models(app):\n if not model._meta.managed:\n continue\n if not router.allow_syncdb(self.connection.alias, model):\n continue\n tables.add(model._meta.db_table)\n tables.update([f.m2m_db_table() for f in model._meta.local_many_to_many])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99056:For_L625_C12", "label": "for model", "type": "for", "loc": [625, 631], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99056:For_L624_C8", "vector": [6, 3, 0.8895, 0.0099, 3, 0.71, 0.0, 722, 3, 0, 0, 0, 0, 0, 5], "semantic": {"name": "model", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for model in models.get_models(app):\n if not model._meta.managed:\n continue\n if not router.allow_syncdb(self.connection.alias, model):\n continue\n tables.add(model._meta.db_table)\n tables.update([f.m2m_db_table() for f in model._meta.local_many_to_many])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99056:If_L626_C16", "label": "if", "type": "if", "loc": [626, 627], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99056:For_L625_C12", "vector": [4, 4, 0.8874, 0.0028, 4, 0.18, 0.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not model._meta.managed:\n continue"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99056:If_L628_C16", "label": "if", "type": "if", "loc": [628, 629], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99056:For_L625_C12", "vector": [4, 4, 0.8902, 0.0028, 4, 0.18, 0.3333, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not router.allow_syncdb(self.connection.alias, model):\n continue"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99056:Expr_L630_C16", "label": "add()", "type": "expression", "loc": [630, 630], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99056:For_L625_C12", "vector": [8, 4, 0.8924, 0.0014, 4, 0.18, 0.6667, 241, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "add", "arg_names": [], "import_names": [], "rhs_call_name": "add", "annotation": ""}, "snippet": " tables.add(model._meta.db_table)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99056:Expr_L631_C16", "label": "update()", "type": "expression", "loc": [631, 631], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99056:For_L625_C12", "vector": [8, 4, 0.8938, 0.0014, 4, 0.18, 1.0, 637, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "update", "arg_names": [], "import_names": [], "rhs_call_name": "update", "annotation": ""}, "snippet": " tables.update([f.m2m_db_table() for f in model._meta.local_many_to_many])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99056:If_L632_C8", "label": "if", "type": "if", "loc": [632, 638], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99056:FunctionDef_L614_C4", "vector": [4, 2, 0.8994, 0.0099, 2, 0.23, 0.8, 0, 2, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if only_existing:\n existing_tables = self.table_names()\n tables = [\n t\n for t in tables\n if self.table_name_converter(t) in existing_tables\n ]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99056:Assign_L633_C12", "label": "existing_tables = table_names()", "type": "assigned_variable", "loc": [633, 633], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99056:If_L632_C8", "vector": [14, 3, 0.8966, 0.0014, 3, 0.44, 0.0, 699, 3, 0, 0, 0, 480, 10, 1], "semantic": {"name": "existing_tables", "arg_names": [], "import_names": [], "rhs_call_name": "table_names", "annotation": ""}, "snippet": " existing_tables = self.table_names()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99056:Assign_L634_C12", "label": "tables =", "type": "assigned_variable", "loc": [634, 638], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99056:If_L632_C8", "vector": [14, 3, 0.9008, 0.0071, 3, 0.44, 1.0, 475, 5, 0, 0, 0, 0, 0, 1], "semantic": {"name": "tables", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " tables = [\n t\n for t in tables\n if self.table_name_converter(t) in existing_tables\n ]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99056:Return_L639_C8", "label": "return", "type": "return", "loc": [639, 639], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99056:FunctionDef_L614_C4", "vector": [13, 2, 0.9051, 0.0014, 2, 0.23, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return tables"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99056:FunctionDef_L641_C4", "label": "installed_models", "type": "function", "loc": [641, 653], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99056:ClassDef_L585_C0", "vector": [2, 1, 0.9164, 0.0184, 1, 0.39, 0.875, 775, 0, 2, 1, 0, 0, 0, 7], "semantic": {"name": "installed_models", "arg_names": ["self", "tables"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def installed_models(self, tables):\n \"Returns a set of all models represented by the provided list of table names.\"\n from django.db import models, router\n all_models = []\n for app in models.get_apps():\n for model in models.get_models(app):\n if router.allow_syncdb(self.connection.alias, model):\n all_models.append(model)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99056:Expr_L642_C8", "label": "expression", "type": "expression", "loc": [642, 642], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99056:FunctionDef_L641_C4", "vector": [8, 2, 0.9093, 0.0014, 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 a set of all models represented by the provided list of table names.\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99056:ImportFrom_L643_C8", "label": "from django.db import models, router", "type": "import", "loc": [643, 643], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99056:FunctionDef_L641_C4", "vector": [1, 2, 0.9108, 0.0014, 2, 0.55, 0.2, 40, 0, 2, 0, 0, 40, 0, 0], "semantic": {"name": "django.db", "arg_names": [], "import_names": ["models", "router"], "rhs_call_name": "", "annotation": ""}, "snippet": " from django.db import models, router"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99056:Assign_L644_C8", "label": "all_models =", "type": "assigned_variable", "loc": [644, 644], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99056:FunctionDef_L641_C4", "vector": [14, 2, 0.9122, 0.0014, 2, 0.55, 0.4, 581, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "all_models", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " all_models = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99056:For_L645_C8", "label": "for app", "type": "for", "loc": [645, 648], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99056:FunctionDef_L641_C4", "vector": [6, 2, 0.9157, 0.0057, 2, 0.55, 0.6, 494, 3, 0, 0, 0, 0, 0, 4], "semantic": {"name": "app", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for app in models.get_apps():\n for model in models.get_models(app):\n if router.allow_syncdb(self.connection.alias, model):\n all_models.append(model)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99056:For_L646_C12", "label": "for model", "type": "for", "loc": [646, 648], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99056:For_L645_C8", "vector": [6, 3, 0.9164, 0.0042, 3, 0.4, 0.0, 722, 3, 0, 0, 0, 0, 0, 3], "semantic": {"name": "model", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for model in models.get_models(app):\n if router.allow_syncdb(self.connection.alias, model):\n all_models.append(model)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99056:If_L647_C16", "label": "if", "type": "if", "loc": [647, 648], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99056:For_L646_C12", "vector": [4, 4, 0.9171, 0.0028, 4, 0.49, 0.0, 0, 3, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if router.allow_syncdb(self.connection.alias, model):\n all_models.append(model)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99056:Expr_L648_C20", "label": "append()", "type": "expression", "loc": [648, 648], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99056:If_L647_C16", "vector": [8, 5, 0.9178, 0.0014, 5, 0.43, 0.0, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " all_models.append(model)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99056:Assign_L649_C8", "label": "tables = map()", "type": "assigned_variable", "loc": [649, 649], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99056:FunctionDef_L641_C4", "vector": [14, 2, 0.9193, 0.0014, 2, 0.55, 0.8, 475, 3, 2, 0, 0, 53, 10, 1], "semantic": {"name": "tables", "arg_names": [], "import_names": [], "rhs_call_name": "map", "annotation": ""}, "snippet": " tables = map(self.table_name_converter, tables)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99056:Return_L650_C8", "label": "return", "type": "return", "loc": [650, 653], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99056:FunctionDef_L641_C4", "vector": [13, 2, 0.9228, 0.0057, 2, 0.55, 1.0, 0, 3, 0, 0, 0, 0, 10, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return set([\n m for m in all_models\n if self.table_name_converter(m._meta.db_table) in tables\n ])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99056:FunctionDef_L655_C4", "label": "sequence_list", "type": "function", "loc": [655, 679], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99056:ClassDef_L585_C0", "vector": [2, 1, 0.9448, 0.0354, 1, 0.39, 1.0, 741, 0, 1, 1, 0, 0, 0, 7], "semantic": {"name": "sequence_list", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def sequence_list(self):\n \"Returns a list of information about all DB sequences for all models in all apps.\"\n from django.db import models, router\n\n apps = models.get_apps()\n sequence_list = []\n\n for app in apps:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99056:Expr_L656_C8", "label": "expression", "type": "expression", "loc": [656, 656], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99056:FunctionDef_L655_C4", "vector": [8, 2, 0.9292, 0.0014, 2, 0.47, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"Returns a list of information about all DB sequences for all models in all apps.\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99056:ImportFrom_L657_C8", "label": "from django.db import models, router", "type": "import", "loc": [657, 657], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99056:FunctionDef_L655_C4", "vector": [1, 2, 0.9306, 0.0014, 2, 0.47, 0.2, 40, 0, 2, 0, 0, 40, 0, 0], "semantic": {"name": "django.db", "arg_names": [], "import_names": ["models", "router"], "rhs_call_name": "", "annotation": ""}, "snippet": " from django.db import models, router"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99056:Assign_L659_C8", "label": "apps = get_apps()", "type": "assigned_variable", "loc": [659, 659], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99056:FunctionDef_L655_C4", "vector": [14, 2, 0.9334, 0.0014, 2, 0.47, 0.4, 556, 3, 0, 0, 0, 221, 10, 1], "semantic": {"name": "apps", "arg_names": [], "import_names": [], "rhs_call_name": "get_apps", "annotation": ""}, "snippet": " apps = models.get_apps()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99056:Assign_L660_C8", "label": "sequence_list =", "type": "assigned_variable", "loc": [660, 660], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99056:FunctionDef_L655_C4", "vector": [14, 2, 0.9348, 0.0014, 2, 0.47, 0.6, 741, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "sequence_list", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " sequence_list = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99056:For_L662_C8", "label": "for app", "type": "for", "loc": [662, 677], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99056:FunctionDef_L655_C4", "vector": [6, 2, 0.9483, 0.0227, 2, 0.47, 0.8, 494, 2, 0, 0, 0, 0, 0, 6], "semantic": {"name": "app", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for app in apps:\n for model in models.get_models(app):\n if not model._meta.managed:\n continue\n if not router.allow_syncdb(self.connection.alias, model):\n continue\n for f in model._meta.local_fields:\n if isinstance(f, models.AutoField):"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99056:For_L663_C12", "label": "for model", "type": "for", "loc": [663, 677], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99056:For_L662_C8", "vector": [6, 3, 0.949, 0.0212, 3, 0.09, 0.0, 722, 3, 0, 0, 0, 0, 0, 6], "semantic": {"name": "model", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for model in models.get_models(app):\n if not model._meta.managed:\n continue\n if not router.allow_syncdb(self.connection.alias, model):\n continue\n for f in model._meta.local_fields:\n if isinstance(f, models.AutoField):\n sequence_list.append({'table': model._meta.db_table, 'column': f.column})"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99056:If_L664_C16", "label": "if", "type": "if", "loc": [664, 665], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99056:For_L663_C12", "vector": [4, 4, 0.9412, 0.0028, 4, 0.02, 0.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not model._meta.managed:\n continue"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99056:If_L666_C16", "label": "if", "type": "if", "loc": [666, 667], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99056:For_L663_C12", "vector": [4, 4, 0.9441, 0.0028, 4, 0.02, 0.3333, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not router.allow_syncdb(self.connection.alias, model):\n continue"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99056:For_L668_C16", "label": "for f", "type": "for", "loc": [668, 671], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99056:For_L663_C12", "vector": [6, 4, 0.9483, 0.0057, 4, 0.02, 0.6667, 899, 7, 0, 0, 0, 0, 0, 2], "semantic": {"name": "f", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for f in model._meta.local_fields:\n if isinstance(f, models.AutoField):\n sequence_list.append({'table': model._meta.db_table, 'column': f.column})\n break # Only one AutoField is allowed per model, so don't bother continuing."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99056:If_L669_C20", "label": "if", "type": "if", "loc": [669, 671], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99056:For_L668_C16", "vector": [4, 5, 0.949, 0.0042, 5, 0.93, 0.0, 0, 3, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if isinstance(f, models.AutoField):\n sequence_list.append({'table': model._meta.db_table, 'column': f.column})\n break # Only one AutoField is allowed per model, so don't bother continuing."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99056:Expr_L670_C24", "label": "append()", "type": "expression", "loc": [670, 670], "level": 6, "parent": "ajibawa-2023/Python-Code-Large/train/row_99056:If_L669_C20", "vector": [8, 6, 0.949, 0.0014, 6, 0.59, 0.0, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " sequence_list.append({'table': model._meta.db_table, 'column': f.column})"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99056:For_L673_C16", "label": "for f", "type": "for", "loc": [673, 677], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99056:For_L663_C12", "vector": [6, 4, 0.9561, 0.0071, 4, 0.02, 1.0, 899, 7, 0, 0, 0, 0, 0, 2], "semantic": {"name": "f", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for f in model._meta.local_many_to_many:\n # If this is an m2m using an intermediate table,\n # we don't need to reset the sequence.\n if f.rel.through is None:\n sequence_list.append({'table': f.m2m_db_table(), 'column': None})"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99056:If_L676_C20", "label": "if", "type": "if", "loc": [676, 677], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99056:For_L673_C16", "vector": [4, 5, 0.9582, 0.0028, 5, 0.03, 0.0, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if f.rel.through is None:\n sequence_list.append({'table': f.m2m_db_table(), 'column': None})"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99056:Expr_L677_C24", "label": "append()", "type": "expression", "loc": [677, 677], "level": 6, "parent": "ajibawa-2023/Python-Code-Large/train/row_99056:If_L676_C20", "vector": [8, 6, 0.9589, 0.0014, 6, 0.35, 0.0, 243, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " sequence_list.append({'table': f.m2m_db_table(), 'column': None})"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99056:Return_L679_C8", "label": "return", "type": "return", "loc": [679, 679], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99056:FunctionDef_L655_C4", "vector": [13, 2, 0.9618, 0.0014, 2, 0.47, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return sequence_list"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99056:ClassDef_L681_C0", "label": "BaseDatabaseClient", "type": "class", "loc": [681, 695], "level": 0, "parent": null, "vector": [3, 0, 0.9745, 0.0212, 0, 0.66, 0.9091, 729, 0, 2, 0, 0, 186, 0, 1], "semantic": {"name": "BaseDatabaseClient", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class BaseDatabaseClient(object):\n \"\"\"\n This class encapsulates all backend-specific methods for opening a\n client shell.\n \"\"\"\n # This should be a string representing the name of the executable\n # (e.g., \"psql\"). Subclasses must override this.\n executable_name = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99056:Expr_L682_C4", "label": "expression", "type": "expression", "loc": [682, 685], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99056:ClassDef_L681_C0", "vector": [8, 1, 0.9681, 0.0057, 1, 0.67, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"\n This class encapsulates all backend-specific methods for opening a\n client shell.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99056:Assign_L688_C4", "label": "executable_name =", "type": "assigned_variable", "loc": [688, 688], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99056:ClassDef_L681_C0", "vector": [14, 1, 0.9745, 0.0014, 1, 0.67, 0.3333, 723, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "executable_name", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " executable_name = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99056:FunctionDef_L690_C4", "label": "__init__", "type": "function", "loc": [690, 692], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99056:ClassDef_L681_C0", "vector": [2, 1, 0.9788, 0.0042, 1, 0.67, 0.6667, 555, 0, 2, 0, 0, 0, 0, 0], "semantic": {"name": "__init__", "arg_names": ["self", "connection"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, connection):\n # connection is an instance of BaseDatabaseWrapper.\n self.connection = connection"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99056:Assign_L692_C8", "label": "self.connection =", "type": "assigned_variable", "loc": [692, 692], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99056:FunctionDef_L690_C4", "vector": [14, 2, 0.9802, 0.0014, 2, 0.63, 0.0, 685, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.connection", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.connection = connection"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99056:FunctionDef_L694_C4", "label": "runshell", "type": "function", "loc": [694, 695], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99056:ClassDef_L681_C0", "vector": [2, 1, 0.9837, 0.0028, 1, 0.67, 1.0, 795, 0, 1, 0, 0, 0, 0, 1], "semantic": {"name": "runshell", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def runshell(self):\n raise NotImplementedError()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99056:ClassDef_L697_C0", "label": "BaseDatabaseValidation", "type": "class", "loc": [697, 706], "level": 0, "parent": null, "vector": [3, 0, 0.9936, 0.0142, 0, 0.66, 1.0, 818, 0, 2, 0, 0, 186, 0, 0], "semantic": {"name": "BaseDatabaseValidation", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class BaseDatabaseValidation(object):\n \"\"\"\n This class encapsualtes all backend-specific model validation.\n \"\"\"\n def __init__(self, connection):\n self.connection = connection\n\n def validate_field(self, errors, opts, f):"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99056:Expr_L698_C4", "label": "expression", "type": "expression", "loc": [698, 700], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99056:ClassDef_L697_C0", "vector": [8, 1, 0.9901, 0.0042, 1, 0.59, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"\n This class encapsualtes all backend-specific model validation.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99056:FunctionDef_L701_C4", "label": "__init__", "type": "function", "loc": [701, 702], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99056:ClassDef_L697_C0", "vector": [2, 1, 0.9936, 0.0028, 1, 0.59, 0.5, 555, 0, 2, 0, 0, 0, 0, 0], "semantic": {"name": "__init__", "arg_names": ["self", "connection"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, connection):\n self.connection = connection"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99056:Assign_L702_C8", "label": "self.connection =", "type": "assigned_variable", "loc": [702, 702], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99056:FunctionDef_L701_C4", "vector": [14, 2, 0.9943, 0.0014, 2, 0.5, 0.0, 685, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.connection", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.connection = connection"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99056:FunctionDef_L704_C4", "label": "validate_field", "type": "function", "loc": [704, 706], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99056:ClassDef_L697_C0", "vector": [2, 1, 0.9986, 0.0042, 1, 0.59, 1.0, 162, 0, 4, 0, 0, 0, 0, 0], "semantic": {"name": "validate_field", "arg_names": ["self", "errors", "opts", "f"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def validate_field(self, errors, opts, f):\n \"By default, there is no backend-specific validation\"\n pass"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99056:Expr_L705_C8", "label": "expression", "type": "expression", "loc": [705, 705], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99056:FunctionDef_L704_C4", "vector": [8, 2, 0.9986, 0.0014, 2, 0.3, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"By default, there is no backend-specific validation\""}]
[{"f": "ajibawa-2023/Python-Code-Large/train/row_99056:ClassDef_L9_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99056:Expr_L10_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99056:ClassDef_L9_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99056:Assign_L13_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99056:ClassDef_L9_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99056:FunctionDef_L15_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99056:FunctionDef_L15_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99056:Assign_L19_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99056:FunctionDef_L15_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99056:Assign_L20_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99056:FunctionDef_L15_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99056:Assign_L21_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99056:FunctionDef_L15_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99056:Assign_L22_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99056:FunctionDef_L15_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99056:Assign_L23_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99056:FunctionDef_L15_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99056:Assign_L24_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99056:ClassDef_L9_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99056:FunctionDef_L26_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99056:FunctionDef_L26_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99056:Return_L27_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99056:ClassDef_L9_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99056:FunctionDef_L29_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99056:FunctionDef_L29_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99056:Return_L30_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99056:ClassDef_L9_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99056:FunctionDef_L32_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99056:FunctionDef_L32_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99056:If_L33_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99056:If_L33_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99056:Return_L34_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99056:ClassDef_L9_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99056:FunctionDef_L36_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99056:FunctionDef_L36_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99056:If_L37_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99056:If_L37_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99056:Return_L38_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99056:ClassDef_L9_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99056:FunctionDef_L40_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99056:FunctionDef_L40_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99056:Expr_L41_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99056:ClassDef_L9_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99056:FunctionDef_L47_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99056:FunctionDef_L47_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99056:Expr_L48_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99056:ClassDef_L9_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99056:FunctionDef_L55_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99056:FunctionDef_L55_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99056:If_L56_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99056:If_L56_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99056:Return_L57_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99056:FunctionDef_L55_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99056:Expr_L58_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99056:ClassDef_L9_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99056:FunctionDef_L60_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99056:FunctionDef_L60_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99056:If_L61_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99056:If_L61_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99056:Return_L62_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99056:FunctionDef_L60_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99056:Expr_L63_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99056:ClassDef_L9_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99056:FunctionDef_L65_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99056:FunctionDef_L65_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99056:If_L66_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99056:If_L66_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99056:Return_L67_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99056:FunctionDef_L65_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99056:Expr_L68_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99056:ClassDef_L9_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99056:FunctionDef_L70_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99056:FunctionDef_L70_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99056:If_L71_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99056:If_L71_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99056:Expr_L72_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99056:If_L71_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99056:Assign_L73_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99056:ClassDef_L9_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99056:FunctionDef_L75_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99056:FunctionDef_L75_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99056:ImportFrom_L76_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99056:FunctionDef_L75_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99056:Assign_L77_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99056:FunctionDef_L75_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99056:If_L78_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99056:If_L78_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99056:Return_L80_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99056:FunctionDef_L75_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99056:Return_L81_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99056:ClassDef_L9_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99056:FunctionDef_L83_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99056:FunctionDef_L83_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99056:Return_L84_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99056:ClassDef_L86_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99056:Assign_L87_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99056:ClassDef_L86_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99056:Assign_L90_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99056:ClassDef_L86_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99056:Assign_L91_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99056:ClassDef_L86_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99056:Assign_L92_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99056:ClassDef_L86_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99056:Assign_L95_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99056:ClassDef_L86_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99056:Assign_L97_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99056:ClassDef_L86_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99056:Assign_L98_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99056:ClassDef_L86_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99056:Assign_L99_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99056:ClassDef_L86_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99056:Assign_L100_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99056:ClassDef_L86_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99056:Assign_L104_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99056:ClassDef_L86_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99056:Assign_L105_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99056:ClassDef_L86_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99056:Assign_L106_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99056:ClassDef_L86_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99056:Assign_L107_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99056:ClassDef_L86_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99056:Assign_L111_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99056:ClassDef_L86_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99056:Assign_L114_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99056:ClassDef_L86_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99056:Assign_L119_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99056:ClassDef_L86_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99056:Assign_L123_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99056:ClassDef_L86_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99056:Assign_L126_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99056:ClassDef_L86_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99056:Assign_L129_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99056:ClassDef_L86_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99056:Assign_L130_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99056:ClassDef_L86_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99056:Assign_L131_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99056:ClassDef_L86_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99056:Assign_L134_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99056:ClassDef_L86_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99056:Assign_L137_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99056:ClassDef_L86_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99056:Assign_L140_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99056:ClassDef_L86_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99056:Assign_L143_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99056:ClassDef_L86_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99056:Assign_L147_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99056:ClassDef_L86_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99056:Assign_L150_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99056:ClassDef_L86_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99056:Assign_L153_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99056:ClassDef_L86_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99056:Assign_L157_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99056:ClassDef_L86_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99056:Assign_L161_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99056:ClassDef_L86_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99056:Assign_L162_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99056:ClassDef_L86_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99056:Assign_L163_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99056:ClassDef_L86_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99056:FunctionDef_L165_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99056:FunctionDef_L165_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99056:Assign_L166_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99056:ClassDef_L86_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99056:FunctionDef_L168_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99056:FunctionDef_L168_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99056:Expr_L169_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99056:FunctionDef_L168_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99056:Assign_L170_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99056:FunctionDef_L168_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99056:Assign_L171_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99056:FunctionDef_L168_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99056:Assign_L172_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99056:ClassDef_L86_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99056:FunctionDef_L174_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99056:FunctionDef_L174_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99056:Expr_L175_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99056:FunctionDef_L174_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99056:Assign_L176_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99056:FunctionDef_L174_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99056:Expr_L177_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99056:FunctionDef_L174_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99056:Expr_L178_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99056:FunctionDef_L174_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99056:Expr_L179_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99056:FunctionDef_L174_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99056:Expr_L180_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99056:FunctionDef_L174_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99056:Expr_L181_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99056:FunctionDef_L174_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99056:Assign_L182_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99056:FunctionDef_L174_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99056:Expr_L183_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99056:FunctionDef_L174_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99056:Expr_L184_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99056:FunctionDef_L174_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99056:Return_L185_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99056:ClassDef_L86_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99056:FunctionDef_L187_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99056:FunctionDef_L187_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99056:Expr_L188_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99056:FunctionDef_L187_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99056:ClassDef_L189_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99056:ClassDef_L189_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99056:Assign_L190_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99056:FunctionDef_L187_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99056:Try_L192_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99056:Try_L192_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99056:Expr_L193_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99056:Try_L192_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99056:Assign_L195_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99056:ClassDef_L198_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99056:Expr_L199_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99056:ClassDef_L198_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99056:Assign_L204_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99056:ClassDef_L198_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99056:FunctionDef_L206_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99056:FunctionDef_L206_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99056:Assign_L207_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99056:ClassDef_L198_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99056:FunctionDef_L209_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99056:FunctionDef_L209_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99056:Expr_L210_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99056:FunctionDef_L209_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99056:Return_L216_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99056:ClassDef_L198_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99056:FunctionDef_L218_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99056:FunctionDef_L218_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99056:Expr_L219_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99056:ClassDef_L198_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99056:FunctionDef_L225_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99056:FunctionDef_L225_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99056:Expr_L226_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99056:ClassDef_L198_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99056:FunctionDef_L233_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99056:FunctionDef_L233_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99056:Expr_L234_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99056:FunctionDef_L233_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99056:Return_L240_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99056:ClassDef_L198_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99056:FunctionDef_L242_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99056:FunctionDef_L242_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99056:Expr_L243_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99056:FunctionDef_L242_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99056:Return_L247_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99056:ClassDef_L198_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99056:FunctionDef_L249_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99056:FunctionDef_L249_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99056:Expr_L250_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99056:FunctionDef_L249_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99056:Return_L253_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99056:ClassDef_L198_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99056:FunctionDef_L255_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99056:FunctionDef_L255_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99056:Expr_L256_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99056:FunctionDef_L255_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99056:Return_L260_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99056:ClassDef_L198_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99056:FunctionDef_L262_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99056:FunctionDef_L262_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99056:Expr_L263_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99056:FunctionDef_L262_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99056:Return_L268_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99056:ClassDef_L198_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99056:FunctionDef_L270_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99056:FunctionDef_L270_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99056:Expr_L271_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99056:FunctionDef_L270_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99056:Return_L277_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99056:ClassDef_L198_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99056:FunctionDef_L279_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99056:FunctionDef_L279_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99056:Expr_L280_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99056:FunctionDef_L279_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99056:Return_L285_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99056:ClassDef_L198_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99056:FunctionDef_L287_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99056:FunctionDef_L287_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99056:Expr_L288_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99056:ClassDef_L198_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99056:FunctionDef_L295_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99056:FunctionDef_L295_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99056:Expr_L296_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99056:FunctionDef_L295_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99056:ImportFrom_L305_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99056:FunctionDef_L295_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99056:Assign_L308_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99056:FunctionDef_L295_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99056:If_L309_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99056:If_L309_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99056:Assign_L310_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99056:If_L309_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99056:Assign_L312_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99056:FunctionDef_L295_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99056:Return_L314_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99056:ClassDef_L198_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99056:FunctionDef_L316_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99056:FunctionDef_L316_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99056:Expr_L317_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99056:FunctionDef_L316_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99056:Return_L324_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99056:ClassDef_L198_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99056:FunctionDef_L326_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99056:FunctionDef_L326_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99056:Expr_L327_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99056:FunctionDef_L326_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99056:Return_L332_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99056:ClassDef_L198_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99056:FunctionDef_L334_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99056:FunctionDef_L334_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99056:Expr_L335_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99056:FunctionDef_L334_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99056:Return_L339_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99056:ClassDef_L198_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99056:FunctionDef_L341_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99056:FunctionDef_L341_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99056:Expr_L342_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99056:FunctionDef_L341_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99056:Return_L346_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99056:ClassDef_L198_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99056:FunctionDef_L348_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99056:FunctionDef_L348_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99056:Expr_L349_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99056:ClassDef_L198_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99056:FunctionDef_L355_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99056:FunctionDef_L355_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99056:Expr_L356_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99056:FunctionDef_L355_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99056:Return_L360_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99056:ClassDef_L198_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99056:FunctionDef_L362_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99056:FunctionDef_L362_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99056:Expr_L363_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99056:FunctionDef_L362_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99056:Return_L367_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99056:ClassDef_L198_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99056:FunctionDef_L369_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99056:FunctionDef_L369_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99056:Expr_L370_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99056:ClassDef_L198_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99056:FunctionDef_L378_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99056:FunctionDef_L378_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99056:Expr_L379_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99056:FunctionDef_L378_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99056:If_L384_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99056:If_L384_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99056:Assign_L385_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99056:FunctionDef_L378_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99056:Return_L388_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99056:ClassDef_L198_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99056:FunctionDef_L390_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99056:FunctionDef_L390_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99056:Expr_L391_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99056:ClassDef_L198_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99056:FunctionDef_L397_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99056:FunctionDef_L397_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99056:Expr_L398_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99056:FunctionDef_L397_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99056:Return_L401_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99056:ClassDef_L198_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99056:FunctionDef_L403_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99056:FunctionDef_L403_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99056:Expr_L404_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99056:ClassDef_L198_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99056:FunctionDef_L414_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99056:FunctionDef_L414_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99056:Expr_L415_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99056:ClassDef_L198_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99056:FunctionDef_L422_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99056:FunctionDef_L422_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99056:Expr_L423_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99056:ClassDef_L198_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99056:FunctionDef_L428_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99056:FunctionDef_L428_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99056:Expr_L429_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99056:ClassDef_L198_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99056:FunctionDef_L434_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99056:FunctionDef_L434_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99056:Expr_L435_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99056:ClassDef_L198_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99056:FunctionDef_L445_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99056:FunctionDef_L445_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99056:Expr_L446_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99056:FunctionDef_L445_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99056:Return_L453_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99056:ClassDef_L198_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99056:FunctionDef_L455_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99056:FunctionDef_L455_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99056:Expr_L456_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99056:FunctionDef_L455_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99056:Return_L459_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99056:ClassDef_L198_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99056:FunctionDef_L461_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99056:FunctionDef_L461_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99056:If_L462_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99056:If_L462_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99056:Return_L463_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99056:FunctionDef_L461_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99056:Return_L464_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99056:ClassDef_L198_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99056:FunctionDef_L466_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99056:FunctionDef_L466_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99056:Expr_L467_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99056:FunctionDef_L466_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99056:Return_L471_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99056:ClassDef_L198_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99056:FunctionDef_L473_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99056:FunctionDef_L473_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99056:Expr_L474_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99056:FunctionDef_L473_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99056:ImportFrom_L475_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99056:FunctionDef_L473_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99056:Return_L476_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99056:ClassDef_L198_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99056:Assign_L480_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99056:ClassDef_L198_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99056:FunctionDef_L482_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99056:FunctionDef_L482_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99056:Expr_L483_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99056:FunctionDef_L482_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99056:If_L487_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99056:If_L487_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99056:Return_L488_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99056:FunctionDef_L482_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99056:Return_L489_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99056:ClassDef_L198_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99056:FunctionDef_L491_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99056:FunctionDef_L491_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99056:Expr_L492_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99056:FunctionDef_L491_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99056:If_L496_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99056:If_L496_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99056:Return_L497_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99056:FunctionDef_L491_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99056:Return_L498_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99056:ClassDef_L198_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99056:FunctionDef_L500_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99056:FunctionDef_L500_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99056:Expr_L501_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99056:FunctionDef_L500_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99056:If_L505_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99056:If_L505_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99056:Return_L506_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99056:FunctionDef_L500_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99056:Return_L507_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99056:ClassDef_L198_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99056:FunctionDef_L509_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99056:FunctionDef_L509_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99056:Expr_L510_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99056:FunctionDef_L509_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99056:If_L514_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99056:If_L514_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99056:Return_L515_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99056:FunctionDef_L509_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99056:Return_L516_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99056:ClassDef_L198_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99056:FunctionDef_L518_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99056:FunctionDef_L518_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99056:Expr_L519_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99056:FunctionDef_L518_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99056:If_L523_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99056:If_L523_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99056:Return_L524_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99056:FunctionDef_L518_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99056:Return_L525_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99056:ClassDef_L198_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99056:FunctionDef_L527_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99056:FunctionDef_L527_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99056:Expr_L528_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99056:FunctionDef_L527_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99056:Assign_L534_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99056:FunctionDef_L527_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99056:Assign_L535_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99056:FunctionDef_L527_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99056:Return_L536_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99056:ClassDef_L198_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99056:FunctionDef_L538_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99056:FunctionDef_L538_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99056:Expr_L539_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99056:FunctionDef_L538_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99056:Return_L549_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99056:ClassDef_L198_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99056:FunctionDef_L551_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99056:FunctionDef_L551_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99056:Expr_L552_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99056:FunctionDef_L551_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99056:Assign_L555_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99056:FunctionDef_L551_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99056:If_L556_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99056:If_L556_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99056:Return_L557_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99056:If_L556_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99056:If_L558_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99056:If_L558_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99056:Return_L559_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99056:If_L558_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99056:If_L560_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99056:If_L560_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99056:Return_L561_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99056:FunctionDef_L551_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99056:Return_L564_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99056:ClassDef_L198_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99056:FunctionDef_L566_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99056:FunctionDef_L566_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99056:Expr_L567_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99056:ClassDef_L198_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99056:FunctionDef_L576_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99056:FunctionDef_L576_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99056:Expr_L577_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99056:FunctionDef_L576_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99056:Assign_L582_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99056:FunctionDef_L576_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99056:Return_L583_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99056:ClassDef_L585_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99056:Expr_L586_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99056:ClassDef_L585_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99056:Assign_L589_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99056:ClassDef_L585_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99056:FunctionDef_L591_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99056:FunctionDef_L591_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99056:Assign_L592_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99056:ClassDef_L585_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99056:FunctionDef_L594_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99056:FunctionDef_L594_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99056:Expr_L595_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99056:FunctionDef_L594_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99056:Return_L600_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99056:ClassDef_L585_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99056:FunctionDef_L602_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99056:FunctionDef_L602_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99056:Expr_L603_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99056:FunctionDef_L602_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99056:Return_L607_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99056:ClassDef_L585_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99056:FunctionDef_L609_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99056:FunctionDef_L609_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99056:Expr_L610_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99056:FunctionDef_L609_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99056:Assign_L611_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99056:FunctionDef_L609_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99056:Return_L612_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99056:ClassDef_L585_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99056:FunctionDef_L614_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99056:FunctionDef_L614_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99056:Expr_L615_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99056:FunctionDef_L614_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99056:ImportFrom_L622_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99056:FunctionDef_L614_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99056:Assign_L623_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99056:FunctionDef_L614_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99056:For_L624_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99056:For_L624_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99056:For_L625_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99056:For_L625_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99056:If_L626_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99056:For_L625_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99056:If_L628_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99056:For_L625_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99056:Expr_L630_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99056:For_L625_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99056:Expr_L631_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99056:FunctionDef_L614_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99056:If_L632_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99056:If_L632_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99056:Assign_L633_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99056:If_L632_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99056:Assign_L634_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99056:FunctionDef_L614_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99056:Return_L639_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99056:ClassDef_L585_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99056:FunctionDef_L641_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99056:FunctionDef_L641_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99056:Expr_L642_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99056:FunctionDef_L641_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99056:ImportFrom_L643_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99056:FunctionDef_L641_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99056:Assign_L644_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99056:FunctionDef_L641_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99056:For_L645_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99056:For_L645_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99056:For_L646_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99056:For_L646_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99056:If_L647_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99056:If_L647_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99056:Expr_L648_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99056:FunctionDef_L641_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99056:Assign_L649_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99056:FunctionDef_L641_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99056:Return_L650_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99056:ClassDef_L585_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99056:FunctionDef_L655_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99056:FunctionDef_L655_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99056:Expr_L656_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99056:FunctionDef_L655_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99056:ImportFrom_L657_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99056:FunctionDef_L655_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99056:Assign_L659_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99056:FunctionDef_L655_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99056:Assign_L660_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99056:FunctionDef_L655_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99056:For_L662_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99056:For_L662_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99056:For_L663_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99056:For_L663_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99056:If_L664_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99056:For_L663_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99056:If_L666_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99056:For_L663_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99056:For_L668_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99056:For_L668_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99056:If_L669_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99056:If_L669_C20", "t": "ajibawa-2023/Python-Code-Large/train/row_99056:Expr_L670_C24"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99056:For_L663_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99056:For_L673_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99056:For_L673_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99056:If_L676_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99056:If_L676_C20", "t": "ajibawa-2023/Python-Code-Large/train/row_99056:Expr_L677_C24"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99056:FunctionDef_L655_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99056:Return_L679_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99056:ClassDef_L681_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99056:Expr_L682_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99056:ClassDef_L681_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99056:Assign_L688_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99056:ClassDef_L681_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99056:FunctionDef_L690_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99056:FunctionDef_L690_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99056:Assign_L692_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99056:ClassDef_L681_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99056:FunctionDef_L694_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99056:ClassDef_L697_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99056:Expr_L698_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99056:ClassDef_L697_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99056:FunctionDef_L701_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99056:FunctionDef_L701_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99056:Assign_L702_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99056:ClassDef_L697_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99056:FunctionDef_L704_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99056:FunctionDef_L704_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99056:Expr_L705_C8"}]
from django.db.backends import BaseDatabaseIntrospection import cx_Oracle import re foreign_key_re = re.compile(r"\sCONSTRAINT `[^`]*` FOREIGN KEY \(`([^`]*)`\) REFERENCES `([^`]*)` \(`([^`]*)`\)") class DatabaseIntrospection(BaseDatabaseIntrospection): # Maps type objects to Django Field types. data_types_reverse = { cx_Oracle.CLOB: 'TextField', cx_Oracle.DATETIME: 'DateField', cx_Oracle.FIXED_CHAR: 'CharField', cx_Oracle.NCLOB: 'TextField', cx_Oracle.NUMBER: 'DecimalField', cx_Oracle.STRING: 'CharField', cx_Oracle.TIMESTAMP: 'DateTimeField', } try: data_types_reverse[cx_Oracle.NATIVE_FLOAT] = 'FloatField' except AttributeError: pass try: data_types_reverse[cx_Oracle.UNICODE] = 'CharField' except AttributeError: pass def get_field_type(self, data_type, description): # If it's a NUMBER with scale == 0, consider it an IntegerField if data_type == cx_Oracle.NUMBER and description[5] == 0: if description[4] > 11: return 'BigIntegerField' else: return 'IntegerField' else: return super(DatabaseIntrospection, self).get_field_type( data_type, description) def get_table_list(self, cursor): "Returns a list of table names in the current database." cursor.execute("SELECT TABLE_NAME FROM USER_TABLES") return [row[0].lower() for row in cursor.fetchall()] def get_table_description(self, cursor, table_name): "Returns a description of the table, with the DB-API cursor.description interface." cursor.execute("SELECT * FROM %s WHERE ROWNUM < 2" % self.connection.ops.quote_name(table_name)) description = [] for desc in cursor.description: description.append((desc[0].lower(),) + desc[1:]) return description def table_name_converter(self, name): "Table name comparison is case insensitive under Oracle" return name.lower() def _name_to_index(self, cursor, table_name): """ Returns a dictionary of {field_name: field_index} for the given table. Indexes are 0-based. """ return dict([(d[0], i) for i, d in enumerate(self.get_table_description(cursor, table_name))]) def get_relations(self, cursor, table_name): """ Returns a dictionary of {field_index: (field_index_other_table, other_table)} representing all relationships to the given table. Indexes are 0-based. """ cursor.execute(""" SELECT ta.column_id - 1, tb.table_name, tb.column_id - 1 FROM user_constraints, USER_CONS_COLUMNS ca, USER_CONS_COLUMNS cb, user_tab_cols ta, user_tab_cols tb WHERE user_constraints.table_name = %s AND ta.table_name = %s AND ta.column_name = ca.column_name AND ca.table_name = %s AND user_constraints.constraint_name = ca.constraint_name AND user_constraints.r_constraint_name = cb.constraint_name AND cb.table_name = tb.table_name AND cb.column_name = tb.column_name AND ca.position = cb.position""", [table_name, table_name, table_name]) relations = {} for row in cursor.fetchall(): relations[row[0]] = (row[2], row[1]) return relations def get_indexes(self, cursor, table_name): """ Returns a dictionary of fieldname -> infodict for the given table, where each infodict is in the format: {'primary_key': boolean representing whether it's the primary key, 'unique': boolean representing whether it's a unique index} """ # This query retrieves each index on the given table, including the # first associated field name # "We were in the nick of time; you were in great peril!" sql = """\ SELECT LOWER(all_tab_cols.column_name) AS column_name, CASE user_constraints.constraint_type WHEN 'P' THEN 1 ELSE 0 END AS is_primary_key, CASE user_indexes.uniqueness WHEN 'UNIQUE' THEN 1 ELSE 0 END AS is_unique FROM all_tab_cols, user_cons_columns, user_constraints, user_ind_columns, user_indexes WHERE all_tab_cols.column_name = user_cons_columns.column_name (+) AND all_tab_cols.table_name = user_cons_columns.table_name (+) AND user_cons_columns.constraint_name = user_constraints.constraint_name (+) AND user_constraints.constraint_type (+) = 'P' AND user_ind_columns.column_name (+) = all_tab_cols.column_name AND user_ind_columns.table_name (+) = all_tab_cols.table_name AND user_indexes.uniqueness (+) = 'UNIQUE' AND user_indexes.index_name (+) = user_ind_columns.index_name AND all_tab_cols.table_name = UPPER(%s) """ cursor.execute(sql, [table_name]) indexes = {} for row in cursor.fetchall(): indexes[row[0]] = {'primary_key': row[1], 'unique': row[2]} return indexes
ajibawa-2023/Python-Code-Large/train/row_99057
48
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_99057:ImportFrom_L1_C0", "label": "from django.db.backends import BaseDatabaseIntrospection", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0083, 0.0083, 0, 0.66, 0.0, 981, 0, 1, 0, 0, 981, 0, 0], "semantic": {"name": "django.db.backends", "arg_names": [], "import_names": ["BaseDatabaseIntrospection"], "rhs_call_name": "", "annotation": ""}, "snippet": "from django.db.backends import BaseDatabaseIntrospection"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99057:Import_L2_C0", "label": "cx_Oracle import cx_Oracle", "type": "import", "loc": [2, 2], "level": 0, "parent": null, "vector": [1, 0, 0.0165, 0.0083, 0, 0.66, 0.25, 554, 0, 1, 0, 0, 554, 0, 0], "semantic": {"name": "cx_Oracle", "arg_names": [], "import_names": ["cx_Oracle"], "rhs_call_name": "", "annotation": ""}, "snippet": "import cx_Oracle"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99057:Import_L3_C0", "label": "re import re", "type": "import", "loc": [3, 3], "level": 0, "parent": null, "vector": [1, 0, 0.0248, 0.0083, 0, 0.66, 0.5, 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_99057:Assign_L5_C0", "label": "foreign_key_re = compile()", "type": "assigned_variable", "loc": [5, 5], "level": 0, "parent": null, "vector": [14, 0, 0.0413, 0.0083, 0, 0.66, 0.75, 541, 3, 1, 0, 0, 821, 10, 1], "semantic": {"name": "foreign_key_re", "arg_names": [], "import_names": [], "rhs_call_name": "compile", "annotation": ""}, "snippet": "foreign_key_re = re.compile(r\"\\sCONSTRAINT `[^`]*` FOREIGN KEY \\(`([^`]*)`\\) REFERENCES `([^`]*)` \\(`([^`]*)`\\)\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99057:ClassDef_L7_C0", "label": "DatabaseIntrospection", "type": "class", "loc": [7, 121], "level": 0, "parent": null, "vector": [3, 0, 0.5289, 0.9504, 0, 0.66, 1.0, 77, 0, 7, 0, 0, 41, 0, 17], "semantic": {"name": "DatabaseIntrospection", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class DatabaseIntrospection(BaseDatabaseIntrospection):\n # Maps type objects to Django Field types.\n data_types_reverse = {\n cx_Oracle.CLOB: 'TextField',\n cx_Oracle.DATETIME: 'DateField',\n cx_Oracle.FIXED_CHAR: 'CharField',\n cx_Oracle.NCLOB: 'TextField',\n cx_Oracle.NUMBER: 'DecimalField',"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99057:Assign_L9_C4", "label": "data_types_reverse =", "type": "assigned_variable", "loc": [9, 17], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99057:ClassDef_L7_C0", "vector": [14, 1, 0.1074, 0.0744, 1, 0.34, 0.0, 403, 0, 0, 0, 0, 0, 6, 0], "semantic": {"name": "data_types_reverse", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " data_types_reverse = {\n cx_Oracle.CLOB: 'TextField',\n cx_Oracle.DATETIME: 'DateField',\n cx_Oracle.FIXED_CHAR: 'CharField',\n cx_Oracle.NCLOB: 'TextField',\n cx_Oracle.NUMBER: 'DecimalField',\n cx_Oracle.STRING: 'CharField',\n cx_Oracle.TIMESTAMP: 'DateTimeField',"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99057:Try_L19_C4", "label": "try", "type": "try", "loc": [19, 22], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99057:ClassDef_L7_C0", "vector": [7, 1, 0.1694, 0.0331, 1, 0.34, 0.1111, 0, 0, 1, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " try:\n data_types_reverse[cx_Oracle.NATIVE_FLOAT] = 'FloatField'\n except AttributeError:\n pass"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99057:Assign_L20_C8", "label": "assign", "type": "assigned_variable", "loc": [20, 20], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99057:Try_L19_C4", "vector": [14, 2, 0.1653, 0.0083, 2, 0.71, 0.0, 0, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " data_types_reverse[cx_Oracle.NATIVE_FLOAT] = 'FloatField'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99057:Try_L24_C4", "label": "try", "type": "try", "loc": [24, 27], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99057:ClassDef_L7_C0", "vector": [7, 1, 0.2107, 0.0331, 1, 0.34, 0.2222, 0, 0, 1, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " try:\n data_types_reverse[cx_Oracle.UNICODE] = 'CharField'\n except AttributeError:\n pass"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99057:Assign_L25_C8", "label": "assign", "type": "assigned_variable", "loc": [25, 25], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99057:Try_L24_C4", "vector": [14, 2, 0.2066, 0.0083, 2, 0.09, 0.0, 0, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " data_types_reverse[cx_Oracle.UNICODE] = 'CharField'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99057:FunctionDef_L29_C4", "label": "get_field_type", "type": "function", "loc": [29, 38], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99057:ClassDef_L7_C0", "vector": [2, 1, 0.2769, 0.0826, 1, 0.34, 0.3333, 691, 0, 3, 1, 0, 0, 0, 2], "semantic": {"name": "get_field_type", "arg_names": ["self", "data_type", "description"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def get_field_type(self, data_type, description):\n # If it's a NUMBER with scale == 0, consider it an IntegerField\n if data_type == cx_Oracle.NUMBER and description[5] == 0:\n if description[4] > 11:\n return 'BigIntegerField'\n else:\n return 'IntegerField'\n else:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99057:If_L31_C8", "label": "if", "type": "if", "loc": [31, 38], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99057:FunctionDef_L29_C4", "vector": [4, 2, 0.2851, 0.0661, 2, 0.39, 0.0, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if data_type == cx_Oracle.NUMBER and description[5] == 0:\n if description[4] > 11:\n return 'BigIntegerField'\n else:\n return 'IntegerField'\n else:\n return super(DatabaseIntrospection, self).get_field_type(\n data_type, description)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99057:If_L32_C12", "label": "if", "type": "if", "loc": [32, 35], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99057:If_L31_C8", "vector": [4, 3, 0.2769, 0.0331, 3, 0.9, 0.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if description[4] > 11:\n return 'BigIntegerField'\n else:\n return 'IntegerField'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99057:Return_L33_C16", "label": "return", "type": "return", "loc": [33, 33], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99057:If_L32_C12", "vector": [13, 4, 0.2727, 0.0083, 4, 0.23, 0.0, 0, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return 'BigIntegerField'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99057:Return_L35_C16", "label": "return", "type": "return", "loc": [35, 35], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99057:If_L32_C12", "vector": [13, 4, 0.2893, 0.0083, 4, 0.23, 1.0, 0, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return 'IntegerField'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99057:Return_L37_C12", "label": "return", "type": "return", "loc": [37, 38], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99057:If_L31_C8", "vector": [13, 3, 0.3099, 0.0165, 3, 0.9, 1.0, 0, 3, 0, 0, 0, 0, 10, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return super(DatabaseIntrospection, self).get_field_type(\n data_type, description)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99057:FunctionDef_L40_C4", "label": "get_table_list", "type": "function", "loc": [40, 43], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99057:ClassDef_L7_C0", "vector": [2, 1, 0.343, 0.0331, 1, 0.34, 0.4444, 878, 0, 2, 1, 0, 0, 0, 3], "semantic": {"name": "get_table_list", "arg_names": ["self", "cursor"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def get_table_list(self, cursor):\n \"Returns a list of table names in the current database.\"\n cursor.execute(\"SELECT TABLE_NAME FROM USER_TABLES\")\n return [row[0].lower() for row in cursor.fetchall()]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99057:Expr_L41_C8", "label": "expression", "type": "expression", "loc": [41, 41], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99057:FunctionDef_L40_C4", "vector": [8, 2, 0.3388, 0.0083, 2, 0.74, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"Returns a list of table names in the current database.\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99057:Expr_L42_C8", "label": "execute()", "type": "expression", "loc": [42, 42], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99057:FunctionDef_L40_C4", "vector": [8, 2, 0.3471, 0.0083, 2, 0.74, 0.5, 569, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "execute", "arg_names": [], "import_names": [], "rhs_call_name": "execute", "annotation": ""}, "snippet": " cursor.execute(\"SELECT TABLE_NAME FROM USER_TABLES\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99057:Return_L43_C8", "label": "return", "type": "return", "loc": [43, 43], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99057:FunctionDef_L40_C4", "vector": [13, 2, 0.3554, 0.0083, 2, 0.74, 1.0, 0, 5, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return [row[0].lower() for row in cursor.fetchall()]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99057:FunctionDef_L45_C4", "label": "get_table_description", "type": "function", "loc": [45, 51], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99057:ClassDef_L7_C0", "vector": [2, 1, 0.3967, 0.0579, 1, 0.34, 0.5556, 876, 0, 3, 1, 0, 0, 0, 4], "semantic": {"name": "get_table_description", "arg_names": ["self", "cursor", "table_name"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def get_table_description(self, cursor, table_name):\n \"Returns a description of the table, with the DB-API cursor.description interface.\"\n cursor.execute(\"SELECT * FROM %s WHERE ROWNUM < 2\" % self.connection.ops.quote_name(table_name))\n description = []\n for desc in cursor.description:\n description.append((desc[0].lower(),) + desc[1:])\n return description"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99057:Expr_L46_C8", "label": "expression", "type": "expression", "loc": [46, 46], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99057:FunctionDef_L45_C4", "vector": [8, 2, 0.3802, 0.0083, 2, 0.17, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"Returns a description of the table, with the DB-API cursor.description interface.\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99057:Expr_L47_C8", "label": "execute()", "type": "expression", "loc": [47, 47], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99057:FunctionDef_L45_C4", "vector": [8, 2, 0.3884, 0.0083, 2, 0.17, 0.25, 569, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "execute", "arg_names": [], "import_names": [], "rhs_call_name": "execute", "annotation": ""}, "snippet": " cursor.execute(\"SELECT * FROM %s WHERE ROWNUM < 2\" % self.connection.ops.quote_name(table_name))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99057:Assign_L48_C8", "label": "description =", "type": "assigned_variable", "loc": [48, 48], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99057:FunctionDef_L45_C4", "vector": [14, 2, 0.3967, 0.0083, 2, 0.17, 0.5, 306, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "description", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " description = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99057:For_L49_C8", "label": "for desc", "type": "for", "loc": [49, 50], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99057:FunctionDef_L45_C4", "vector": [6, 2, 0.4091, 0.0165, 2, 0.17, 0.75, 796, 7, 0, 0, 0, 0, 0, 2], "semantic": {"name": "desc", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for desc in cursor.description:\n description.append((desc[0].lower(),) + desc[1:])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99057:Expr_L50_C12", "label": "append()", "type": "expression", "loc": [50, 50], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99057:For_L49_C8", "vector": [8, 3, 0.4132, 0.0083, 3, 0.08, 0.0, 243, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " description.append((desc[0].lower(),) + desc[1:])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99057:Return_L51_C8", "label": "return", "type": "return", "loc": [51, 51], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99057:FunctionDef_L45_C4", "vector": [13, 2, 0.4215, 0.0083, 2, 0.17, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return description"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99057:FunctionDef_L53_C4", "label": "table_name_converter", "type": "function", "loc": [53, 55], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99057:ClassDef_L7_C0", "vector": [2, 1, 0.4463, 0.0248, 1, 0.34, 0.6667, 438, 0, 2, 1, 0, 0, 0, 1], "semantic": {"name": "table_name_converter", "arg_names": ["self", "name"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def table_name_converter(self, name):\n \"Table name comparison is case insensitive under Oracle\"\n return name.lower()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99057:Expr_L54_C8", "label": "expression", "type": "expression", "loc": [54, 54], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99057:FunctionDef_L53_C4", "vector": [8, 2, 0.4463, 0.0083, 2, 0.81, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"Table name comparison is case insensitive under Oracle\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99057:Return_L55_C8", "label": "return", "type": "return", "loc": [55, 55], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99057:FunctionDef_L53_C4", "vector": [13, 2, 0.4545, 0.0083, 2, 0.81, 1.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return name.lower()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99057:FunctionDef_L57_C4", "label": "_name_to_index", "type": "function", "loc": [57, 62], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99057:ClassDef_L7_C0", "vector": [2, 1, 0.4917, 0.0496, 1, 0.34, 0.7778, 950, 0, 3, 1, 0, 0, 0, 3], "semantic": {"name": "_name_to_index", "arg_names": ["self", "cursor", "table_name"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _name_to_index(self, cursor, table_name):\n \"\"\"\n Returns a dictionary of {field_name: field_index} for the given table.\n Indexes are 0-based.\n \"\"\"\n return dict([(d[0], i) for i, d in enumerate(self.get_table_description(cursor, table_name))])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99057:Expr_L58_C8", "label": "expression", "type": "expression", "loc": [58, 61], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99057:FunctionDef_L57_C4", "vector": [8, 2, 0.4917, 0.0331, 2, 0.04, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"\n Returns a dictionary of {field_name: field_index} for the given table.\n Indexes are 0-based.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99057:Return_L62_C8", "label": "return", "type": "return", "loc": [62, 62], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99057:FunctionDef_L57_C4", "vector": [13, 2, 0.5124, 0.0083, 2, 0.04, 1.0, 0, 3, 0, 0, 0, 0, 10, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return dict([(d[0], i) for i, d in enumerate(self.get_table_description(cursor, table_name))])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99057:FunctionDef_L64_C4", "label": "get_relations", "type": "function", "loc": [64, 86], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99057:ClassDef_L7_C0", "vector": [2, 1, 0.6198, 0.1901, 1, 0.34, 0.8889, 814, 0, 3, 1, 0, 0, 0, 2], "semantic": {"name": "get_relations", "arg_names": ["self", "cursor", "table_name"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def get_relations(self, cursor, table_name):\n \"\"\"\n Returns a dictionary of {field_index: (field_index_other_table, other_table)}\n representing all relationships to the given table. Indexes are 0-based.\n \"\"\"\n cursor.execute(\"\"\"\n SELECT ta.column_id - 1, tb.table_name, tb.column_id - 1\n FROM user_constraints, USER_CONS_COLUMNS ca, USER_CONS_COLUMNS cb,"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99057:Expr_L65_C8", "label": "expression", "type": "expression", "loc": [65, 68], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99057:FunctionDef_L64_C4", "vector": [8, 2, 0.5496, 0.0331, 2, 0.08, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"\n Returns a dictionary of {field_index: (field_index_other_table, other_table)}\n representing all relationships to the given table. Indexes are 0-based.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99057:Expr_L69_C8", "label": "execute()", "type": "expression", "loc": [69, 81], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99057:FunctionDef_L64_C4", "vector": [8, 2, 0.6198, 0.1074, 2, 0.08, 0.25, 569, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "execute", "arg_names": [], "import_names": [], "rhs_call_name": "execute", "annotation": ""}, "snippet": " cursor.execute(\"\"\"\n SELECT ta.column_id - 1, tb.table_name, tb.column_id - 1\n FROM user_constraints, USER_CONS_COLUMNS ca, USER_CONS_COLUMNS cb,\n user_tab_cols ta, user_tab_cols tb\n WHERE user_constraints.table_name = %s AND\n ta.table_name = %s AND\n ta.column_name = ca.column_name AND\n ca.table_name = %s AND"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99057:Assign_L83_C8", "label": "relations =", "type": "assigned_variable", "loc": [83, 83], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99057:FunctionDef_L64_C4", "vector": [14, 2, 0.686, 0.0083, 2, 0.08, 0.5, 900, 0, 0, 0, 0, 0, 6, 0], "semantic": {"name": "relations", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " relations = {}"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99057:For_L84_C8", "label": "for row", "type": "for", "loc": [84, 85], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99057:FunctionDef_L64_C4", "vector": [6, 2, 0.6983, 0.0165, 2, 0.08, 0.75, 767, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "row", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for row in cursor.fetchall():\n relations[row[0]] = (row[2], row[1])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99057:Assign_L85_C12", "label": "assign", "type": "assigned_variable", "loc": [85, 85], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99057:For_L84_C8", "vector": [14, 3, 0.7025, 0.0083, 3, 0.73, 0.0, 0, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " relations[row[0]] = (row[2], row[1])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99057:Return_L86_C8", "label": "return", "type": "return", "loc": [86, 86], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99057:FunctionDef_L64_C4", "vector": [13, 2, 0.7107, 0.0083, 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 relations"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99057:FunctionDef_L88_C4", "label": "get_indexes", "type": "function", "loc": [88, 121], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99057:ClassDef_L7_C0", "vector": [2, 1, 0.8636, 0.281, 1, 0.34, 1.0, 808, 0, 3, 1, 0, 0, 0, 2], "semantic": {"name": "get_indexes", "arg_names": ["self", "cursor", "table_name"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def get_indexes(self, cursor, table_name):\n \"\"\"\n Returns a dictionary of fieldname -> infodict for the given table,\n where each infodict is in the format:\n {'primary_key': boolean representing whether it's the primary key,\n 'unique': boolean representing whether it's a unique index}\n \"\"\"\n # This query retrieves each index on the given table, including the"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99057:Expr_L89_C8", "label": "expression", "type": "expression", "loc": [89, 94], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99057:FunctionDef_L88_C4", "vector": [8, 2, 0.7562, 0.0496, 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 Returns a dictionary of fieldname -> infodict for the given table,\n where each infodict is in the format:\n {'primary_key': boolean representing whether it's the primary key,\n 'unique': boolean representing whether it's a unique index}\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99057:Assign_L98_C8", "label": "sql =", "type": "assigned_variable", "loc": [98, 116], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99057:FunctionDef_L88_C4", "vector": [14, 2, 0.8843, 0.157, 2, 0.99, 0.2, 736, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "sql", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " sql = \"\"\"\\\nSELECT LOWER(all_tab_cols.column_name) AS column_name,\n CASE user_constraints.constraint_type\n WHEN 'P' THEN 1 ELSE 0\n END AS is_primary_key,\n CASE user_indexes.uniqueness\n WHEN 'UNIQUE' THEN 1 ELSE 0\n END AS is_unique"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99057:Expr_L117_C8", "label": "execute()", "type": "expression", "loc": [117, 117], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99057:FunctionDef_L88_C4", "vector": [8, 2, 0.9669, 0.0083, 2, 0.99, 0.4, 569, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "execute", "arg_names": [], "import_names": [], "rhs_call_name": "execute", "annotation": ""}, "snippet": " cursor.execute(sql, [table_name])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99057:Assign_L118_C8", "label": "indexes =", "type": "assigned_variable", "loc": [118, 118], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99057:FunctionDef_L88_C4", "vector": [14, 2, 0.9752, 0.0083, 2, 0.99, 0.6, 600, 0, 0, 0, 0, 0, 6, 0], "semantic": {"name": "indexes", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " indexes = {}"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99057:For_L119_C8", "label": "for row", "type": "for", "loc": [119, 120], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99057:FunctionDef_L88_C4", "vector": [6, 2, 0.9876, 0.0165, 2, 0.99, 0.8, 767, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "row", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for row in cursor.fetchall():\n indexes[row[0]] = {'primary_key': row[1], 'unique': row[2]}"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99057:Assign_L120_C12", "label": "assign", "type": "assigned_variable", "loc": [120, 120], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99057:For_L119_C8", "vector": [14, 3, 0.9917, 0.0083, 3, 0.57, 0.0, 0, 0, 0, 0, 0, 0, 6, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " indexes[row[0]] = {'primary_key': row[1], 'unique': row[2]}"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99057:Return_L121_C8", "label": "return", "type": "return", "loc": [121, 121], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99057:FunctionDef_L88_C4", "vector": [13, 2, 1.0, 0.0083, 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 indexes"}]
[{"f": "ajibawa-2023/Python-Code-Large/train/row_99057:ClassDef_L7_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99057:Assign_L9_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99057:ClassDef_L7_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99057:Try_L19_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99057:Try_L19_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99057:Assign_L20_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99057:ClassDef_L7_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99057:Try_L24_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99057:Try_L24_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99057:Assign_L25_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99057:ClassDef_L7_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99057:FunctionDef_L29_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99057:FunctionDef_L29_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99057:If_L31_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99057:If_L31_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99057:If_L32_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99057:If_L32_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99057:Return_L33_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99057:If_L32_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99057:Return_L35_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99057:If_L31_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99057:Return_L37_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99057:ClassDef_L7_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99057:FunctionDef_L40_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99057:FunctionDef_L40_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99057:Expr_L41_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99057:FunctionDef_L40_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99057:Expr_L42_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99057:FunctionDef_L40_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99057:Return_L43_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99057:ClassDef_L7_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99057:FunctionDef_L45_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99057:FunctionDef_L45_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99057:Expr_L46_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99057:FunctionDef_L45_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99057:Expr_L47_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99057:FunctionDef_L45_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99057:Assign_L48_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99057:FunctionDef_L45_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99057:For_L49_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99057:For_L49_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99057:Expr_L50_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99057:FunctionDef_L45_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99057:Return_L51_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99057:ClassDef_L7_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99057:FunctionDef_L53_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99057:FunctionDef_L53_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99057:Expr_L54_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99057:FunctionDef_L53_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99057:Return_L55_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99057:ClassDef_L7_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99057:FunctionDef_L57_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99057:FunctionDef_L57_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99057:Expr_L58_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99057:FunctionDef_L57_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99057:Return_L62_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99057:ClassDef_L7_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99057:FunctionDef_L64_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99057:FunctionDef_L64_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99057:Expr_L65_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99057:FunctionDef_L64_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99057:Expr_L69_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99057:FunctionDef_L64_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99057:Assign_L83_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99057:FunctionDef_L64_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99057:For_L84_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99057:For_L84_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99057:Assign_L85_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99057:FunctionDef_L64_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99057:Return_L86_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99057:ClassDef_L7_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99057:FunctionDef_L88_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99057:FunctionDef_L88_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99057:Expr_L89_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99057:FunctionDef_L88_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99057:Assign_L98_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99057:FunctionDef_L88_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99057:Expr_L117_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99057:FunctionDef_L88_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99057:Assign_L118_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99057:FunctionDef_L88_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99057:For_L119_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99057:For_L119_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99057:Assign_L120_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99057:FunctionDef_L88_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99057:Return_L121_C8"}]
from django.db.models.sql import compiler class SQLCompiler(compiler.SQLCompiler): def resolve_columns(self, row, fields=()): # If this query has limit/offset information, then we expect the # first column to be an extra "_RN" column that we need to throw # away. if self.query.high_mark is not None or self.query.low_mark: rn_offset = 1 else: rn_offset = 0 index_start = rn_offset + len(self.query.extra_select.keys()) values = [self.query.convert_values(v, None, connection=self.connection) for v in row[rn_offset:index_start]] for value, field in map(None, row[index_start:], fields): values.append(self.query.convert_values(value, field, connection=self.connection)) return tuple(values) def as_sql(self, with_limits=True, with_col_aliases=False): """ Creates the SQL for this query. Returns the SQL string and list of parameters. This is overriden from the original Query class to handle the additional SQL Oracle requires to emulate LIMIT and OFFSET. If 'with_limits' is False, any limit/offset information is not included in the query. """ if with_limits and self.query.low_mark == self.query.high_mark: return '', () # The `do_offset` flag indicates whether we need to construct # the SQL needed to use limit/offset with Oracle. do_offset = with_limits and (self.query.high_mark is not None or self.query.low_mark) if not do_offset: sql, params = super(SQLCompiler, self).as_sql(with_limits=False, with_col_aliases=with_col_aliases) else: sql, params = super(SQLCompiler, self).as_sql(with_limits=False, with_col_aliases=True) # Wrap the base query in an outer SELECT * with boundaries on # the "_RN" column. This is the canonical way to emulate LIMIT # and OFFSET on Oracle. high_where = '' if self.query.high_mark is not None: high_where = 'WHERE ROWNUM <= %d' % (self.query.high_mark,) sql = 'SELECT * FROM (SELECT ROWNUM AS "_RN", "_SUB".* FROM (%s) "_SUB" %s) WHERE "_RN" > %d' % (sql, high_where, self.query.low_mark) return sql, params class SQLInsertCompiler(compiler.SQLInsertCompiler, SQLCompiler): pass class SQLDeleteCompiler(compiler.SQLDeleteCompiler, SQLCompiler): pass class SQLUpdateCompiler(compiler.SQLUpdateCompiler, SQLCompiler): pass class SQLAggregateCompiler(compiler.SQLAggregateCompiler, SQLCompiler): pass class SQLDateCompiler(compiler.SQLDateCompiler, SQLCompiler): pass
ajibawa-2023/Python-Code-Large/train/row_99058
29
68
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_99058:ImportFrom_L1_C0", "label": "from django.db.models.sql import compiler", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0147, 0.0147, 0, 0.66, 0.0, 841, 0, 1, 0, 0, 841, 0, 0], "semantic": {"name": "django.db.models.sql", "arg_names": [], "import_names": ["compiler"], "rhs_call_name": "", "annotation": ""}, "snippet": "from django.db.models.sql import compiler"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99058:ClassDef_L4_C0", "label": "SQLCompiler", "type": "class", "loc": [4, 52], "level": 0, "parent": null, "vector": [3, 0, 0.4118, 0.7206, 0, 0.66, 0.1667, 718, 0, 2, 0, 0, 749, 0, 11], "semantic": {"name": "SQLCompiler", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class SQLCompiler(compiler.SQLCompiler):\n def resolve_columns(self, row, fields=()):\n # If this query has limit/offset information, then we expect the\n # first column to be an extra \"_RN\" column that we need to throw\n # away.\n if self.query.high_mark is not None or self.query.low_mark:\n rn_offset = 1\n else:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99058:FunctionDef_L5_C4", "label": "resolve_columns", "type": "function", "loc": [5, 18], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99058:ClassDef_L4_C0", "vector": [2, 1, 0.1691, 0.2059, 1, 0.0, 0.0, 224, 0, 3, 1, 0, 0, 0, 7], "semantic": {"name": "resolve_columns", "arg_names": ["self", "row", "fields"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def resolve_columns(self, row, fields=()):\n # If this query has limit/offset information, then we expect the\n # first column to be an extra \"_RN\" column that we need to throw\n # away.\n if self.query.high_mark is not None or self.query.low_mark:\n rn_offset = 1\n else:\n rn_offset = 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99058:If_L9_C8", "label": "if", "type": "if", "loc": [9, 12], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99058:FunctionDef_L5_C4", "vector": [4, 2, 0.1544, 0.0588, 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.query.high_mark is not None or self.query.low_mark:\n rn_offset = 1\n else:\n rn_offset = 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99058:Assign_L10_C12", "label": "rn_offset =", "type": "assigned_variable", "loc": [10, 10], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99058:If_L9_C8", "vector": [14, 3, 0.1471, 0.0147, 3, 0.62, 0.0, 143, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "rn_offset", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " rn_offset = 1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99058:Assign_L12_C12", "label": "rn_offset =", "type": "assigned_variable", "loc": [12, 12], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99058:If_L9_C8", "vector": [14, 3, 0.1765, 0.0147, 3, 0.62, 1.0, 143, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "rn_offset", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " rn_offset = 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99058:Assign_L13_C8", "label": "index_start =", "type": "assigned_variable", "loc": [13, 13], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99058:FunctionDef_L5_C4", "vector": [14, 2, 0.1912, 0.0147, 2, 0.87, 0.25, 645, 4, 0, 0, 0, 0, 0, 2], "semantic": {"name": "index_start", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " index_start = rn_offset + len(self.query.extra_select.keys())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99058:Assign_L14_C8", "label": "values =", "type": "assigned_variable", "loc": [14, 15], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99058:FunctionDef_L5_C4", "vector": [14, 2, 0.2132, 0.0294, 2, 0.87, 0.5, 721, 5, 0, 0, 0, 0, 0, 1], "semantic": {"name": "values", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " values = [self.query.convert_values(v, None, connection=self.connection)\n for v in row[rn_offset:index_start]]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99058:For_L16_C8", "label": "for value, field", "type": "for", "loc": [16, 17], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99058:FunctionDef_L5_C4", "vector": [6, 2, 0.2426, 0.0294, 2, 0.87, 0.75, 261, 3, 0, 0, 0, 0, 0, 3], "semantic": {"name": "value, field", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for value, field in map(None, row[index_start:], fields):\n values.append(self.query.convert_values(value, field, connection=self.connection))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99058:Expr_L17_C12", "label": "append()", "type": "expression", "loc": [17, 17], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99058:For_L16_C8", "vector": [8, 3, 0.25, 0.0147, 3, 0.0, 0.0, 243, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " values.append(self.query.convert_values(value, field, connection=self.connection))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99058:Return_L18_C8", "label": "return", "type": "return", "loc": [18, 18], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99058:FunctionDef_L5_C4", "vector": [13, 2, 0.2647, 0.0147, 2, 0.87, 1.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return tuple(values)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99058:FunctionDef_L20_C4", "label": "as_sql", "type": "function", "loc": [20, 52], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99058:ClassDef_L4_C0", "vector": [2, 1, 0.5294, 0.4853, 1, 0.0, 1.0, 122, 0, 3, 1, 0, 0, 0, 4], "semantic": {"name": "as_sql", "arg_names": ["self", "with_limits", "with_col_aliases"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def as_sql(self, with_limits=True, with_col_aliases=False):\n \"\"\"\n Creates the SQL for this query. Returns the SQL string and list\n of parameters. This is overriden from the original Query class\n to handle the additional SQL Oracle requires to emulate LIMIT\n and OFFSET.\n\n If 'with_limits' is False, any limit/offset information is not"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99058:Expr_L21_C8", "label": "expression", "type": "expression", "loc": [21, 29], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99058:FunctionDef_L20_C4", "vector": [8, 2, 0.3676, 0.1324, 2, 0.66, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"\n Creates the SQL for this query. Returns the SQL string and list\n of parameters. This is overriden from the original Query class\n to handle the additional SQL Oracle requires to emulate LIMIT\n and OFFSET.\n\n If 'with_limits' is False, any limit/offset information is not\n included in the query."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99058:If_L30_C8", "label": "if", "type": "if", "loc": [30, 31], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99058:FunctionDef_L20_C4", "vector": [4, 2, 0.4485, 0.0294, 2, 0.66, 0.25, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if with_limits and self.query.low_mark == self.query.high_mark:\n return '', ()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99058:Return_L31_C12", "label": "return", "type": "return", "loc": [31, 31], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99058:If_L30_C8", "vector": [13, 3, 0.4559, 0.0147, 3, 0.42, 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_99058:Assign_L35_C8", "label": "do_offset =", "type": "assigned_variable", "loc": [35, 36], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99058:FunctionDef_L20_C4", "vector": [14, 2, 0.5221, 0.0294, 2, 0.66, 0.5, 696, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "do_offset", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " do_offset = with_limits and (self.query.high_mark is not None\n or self.query.low_mark)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99058:If_L37_C8", "label": "if", "type": "if", "loc": [37, 50], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99058:FunctionDef_L20_C4", "vector": [4, 2, 0.6397, 0.2059, 2, 0.66, 0.75, 0, 0, 0, 0, 0, 0, 0, 4], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not do_offset:\n sql, params = super(SQLCompiler, self).as_sql(with_limits=False,\n with_col_aliases=with_col_aliases)\n else:\n sql, params = super(SQLCompiler, self).as_sql(with_limits=False,\n with_col_aliases=True)\n\n # Wrap the base query in an outer SELECT * with boundaries on"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99058:Assign_L38_C12", "label": "sql, params = as_sql()", "type": "assigned_variable", "loc": [38, 39], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99058:If_L37_C8", "vector": [14, 3, 0.5662, 0.0294, 3, 0.15, 0.0, 643, 3, 2, 0, 0, 122, 10, 2], "semantic": {"name": "sql, params", "arg_names": [], "import_names": [], "rhs_call_name": "as_sql", "annotation": ""}, "snippet": " sql, params = super(SQLCompiler, self).as_sql(with_limits=False,\n with_col_aliases=with_col_aliases)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99058:Assign_L41_C12", "label": "sql, params = as_sql()", "type": "assigned_variable", "loc": [41, 42], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99058:If_L37_C8", "vector": [14, 3, 0.6103, 0.0294, 3, 0.15, 0.25, 643, 3, 2, 0, 0, 122, 10, 2], "semantic": {"name": "sql, params", "arg_names": [], "import_names": [], "rhs_call_name": "as_sql", "annotation": ""}, "snippet": " sql, params = super(SQLCompiler, self).as_sql(with_limits=False,\n with_col_aliases=True)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99058:Assign_L47_C12", "label": "high_where =", "type": "assigned_variable", "loc": [47, 47], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99058:If_L37_C8", "vector": [14, 3, 0.6912, 0.0147, 3, 0.15, 0.5, 151, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "high_where", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " high_where = ''"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99058:If_L48_C12", "label": "if", "type": "if", "loc": [48, 49], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99058:If_L37_C8", "vector": [4, 3, 0.7132, 0.0294, 3, 0.15, 0.75, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self.query.high_mark is not None:\n high_where = 'WHERE ROWNUM <= %d' % (self.query.high_mark,)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99058:Assign_L49_C16", "label": "high_where =", "type": "assigned_variable", "loc": [49, 49], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99058:If_L48_C12", "vector": [14, 4, 0.7206, 0.0147, 4, 0.32, 0.0, 151, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "high_where", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " high_where = 'WHERE ROWNUM <= %d' % (self.query.high_mark,)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99058:Assign_L50_C12", "label": "sql =", "type": "assigned_variable", "loc": [50, 50], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99058:If_L37_C8", "vector": [14, 3, 0.7353, 0.0147, 3, 0.15, 1.0, 736, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "sql", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " sql = 'SELECT * FROM (SELECT ROWNUM AS \"_RN\", \"_SUB\".* FROM (%s) \"_SUB\" %s) WHERE \"_RN\" > %d' % (sql, high_where, self.query.low_mark)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99058:Return_L52_C8", "label": "return", "type": "return", "loc": [52, 52], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99058:FunctionDef_L20_C4", "vector": [13, 2, 0.7647, 0.0147, 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 sql, params"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99058:ClassDef_L55_C0", "label": "SQLInsertCompiler", "type": "class", "loc": [55, 56], "level": 0, "parent": null, "vector": [3, 0, 0.8162, 0.0294, 0, 0.66, 0.3333, 217, 0, 0, 0, 0, 928, 0, 0], "semantic": {"name": "SQLInsertCompiler", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class SQLInsertCompiler(compiler.SQLInsertCompiler, SQLCompiler):\n pass"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99058:ClassDef_L58_C0", "label": "SQLDeleteCompiler", "type": "class", "loc": [58, 59], "level": 0, "parent": null, "vector": [3, 0, 0.8603, 0.0294, 0, 0.66, 0.5, 715, 0, 0, 0, 0, 754, 0, 0], "semantic": {"name": "SQLDeleteCompiler", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class SQLDeleteCompiler(compiler.SQLDeleteCompiler, SQLCompiler):\n pass"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99058:ClassDef_L61_C0", "label": "SQLUpdateCompiler", "type": "class", "loc": [61, 62], "level": 0, "parent": null, "vector": [3, 0, 0.9044, 0.0294, 0, 0.66, 0.6667, 756, 0, 0, 0, 0, 592, 0, 0], "semantic": {"name": "SQLUpdateCompiler", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class SQLUpdateCompiler(compiler.SQLUpdateCompiler, SQLCompiler):\n pass"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99058:ClassDef_L64_C0", "label": "SQLAggregateCompiler", "type": "class", "loc": [64, 65], "level": 0, "parent": null, "vector": [3, 0, 0.9485, 0.0294, 0, 0.66, 0.8333, 216, 0, 0, 0, 0, 742, 0, 0], "semantic": {"name": "SQLAggregateCompiler", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class SQLAggregateCompiler(compiler.SQLAggregateCompiler, SQLCompiler):\n pass"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99058:ClassDef_L67_C0", "label": "SQLDateCompiler", "type": "class", "loc": [67, 68], "level": 0, "parent": null, "vector": [3, 0, 0.9926, 0.0294, 0, 0.66, 1.0, 583, 0, 0, 0, 0, 171, 0, 0], "semantic": {"name": "SQLDateCompiler", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class SQLDateCompiler(compiler.SQLDateCompiler, SQLCompiler):\n pass"}]
[{"f": "ajibawa-2023/Python-Code-Large/train/row_99058:ClassDef_L4_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99058:FunctionDef_L5_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99058:FunctionDef_L5_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99058:If_L9_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99058:If_L9_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99058:Assign_L10_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99058:If_L9_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99058:Assign_L12_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99058:FunctionDef_L5_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99058:Assign_L13_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99058:FunctionDef_L5_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99058:Assign_L14_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99058:FunctionDef_L5_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99058:For_L16_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99058:For_L16_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99058:Expr_L17_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99058:FunctionDef_L5_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99058:Return_L18_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99058:ClassDef_L4_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99058:FunctionDef_L20_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99058:FunctionDef_L20_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99058:Expr_L21_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99058:FunctionDef_L20_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99058:If_L30_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99058:If_L30_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99058:Return_L31_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99058:FunctionDef_L20_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99058:Assign_L35_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99058:FunctionDef_L20_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99058:If_L37_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99058:If_L37_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99058:Assign_L38_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99058:If_L37_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99058:Assign_L41_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99058:If_L37_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99058:Assign_L47_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99058:If_L37_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99058:If_L48_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99058:If_L48_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99058:Assign_L49_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99058:If_L37_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99058:Assign_L50_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99058:FunctionDef_L20_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99058:Return_L52_C8"}]
import os import sys from django.db.backends import BaseDatabaseClient class DatabaseClient(BaseDatabaseClient): executable_name = 'sqlplus' def runshell(self): conn_string = self.connection._connect_string() args = [self.executable_name, "-L", conn_string] if os.name == 'nt': sys.exit(os.system(" ".join(args))) else: os.execvp(self.executable_name, args)
ajibawa-2023/Python-Code-Large/train/row_99059
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_99059:Import_L1_C0", "label": "os import os", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0625, 0.0625, 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_99059:Import_L2_C0", "label": "sys import sys", "type": "import", "loc": [2, 2], "level": 0, "parent": null, "vector": [1, 0, 0.125, 0.0625, 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_99059:ImportFrom_L4_C0", "label": "from django.db.backends import BaseDatabaseClient", "type": "import", "loc": [4, 4], "level": 0, "parent": null, "vector": [1, 0, 0.25, 0.0625, 0, 0.66, 0.6667, 981, 0, 1, 0, 0, 981, 0, 0], "semantic": {"name": "django.db.backends", "arg_names": [], "import_names": ["BaseDatabaseClient"], "rhs_call_name": "", "annotation": ""}, "snippet": "from django.db.backends import BaseDatabaseClient"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99059:ClassDef_L6_C0", "label": "DatabaseClient", "type": "class", "loc": [6, 15], "level": 0, "parent": null, "vector": [3, 0, 0.6562, 0.625, 0, 0.66, 1.0, 207, 0, 1, 0, 0, 729, 0, 5], "semantic": {"name": "DatabaseClient", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class DatabaseClient(BaseDatabaseClient):\n executable_name = 'sqlplus'\n\n def runshell(self):\n conn_string = self.connection._connect_string()\n args = [self.executable_name, \"-L\", conn_string]\n if os.name == 'nt':\n sys.exit(os.system(\" \".join(args)))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99059:Assign_L7_C4", "label": "executable_name =", "type": "assigned_variable", "loc": [7, 7], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99059:ClassDef_L6_C0", "vector": [14, 1, 0.4375, 0.0625, 1, 0.55, 0.0, 723, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "executable_name", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " executable_name = 'sqlplus'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99059:FunctionDef_L9_C4", "label": "runshell", "type": "function", "loc": [9, 15], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99059:ClassDef_L6_C0", "vector": [2, 1, 0.75, 0.4375, 1, 0.55, 1.0, 795, 0, 1, 0, 0, 0, 0, 5], "semantic": {"name": "runshell", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def runshell(self):\n conn_string = self.connection._connect_string()\n args = [self.executable_name, \"-L\", conn_string]\n if os.name == 'nt':\n sys.exit(os.system(\" \".join(args)))\n else:\n os.execvp(self.executable_name, args)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99059:Assign_L10_C8", "label": "conn_string = _connect_string()", "type": "assigned_variable", "loc": [10, 10], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99059:FunctionDef_L9_C4", "vector": [14, 2, 0.625, 0.0625, 2, 0.85, 0.0, 571, 3, 0, 0, 0, 802, 10, 1], "semantic": {"name": "conn_string", "arg_names": [], "import_names": [], "rhs_call_name": "_connect_string", "annotation": ""}, "snippet": " conn_string = self.connection._connect_string()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99059:Assign_L11_C8", "label": "args =", "type": "assigned_variable", "loc": [11, 11], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99059:FunctionDef_L9_C4", "vector": [14, 2, 0.6875, 0.0625, 2, 0.85, 0.5, 805, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "args", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " args = [self.executable_name, \"-L\", conn_string]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99059:If_L12_C8", "label": "if", "type": "if", "loc": [12, 15], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99059:FunctionDef_L9_C4", "vector": [4, 2, 0.8438, 0.25, 2, 0.85, 1.0, 0, 0, 0, 0, 0, 0, 0, 4], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if os.name == 'nt':\n sys.exit(os.system(\" \".join(args)))\n else:\n os.execvp(self.executable_name, args)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99059:Expr_L13_C12", "label": "exit()", "type": "expression", "loc": [13, 13], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99059:If_L12_C8", "vector": [8, 3, 0.8125, 0.0625, 3, 0.14, 0.0, 436, 3, 1, 0, 0, 0, 0, 3], "semantic": {"name": "exit", "arg_names": [], "import_names": [], "rhs_call_name": "exit", "annotation": ""}, "snippet": " sys.exit(os.system(\" \".join(args)))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99059:Expr_L15_C12", "label": "execvp()", "type": "expression", "loc": [15, 15], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99059:If_L12_C8", "vector": [8, 3, 0.9375, 0.0625, 3, 0.14, 1.0, 784, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "execvp", "arg_names": [], "import_names": [], "rhs_call_name": "execvp", "annotation": ""}, "snippet": " os.execvp(self.executable_name, args)"}]
[{"f": "ajibawa-2023/Python-Code-Large/train/row_99059:ClassDef_L6_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99059:Assign_L7_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99059:ClassDef_L6_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99059:FunctionDef_L9_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99059:FunctionDef_L9_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99059:Assign_L10_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99059:FunctionDef_L9_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99059:Assign_L11_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99059:FunctionDef_L9_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99059:If_L12_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99059:If_L12_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99059:Expr_L13_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99059:If_L12_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99059:Expr_L15_C12"}]
from django.conf import settings from django.core import signals from django.core.exceptions import ImproperlyConfigured from django.db.utils import ConnectionHandler, ConnectionRouter, load_backend, DEFAULT_DB_ALIAS, \ DatabaseError, IntegrityError from django.utils.functional import curry __all__ = ('backend', 'connection', 'connections', 'router', 'DatabaseError', 'IntegrityError', 'DEFAULT_DB_ALIAS') # For backwards compatibility - Port any old database settings over to # the new values. if not settings.DATABASES: import warnings warnings.warn( "settings.DATABASE_* is deprecated; use settings.DATABASES instead.", DeprecationWarning ) settings.DATABASES[DEFAULT_DB_ALIAS] = { 'ENGINE': settings.DATABASE_ENGINE, 'HOST': settings.DATABASE_HOST, 'NAME': settings.DATABASE_NAME, 'OPTIONS': settings.DATABASE_OPTIONS, 'PASSWORD': settings.DATABASE_PASSWORD, 'PORT': settings.DATABASE_PORT, 'USER': settings.DATABASE_USER, 'TEST_CHARSET': settings.TEST_DATABASE_CHARSET, 'TEST_COLLATION': settings.TEST_DATABASE_COLLATION, 'TEST_NAME': settings.TEST_DATABASE_NAME, } if DEFAULT_DB_ALIAS not in settings.DATABASES: raise ImproperlyConfigured("You must define a '%s' database" % DEFAULT_DB_ALIAS) for alias, database in settings.DATABASES.items(): if 'ENGINE' not in database: raise ImproperlyConfigured("You must specify a 'ENGINE' for database '%s'" % alias) if database['ENGINE'] in ("postgresql", "postgresql_psycopg2", "sqlite3", "mysql", "oracle"): import warnings if 'django.contrib.gis' in settings.INSTALLED_APPS: warnings.warn( "django.contrib.gis is now implemented as a full database backend. " "Modify ENGINE in the %s database configuration to select " "a backend from 'django.contrib.gis.db.backends'" % alias, DeprecationWarning ) if database['ENGINE'] == 'postgresql_psycopg2': full_engine = 'django.contrib.gis.db.backends.postgis' elif database['ENGINE'] == 'sqlite3': full_engine = 'django.contrib.gis.db.backends.spatialite' else: full_engine = 'django.contrib.gis.db.backends.%s' % database['ENGINE'] else: warnings.warn( "Short names for ENGINE in database configurations are deprecated. " "Prepend %s.ENGINE with 'django.db.backends.'" % alias, DeprecationWarning ) full_engine = "django.db.backends.%s" % database['ENGINE'] database['ENGINE'] = full_engine connections = ConnectionHandler(settings.DATABASES) router = ConnectionRouter(settings.DATABASE_ROUTERS) # `connection`, `DatabaseError` and `IntegrityError` are convenient aliases # for backend bits. # DatabaseWrapper.__init__() takes a dictionary, not a settings module, so # we manually create the dictionary from the settings, passing only the # settings that the database backends care about. Note that TIME_ZONE is used # by the PostgreSQL backends. # we load all these up for backwards compatibility, you should use # connections['default'] instead. connection = connections[DEFAULT_DB_ALIAS] backend = load_backend(connection.settings_dict['ENGINE']) # Register an event that closes the database connection # when a Django request is finished. def close_connection(**kwargs): for conn in connections.all(): conn.close() signals.request_finished.connect(close_connection) # Register an event that resets connection.queries # when a Django request is started. def reset_queries(**kwargs): for conn in connections.all(): conn.queries = [] signals.request_started.connect(reset_queries) # Register an event that rolls back the connections # when a Django request has an exception. def _rollback_on_exception(**kwargs): from django.db import transaction for conn in connections: try: transaction.rollback_unless_managed(using=conn) except DatabaseError: pass signals.got_request_exception.connect(_rollback_on_exception)
ajibawa-2023/Python-Code-Large/train/row_99062
43
103
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_99062:ImportFrom_L1_C0", "label": "from django.conf import settings", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0097, 0.0097, 0, 0.66, 0.0, 128, 0, 1, 0, 0, 128, 0, 0], "semantic": {"name": "django.conf", "arg_names": [], "import_names": ["settings"], "rhs_call_name": "", "annotation": ""}, "snippet": "from django.conf import settings"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99062:ImportFrom_L2_C0", "label": "from django.core import signals", "type": "import", "loc": [2, 2], "level": 0, "parent": null, "vector": [1, 0, 0.0194, 0.0097, 0, 0.66, 0.0556, 913, 0, 1, 0, 0, 913, 0, 0], "semantic": {"name": "django.core", "arg_names": [], "import_names": ["signals"], "rhs_call_name": "", "annotation": ""}, "snippet": "from django.core import signals"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99062:ImportFrom_L3_C0", "label": "from django.core.exceptions import ImproperlyConfigured", "type": "import", "loc": [3, 3], "level": 0, "parent": null, "vector": [1, 0, 0.0291, 0.0097, 0, 0.66, 0.1111, 160, 0, 1, 0, 0, 160, 0, 0], "semantic": {"name": "django.core.exceptions", "arg_names": [], "import_names": ["ImproperlyConfigured"], "rhs_call_name": "", "annotation": ""}, "snippet": "from django.core.exceptions import ImproperlyConfigured"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99062:ImportFrom_L4_C0", "label": "from django.db.utils import ConnectionHandler, ConnectionRouter, load_backend\u2026", "type": "import", "loc": [4, 5], "level": 0, "parent": null, "vector": [1, 0, 0.0437, 0.0194, 0, 0.66, 0.1667, 495, 0, 6, 0, 0, 495, 0, 0], "semantic": {"name": "django.db.utils", "arg_names": [], "import_names": ["ConnectionHandler", "ConnectionRouter", "load_backend", "DEFAULT_DB_ALIAS", "DatabaseError", "IntegrityError"], "rhs_call_name": "", "annotation": ""}, "snippet": "from django.db.utils import ConnectionHandler, ConnectionRouter, load_backend, DEFAULT_DB_ALIAS, \\\n DatabaseError, IntegrityError"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99062:ImportFrom_L6_C0", "label": "from django.utils.functional import curry", "type": "import", "loc": [6, 6], "level": 0, "parent": null, "vector": [1, 0, 0.0583, 0.0097, 0, 0.66, 0.2222, 375, 0, 1, 0, 0, 375, 0, 0], "semantic": {"name": "django.utils.functional", "arg_names": [], "import_names": ["curry"], "rhs_call_name": "", "annotation": ""}, "snippet": "from django.utils.functional import curry"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99062:Assign_L8_C0", "label": "__all__ =", "type": "assigned_variable", "loc": [8, 9], "level": 0, "parent": null, "vector": [14, 0, 0.0825, 0.0194, 0, 0.66, 0.2778, 272, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "__all__", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "__all__ = ('backend', 'connection', 'connections', 'router', 'DatabaseError',\n 'IntegrityError', 'DEFAULT_DB_ALIAS')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99062:If_L14_C0", "label": "if", "type": "if", "loc": [14, 32], "level": 0, "parent": null, "vector": [4, 0, 0.2233, 0.1845, 0, 0.66, 0.3333, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "if not settings.DATABASES:\n import warnings\n warnings.warn(\n \"settings.DATABASE_* is deprecated; use settings.DATABASES instead.\",\n DeprecationWarning\n )\n\n settings.DATABASES[DEFAULT_DB_ALIAS] = {"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99062:Import_L15_C4", "label": "warnings import warnings", "type": "import", "loc": [15, 15], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99062:If_L14_C0", "vector": [1, 1, 0.1456, 0.0097, 1, 0.64, 0.0, 358, 0, 1, 0, 0, 358, 0, 0], "semantic": {"name": "warnings", "arg_names": [], "import_names": ["warnings"], "rhs_call_name": "", "annotation": ""}, "snippet": " import warnings"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99062:Expr_L16_C4", "label": "warn()", "type": "expression", "loc": [16, 19], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99062:If_L14_C0", "vector": [8, 1, 0.1699, 0.0388, 1, 0.64, 0.5, 960, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "warn", "arg_names": [], "import_names": [], "rhs_call_name": "warn", "annotation": ""}, "snippet": " warnings.warn(\n \"settings.DATABASE_* is deprecated; use settings.DATABASES instead.\",\n DeprecationWarning\n )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99062:Assign_L21_C4", "label": "assign", "type": "assigned_variable", "loc": [21, 32], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99062:If_L14_C0", "vector": [14, 1, 0.2573, 0.1165, 1, 0.64, 1.0, 0, 0, 0, 0, 0, 0, 6, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " settings.DATABASES[DEFAULT_DB_ALIAS] = {\n 'ENGINE': settings.DATABASE_ENGINE,\n 'HOST': settings.DATABASE_HOST,\n 'NAME': settings.DATABASE_NAME,\n 'OPTIONS': settings.DATABASE_OPTIONS,\n 'PASSWORD': settings.DATABASE_PASSWORD,\n 'PORT': settings.DATABASE_PORT,\n 'USER': settings.DATABASE_USER,"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99062:If_L34_C0", "label": "if", "type": "if", "loc": [34, 35], "level": 0, "parent": null, "vector": [4, 0, 0.335, 0.0194, 0, 0.66, 0.3889, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "if DEFAULT_DB_ALIAS not in settings.DATABASES:\n raise ImproperlyConfigured(\"You must define a '%s' database\" % DEFAULT_DB_ALIAS)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99062:For_L37_C0", "label": "for alias, database", "type": "for", "loc": [37, 62], "level": 0, "parent": null, "vector": [6, 0, 0.4806, 0.2524, 0, 0.66, 0.4444, 573, 3, 0, 0, 0, 0, 0, 4], "semantic": {"name": "alias, database", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "for alias, database in settings.DATABASES.items():\n if 'ENGINE' not in database:\n raise ImproperlyConfigured(\"You must specify a 'ENGINE' for database '%s'\" % alias)\n if database['ENGINE'] in (\"postgresql\", \"postgresql_psycopg2\", \"sqlite3\", \"mysql\", \"oracle\"):\n import warnings\n if 'django.contrib.gis' in settings.INSTALLED_APPS:\n warnings.warn(\n \"django.contrib.gis is now implemented as a full database backend. \""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99062:If_L38_C4", "label": "if", "type": "if", "loc": [38, 39], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99062:For_L37_C0", "vector": [4, 1, 0.3738, 0.0194, 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 'ENGINE' not in database:\n raise ImproperlyConfigured(\"You must specify a 'ENGINE' for database '%s'\" % alias)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99062:If_L40_C4", "label": "if", "type": "if", "loc": [40, 62], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99062:For_L37_C0", "vector": [4, 1, 0.4951, 0.2233, 1, 0.64, 1.0, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if database['ENGINE'] in (\"postgresql\", \"postgresql_psycopg2\", \"sqlite3\", \"mysql\", \"oracle\"):\n import warnings\n if 'django.contrib.gis' in settings.INSTALLED_APPS:\n warnings.warn(\n \"django.contrib.gis is now implemented as a full database backend. \"\n \"Modify ENGINE in the %s database configuration to select \"\n \"a backend from 'django.contrib.gis.db.backends'\" % alias,\n DeprecationWarning"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99062:Import_L41_C8", "label": "warnings import warnings", "type": "import", "loc": [41, 41], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99062:If_L40_C4", "vector": [1, 2, 0.3981, 0.0097, 2, 0.83, 0.0, 358, 0, 1, 0, 0, 358, 0, 0], "semantic": {"name": "warnings", "arg_names": [], "import_names": ["warnings"], "rhs_call_name": "", "annotation": ""}, "snippet": " import warnings"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99062:If_L42_C8", "label": "if", "type": "if", "loc": [42, 61], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99062:If_L40_C4", "vector": [4, 2, 0.5, 0.1942, 2, 0.83, 0.5, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if 'django.contrib.gis' in settings.INSTALLED_APPS:\n warnings.warn(\n \"django.contrib.gis is now implemented as a full database backend. \"\n \"Modify ENGINE in the %s database configuration to select \"\n \"a backend from 'django.contrib.gis.db.backends'\" % alias,\n DeprecationWarning\n )\n if database['ENGINE'] == 'postgresql_psycopg2':"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99062:Expr_L43_C12", "label": "warn()", "type": "expression", "loc": [43, 48], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99062:If_L42_C8", "vector": [8, 3, 0.4417, 0.0583, 3, 0.76, 0.0, 960, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "warn", "arg_names": [], "import_names": [], "rhs_call_name": "warn", "annotation": ""}, "snippet": " warnings.warn(\n \"django.contrib.gis is now implemented as a full database backend. \"\n \"Modify ENGINE in the %s database configuration to select \"\n \"a backend from 'django.contrib.gis.db.backends'\" % alias,\n DeprecationWarning\n )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99062:If_L49_C12", "label": "if", "type": "if", "loc": [49, 54], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99062:If_L42_C8", "vector": [4, 3, 0.5, 0.0583, 3, 0.76, 0.3333, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if database['ENGINE'] == 'postgresql_psycopg2':\n full_engine = 'django.contrib.gis.db.backends.postgis'\n elif database['ENGINE'] == 'sqlite3':\n full_engine = 'django.contrib.gis.db.backends.spatialite'\n else:\n full_engine = 'django.contrib.gis.db.backends.%s' % database['ENGINE']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99062:Assign_L50_C16", "label": "full_engine =", "type": "assigned_variable", "loc": [50, 50], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99062:If_L49_C12", "vector": [14, 4, 0.4854, 0.0097, 4, 0.37, 0.0, 364, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "full_engine", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " full_engine = 'django.contrib.gis.db.backends.postgis'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99062:If_L51_C12", "label": "if", "type": "if", "loc": [51, 54], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99062:If_L49_C12", "vector": [4, 4, 0.5097, 0.0388, 4, 0.37, 1.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " elif database['ENGINE'] == 'sqlite3':\n full_engine = 'django.contrib.gis.db.backends.spatialite'\n else:\n full_engine = 'django.contrib.gis.db.backends.%s' % database['ENGINE']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99062:Assign_L52_C16", "label": "full_engine =", "type": "assigned_variable", "loc": [52, 52], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99062:If_L51_C12", "vector": [14, 5, 0.5049, 0.0097, 5, 0.51, 0.0, 364, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "full_engine", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " full_engine = 'django.contrib.gis.db.backends.spatialite'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99062:Assign_L54_C16", "label": "full_engine =", "type": "assigned_variable", "loc": [54, 54], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99062:If_L51_C12", "vector": [14, 5, 0.5243, 0.0097, 5, 0.51, 1.0, 364, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "full_engine", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " full_engine = 'django.contrib.gis.db.backends.%s' % database['ENGINE']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99062:Expr_L56_C12", "label": "warn()", "type": "expression", "loc": [56, 60], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99062:If_L42_C8", "vector": [8, 3, 0.5631, 0.0485, 3, 0.76, 0.6667, 960, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "warn", "arg_names": [], "import_names": [], "rhs_call_name": "warn", "annotation": ""}, "snippet": " warnings.warn(\n \"Short names for ENGINE in database configurations are deprecated. \"\n \"Prepend %s.ENGINE with 'django.db.backends.'\" % alias,\n DeprecationWarning\n )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99062:Assign_L61_C12", "label": "full_engine =", "type": "assigned_variable", "loc": [61, 61], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99062:If_L42_C8", "vector": [14, 3, 0.5922, 0.0097, 3, 0.76, 1.0, 364, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "full_engine", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " full_engine = \"django.db.backends.%s\" % database['ENGINE']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99062:Assign_L62_C8", "label": "assign", "type": "assigned_variable", "loc": [62, 62], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99062:If_L40_C4", "vector": [14, 2, 0.6019, 0.0097, 2, 0.83, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " database['ENGINE'] = full_engine"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99062:Assign_L64_C0", "label": "connections = ConnectionHandler()", "type": "assigned_variable", "loc": [64, 64], "level": 0, "parent": null, "vector": [14, 0, 0.6214, 0.0097, 0, 0.66, 0.5, 523, 3, 1, 0, 0, 838, 10, 1], "semantic": {"name": "connections", "arg_names": [], "import_names": [], "rhs_call_name": "ConnectionHandler", "annotation": ""}, "snippet": "connections = ConnectionHandler(settings.DATABASES)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99062:Assign_L66_C0", "label": "router = ConnectionRouter()", "type": "assigned_variable", "loc": [66, 66], "level": 0, "parent": null, "vector": [14, 0, 0.6408, 0.0097, 0, 0.66, 0.5556, 178, 3, 1, 0, 0, 74, 10, 1], "semantic": {"name": "router", "arg_names": [], "import_names": [], "rhs_call_name": "ConnectionRouter", "annotation": ""}, "snippet": "router = ConnectionRouter(settings.DATABASE_ROUTERS)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99062:Assign_L77_C0", "label": "connection =", "type": "assigned_variable", "loc": [77, 77], "level": 0, "parent": null, "vector": [14, 0, 0.7476, 0.0097, 0, 0.66, 0.6111, 351, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "connection", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "connection = connections[DEFAULT_DB_ALIAS]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99062:Assign_L78_C0", "label": "backend = load_backend()", "type": "assigned_variable", "loc": [78, 78], "level": 0, "parent": null, "vector": [14, 0, 0.7573, 0.0097, 0, 0.66, 0.6667, 631, 3, 1, 0, 0, 221, 10, 1], "semantic": {"name": "backend", "arg_names": [], "import_names": [], "rhs_call_name": "load_backend", "annotation": ""}, "snippet": "backend = load_backend(connection.settings_dict['ENGINE'])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99062:FunctionDef_L82_C0", "label": "close_connection", "type": "function", "loc": [82, 84], "level": 0, "parent": null, "vector": [2, 0, 0.8058, 0.0291, 0, 0.66, 0.7222, 801, 0, 1, 0, 0, 0, 0, 2], "semantic": {"name": "close_connection", "arg_names": ["kwargs"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def close_connection(**kwargs):\n for conn in connections.all():\n conn.close()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99062:For_L83_C4", "label": "for conn", "type": "for", "loc": [83, 84], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99062:FunctionDef_L82_C0", "vector": [6, 1, 0.8107, 0.0194, 1, 0.97, 0.0, 345, 3, 0, 0, 0, 0, 0, 2], "semantic": {"name": "conn", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for conn in connections.all():\n conn.close()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99062:Expr_L84_C8", "label": "close()", "type": "expression", "loc": [84, 84], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99062:For_L83_C4", "vector": [8, 2, 0.8155, 0.0097, 2, 0.41, 0.0, 77, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "close", "arg_names": [], "import_names": [], "rhs_call_name": "close", "annotation": ""}, "snippet": " conn.close()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99062:Expr_L85_C0", "label": "connect()", "type": "expression", "loc": [85, 85], "level": 0, "parent": null, "vector": [8, 0, 0.8252, 0.0097, 0, 0.66, 0.7778, 242, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "connect", "arg_names": [], "import_names": [], "rhs_call_name": "connect", "annotation": ""}, "snippet": "signals.request_finished.connect(close_connection)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99062:FunctionDef_L89_C0", "label": "reset_queries", "type": "function", "loc": [89, 91], "level": 0, "parent": null, "vector": [2, 0, 0.8738, 0.0291, 0, 0.66, 0.8333, 537, 0, 1, 0, 0, 0, 0, 1], "semantic": {"name": "reset_queries", "arg_names": ["kwargs"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def reset_queries(**kwargs):\n for conn in connections.all():\n conn.queries = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99062:For_L90_C4", "label": "for conn", "type": "for", "loc": [90, 91], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99062:FunctionDef_L89_C0", "vector": [6, 1, 0.8786, 0.0194, 1, 0.22, 0.0, 345, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "conn", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for conn in connections.all():\n conn.queries = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99062:Assign_L91_C8", "label": "conn.queries =", "type": "assigned_variable", "loc": [91, 91], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99062:For_L90_C4", "vector": [14, 2, 0.8835, 0.0097, 2, 0.5, 0.0, 641, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "conn.queries", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " conn.queries = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99062:Expr_L92_C0", "label": "connect()", "type": "expression", "loc": [92, 92], "level": 0, "parent": null, "vector": [8, 0, 0.8932, 0.0097, 0, 0.66, 0.8889, 242, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "connect", "arg_names": [], "import_names": [], "rhs_call_name": "connect", "annotation": ""}, "snippet": "signals.request_started.connect(reset_queries)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99062:FunctionDef_L96_C0", "label": "_rollback_on_exception", "type": "function", "loc": [96, 102], "level": 0, "parent": null, "vector": [2, 0, 0.9612, 0.068, 0, 0.66, 0.9444, 677, 0, 1, 0, 0, 0, 0, 1], "semantic": {"name": "_rollback_on_exception", "arg_names": ["kwargs"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def _rollback_on_exception(**kwargs):\n from django.db import transaction\n for conn in connections:\n try:\n transaction.rollback_unless_managed(using=conn)\n except DatabaseError:\n pass"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99062:ImportFrom_L97_C4", "label": "from django.db import transaction", "type": "import", "loc": [97, 97], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99062:FunctionDef_L96_C0", "vector": [1, 1, 0.9417, 0.0097, 1, 0.02, 0.0, 40, 0, 1, 0, 0, 40, 0, 0], "semantic": {"name": "django.db", "arg_names": [], "import_names": ["transaction"], "rhs_call_name": "", "annotation": ""}, "snippet": " from django.db import transaction"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99062:For_L98_C4", "label": "for conn", "type": "for", "loc": [98, 102], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99062:FunctionDef_L96_C0", "vector": [6, 1, 0.9709, 0.0485, 1, 0.02, 1.0, 345, 2, 0, 0, 0, 0, 0, 1], "semantic": {"name": "conn", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for conn in connections:\n try:\n transaction.rollback_unless_managed(using=conn)\n except DatabaseError:\n pass"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99062:Try_L99_C8", "label": "try", "type": "try", "loc": [99, 102], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99062:For_L98_C4", "vector": [7, 2, 0.9757, 0.0388, 2, 0.77, 0.0, 0, 0, 1, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " try:\n transaction.rollback_unless_managed(using=conn)\n except DatabaseError:\n pass"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99062:Expr_L100_C12", "label": "rollback_unless_managed()", "type": "expression", "loc": [100, 100], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99062:Try_L99_C8", "vector": [8, 3, 0.9709, 0.0097, 3, 0.92, 0.0, 419, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "rollback_unless_managed", "arg_names": [], "import_names": [], "rhs_call_name": "rollback_unless_managed", "annotation": ""}, "snippet": " transaction.rollback_unless_managed(using=conn)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99062:Expr_L103_C0", "label": "connect()", "type": "expression", "loc": [103, 103], "level": 0, "parent": null, "vector": [8, 0, 1.0, 0.0097, 0, 0.66, 1.0, 242, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "connect", "arg_names": [], "import_names": [], "rhs_call_name": "connect", "annotation": ""}, "snippet": "signals.got_request_exception.connect(_rollback_on_exception)"}]
[{"f": "ajibawa-2023/Python-Code-Large/train/row_99062:If_L14_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99062:Import_L15_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99062:If_L14_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99062:Expr_L16_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99062:If_L14_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99062:Assign_L21_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99062:For_L37_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99062:If_L38_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99062:For_L37_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99062:If_L40_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99062:If_L40_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99062:Import_L41_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99062:If_L40_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99062:If_L42_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99062:If_L42_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99062:Expr_L43_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99062:If_L42_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99062:If_L49_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99062:If_L49_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99062:Assign_L50_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99062:If_L49_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99062:If_L51_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99062:If_L51_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99062:Assign_L52_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99062:If_L51_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99062:Assign_L54_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99062:If_L42_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99062:Expr_L56_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99062:If_L42_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99062:Assign_L61_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99062:If_L40_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99062:Assign_L62_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99062:FunctionDef_L82_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99062:For_L83_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99062:For_L83_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99062:Expr_L84_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99062:FunctionDef_L89_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99062:For_L90_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99062:For_L90_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99062:Assign_L91_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99062:FunctionDef_L96_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99062:ImportFrom_L97_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99062:FunctionDef_L96_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99062:For_L98_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99062:For_L98_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99062:Try_L99_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99062:Try_L99_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99062:Expr_L100_C12"}]
import re import sys from urlparse import urlsplit, urlunsplit from xml.dom.minidom import parseString, Node from django.conf import settings from django.core import mail from django.core.management import call_command from django.core.urlresolvers import clear_url_caches from django.db import transaction, connection, connections, DEFAULT_DB_ALIAS from django.http import QueryDict from django.test import _doctest as doctest from django.test.client import Client from django.test.utils import get_warnings_state, restore_warnings_state from django.utils import simplejson, unittest as ut2 from django.utils.encoding import smart_str from django.utils.functional import wraps __all__ = ('DocTestRunner', 'OutputChecker', 'TestCase', 'TransactionTestCase', 'skipIfDBFeature', 'skipUnlessDBFeature') try: all except NameError: from django.utils.itercompat import all normalize_long_ints = lambda s: re.sub(r'(?<![\w])(\d+)L(?![\w])', '\\1', s) normalize_decimals = lambda s: re.sub(r"Decimal\('(\d+(\.\d*)?)'\)", lambda m: "Decimal(\"%s\")" % m.groups()[0], s) def to_list(value): """ Puts value into a list if it's not already one. Returns an empty list if value is None. """ if value is None: value = [] elif not isinstance(value, list): value = [value] return value real_commit = transaction.commit real_rollback = transaction.rollback real_enter_transaction_management = transaction.enter_transaction_management real_leave_transaction_management = transaction.leave_transaction_management real_managed = transaction.managed def nop(*args, **kwargs): return def disable_transaction_methods(): transaction.commit = nop transaction.rollback = nop transaction.enter_transaction_management = nop transaction.leave_transaction_management = nop transaction.managed = nop def restore_transaction_methods(): transaction.commit = real_commit transaction.rollback = real_rollback transaction.enter_transaction_management = real_enter_transaction_management transaction.leave_transaction_management = real_leave_transaction_management transaction.managed = real_managed class OutputChecker(doctest.OutputChecker): def check_output(self, want, got, optionflags): "The entry method for doctest output checking. Defers to a sequence of child checkers" checks = (self.check_output_default, self.check_output_numeric, self.check_output_xml, self.check_output_json) for check in checks: if check(want, got, optionflags): return True return False def check_output_default(self, want, got, optionflags): "The default comparator provided by doctest - not perfect, but good for most purposes" return doctest.OutputChecker.check_output(self, want, got, optionflags) def check_output_numeric(self, want, got, optionflags): """Doctest does an exact string comparison of output, which means that some numerically equivalent values aren't equal. This check normalizes * long integers (22L) so that they equal normal integers. (22) * Decimals so that they are comparable, regardless of the change made to __repr__ in Python 2.6. """ return doctest.OutputChecker.check_output(self, normalize_decimals(normalize_long_ints(want)), normalize_decimals(normalize_long_ints(got)), optionflags) def check_output_xml(self, want, got, optionsflags): """Tries to do a 'xml-comparision' of want and got. Plain string comparision doesn't always work because, for example, attribute ordering should not be important. Based on http://codespeak.net/svn/lxml/trunk/src/lxml/doctestcompare.py """ _norm_whitespace_re = re.compile(r'[ \t\n][ \t\n]+') def norm_whitespace(v): return _norm_whitespace_re.sub(' ', v) def child_text(element): return ''.join([c.data for c in element.childNodes if c.nodeType == Node.TEXT_NODE]) def children(element): return [c for c in element.childNodes if c.nodeType == Node.ELEMENT_NODE] def norm_child_text(element): return norm_whitespace(child_text(element)) def attrs_dict(element): return dict(element.attributes.items()) def check_element(want_element, got_element): if want_element.tagName != got_element.tagName: return False if norm_child_text(want_element) != norm_child_text(got_element): return False if attrs_dict(want_element) != attrs_dict(got_element): return False want_children = children(want_element) got_children = children(got_element) if len(want_children) != len(got_children): return False for want, got in zip(want_children, got_children): if not check_element(want, got): return False return True want, got = self._strip_quotes(want, got) want = want.replace('\\n','\n') got = got.replace('\\n','\n') # If the string is not a complete xml document, we may need to add a # root element. This allow us to compare fragments, like "<foo/><bar/>" if not want.startswith('<?xml'): wrapper = '<root>%s</root>' want = wrapper % want got = wrapper % got # Parse the want and got strings, and compare the parsings. try: want_root = parseString(want).firstChild got_root = parseString(got).firstChild except: return False return check_element(want_root, got_root) def check_output_json(self, want, got, optionsflags): "Tries to compare want and got as if they were JSON-encoded data" want, got = self._strip_quotes(want, got) try: want_json = simplejson.loads(want) got_json = simplejson.loads(got) except: return False return want_json == got_json def _strip_quotes(self, want, got): """ Strip quotes of doctests output values: >>> o = OutputChecker() >>> o._strip_quotes("'foo'") "foo" >>> o._strip_quotes('"foo"') "foo" >>> o._strip_quotes("u'foo'") "foo" >>> o._strip_quotes('u"foo"') "foo" """ def is_quoted_string(s): s = s.strip() return (len(s) >= 2 and s[0] == s[-1] and s[0] in ('"', "'")) def is_quoted_unicode(s): s = s.strip() return (len(s) >= 3 and s[0] == 'u' and s[1] == s[-1] and s[1] in ('"', "'")) if is_quoted_string(want) and is_quoted_string(got): want = want.strip()[1:-1] got = got.strip()[1:-1] elif is_quoted_unicode(want) and is_quoted_unicode(got): want = want.strip()[2:-1] got = got.strip()[2:-1] return want, got class DocTestRunner(doctest.DocTestRunner): def __init__(self, *args, **kwargs): doctest.DocTestRunner.__init__(self, *args, **kwargs) self.optionflags = doctest.ELLIPSIS def report_unexpected_exception(self, out, test, example, exc_info): doctest.DocTestRunner.report_unexpected_exception(self, out, test, example, exc_info) # Rollback, in case of database errors. Otherwise they'd have # side effects on other tests. for conn in connections: transaction.rollback_unless_managed(using=conn) class _AssertNumQueriesContext(object): def __init__(self, test_case, num, connection): self.test_case = test_case self.num = num self.connection = connection def __enter__(self): self.old_debug_cursor = self.connection.use_debug_cursor self.connection.use_debug_cursor = True self.starting_queries = len(self.connection.queries) return self def __exit__(self, exc_type, exc_value, traceback): self.connection.use_debug_cursor = self.old_debug_cursor if exc_type is not None: return final_queries = len(self.connection.queries) executed = final_queries - self.starting_queries self.test_case.assertEqual( executed, self.num, "%d queries executed, %d expected" % ( executed, self.num ) ) class TransactionTestCase(ut2.TestCase): # The class we'll use for the test client self.client. # Can be overridden in derived classes. client_class = Client def _pre_setup(self): """Performs any pre-test setup. This includes: * Flushing the database. * If the Test Case class has a 'fixtures' member, installing the named fixtures. * If the Test Case class has a 'urls' member, replace the ROOT_URLCONF with it. * Clearing the mail test outbox. """ self._fixture_setup() self._urlconf_setup() mail.outbox = [] def _fixture_setup(self): # If the test case has a multi_db=True flag, flush all databases. # Otherwise, just flush default. if getattr(self, 'multi_db', False): databases = connections else: databases = [DEFAULT_DB_ALIAS] for db in databases: call_command('flush', verbosity=0, interactive=False, database=db) if hasattr(self, 'fixtures'): # We have to use this slightly awkward syntax due to the fact # that we're using *args and **kwargs together. call_command('loaddata', *self.fixtures, **{'verbosity': 0, 'database': db}) def _urlconf_setup(self): if hasattr(self, 'urls'): self._old_root_urlconf = settings.ROOT_URLCONF settings.ROOT_URLCONF = self.urls clear_url_caches() def __call__(self, result=None): """ Wrapper around default __call__ method to perform common Django test set up. This means that user-defined Test Cases aren't required to include a call to super().setUp(). """ self.client = self.client_class() try: self._pre_setup() except (KeyboardInterrupt, SystemExit): raise except Exception: import sys result.addError(self, sys.exc_info()) return super(TransactionTestCase, self).__call__(result) try: self._post_teardown() except (KeyboardInterrupt, SystemExit): raise except Exception: import sys result.addError(self, sys.exc_info()) return def _post_teardown(self): """ Performs any post-test things. This includes: * Putting back the original ROOT_URLCONF if it was changed. * Force closing the connection, so that the next test gets a clean cursor. """ self._fixture_teardown() self._urlconf_teardown() # Some DB cursors include SQL statements as part of cursor # creation. If you have a test that does rollback, the effect # of these statements is lost, which can effect the operation # of tests (e.g., losing a timezone setting causing objects to # be created with the wrong time). # To make sure this doesn't happen, get a clean connection at the # start of every test. for connection in connections.all(): connection.close() def _fixture_teardown(self): pass def _urlconf_teardown(self): if hasattr(self, '_old_root_urlconf'): settings.ROOT_URLCONF = self._old_root_urlconf clear_url_caches() def save_warnings_state(self): """ Saves the state of the warnings module """ self._warnings_state = get_warnings_state() def restore_warnings_state(self): """ Restores the sate of the warnings module to the state saved by save_warnings_state() """ restore_warnings_state(self._warnings_state) def assertRedirects(self, response, expected_url, status_code=302, target_status_code=200, host=None, msg_prefix=''): """Asserts that a response redirected to a specific URL, and that the redirect URL can be loaded. Note that assertRedirects won't work for external links since it uses TestClient to do a request. """ if msg_prefix: msg_prefix += ": " if hasattr(response, 'redirect_chain'): # The request was a followed redirect self.failUnless(len(response.redirect_chain) > 0, msg_prefix + "Response didn't redirect as expected: Response" " code was %d (expected %d)" % (response.status_code, status_code)) self.assertEqual(response.redirect_chain[0][1], status_code, msg_prefix + "Initial response didn't redirect as expected:" " Response code was %d (expected %d)" % (response.redirect_chain[0][1], status_code)) url, status_code = response.redirect_chain[-1] self.assertEqual(response.status_code, target_status_code, msg_prefix + "Response didn't redirect as expected: Final" " Response code was %d (expected %d)" % (response.status_code, target_status_code)) else: # Not a followed redirect self.assertEqual(response.status_code, status_code, msg_prefix + "Response didn't redirect as expected: Response" " code was %d (expected %d)" % (response.status_code, status_code)) url = response['Location'] scheme, netloc, path, query, fragment = urlsplit(url) redirect_response = response.client.get(path, QueryDict(query)) # Get the redirection page, using the same client that was used # to obtain the original response. self.assertEqual(redirect_response.status_code, target_status_code, msg_prefix + "Couldn't retrieve redirection page '%s':" " response code was %d (expected %d)" % (path, redirect_response.status_code, target_status_code)) e_scheme, e_netloc, e_path, e_query, e_fragment = urlsplit(expected_url) if not (e_scheme or e_netloc): expected_url = urlunsplit(('http', host or 'testserver', e_path, e_query, e_fragment)) self.assertEqual(url, expected_url, msg_prefix + "Response redirected to '%s', expected '%s'" % (url, expected_url)) def assertContains(self, response, text, count=None, status_code=200, msg_prefix=''): """ Asserts that a response indicates that some content was retrieved successfully, (i.e., the HTTP status code was as expected), and that ``text`` occurs ``count`` times in the content of the response. If ``count`` is None, the count doesn't matter - the assertion is true if the text occurs at least once in the response. """ if msg_prefix: msg_prefix += ": " self.assertEqual(response.status_code, status_code, msg_prefix + "Couldn't retrieve content: Response code was %d" " (expected %d)" % (response.status_code, status_code)) text = smart_str(text, response._charset) real_count = response.content.count(text) if count is not None: self.assertEqual(real_count, count, msg_prefix + "Found %d instances of '%s' in response" " (expected %d)" % (real_count, text, count)) else: self.assertTrue(real_count != 0, msg_prefix + "Couldn't find '%s' in response" % text) def assertNotContains(self, response, text, status_code=200, msg_prefix=''): """ Asserts that a response indicates that some content was retrieved successfully, (i.e., the HTTP status code was as expected), and that ``text`` doesn't occurs in the content of the response. """ if msg_prefix: msg_prefix += ": " self.assertEqual(response.status_code, status_code, msg_prefix + "Couldn't retrieve content: Response code was %d" " (expected %d)" % (response.status_code, status_code)) text = smart_str(text, response._charset) self.assertEqual(response.content.count(text), 0, msg_prefix + "Response should not contain '%s'" % text) def assertFormError(self, response, form, field, errors, msg_prefix=''): """ Asserts that a form used to render the response has a specific field error. """ if msg_prefix: msg_prefix += ": " # Put context(s) into a list to simplify processing. contexts = to_list(response.context) if not contexts: self.fail(msg_prefix + "Response did not use any contexts to " "render the response") # Put error(s) into a list to simplify processing. errors = to_list(errors) # Search all contexts for the error. found_form = False for i,context in enumerate(contexts): if form not in context: continue found_form = True for err in errors: if field: if field in context[form].errors: field_errors = context[form].errors[field] self.failUnless(err in field_errors, msg_prefix + "The field '%s' on form '%s' in" " context %d does not contain the error '%s'" " (actual errors: %s)" % (field, form, i, err, repr(field_errors))) elif field in context[form].fields: self.fail(msg_prefix + "The field '%s' on form '%s'" " in context %d contains no errors" % (field, form, i)) else: self.fail(msg_prefix + "The form '%s' in context %d" " does not contain the field '%s'" % (form, i, field)) else: non_field_errors = context[form].non_field_errors() self.failUnless(err in non_field_errors, msg_prefix + "The form '%s' in context %d does not" " contain the non-field error '%s'" " (actual errors: %s)" % (form, i, err, non_field_errors)) if not found_form: self.fail(msg_prefix + "The form '%s' was not used to render the" " response" % form) def assertTemplateUsed(self, response, template_name, msg_prefix=''): """ Asserts that the template with the provided name was used in rendering the response. """ if msg_prefix: msg_prefix += ": " template_names = [t.name for t in response.templates] if not template_names: self.fail(msg_prefix + "No templates used to render the response") self.failUnless(template_name in template_names, msg_prefix + "Template '%s' was not a template used to render" " the response. Actual template(s) used: %s" % (template_name, u', '.join(template_names))) def assertTemplateNotUsed(self, response, template_name, msg_prefix=''): """ Asserts that the template with the provided name was NOT used in rendering the response. """ if msg_prefix: msg_prefix += ": " template_names = [t.name for t in response.templates] self.failIf(template_name in template_names, msg_prefix + "Template '%s' was used unexpectedly in rendering" " the response" % template_name) def assertQuerysetEqual(self, qs, values, transform=repr): return self.assertEqual(map(transform, qs), values) def assertNumQueries(self, num, func=None, *args, **kwargs): using = kwargs.pop("using", DEFAULT_DB_ALIAS) connection = connections[using] context = _AssertNumQueriesContext(self, num, connection) if func is None: return context # Basically emulate the `with` statement here. context.__enter__() try: func(*args, **kwargs) except: context.__exit__(*sys.exc_info()) raise else: context.__exit__(*sys.exc_info()) def connections_support_transactions(): """ Returns True if all connections support transactions. This is messy because 2.4 doesn't support any or all. """ return all(conn.features.supports_transactions for conn in connections.all()) class TestCase(TransactionTestCase): """ Does basically the same as TransactionTestCase, but surrounds every test with a transaction, monkey-patches the real transaction management routines to do nothing, and rollsback the test transaction at the end of the test. You have to use TransactionTestCase, if you need transaction management inside a test. """ def _fixture_setup(self): if not connections_support_transactions(): return super(TestCase, self)._fixture_setup() # If the test case has a multi_db=True flag, setup all databases. # Otherwise, just use default. if getattr(self, 'multi_db', False): databases = connections else: databases = [DEFAULT_DB_ALIAS] for db in databases: transaction.enter_transaction_management(using=db) transaction.managed(True, using=db) disable_transaction_methods() from django.contrib.sites.models import Site Site.objects.clear_cache() for db in databases: if hasattr(self, 'fixtures'): call_command('loaddata', *self.fixtures, **{ 'verbosity': 0, 'commit': False, 'database': db }) def _fixture_teardown(self): if not connections_support_transactions(): return super(TestCase, self)._fixture_teardown() # If the test case has a multi_db=True flag, teardown all databases. # Otherwise, just teardown default. if getattr(self, 'multi_db', False): databases = connections else: databases = [DEFAULT_DB_ALIAS] restore_transaction_methods() for db in databases: transaction.rollback(using=db) transaction.leave_transaction_management(using=db) def _deferredSkip(condition, reason): def decorator(test_func): if not (isinstance(test_func, type) and issubclass(test_func, TestCase)): @wraps(test_func) def skip_wrapper(*args, **kwargs): if condition(): raise ut2.SkipTest(reason) return test_func(*args, **kwargs) test_item = skip_wrapper else: test_item = test_func test_item.__unittest_skip_why__ = reason return test_item return decorator def skipIfDBFeature(feature): "Skip a test if a database has the named feature" return _deferredSkip(lambda: getattr(connection.features, feature), "Database has feature %s" % feature) def skipUnlessDBFeature(feature): "Skip a test unless a database has the named feature" return _deferredSkip(lambda: not getattr(connection.features, feature), "Database doesn't support feature %s" % feature)
ajibawa-2023/Python-Code-Large/train/row_99063
328
629
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_99063:Import_L1_C0", "label": "re import re", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0016, 0.0016, 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_99063:Import_L2_C0", "label": "sys import sys", "type": "import", "loc": [2, 2], "level": 0, "parent": null, "vector": [1, 0, 0.0032, 0.0016, 0, 0.66, 0.027, 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_99063:ImportFrom_L3_C0", "label": "from urlparse import urlsplit, urlunsplit", "type": "import", "loc": [3, 3], "level": 0, "parent": null, "vector": [1, 0, 0.0048, 0.0016, 0, 0.66, 0.0541, 857, 0, 2, 0, 0, 857, 0, 0], "semantic": {"name": "urlparse", "arg_names": [], "import_names": ["urlsplit", "urlunsplit"], "rhs_call_name": "", "annotation": ""}, "snippet": "from urlparse import urlsplit, urlunsplit"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99063:ImportFrom_L4_C0", "label": "from xml.dom.minidom import parseString, Node", "type": "import", "loc": [4, 4], "level": 0, "parent": null, "vector": [1, 0, 0.0064, 0.0016, 0, 0.66, 0.0811, 770, 0, 2, 0, 0, 770, 0, 0], "semantic": {"name": "xml.dom.minidom", "arg_names": [], "import_names": ["parseString", "Node"], "rhs_call_name": "", "annotation": ""}, "snippet": "from xml.dom.minidom import parseString, Node"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99063:ImportFrom_L6_C0", "label": "from django.conf import settings", "type": "import", "loc": [6, 6], "level": 0, "parent": null, "vector": [1, 0, 0.0095, 0.0016, 0, 0.66, 0.1081, 128, 0, 1, 0, 0, 128, 0, 0], "semantic": {"name": "django.conf", "arg_names": [], "import_names": ["settings"], "rhs_call_name": "", "annotation": ""}, "snippet": "from django.conf import settings"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99063:ImportFrom_L7_C0", "label": "from django.core import mail", "type": "import", "loc": [7, 7], "level": 0, "parent": null, "vector": [1, 0, 0.0111, 0.0016, 0, 0.66, 0.1351, 913, 0, 1, 0, 0, 913, 0, 0], "semantic": {"name": "django.core", "arg_names": [], "import_names": ["mail"], "rhs_call_name": "", "annotation": ""}, "snippet": "from django.core import mail"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99063:ImportFrom_L8_C0", "label": "from django.core.management import call_command", "type": "import", "loc": [8, 8], "level": 0, "parent": null, "vector": [1, 0, 0.0127, 0.0016, 0, 0.66, 0.1622, 879, 0, 1, 0, 0, 879, 0, 0], "semantic": {"name": "django.core.management", "arg_names": [], "import_names": ["call_command"], "rhs_call_name": "", "annotation": ""}, "snippet": "from django.core.management import call_command"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99063:ImportFrom_L9_C0", "label": "from django.core.urlresolvers import clear_url_caches", "type": "import", "loc": [9, 9], "level": 0, "parent": null, "vector": [1, 0, 0.0143, 0.0016, 0, 0.66, 0.1892, 749, 0, 1, 0, 0, 749, 0, 0], "semantic": {"name": "django.core.urlresolvers", "arg_names": [], "import_names": ["clear_url_caches"], "rhs_call_name": "", "annotation": ""}, "snippet": "from django.core.urlresolvers import clear_url_caches"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99063:ImportFrom_L10_C0", "label": "from django.db import transaction, connection, connections\u2026", "type": "import", "loc": [10, 10], "level": 0, "parent": null, "vector": [1, 0, 0.0159, 0.0016, 0, 0.66, 0.2162, 40, 0, 4, 0, 0, 40, 0, 0], "semantic": {"name": "django.db", "arg_names": [], "import_names": ["transaction", "connection", "connections", "DEFAULT_DB_ALIAS"], "rhs_call_name": "", "annotation": ""}, "snippet": "from django.db import transaction, connection, connections, DEFAULT_DB_ALIAS"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99063:ImportFrom_L11_C0", "label": "from django.http import QueryDict", "type": "import", "loc": [11, 11], "level": 0, "parent": null, "vector": [1, 0, 0.0175, 0.0016, 0, 0.66, 0.2432, 779, 0, 1, 0, 0, 779, 0, 0], "semantic": {"name": "django.http", "arg_names": [], "import_names": ["QueryDict"], "rhs_call_name": "", "annotation": ""}, "snippet": "from django.http import QueryDict"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99063:ImportFrom_L12_C0", "label": "from django.test import doctest", "type": "import", "loc": [12, 12], "level": 0, "parent": null, "vector": [1, 0, 0.0191, 0.0016, 0, 0.66, 0.2703, 944, 0, 1, 0, 0, 944, 0, 0], "semantic": {"name": "django.test", "arg_names": [], "import_names": ["doctest"], "rhs_call_name": "", "annotation": ""}, "snippet": "from django.test import _doctest as doctest"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99063:ImportFrom_L13_C0", "label": "from django.test.client import Client", "type": "import", "loc": [13, 13], "level": 0, "parent": null, "vector": [1, 0, 0.0207, 0.0016, 0, 0.66, 0.2973, 479, 0, 1, 0, 0, 479, 0, 0], "semantic": {"name": "django.test.client", "arg_names": [], "import_names": ["Client"], "rhs_call_name": "", "annotation": ""}, "snippet": "from django.test.client import Client"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99063:ImportFrom_L14_C0", "label": "from django.test.utils import get_warnings_state, restore_warnings_state", "type": "import", "loc": [14, 14], "level": 0, "parent": null, "vector": [1, 0, 0.0223, 0.0016, 0, 0.66, 0.3243, 768, 0, 2, 0, 0, 768, 0, 0], "semantic": {"name": "django.test.utils", "arg_names": [], "import_names": ["get_warnings_state", "restore_warnings_state"], "rhs_call_name": "", "annotation": ""}, "snippet": "from django.test.utils import get_warnings_state, restore_warnings_state"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99063:ImportFrom_L15_C0", "label": "from django.utils import simplejson, ut2", "type": "import", "loc": [15, 15], "level": 0, "parent": null, "vector": [1, 0, 0.0238, 0.0016, 0, 0.66, 0.3514, 944, 0, 2, 0, 0, 944, 0, 0], "semantic": {"name": "django.utils", "arg_names": [], "import_names": ["simplejson", "ut2"], "rhs_call_name": "", "annotation": ""}, "snippet": "from django.utils import simplejson, unittest as ut2"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99063:ImportFrom_L16_C0", "label": "from django.utils.encoding import smart_str", "type": "import", "loc": [16, 16], "level": 0, "parent": null, "vector": [1, 0, 0.0254, 0.0016, 0, 0.66, 0.3784, 96, 0, 1, 0, 0, 96, 0, 0], "semantic": {"name": "django.utils.encoding", "arg_names": [], "import_names": ["smart_str"], "rhs_call_name": "", "annotation": ""}, "snippet": "from django.utils.encoding import smart_str"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99063:ImportFrom_L17_C0", "label": "from django.utils.functional import wraps", "type": "import", "loc": [17, 17], "level": 0, "parent": null, "vector": [1, 0, 0.027, 0.0016, 0, 0.66, 0.4054, 375, 0, 1, 0, 0, 375, 0, 0], "semantic": {"name": "django.utils.functional", "arg_names": [], "import_names": ["wraps"], "rhs_call_name": "", "annotation": ""}, "snippet": "from django.utils.functional import wraps"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99063:Assign_L19_C0", "label": "__all__ =", "type": "assigned_variable", "loc": [19, 20], "level": 0, "parent": null, "vector": [14, 0, 0.031, 0.0032, 0, 0.66, 0.4324, 272, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "__all__", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "__all__ = ('DocTestRunner', 'OutputChecker', 'TestCase', 'TransactionTestCase',\n 'skipIfDBFeature', 'skipUnlessDBFeature')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99063:Try_L23_C0", "label": "try", "type": "try", "loc": [23, 26], "level": 0, "parent": null, "vector": [7, 0, 0.039, 0.0064, 0, 0.66, 0.4595, 0, 0, 1, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "try:\n all\nexcept NameError:\n from django.utils.itercompat import all"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99063:Expr_L24_C4", "label": "expression", "type": "expression", "loc": [24, 24], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99063:Try_L23_C0", "vector": [8, 1, 0.0382, 0.0016, 1, 0.98, 0.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " all"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99063:ImportFrom_L26_C4", "label": "from django.utils.itercompat import all", "type": "import", "loc": [26, 26], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99063:Try_L23_C0", "vector": [1, 1, 0.0413, 0.0016, 1, 0.98, 0.0, 358, 0, 1, 0, 0, 358, 0, 0], "semantic": {"name": "django.utils.itercompat", "arg_names": [], "import_names": ["all"], "rhs_call_name": "", "annotation": ""}, "snippet": " from django.utils.itercompat import all"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99063:Assign_L28_C0", "label": "normalize_long_ints =", "type": "assigned_variable", "loc": [28, 28], "level": 0, "parent": null, "vector": [14, 0, 0.0445, 0.0016, 0, 0.66, 0.4865, 798, 9, 0, 0, 0, 0, 0, 1], "semantic": {"name": "normalize_long_ints", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "normalize_long_ints = lambda s: re.sub(r'(?<![\\w])(\\d+)L(?![\\w])', '\\\\1', s)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99063:Assign_L29_C0", "label": "normalize_decimals =", "type": "assigned_variable", "loc": [29, 29], "level": 0, "parent": null, "vector": [14, 0, 0.0461, 0.0016, 0, 0.66, 0.5135, 447, 9, 0, 0, 0, 0, 0, 2], "semantic": {"name": "normalize_decimals", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "normalize_decimals = lambda s: re.sub(r\"Decimal\\('(\\d+(\\.\\d*)?)'\\)\", lambda m: \"Decimal(\\\"%s\\\")\" % m.groups()[0], s)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99063:FunctionDef_L32_C0", "label": "to_list", "type": "function", "loc": [32, 41], "level": 0, "parent": null, "vector": [2, 0, 0.058, 0.0159, 0, 0.66, 0.5405, 64, 0, 1, 1, 0, 0, 0, 1], "semantic": {"name": "to_list", "arg_names": ["value"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def to_list(value):\n \"\"\"\n Puts value into a list if it's not already one.\n Returns an empty list if value is None.\n \"\"\"\n if value is None:\n value = []\n elif not isinstance(value, list):"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99063:Expr_L33_C4", "label": "expression", "type": "expression", "loc": [33, 36], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99063:FunctionDef_L32_C0", "vector": [8, 1, 0.0548, 0.0064, 1, 0.71, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"\n Puts value into a list if it's not already one.\n Returns an empty list if value is None.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99063:If_L37_C4", "label": "if", "type": "if", "loc": [37, 40], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99063:FunctionDef_L32_C0", "vector": [4, 1, 0.0612, 0.0064, 1, 0.71, 0.5, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if value is None:\n value = []\n elif not isinstance(value, list):\n value = [value]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99063:Assign_L38_C8", "label": "value =", "type": "assigned_variable", "loc": [38, 38], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99063:If_L37_C4", "vector": [14, 2, 0.0604, 0.0016, 2, 0.67, 0.0, 441, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "value", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " value = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99063:If_L39_C4", "label": "if", "type": "if", "loc": [39, 40], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99063:If_L37_C4", "vector": [4, 2, 0.0628, 0.0032, 2, 0.67, 1.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " elif not isinstance(value, list):\n value = [value]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99063:Assign_L40_C8", "label": "value =", "type": "assigned_variable", "loc": [40, 40], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99063:If_L39_C4", "vector": [14, 3, 0.0636, 0.0016, 3, 0.59, 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_99063:Return_L41_C4", "label": "return", "type": "return", "loc": [41, 41], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99063:FunctionDef_L32_C0", "vector": [13, 1, 0.0652, 0.0016, 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 value"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99063:Assign_L43_C0", "label": "real_commit =", "type": "assigned_variable", "loc": [43, 43], "level": 0, "parent": null, "vector": [14, 0, 0.0684, 0.0016, 0, 0.66, 0.5676, 531, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "real_commit", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "real_commit = transaction.commit"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99063:Assign_L44_C0", "label": "real_rollback =", "type": "assigned_variable", "loc": [44, 44], "level": 0, "parent": null, "vector": [14, 0, 0.07, 0.0016, 0, 0.66, 0.5946, 529, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "real_rollback", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "real_rollback = transaction.rollback"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99063:Assign_L45_C0", "label": "real_enter_transaction_management =", "type": "assigned_variable", "loc": [45, 45], "level": 0, "parent": null, "vector": [14, 0, 0.0715, 0.0016, 0, 0.66, 0.6216, 378, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "real_enter_transaction_management", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "real_enter_transaction_management = transaction.enter_transaction_management"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99063:Assign_L46_C0", "label": "real_leave_transaction_management =", "type": "assigned_variable", "loc": [46, 46], "level": 0, "parent": null, "vector": [14, 0, 0.0731, 0.0016, 0, 0.66, 0.6486, 356, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "real_leave_transaction_management", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "real_leave_transaction_management = transaction.leave_transaction_management"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99063:Assign_L47_C0", "label": "real_managed =", "type": "assigned_variable", "loc": [47, 47], "level": 0, "parent": null, "vector": [14, 0, 0.0747, 0.0016, 0, 0.66, 0.6757, 853, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "real_managed", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "real_managed = transaction.managed"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99063:FunctionDef_L49_C0", "label": "nop", "type": "function", "loc": [49, 50], "level": 0, "parent": null, "vector": [2, 0, 0.0787, 0.0032, 0, 0.66, 0.7027, 198, 0, 2, 0, 0, 0, 0, 0], "semantic": {"name": "nop", "arg_names": ["args", "kwargs"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def nop(*args, **kwargs):\n return"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99063:Return_L50_C4", "label": "return", "type": "return", "loc": [50, 50], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99063:FunctionDef_L49_C0", "vector": [13, 1, 0.0795, 0.0016, 1, 0.1, 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_99063:FunctionDef_L52_C0", "label": "disable_transaction_methods", "type": "function", "loc": [52, 57], "level": 0, "parent": null, "vector": [2, 0, 0.0866, 0.0095, 0, 0.66, 0.7297, 699, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "disable_transaction_methods", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def disable_transaction_methods():\n transaction.commit = nop\n transaction.rollback = nop\n transaction.enter_transaction_management = nop\n transaction.leave_transaction_management = nop\n transaction.managed = nop"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99063:Assign_L53_C4", "label": "transaction.commit =", "type": "assigned_variable", "loc": [53, 53], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99063:FunctionDef_L52_C0", "vector": [14, 1, 0.0843, 0.0016, 1, 0.91, 0.0, 424, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "transaction.commit", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " transaction.commit = nop"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99063:Assign_L54_C4", "label": "transaction.rollback =", "type": "assigned_variable", "loc": [54, 54], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99063:FunctionDef_L52_C0", "vector": [14, 1, 0.0859, 0.0016, 1, 0.91, 0.25, 161, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "transaction.rollback", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " transaction.rollback = nop"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99063:Assign_L55_C4", "label": "transaction.enter_transaction_management =", "type": "assigned_variable", "loc": [55, 55], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99063:FunctionDef_L52_C0", "vector": [14, 1, 0.0874, 0.0016, 1, 0.91, 0.5, 274, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "transaction.enter_transaction_management", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " transaction.enter_transaction_management = nop"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99063:Assign_L56_C4", "label": "transaction.leave_transaction_management =", "type": "assigned_variable", "loc": [56, 56], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99063:FunctionDef_L52_C0", "vector": [14, 1, 0.089, 0.0016, 1, 0.91, 0.75, 528, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "transaction.leave_transaction_management", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " transaction.leave_transaction_management = nop"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99063:Assign_L57_C4", "label": "transaction.managed =", "type": "assigned_variable", "loc": [57, 57], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99063:FunctionDef_L52_C0", "vector": [14, 1, 0.0906, 0.0016, 1, 0.91, 1.0, 580, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "transaction.managed", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " transaction.managed = nop"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99063:FunctionDef_L59_C0", "label": "restore_transaction_methods", "type": "function", "loc": [59, 64], "level": 0, "parent": null, "vector": [2, 0, 0.0978, 0.0095, 0, 0.66, 0.7568, 701, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "restore_transaction_methods", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def restore_transaction_methods():\n transaction.commit = real_commit\n transaction.rollback = real_rollback\n transaction.enter_transaction_management = real_enter_transaction_management\n transaction.leave_transaction_management = real_leave_transaction_management\n transaction.managed = real_managed"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99063:Assign_L60_C4", "label": "transaction.commit =", "type": "assigned_variable", "loc": [60, 60], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99063:FunctionDef_L59_C0", "vector": [14, 1, 0.0954, 0.0016, 1, 0.64, 0.0, 424, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "transaction.commit", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " transaction.commit = real_commit"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99063:Assign_L61_C4", "label": "transaction.rollback =", "type": "assigned_variable", "loc": [61, 61], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99063:FunctionDef_L59_C0", "vector": [14, 1, 0.097, 0.0016, 1, 0.64, 0.25, 161, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "transaction.rollback", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " transaction.rollback = real_rollback"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99063:Assign_L62_C4", "label": "transaction.enter_transaction_management =", "type": "assigned_variable", "loc": [62, 62], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99063:FunctionDef_L59_C0", "vector": [14, 1, 0.0986, 0.0016, 1, 0.64, 0.5, 274, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "transaction.enter_transaction_management", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " transaction.enter_transaction_management = real_enter_transaction_management"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99063:Assign_L63_C4", "label": "transaction.leave_transaction_management =", "type": "assigned_variable", "loc": [63, 63], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99063:FunctionDef_L59_C0", "vector": [14, 1, 0.1002, 0.0016, 1, 0.64, 0.75, 528, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "transaction.leave_transaction_management", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " transaction.leave_transaction_management = real_leave_transaction_management"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99063:Assign_L64_C4", "label": "transaction.managed =", "type": "assigned_variable", "loc": [64, 64], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99063:FunctionDef_L59_C0", "vector": [14, 1, 0.1017, 0.0016, 1, 0.64, 1.0, 580, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "transaction.managed", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " transaction.managed = real_managed"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99063:ClassDef_L66_C0", "label": "OutputChecker", "type": "class", "loc": [66, 197], "level": 0, "parent": null, "vector": [3, 0, 0.2091, 0.2099, 0, 0.66, 0.7838, 890, 0, 14, 0, 0, 475, 0, 46], "semantic": {"name": "OutputChecker", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class OutputChecker(doctest.OutputChecker):\n def check_output(self, want, got, optionflags):\n \"The entry method for doctest output checking. Defers to a sequence of child checkers\"\n checks = (self.check_output_default,\n self.check_output_numeric,\n self.check_output_xml,\n self.check_output_json)\n for check in checks:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99063:FunctionDef_L67_C4", "label": "check_output", "type": "function", "loc": [67, 76], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99063:ClassDef_L66_C0", "vector": [2, 1, 0.1137, 0.0159, 1, 0.09, 0.0, 702, 0, 4, 1, 0, 0, 0, 1], "semantic": {"name": "check_output", "arg_names": ["self", "want", "got", "optionflags"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def check_output(self, want, got, optionflags):\n \"The entry method for doctest output checking. Defers to a sequence of child checkers\"\n checks = (self.check_output_default,\n self.check_output_numeric,\n self.check_output_xml,\n self.check_output_json)\n for check in checks:\n if check(want, got, optionflags):"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99063:Expr_L68_C8", "label": "expression", "type": "expression", "loc": [68, 68], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99063:FunctionDef_L67_C4", "vector": [8, 2, 0.1081, 0.0016, 2, 0.57, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"The entry method for doctest output checking. Defers to a sequence of child checkers\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99063:Assign_L69_C8", "label": "checks =", "type": "assigned_variable", "loc": [69, 72], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99063:FunctionDef_L67_C4", "vector": [14, 2, 0.1121, 0.0064, 2, 0.57, 0.3333, 348, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "checks", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " checks = (self.check_output_default,\n self.check_output_numeric,\n self.check_output_xml,\n self.check_output_json)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99063:For_L73_C8", "label": "for check", "type": "for", "loc": [73, 75], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99063:FunctionDef_L67_C4", "vector": [6, 2, 0.1176, 0.0048, 2, 0.57, 0.6667, 803, 2, 0, 0, 0, 0, 0, 1], "semantic": {"name": "check", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for check in checks:\n if check(want, got, optionflags):\n return True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99063:If_L74_C12", "label": "if", "type": "if", "loc": [74, 75], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99063:For_L73_C8", "vector": [4, 3, 0.1184, 0.0032, 3, 0.03, 0.0, 0, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if check(want, got, optionflags):\n return True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99063:Return_L75_C16", "label": "return", "type": "return", "loc": [75, 75], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99063:If_L74_C12", "vector": [13, 4, 0.1192, 0.0016, 4, 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_99063:Return_L76_C8", "label": "return", "type": "return", "loc": [76, 76], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99063:FunctionDef_L67_C4", "vector": [13, 2, 0.1208, 0.0016, 2, 0.57, 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_99063:FunctionDef_L78_C4", "label": "check_output_default", "type": "function", "loc": [78, 80], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99063:ClassDef_L66_C0", "vector": [2, 1, 0.1256, 0.0048, 1, 0.09, 0.2, 226, 0, 4, 1, 0, 0, 0, 1], "semantic": {"name": "check_output_default", "arg_names": ["self", "want", "got", "optionflags"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def check_output_default(self, want, got, optionflags):\n \"The default comparator provided by doctest - not perfect, but good for most purposes\"\n return doctest.OutputChecker.check_output(self, want, got, optionflags)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99063:Expr_L79_C8", "label": "expression", "type": "expression", "loc": [79, 79], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99063:FunctionDef_L78_C4", "vector": [8, 2, 0.1256, 0.0016, 2, 0.61, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"The default comparator provided by doctest - not perfect, but good for most purposes\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99063:Return_L80_C8", "label": "return", "type": "return", "loc": [80, 80], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99063:FunctionDef_L78_C4", "vector": [13, 2, 0.1272, 0.0016, 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 doctest.OutputChecker.check_output(self, want, got, optionflags)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99063:FunctionDef_L82_C4", "label": "check_output_numeric", "type": "function", "loc": [82, 92], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99063:ClassDef_L66_C0", "vector": [2, 1, 0.1383, 0.0175, 1, 0.09, 0.4, 19, 0, 4, 1, 0, 0, 0, 5], "semantic": {"name": "check_output_numeric", "arg_names": ["self", "want", "got", "optionflags"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def check_output_numeric(self, want, got, optionflags):\n \"\"\"Doctest does an exact string comparison of output, which means that\n some numerically equivalent values aren't equal. This check normalizes\n * long integers (22L) so that they equal normal integers. (22)\n * Decimals so that they are comparable, regardless of the change\n made to __repr__ in Python 2.6.\n \"\"\"\n return doctest.OutputChecker.check_output(self,"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99063:Expr_L83_C8", "label": "expression", "type": "expression", "loc": [83, 88], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99063:FunctionDef_L82_C4", "vector": [8, 2, 0.1359, 0.0095, 2, 0.98, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Doctest does an exact string comparison of output, which means that\n some numerically equivalent values aren't equal. This check normalizes\n * long integers (22L) so that they equal normal integers. (22)\n * Decimals so that they are comparable, regardless of the change\n made to __repr__ in Python 2.6.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99063:Return_L89_C8", "label": "return", "type": "return", "loc": [89, 92], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99063:FunctionDef_L82_C4", "vector": [13, 2, 0.1439, 0.0064, 2, 0.98, 1.0, 0, 3, 0, 0, 0, 0, 10, 5], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return doctest.OutputChecker.check_output(self,\n normalize_decimals(normalize_long_ints(want)),\n normalize_decimals(normalize_long_ints(got)),\n optionflags)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99063:FunctionDef_L94_C4", "label": "check_output_xml", "type": "function", "loc": [94, 152], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99063:ClassDef_L66_C0", "vector": [2, 1, 0.1955, 0.0938, 1, 0.09, 0.6, 234, 0, 4, 1, 0, 0, 0, 24], "semantic": {"name": "check_output_xml", "arg_names": ["self", "want", "got", "optionsflags"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def check_output_xml(self, want, got, optionsflags):\n \"\"\"Tries to do a 'xml-comparision' of want and got. Plain string\n comparision doesn't always work because, for example, attribute\n ordering should not be important.\n\n Based on http://codespeak.net/svn/lxml/trunk/src/lxml/doctestcompare.py\n \"\"\"\n _norm_whitespace_re = re.compile(r'[ \\t\\n][ \\t\\n]+')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99063:Expr_L95_C8", "label": "expression", "type": "expression", "loc": [95, 100], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99063:FunctionDef_L94_C4", "vector": [8, 2, 0.155, 0.0095, 2, 0.03, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Tries to do a 'xml-comparision' of want and got. Plain string\n comparision doesn't always work because, for example, attribute\n ordering should not be important.\n\n Based on http://codespeak.net/svn/lxml/trunk/src/lxml/doctestcompare.py\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99063:Assign_L101_C8", "label": "_norm_whitespace_re = compile()", "type": "assigned_variable", "loc": [101, 101], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99063:FunctionDef_L94_C4", "vector": [14, 2, 0.1606, 0.0016, 2, 0.03, 0.0769, 461, 3, 1, 0, 0, 821, 10, 1], "semantic": {"name": "_norm_whitespace_re", "arg_names": [], "import_names": [], "rhs_call_name": "compile", "annotation": ""}, "snippet": " _norm_whitespace_re = re.compile(r'[ \\t\\n][ \\t\\n]+')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99063:FunctionDef_L102_C8", "label": "norm_whitespace", "type": "function", "loc": [102, 103], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99063:FunctionDef_L94_C4", "vector": [2, 2, 0.163, 0.0032, 2, 0.03, 0.1538, 814, 0, 1, 1, 0, 0, 0, 1], "semantic": {"name": "norm_whitespace", "arg_names": ["v"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def norm_whitespace(v):\n return _norm_whitespace_re.sub(' ', v)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99063:Return_L103_C12", "label": "return", "type": "return", "loc": [103, 103], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99063:FunctionDef_L102_C8", "vector": [13, 3, 0.1638, 0.0016, 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 _norm_whitespace_re.sub(' ', v)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99063:FunctionDef_L105_C8", "label": "child_text", "type": "function", "loc": [105, 107], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99063:FunctionDef_L94_C4", "vector": [2, 2, 0.1685, 0.0048, 2, 0.03, 0.2308, 176, 0, 1, 1, 0, 0, 0, 1], "semantic": {"name": "child_text", "arg_names": ["element"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def child_text(element):\n return ''.join([c.data for c in element.childNodes\n if c.nodeType == Node.TEXT_NODE])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99063:Return_L106_C12", "label": "return", "type": "return", "loc": [106, 107], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99063:FunctionDef_L105_C8", "vector": [13, 3, 0.1693, 0.0032, 3, 0.63, 0.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return ''.join([c.data for c in element.childNodes\n if c.nodeType == Node.TEXT_NODE])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99063:FunctionDef_L109_C8", "label": "children", "type": "function", "loc": [109, 111], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99063:FunctionDef_L94_C4", "vector": [2, 2, 0.1749, 0.0048, 2, 0.03, 0.3077, 435, 0, 1, 1, 0, 0, 0, 0], "semantic": {"name": "children", "arg_names": ["element"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def children(element):\n return [c for c in element.childNodes\n if c.nodeType == Node.ELEMENT_NODE]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99063:Return_L110_C12", "label": "return", "type": "return", "loc": [110, 111], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99063:FunctionDef_L109_C8", "vector": [13, 3, 0.1757, 0.0032, 3, 0.28, 0.0, 0, 5, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return [c for c in element.childNodes\n if c.nodeType == Node.ELEMENT_NODE]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99063:FunctionDef_L113_C8", "label": "norm_child_text", "type": "function", "loc": [113, 114], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99063:FunctionDef_L94_C4", "vector": [2, 2, 0.1804, 0.0032, 2, 0.03, 0.3846, 234, 0, 1, 1, 0, 0, 0, 2], "semantic": {"name": "norm_child_text", "arg_names": ["element"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def norm_child_text(element):\n return norm_whitespace(child_text(element))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99063:Return_L114_C12", "label": "return", "type": "return", "loc": [114, 114], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99063:FunctionDef_L113_C8", "vector": [13, 3, 0.1812, 0.0016, 3, 0.04, 0.0, 0, 3, 0, 0, 0, 0, 10, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return norm_whitespace(child_text(element))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99063:FunctionDef_L116_C8", "label": "attrs_dict", "type": "function", "loc": [116, 117], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99063:FunctionDef_L94_C4", "vector": [2, 2, 0.1852, 0.0032, 2, 0.03, 0.4615, 606, 0, 1, 1, 0, 0, 0, 2], "semantic": {"name": "attrs_dict", "arg_names": ["element"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def attrs_dict(element):\n return dict(element.attributes.items())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99063:Return_L117_C12", "label": "return", "type": "return", "loc": [117, 117], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99063:FunctionDef_L116_C8", "vector": [13, 3, 0.186, 0.0016, 3, 0.58, 0.0, 0, 3, 0, 0, 0, 0, 10, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return dict(element.attributes.items())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99063:FunctionDef_L119_C8", "label": "check_element", "type": "function", "loc": [119, 133], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99063:FunctionDef_L94_C4", "vector": [2, 2, 0.2003, 0.0238, 2, 0.03, 0.5385, 776, 0, 2, 1, 0, 0, 0, 10], "semantic": {"name": "check_element", "arg_names": ["want_element", "got_element"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def check_element(want_element, got_element):\n if want_element.tagName != got_element.tagName:\n return False\n if norm_child_text(want_element) != norm_child_text(got_element):\n return False\n if attrs_dict(want_element) != attrs_dict(got_element):\n return False\n want_children = children(want_element)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99063:If_L120_C12", "label": "if", "type": "if", "loc": [120, 121], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99063:FunctionDef_L119_C8", "vector": [4, 3, 0.1916, 0.0032, 3, 0.5, 0.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if want_element.tagName != got_element.tagName:\n return False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99063:Return_L121_C16", "label": "return", "type": "return", "loc": [121, 121], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99063:If_L120_C12", "vector": [13, 4, 0.1924, 0.0016, 4, 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_99063:If_L122_C12", "label": "if", "type": "if", "loc": [122, 123], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99063:FunctionDef_L119_C8", "vector": [4, 3, 0.1948, 0.0032, 3, 0.5, 0.1429, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if norm_child_text(want_element) != norm_child_text(got_element):\n return False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99063:Return_L123_C16", "label": "return", "type": "return", "loc": [123, 123], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99063:If_L122_C12", "vector": [13, 4, 0.1955, 0.0016, 4, 0.52, 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_99063:If_L124_C12", "label": "if", "type": "if", "loc": [124, 125], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99063:FunctionDef_L119_C8", "vector": [4, 3, 0.1979, 0.0032, 3, 0.5, 0.2857, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if attrs_dict(want_element) != attrs_dict(got_element):\n return False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99063:Return_L125_C16", "label": "return", "type": "return", "loc": [125, 125], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99063:If_L124_C12", "vector": [13, 4, 0.1987, 0.0016, 4, 0.27, 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_99063:Assign_L126_C12", "label": "want_children = children()", "type": "assigned_variable", "loc": [126, 126], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99063:FunctionDef_L119_C8", "vector": [14, 3, 0.2003, 0.0016, 3, 0.5, 0.4286, 235, 3, 1, 0, 0, 435, 10, 1], "semantic": {"name": "want_children", "arg_names": [], "import_names": [], "rhs_call_name": "children", "annotation": ""}, "snippet": " want_children = children(want_element)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99063:Assign_L127_C12", "label": "got_children = children()", "type": "assigned_variable", "loc": [127, 127], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99063:FunctionDef_L119_C8", "vector": [14, 3, 0.2019, 0.0016, 3, 0.5, 0.5714, 56, 3, 1, 0, 0, 435, 10, 1], "semantic": {"name": "got_children", "arg_names": [], "import_names": [], "rhs_call_name": "children", "annotation": ""}, "snippet": " got_children = children(got_element)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99063:If_L128_C12", "label": "if", "type": "if", "loc": [128, 129], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99063:FunctionDef_L119_C8", "vector": [4, 3, 0.2043, 0.0032, 3, 0.5, 0.7143, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if len(want_children) != len(got_children):\n return False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99063:Return_L129_C16", "label": "return", "type": "return", "loc": [129, 129], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99063:If_L128_C12", "vector": [13, 4, 0.2051, 0.0016, 4, 0.23, 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_99063:For_L130_C12", "label": "for want, got", "type": "for", "loc": [130, 132], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99063:FunctionDef_L119_C8", "vector": [6, 3, 0.2083, 0.0048, 3, 0.5, 0.8571, 565, 3, 0, 0, 0, 0, 0, 2], "semantic": {"name": "want, got", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for want, got in zip(want_children, got_children):\n if not check_element(want, got):\n return False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99063:If_L131_C16", "label": "if", "type": "if", "loc": [131, 132], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99063:For_L130_C12", "vector": [4, 4, 0.2091, 0.0032, 4, 0.29, 0.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not check_element(want, got):\n return False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99063:Return_L132_C20", "label": "return", "type": "return", "loc": [132, 132], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99063:If_L131_C16", "vector": [13, 5, 0.2099, 0.0016, 5, 0.39, 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_99063:Return_L133_C12", "label": "return", "type": "return", "loc": [133, 133], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99063:FunctionDef_L119_C8", "vector": [13, 3, 0.2114, 0.0016, 3, 0.5, 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_99063:Assign_L135_C8", "label": "want, got = _strip_quotes()", "type": "assigned_variable", "loc": [135, 135], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99063:FunctionDef_L94_C4", "vector": [14, 2, 0.2146, 0.0016, 2, 0.03, 0.6154, 565, 3, 2, 0, 0, 361, 10, 1], "semantic": {"name": "want, got", "arg_names": [], "import_names": [], "rhs_call_name": "_strip_quotes", "annotation": ""}, "snippet": " want, got = self._strip_quotes(want, got)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99063:Assign_L136_C8", "label": "want = replace()", "type": "assigned_variable", "loc": [136, 136], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99063:FunctionDef_L94_C4", "vector": [14, 2, 0.2162, 0.0016, 2, 0.03, 0.6923, 35, 3, 2, 0, 0, 293, 10, 1], "semantic": {"name": "want", "arg_names": [], "import_names": [], "rhs_call_name": "replace", "annotation": ""}, "snippet": " want = want.replace('\\\\n','\\n')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99063:Assign_L137_C8", "label": "got = replace()", "type": "assigned_variable", "loc": [137, 137], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99063:FunctionDef_L94_C4", "vector": [14, 2, 0.2178, 0.0016, 2, 0.03, 0.7692, 852, 3, 2, 0, 0, 293, 10, 1], "semantic": {"name": "got", "arg_names": [], "import_names": [], "rhs_call_name": "replace", "annotation": ""}, "snippet": " got = got.replace('\\\\n','\\n')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99063:If_L141_C8", "label": "if", "type": "if", "loc": [141, 144], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99063:FunctionDef_L94_C4", "vector": [4, 2, 0.2266, 0.0064, 2, 0.03, 0.8462, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not want.startswith('<?xml'):\n wrapper = '<root>%s</root>'\n want = wrapper % want\n got = wrapper % got"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99063:Assign_L142_C12", "label": "wrapper =", "type": "assigned_variable", "loc": [142, 142], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99063:If_L141_C8", "vector": [14, 3, 0.2258, 0.0016, 3, 0.97, 0.0, 353, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "wrapper", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " wrapper = '<root>%s</root>'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99063:Assign_L143_C12", "label": "want =", "type": "assigned_variable", "loc": [143, 143], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99063:If_L141_C8", "vector": [14, 3, 0.2273, 0.0016, 3, 0.97, 0.5, 35, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "want", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " want = wrapper % want"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99063:Assign_L144_C12", "label": "got =", "type": "assigned_variable", "loc": [144, 144], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99063:If_L141_C8", "vector": [14, 3, 0.2289, 0.0016, 3, 0.97, 1.0, 852, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "got", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " got = wrapper % got"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99063:Try_L147_C8", "label": "try", "type": "try", "loc": [147, 151], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99063:FunctionDef_L94_C4", "vector": [7, 2, 0.2369, 0.0079, 2, 0.03, 0.9231, 0, 0, 1, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " try:\n want_root = parseString(want).firstChild\n got_root = parseString(got).firstChild\n except:\n return False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99063:Assign_L148_C12", "label": "want_root =", "type": "assigned_variable", "loc": [148, 148], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99063:Try_L147_C8", "vector": [14, 3, 0.2353, 0.0016, 3, 0.9, 0.0, 259, 7, 0, 0, 0, 0, 0, 1], "semantic": {"name": "want_root", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " want_root = parseString(want).firstChild"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99063:Assign_L149_C12", "label": "got_root =", "type": "assigned_variable", "loc": [149, 149], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99063:Try_L147_C8", "vector": [14, 3, 0.2369, 0.0016, 3, 0.9, 1.0, 410, 7, 0, 0, 0, 0, 0, 1], "semantic": {"name": "got_root", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " got_root = parseString(got).firstChild"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99063:Return_L151_C12", "label": "return", "type": "return", "loc": [151, 151], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99063:Try_L147_C8", "vector": [13, 3, 0.2401, 0.0016, 3, 0.9, 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_99063:Return_L152_C8", "label": "return", "type": "return", "loc": [152, 152], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99063:FunctionDef_L94_C4", "vector": [13, 2, 0.2417, 0.0016, 2, 0.03, 1.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return check_element(want_root, got_root)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99063:FunctionDef_L154_C4", "label": "check_output_json", "type": "function", "loc": [154, 162], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99063:ClassDef_L66_C0", "vector": [2, 1, 0.2512, 0.0143, 1, 0.09, 0.8, 93, 0, 4, 1, 0, 0, 0, 3], "semantic": {"name": "check_output_json", "arg_names": ["self", "want", "got", "optionsflags"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def check_output_json(self, want, got, optionsflags):\n \"Tries to compare want and got as if they were JSON-encoded data\"\n want, got = self._strip_quotes(want, got)\n try:\n want_json = simplejson.loads(want)\n got_json = simplejson.loads(got)\n except:\n return False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99063:Expr_L155_C8", "label": "expression", "type": "expression", "loc": [155, 155], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99063:FunctionDef_L154_C4", "vector": [8, 2, 0.2464, 0.0016, 2, 0.64, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"Tries to compare want and got as if they were JSON-encoded data\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99063:Assign_L156_C8", "label": "want, got = _strip_quotes()", "type": "assigned_variable", "loc": [156, 156], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99063:FunctionDef_L154_C4", "vector": [14, 2, 0.248, 0.0016, 2, 0.64, 0.3333, 565, 3, 2, 0, 0, 361, 10, 1], "semantic": {"name": "want, got", "arg_names": [], "import_names": [], "rhs_call_name": "_strip_quotes", "annotation": ""}, "snippet": " want, got = self._strip_quotes(want, got)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99063:Try_L157_C8", "label": "try", "type": "try", "loc": [157, 161], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99063:FunctionDef_L154_C4", "vector": [7, 2, 0.2528, 0.0079, 2, 0.64, 0.6667, 0, 0, 1, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " try:\n want_json = simplejson.loads(want)\n got_json = simplejson.loads(got)\n except:\n return False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99063:Assign_L158_C12", "label": "want_json = loads()", "type": "assigned_variable", "loc": [158, 158], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99063:Try_L157_C8", "vector": [14, 3, 0.2512, 0.0016, 3, 0.2, 0.0, 992, 3, 1, 0, 0, 88, 10, 1], "semantic": {"name": "want_json", "arg_names": [], "import_names": [], "rhs_call_name": "loads", "annotation": ""}, "snippet": " want_json = simplejson.loads(want)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99063:Assign_L159_C12", "label": "got_json = loads()", "type": "assigned_variable", "loc": [159, 159], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99063:Try_L157_C8", "vector": [14, 3, 0.2528, 0.0016, 3, 0.2, 1.0, 956, 3, 1, 0, 0, 88, 10, 1], "semantic": {"name": "got_json", "arg_names": [], "import_names": [], "rhs_call_name": "loads", "annotation": ""}, "snippet": " got_json = simplejson.loads(got)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99063:Return_L161_C12", "label": "return", "type": "return", "loc": [161, 161], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99063:Try_L157_C8", "vector": [13, 3, 0.256, 0.0016, 3, 0.2, 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_99063:Return_L162_C8", "label": "return", "type": "return", "loc": [162, 162], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99063:FunctionDef_L154_C4", "vector": [13, 2, 0.2576, 0.0016, 2, 0.64, 1.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return want_json == got_json"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99063:FunctionDef_L164_C4", "label": "_strip_quotes", "type": "function", "loc": [164, 197], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99063:ClassDef_L66_C0", "vector": [2, 1, 0.287, 0.0541, 1, 0.09, 1.0, 361, 0, 3, 1, 0, 0, 0, 12], "semantic": {"name": "_strip_quotes", "arg_names": ["self", "want", "got"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _strip_quotes(self, want, got):\n \"\"\"\n Strip quotes of doctests output values:\n\n >>> o = OutputChecker()\n >>> o._strip_quotes(\"'foo'\")\n \"foo\"\n >>> o._strip_quotes('\"foo\"')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99063:Expr_L165_C8", "label": "expression", "type": "expression", "loc": [165, 177], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99063:FunctionDef_L164_C4", "vector": [8, 2, 0.2719, 0.0207, 2, 0.87, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"\n Strip quotes of doctests output values:\n\n >>> o = OutputChecker()\n >>> o._strip_quotes(\"'foo'\")\n \"foo\"\n >>> o._strip_quotes('\"foo\"')\n \"foo\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99063:FunctionDef_L178_C8", "label": "is_quoted_string", "type": "function", "loc": [178, 182], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99063:FunctionDef_L164_C4", "vector": [2, 2, 0.2862, 0.0079, 2, 0.87, 0.25, 669, 0, 1, 1, 0, 0, 0, 2], "semantic": {"name": "is_quoted_string", "arg_names": ["s"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def is_quoted_string(s):\n s = s.strip()\n return (len(s) >= 2\n and s[0] == s[-1]\n and s[0] in ('\"', \"'\"))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99063:Assign_L179_C12", "label": "s = strip()", "type": "assigned_variable", "loc": [179, 179], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99063:FunctionDef_L178_C8", "vector": [14, 3, 0.2846, 0.0016, 3, 0.24, 0.0, 553, 3, 0, 0, 0, 973, 10, 1], "semantic": {"name": "s", "arg_names": [], "import_names": [], "rhs_call_name": "strip", "annotation": ""}, "snippet": " s = s.strip()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99063:Return_L180_C12", "label": "return", "type": "return", "loc": [180, 182], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99063:FunctionDef_L178_C8", "vector": [13, 3, 0.2878, 0.0048, 3, 0.24, 1.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return (len(s) >= 2\n and s[0] == s[-1]\n and s[0] in ('\"', \"'\"))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99063:FunctionDef_L184_C8", "label": "is_quoted_unicode", "type": "function", "loc": [184, 189], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99063:FunctionDef_L164_C4", "vector": [2, 2, 0.2965, 0.0095, 2, 0.87, 0.5, 623, 0, 1, 1, 0, 0, 0, 2], "semantic": {"name": "is_quoted_unicode", "arg_names": ["s"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def is_quoted_unicode(s):\n s = s.strip()\n return (len(s) >= 3\n and s[0] == 'u'\n and s[1] == s[-1]\n and s[1] in ('\"', \"'\"))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99063:Assign_L185_C12", "label": "s = strip()", "type": "assigned_variable", "loc": [185, 185], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99063:FunctionDef_L184_C8", "vector": [14, 3, 0.2941, 0.0016, 3, 0.0, 0.0, 553, 3, 0, 0, 0, 973, 10, 1], "semantic": {"name": "s", "arg_names": [], "import_names": [], "rhs_call_name": "strip", "annotation": ""}, "snippet": " s = s.strip()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99063:Return_L186_C12", "label": "return", "type": "return", "loc": [186, 189], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99063:FunctionDef_L184_C8", "vector": [13, 3, 0.2981, 0.0064, 3, 0.0, 1.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return (len(s) >= 3\n and s[0] == 'u'\n and s[1] == s[-1]\n and s[1] in ('\"', \"'\"))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99063:If_L191_C8", "label": "if", "type": "if", "loc": [191, 196], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99063:FunctionDef_L164_C4", "vector": [4, 2, 0.3076, 0.0095, 2, 0.87, 0.75, 0, 0, 0, 0, 0, 0, 0, 8], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if is_quoted_string(want) and is_quoted_string(got):\n want = want.strip()[1:-1]\n got = got.strip()[1:-1]\n elif is_quoted_unicode(want) and is_quoted_unicode(got):\n want = want.strip()[2:-1]\n got = got.strip()[2:-1]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99063:Assign_L192_C12", "label": "want =", "type": "assigned_variable", "loc": [192, 192], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99063:If_L191_C8", "vector": [14, 3, 0.3052, 0.0016, 3, 0.12, 0.0, 35, 6, 0, 0, 0, 0, 0, 1], "semantic": {"name": "want", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " want = want.strip()[1:-1]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99063:Assign_L193_C12", "label": "got =", "type": "assigned_variable", "loc": [193, 193], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99063:If_L191_C8", "vector": [14, 3, 0.3068, 0.0016, 3, 0.12, 0.5, 852, 6, 0, 0, 0, 0, 0, 1], "semantic": {"name": "got", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " got = got.strip()[1:-1]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99063:If_L194_C8", "label": "if", "type": "if", "loc": [194, 196], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99063:If_L191_C8", "vector": [4, 3, 0.31, 0.0048, 3, 0.12, 1.0, 0, 0, 0, 0, 0, 0, 0, 4], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " elif is_quoted_unicode(want) and is_quoted_unicode(got):\n want = want.strip()[2:-1]\n got = got.strip()[2:-1]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99063:Assign_L195_C12", "label": "want =", "type": "assigned_variable", "loc": [195, 195], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99063:If_L194_C8", "vector": [14, 4, 0.31, 0.0016, 4, 0.59, 0.0, 35, 6, 0, 0, 0, 0, 0, 1], "semantic": {"name": "want", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " want = want.strip()[2:-1]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99063:Assign_L196_C12", "label": "got =", "type": "assigned_variable", "loc": [196, 196], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99063:If_L194_C8", "vector": [14, 4, 0.3116, 0.0016, 4, 0.59, 1.0, 852, 6, 0, 0, 0, 0, 0, 1], "semantic": {"name": "got", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " got = got.strip()[2:-1]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99063:Return_L197_C8", "label": "return", "type": "return", "loc": [197, 197], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99063:FunctionDef_L164_C4", "vector": [13, 2, 0.3132, 0.0016, 2, 0.87, 1.0, 0, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return want, got"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99063:ClassDef_L200_C0", "label": "DocTestRunner", "type": "class", "loc": [200, 211], "level": 0, "parent": null, "vector": [3, 0, 0.3267, 0.0191, 0, 0.66, 0.8108, 353, 0, 2, 0, 0, 17, 0, 3], "semantic": {"name": "DocTestRunner", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class DocTestRunner(doctest.DocTestRunner):\n def __init__(self, *args, **kwargs):\n doctest.DocTestRunner.__init__(self, *args, **kwargs)\n self.optionflags = doctest.ELLIPSIS\n\n def report_unexpected_exception(self, out, test, example, exc_info):\n doctest.DocTestRunner.report_unexpected_exception(self, out, test,\n example, exc_info)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99063:FunctionDef_L201_C4", "label": "__init__", "type": "function", "loc": [201, 203], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99063:ClassDef_L200_C0", "vector": [2, 1, 0.3211, 0.0048, 1, 0.56, 0.0, 555, 0, 3, 0, 0, 0, 0, 1], "semantic": {"name": "__init__", "arg_names": ["self", "args", "kwargs"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, *args, **kwargs):\n doctest.DocTestRunner.__init__(self, *args, **kwargs)\n self.optionflags = doctest.ELLIPSIS"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99063:Expr_L202_C8", "label": "__init__()", "type": "expression", "loc": [202, 202], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99063:FunctionDef_L201_C4", "vector": [8, 2, 0.3211, 0.0016, 2, 0.53, 0.0, 555, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "__init__", "arg_names": [], "import_names": [], "rhs_call_name": "__init__", "annotation": ""}, "snippet": " doctest.DocTestRunner.__init__(self, *args, **kwargs)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99063:Assign_L203_C8", "label": "self.optionflags =", "type": "assigned_variable", "loc": [203, 203], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99063:FunctionDef_L201_C4", "vector": [14, 2, 0.3227, 0.0016, 2, 0.53, 1.0, 692, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.optionflags", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.optionflags = doctest.ELLIPSIS"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99063:FunctionDef_L205_C4", "label": "report_unexpected_exception", "type": "function", "loc": [205, 211], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99063:ClassDef_L200_C0", "vector": [2, 1, 0.3307, 0.0111, 1, 0.56, 1.0, 380, 0, 5, 0, 0, 0, 0, 2], "semantic": {"name": "report_unexpected_exception", "arg_names": ["self", "out", "test", "example", "exc_info"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def report_unexpected_exception(self, out, test, example, exc_info):\n doctest.DocTestRunner.report_unexpected_exception(self, out, test,\n example, exc_info)\n # Rollback, in case of database errors. Otherwise they'd have\n # side effects on other tests.\n for conn in connections:\n transaction.rollback_unless_managed(using=conn)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99063:Expr_L206_C8", "label": "report_unexpected_exception()", "type": "expression", "loc": [206, 207], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99063:FunctionDef_L205_C4", "vector": [8, 2, 0.3283, 0.0032, 2, 0.49, 0.0, 380, 3, 5, 0, 0, 0, 0, 1], "semantic": {"name": "report_unexpected_exception", "arg_names": [], "import_names": [], "rhs_call_name": "report_unexpected_exception", "annotation": ""}, "snippet": " doctest.DocTestRunner.report_unexpected_exception(self, out, test,\n example, exc_info)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99063:For_L210_C8", "label": "for conn", "type": "for", "loc": [210, 211], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99063:FunctionDef_L205_C4", "vector": [6, 2, 0.3347, 0.0032, 2, 0.49, 1.0, 345, 2, 0, 0, 0, 0, 0, 1], "semantic": {"name": "conn", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for conn in connections:\n transaction.rollback_unless_managed(using=conn)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99063:Expr_L211_C12", "label": "rollback_unless_managed()", "type": "expression", "loc": [211, 211], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99063:For_L210_C8", "vector": [8, 3, 0.3355, 0.0016, 3, 0.36, 0.0, 419, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "rollback_unless_managed", "arg_names": [], "import_names": [], "rhs_call_name": "rollback_unless_managed", "annotation": ""}, "snippet": " transaction.rollback_unless_managed(using=conn)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99063:ClassDef_L213_C0", "label": "_AssertNumQueriesContext", "type": "class", "loc": [213, 237], "level": 0, "parent": null, "vector": [3, 0, 0.3577, 0.0397, 0, 0.66, 0.8378, 863, 0, 3, 0, 0, 186, 0, 3], "semantic": {"name": "_AssertNumQueriesContext", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class _AssertNumQueriesContext(object):\n def __init__(self, test_case, num, connection):\n self.test_case = test_case\n self.num = num\n self.connection = connection\n\n def __enter__(self):\n self.old_debug_cursor = self.connection.use_debug_cursor"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99063:FunctionDef_L214_C4", "label": "__init__", "type": "function", "loc": [214, 217], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99063:ClassDef_L213_C0", "vector": [2, 1, 0.3426, 0.0064, 1, 0.82, 0.0, 555, 0, 4, 0, 0, 0, 0, 0], "semantic": {"name": "__init__", "arg_names": ["self", "test_case", "num", "connection"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, test_case, num, connection):\n self.test_case = test_case\n self.num = num\n self.connection = connection"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99063:Assign_L215_C8", "label": "self.test_case =", "type": "assigned_variable", "loc": [215, 215], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99063:FunctionDef_L214_C4", "vector": [14, 2, 0.3418, 0.0016, 2, 0.4, 0.0, 958, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.test_case", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.test_case = test_case"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99063:Assign_L216_C8", "label": "self.num =", "type": "assigned_variable", "loc": [216, 216], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99063:FunctionDef_L214_C4", "vector": [14, 2, 0.3434, 0.0016, 2, 0.4, 0.5, 970, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.num", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.num = num"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99063:Assign_L217_C8", "label": "self.connection =", "type": "assigned_variable", "loc": [217, 217], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99063:FunctionDef_L214_C4", "vector": [14, 2, 0.345, 0.0016, 2, 0.4, 1.0, 685, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.connection", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.connection = connection"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99063:FunctionDef_L219_C4", "label": "__enter__", "type": "function", "loc": [219, 223], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99063:ClassDef_L213_C0", "vector": [2, 1, 0.3514, 0.0079, 1, 0.82, 0.5, 230, 0, 1, 1, 0, 0, 0, 1], "semantic": {"name": "__enter__", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __enter__(self):\n self.old_debug_cursor = self.connection.use_debug_cursor\n self.connection.use_debug_cursor = True\n self.starting_queries = len(self.connection.queries)\n return self"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99063:Assign_L220_C8", "label": "self.old_debug_cursor =", "type": "assigned_variable", "loc": [220, 220], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99063:FunctionDef_L219_C4", "vector": [14, 2, 0.3498, 0.0016, 2, 0.78, 0.0, 2, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.old_debug_cursor", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.old_debug_cursor = self.connection.use_debug_cursor"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99063:Assign_L221_C8", "label": "self.connection.use_debug_cursor =", "type": "assigned_variable", "loc": [221, 221], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99063:FunctionDef_L219_C4", "vector": [14, 2, 0.3514, 0.0016, 2, 0.78, 0.3333, 950, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "self.connection.use_debug_cursor", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.connection.use_debug_cursor = True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99063:Assign_L222_C8", "label": "self.starting_queries = len()", "type": "assigned_variable", "loc": [222, 222], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99063:FunctionDef_L219_C4", "vector": [14, 2, 0.3529, 0.0016, 2, 0.78, 0.6667, 654, 3, 1, 0, 0, 890, 10, 1], "semantic": {"name": "self.starting_queries", "arg_names": [], "import_names": [], "rhs_call_name": "len", "annotation": ""}, "snippet": " self.starting_queries = len(self.connection.queries)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99063:Return_L223_C8", "label": "return", "type": "return", "loc": [223, 223], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99063:FunctionDef_L219_C4", "vector": [13, 2, 0.3545, 0.0016, 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 self"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99063:FunctionDef_L225_C4", "label": "__exit__", "type": "function", "loc": [225, 237], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99063:ClassDef_L213_C0", "vector": [2, 1, 0.3672, 0.0207, 1, 0.82, 1.0, 12, 0, 4, 0, 0, 0, 0, 2], "semantic": {"name": "__exit__", "arg_names": ["self", "exc_type", "exc_value", "traceback"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __exit__(self, exc_type, exc_value, traceback):\n self.connection.use_debug_cursor = self.old_debug_cursor\n if exc_type is not None:\n return\n\n final_queries = len(self.connection.queries)\n executed = final_queries - self.starting_queries\n"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99063:Assign_L226_C8", "label": "self.connection.use_debug_cursor =", "type": "assigned_variable", "loc": [226, 226], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99063:FunctionDef_L225_C4", "vector": [14, 2, 0.3593, 0.0016, 2, 0.22, 0.0, 950, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.connection.use_debug_cursor", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.connection.use_debug_cursor = self.old_debug_cursor"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99063:If_L227_C8", "label": "if", "type": "if", "loc": [227, 228], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99063:FunctionDef_L225_C4", "vector": [4, 2, 0.3617, 0.0032, 2, 0.22, 0.25, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if exc_type is not None:\n return"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99063:Return_L228_C12", "label": "return", "type": "return", "loc": [228, 228], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99063:If_L227_C8", "vector": [13, 3, 0.3625, 0.0016, 3, 0.93, 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_99063:Assign_L230_C8", "label": "final_queries = len()", "type": "assigned_variable", "loc": [230, 230], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99063:FunctionDef_L225_C4", "vector": [14, 2, 0.3657, 0.0016, 2, 0.22, 0.5, 598, 3, 1, 0, 0, 890, 10, 1], "semantic": {"name": "final_queries", "arg_names": [], "import_names": [], "rhs_call_name": "len", "annotation": ""}, "snippet": " final_queries = len(self.connection.queries)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99063:Assign_L231_C8", "label": "executed =", "type": "assigned_variable", "loc": [231, 231], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99063:FunctionDef_L225_C4", "vector": [14, 2, 0.3672, 0.0016, 2, 0.22, 0.75, 512, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "executed", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " executed = final_queries - self.starting_queries"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99063:Expr_L233_C8", "label": "assertEqual()", "type": "expression", "loc": [233, 237], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99063:FunctionDef_L225_C4", "vector": [8, 2, 0.3736, 0.0079, 2, 0.22, 1.0, 299, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "assertEqual", "arg_names": [], "import_names": [], "rhs_call_name": "assertEqual", "annotation": ""}, "snippet": " self.test_case.assertEqual(\n executed, self.num, \"%d queries executed, %d expected\" % (\n executed, self.num\n )\n )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99063:ClassDef_L240_C0", "label": "TransactionTestCase", "type": "class", "loc": [240, 545], "level": 0, "parent": null, "vector": [3, 0, 0.624, 0.4865, 0, 0.66, 0.8649, 98, 0, 17, 0, 0, 191, 0, 72], "semantic": {"name": "TransactionTestCase", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class TransactionTestCase(ut2.TestCase):\n # The class we'll use for the test client self.client.\n # Can be overridden in derived classes.\n client_class = Client\n\n def _pre_setup(self):\n \"\"\"Performs any pre-test setup. This includes:\n"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99063:Assign_L243_C4", "label": "client_class =", "type": "assigned_variable", "loc": [243, 243], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99063:ClassDef_L240_C0", "vector": [14, 1, 0.3863, 0.0016, 1, 0.62, 0.0, 996, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "client_class", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " client_class = Client"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99063:FunctionDef_L245_C4", "label": "_pre_setup", "type": "function", "loc": [245, 257], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99063:ClassDef_L240_C0", "vector": [2, 1, 0.399, 0.0207, 1, 0.62, 0.0588, 634, 0, 1, 0, 0, 0, 0, 2], "semantic": {"name": "_pre_setup", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _pre_setup(self):\n \"\"\"Performs any pre-test setup. This includes:\n\n * Flushing the database.\n * If the Test Case class has a 'fixtures' member, installing the\n named fixtures.\n * If the Test Case class has a 'urls' member, replace the\n ROOT_URLCONF with it."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99063:Expr_L246_C8", "label": "expression", "type": "expression", "loc": [246, 254], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99063:FunctionDef_L245_C4", "vector": [8, 2, 0.3975, 0.0143, 2, 0.28, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Performs any pre-test setup. This includes:\n\n * Flushing the database.\n * If the Test Case class has a 'fixtures' member, installing the\n named fixtures.\n * If the Test Case class has a 'urls' member, replace the\n ROOT_URLCONF with it.\n * Clearing the mail test outbox."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99063:Expr_L255_C8", "label": "_fixture_setup()", "type": "expression", "loc": [255, 255], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99063:FunctionDef_L245_C4", "vector": [8, 2, 0.4054, 0.0016, 2, 0.28, 0.3333, 173, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "_fixture_setup", "arg_names": [], "import_names": [], "rhs_call_name": "_fixture_setup", "annotation": ""}, "snippet": " self._fixture_setup()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99063:Expr_L256_C8", "label": "_urlconf_setup()", "type": "expression", "loc": [256, 256], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99063:FunctionDef_L245_C4", "vector": [8, 2, 0.407, 0.0016, 2, 0.28, 0.6667, 977, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "_urlconf_setup", "arg_names": [], "import_names": [], "rhs_call_name": "_urlconf_setup", "annotation": ""}, "snippet": " self._urlconf_setup()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99063:Assign_L257_C8", "label": "mail.outbox =", "type": "assigned_variable", "loc": [257, 257], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99063:FunctionDef_L245_C4", "vector": [14, 2, 0.4086, 0.0016, 2, 0.28, 1.0, 227, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "mail.outbox", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " mail.outbox = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99063:FunctionDef_L259_C4", "label": "_fixture_setup", "type": "function", "loc": [259, 272], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99063:ClassDef_L240_C0", "vector": [2, 1, 0.4221, 0.0223, 1, 0.62, 0.1176, 173, 0, 1, 0, 0, 0, 0, 4], "semantic": {"name": "_fixture_setup", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _fixture_setup(self):\n # If the test case has a multi_db=True flag, flush all databases.\n # Otherwise, just flush default.\n if getattr(self, 'multi_db', False):\n databases = connections\n else:\n databases = [DEFAULT_DB_ALIAS]\n for db in databases:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99063:If_L262_C8", "label": "if", "type": "if", "loc": [262, 265], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99063:FunctionDef_L259_C4", "vector": [4, 2, 0.4189, 0.0064, 2, 0.13, 0.0, 0, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if getattr(self, 'multi_db', False):\n databases = connections\n else:\n databases = [DEFAULT_DB_ALIAS]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99063:Assign_L263_C12", "label": "databases =", "type": "assigned_variable", "loc": [263, 263], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99063:If_L262_C8", "vector": [14, 3, 0.4181, 0.0016, 3, 0.89, 0.0, 95, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "databases", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " databases = connections"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99063:Assign_L265_C12", "label": "databases =", "type": "assigned_variable", "loc": [265, 265], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99063:If_L262_C8", "vector": [14, 3, 0.4213, 0.0016, 3, 0.89, 1.0, 95, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "databases", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " databases = [DEFAULT_DB_ALIAS]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99063:For_L266_C8", "label": "for db", "type": "for", "loc": [266, 272], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99063:FunctionDef_L259_C4", "vector": [6, 2, 0.4277, 0.0111, 2, 0.13, 1.0, 761, 2, 0, 0, 0, 0, 0, 3], "semantic": {"name": "db", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for db in databases:\n call_command('flush', verbosity=0, interactive=False, database=db)\n\n if hasattr(self, 'fixtures'):\n # We have to use this slightly awkward syntax due to the fact\n # that we're using *args and **kwargs together.\n call_command('loaddata', *self.fixtures, **{'verbosity': 0, 'database': db})"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99063:Expr_L267_C12", "label": "call_command()", "type": "expression", "loc": [267, 267], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99063:For_L266_C8", "vector": [8, 3, 0.4245, 0.0016, 3, 0.54, 0.0, 587, 3, 4, 0, 0, 0, 0, 1], "semantic": {"name": "call_command", "arg_names": [], "import_names": [], "rhs_call_name": "call_command", "annotation": ""}, "snippet": " call_command('flush', verbosity=0, interactive=False, database=db)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99063:If_L269_C12", "label": "if", "type": "if", "loc": [269, 272], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99063:For_L266_C8", "vector": [4, 3, 0.43, 0.0064, 3, 0.54, 1.0, 0, 3, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if hasattr(self, 'fixtures'):\n # We have to use this slightly awkward syntax due to the fact\n # that we're using *args and **kwargs together.\n call_command('loaddata', *self.fixtures, **{'verbosity': 0, 'database': db})"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99063:Expr_L272_C16", "label": "call_command()", "type": "expression", "loc": [272, 272], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99063:If_L269_C12", "vector": [8, 4, 0.4324, 0.0016, 4, 0.81, 0.0, 587, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "call_command", "arg_names": [], "import_names": [], "rhs_call_name": "call_command", "annotation": ""}, "snippet": " call_command('loaddata', *self.fixtures, **{'verbosity': 0, 'database': db})"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99063:FunctionDef_L274_C4", "label": "_urlconf_setup", "type": "function", "loc": [274, 278], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99063:ClassDef_L240_C0", "vector": [2, 1, 0.4388, 0.0079, 1, 0.62, 0.1765, 977, 0, 1, 0, 0, 0, 0, 2], "semantic": {"name": "_urlconf_setup", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _urlconf_setup(self):\n if hasattr(self, 'urls'):\n self._old_root_urlconf = settings.ROOT_URLCONF\n settings.ROOT_URLCONF = self.urls\n clear_url_caches()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99063:If_L275_C8", "label": "if", "type": "if", "loc": [275, 278], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99063:FunctionDef_L274_C4", "vector": [4, 2, 0.4396, 0.0064, 2, 0.31, 0.0, 0, 3, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if hasattr(self, 'urls'):\n self._old_root_urlconf = settings.ROOT_URLCONF\n settings.ROOT_URLCONF = self.urls\n clear_url_caches()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99063:Assign_L276_C12", "label": "self._old_root_urlconf =", "type": "assigned_variable", "loc": [276, 276], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99063:If_L275_C8", "vector": [14, 3, 0.4388, 0.0016, 3, 0.8, 0.0, 355, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self._old_root_urlconf", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self._old_root_urlconf = settings.ROOT_URLCONF"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99063:Assign_L277_C12", "label": "settings.ROOT_URLCONF =", "type": "assigned_variable", "loc": [277, 277], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99063:If_L275_C8", "vector": [14, 3, 0.4404, 0.0016, 3, 0.8, 0.5, 200, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "settings.ROOT_URLCONF", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " settings.ROOT_URLCONF = self.urls"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99063:Expr_L278_C12", "label": "clear_url_caches()", "type": "expression", "loc": [278, 278], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99063:If_L275_C8", "vector": [8, 3, 0.442, 0.0016, 3, 0.8, 1.0, 964, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "clear_url_caches", "arg_names": [], "import_names": [], "rhs_call_name": "clear_url_caches", "annotation": ""}, "snippet": " clear_url_caches()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99063:FunctionDef_L280_C4", "label": "__call__", "type": "function", "loc": [280, 303], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99063:ClassDef_L240_C0", "vector": [2, 1, 0.4634, 0.0382, 1, 0.62, 0.2353, 319, 0, 2, 0, 0, 0, 0, 9], "semantic": {"name": "__call__", "arg_names": ["self", "result"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __call__(self, result=None):\n \"\"\"\n Wrapper around default __call__ method to perform common Django test\n set up. This means that user-defined Test Cases aren't required to\n include a call to super().setUp().\n \"\"\"\n self.client = self.client_class()\n try:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99063:Expr_L281_C8", "label": "expression", "type": "expression", "loc": [281, 285], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99063:FunctionDef_L280_C4", "vector": [8, 2, 0.4499, 0.0079, 2, 0.73, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"\n Wrapper around default __call__ method to perform common Django test\n set up. This means that user-defined Test Cases aren't required to\n include a call to super().setUp().\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99063:Assign_L286_C8", "label": "self.client = client_class()", "type": "assigned_variable", "loc": [286, 286], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99063:FunctionDef_L280_C4", "vector": [14, 2, 0.4547, 0.0016, 2, 0.73, 0.25, 349, 3, 0, 0, 0, 996, 10, 1], "semantic": {"name": "self.client", "arg_names": [], "import_names": [], "rhs_call_name": "client_class", "annotation": ""}, "snippet": " self.client = self.client_class()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99063:Try_L287_C8", "label": "try", "type": "try", "loc": [287, 294], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99063:FunctionDef_L280_C4", "vector": [7, 2, 0.4618, 0.0127, 2, 0.73, 0.5, 0, 0, 2, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " try:\n self._pre_setup()\n except (KeyboardInterrupt, SystemExit):\n raise\n except Exception:\n import sys\n result.addError(self, sys.exc_info())\n return"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99063:Expr_L288_C12", "label": "_pre_setup()", "type": "expression", "loc": [288, 288], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99063:Try_L287_C8", "vector": [8, 3, 0.4579, 0.0016, 3, 0.67, 0.0, 634, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "_pre_setup", "arg_names": [], "import_names": [], "rhs_call_name": "_pre_setup", "annotation": ""}, "snippet": " self._pre_setup()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99063:Import_L292_C12", "label": "sys import sys", "type": "import", "loc": [292, 292], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99063:Try_L287_C8", "vector": [1, 3, 0.4642, 0.0016, 3, 0.67, 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_99063:Expr_L293_C12", "label": "addError()", "type": "expression", "loc": [293, 293], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99063:Try_L287_C8", "vector": [8, 3, 0.4658, 0.0016, 3, 0.67, 0.5, 635, 3, 2, 0, 0, 0, 0, 2], "semantic": {"name": "addError", "arg_names": [], "import_names": [], "rhs_call_name": "addError", "annotation": ""}, "snippet": " result.addError(self, sys.exc_info())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99063:Return_L294_C12", "label": "return", "type": "return", "loc": [294, 294], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99063:Try_L287_C8", "vector": [13, 3, 0.4674, 0.0016, 3, 0.67, 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_99063:Expr_L295_C8", "label": "__call__()", "type": "expression", "loc": [295, 295], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99063:FunctionDef_L280_C4", "vector": [8, 2, 0.469, 0.0016, 2, 0.73, 0.75, 319, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "__call__", "arg_names": [], "import_names": [], "rhs_call_name": "__call__", "annotation": ""}, "snippet": " super(TransactionTestCase, self).__call__(result)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99063:Try_L296_C8", "label": "try", "type": "try", "loc": [296, 303], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99063:FunctionDef_L280_C4", "vector": [7, 2, 0.4762, 0.0127, 2, 0.73, 1.0, 0, 0, 2, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " try:\n self._post_teardown()\n except (KeyboardInterrupt, SystemExit):\n raise\n except Exception:\n import sys\n result.addError(self, sys.exc_info())\n return"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99063:Expr_L297_C12", "label": "_post_teardown()", "type": "expression", "loc": [297, 297], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99063:Try_L296_C8", "vector": [8, 3, 0.4722, 0.0016, 3, 0.18, 0.0, 703, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "_post_teardown", "arg_names": [], "import_names": [], "rhs_call_name": "_post_teardown", "annotation": ""}, "snippet": " self._post_teardown()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99063:Import_L301_C12", "label": "sys import sys", "type": "import", "loc": [301, 301], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99063:Try_L296_C8", "vector": [1, 3, 0.4785, 0.0016, 3, 0.18, 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_99063:Expr_L302_C12", "label": "addError()", "type": "expression", "loc": [302, 302], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99063:Try_L296_C8", "vector": [8, 3, 0.4801, 0.0016, 3, 0.18, 0.5, 635, 3, 2, 0, 0, 0, 0, 2], "semantic": {"name": "addError", "arg_names": [], "import_names": [], "rhs_call_name": "addError", "annotation": ""}, "snippet": " result.addError(self, sys.exc_info())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99063:Return_L303_C12", "label": "return", "type": "return", "loc": [303, 303], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99063:Try_L296_C8", "vector": [13, 3, 0.4817, 0.0016, 3, 0.18, 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_99063:FunctionDef_L305_C4", "label": "_post_teardown", "type": "function", "loc": [305, 322], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99063:ClassDef_L240_C0", "vector": [2, 1, 0.4984, 0.0286, 1, 0.62, 0.2941, 703, 0, 1, 0, 0, 0, 0, 4], "semantic": {"name": "_post_teardown", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _post_teardown(self):\n \"\"\" Performs any post-test things. This includes:\n\n * Putting back the original ROOT_URLCONF if it was changed.\n * Force closing the connection, so that the next test gets\n a clean cursor.\n \"\"\"\n self._fixture_teardown()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99063:Expr_L306_C8", "label": "expression", "type": "expression", "loc": [306, 311], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99063:FunctionDef_L305_C4", "vector": [8, 2, 0.4905, 0.0095, 2, 0.44, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\" Performs any post-test things. This includes:\n\n * Putting back the original ROOT_URLCONF if it was changed.\n * Force closing the connection, so that the next test gets\n a clean cursor.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99063:Expr_L312_C8", "label": "_fixture_teardown()", "type": "expression", "loc": [312, 312], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99063:FunctionDef_L305_C4", "vector": [8, 2, 0.496, 0.0016, 2, 0.44, 0.3333, 656, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "_fixture_teardown", "arg_names": [], "import_names": [], "rhs_call_name": "_fixture_teardown", "annotation": ""}, "snippet": " self._fixture_teardown()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99063:Expr_L313_C8", "label": "_urlconf_teardown()", "type": "expression", "loc": [313, 313], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99063:FunctionDef_L305_C4", "vector": [8, 2, 0.4976, 0.0016, 2, 0.44, 0.6667, 966, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "_urlconf_teardown", "arg_names": [], "import_names": [], "rhs_call_name": "_urlconf_teardown", "annotation": ""}, "snippet": " self._urlconf_teardown()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99063:For_L321_C8", "label": "for connection", "type": "for", "loc": [321, 322], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99063:FunctionDef_L305_C4", "vector": [6, 2, 0.5111, 0.0032, 2, 0.44, 1.0, 351, 3, 0, 0, 0, 0, 0, 2], "semantic": {"name": "connection", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for connection in connections.all():\n connection.close()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99063:Expr_L322_C12", "label": "close()", "type": "expression", "loc": [322, 322], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99063:For_L321_C8", "vector": [8, 3, 0.5119, 0.0016, 3, 0.91, 0.0, 77, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "close", "arg_names": [], "import_names": [], "rhs_call_name": "close", "annotation": ""}, "snippet": " connection.close()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99063:FunctionDef_L324_C4", "label": "_fixture_teardown", "type": "function", "loc": [324, 325], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99063:ClassDef_L240_C0", "vector": [2, 1, 0.5159, 0.0032, 1, 0.62, 0.3529, 656, 0, 1, 0, 0, 0, 0, 0], "semantic": {"name": "_fixture_teardown", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _fixture_teardown(self):\n pass"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99063:FunctionDef_L327_C4", "label": "_urlconf_teardown", "type": "function", "loc": [327, 330], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99063:ClassDef_L240_C0", "vector": [2, 1, 0.5223, 0.0064, 1, 0.62, 0.4118, 966, 0, 1, 0, 0, 0, 0, 2], "semantic": {"name": "_urlconf_teardown", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _urlconf_teardown(self):\n if hasattr(self, '_old_root_urlconf'):\n settings.ROOT_URLCONF = self._old_root_urlconf\n clear_url_caches()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99063:If_L328_C8", "label": "if", "type": "if", "loc": [328, 330], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99063:FunctionDef_L327_C4", "vector": [4, 2, 0.5231, 0.0048, 2, 0.96, 0.0, 0, 3, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if hasattr(self, '_old_root_urlconf'):\n settings.ROOT_URLCONF = self._old_root_urlconf\n clear_url_caches()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99063:Assign_L329_C12", "label": "settings.ROOT_URLCONF =", "type": "assigned_variable", "loc": [329, 329], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99063:If_L328_C8", "vector": [14, 3, 0.5231, 0.0016, 3, 0.56, 0.0, 200, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "settings.ROOT_URLCONF", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " settings.ROOT_URLCONF = self._old_root_urlconf"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99063:Expr_L330_C12", "label": "clear_url_caches()", "type": "expression", "loc": [330, 330], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99063:If_L328_C8", "vector": [8, 3, 0.5246, 0.0016, 3, 0.56, 1.0, 964, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "clear_url_caches", "arg_names": [], "import_names": [], "rhs_call_name": "clear_url_caches", "annotation": ""}, "snippet": " clear_url_caches()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99063:FunctionDef_L332_C4", "label": "save_warnings_state", "type": "function", "loc": [332, 336], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99063:ClassDef_L240_C0", "vector": [2, 1, 0.531, 0.0079, 1, 0.62, 0.4706, 106, 0, 1, 0, 0, 0, 0, 1], "semantic": {"name": "save_warnings_state", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def save_warnings_state(self):\n \"\"\"\n Saves the state of the warnings module\n \"\"\"\n self._warnings_state = get_warnings_state()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99063:Expr_L333_C8", "label": "expression", "type": "expression", "loc": [333, 335], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99063:FunctionDef_L332_C4", "vector": [8, 2, 0.531, 0.0048, 2, 0.96, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"\n Saves the state of the warnings module\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99063:Assign_L336_C8", "label": "self._warnings_state = get_warnings_state()", "type": "assigned_variable", "loc": [336, 336], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99063:FunctionDef_L332_C4", "vector": [14, 2, 0.5342, 0.0016, 2, 0.96, 1.0, 453, 3, 0, 0, 0, 629, 10, 1], "semantic": {"name": "self._warnings_state", "arg_names": [], "import_names": [], "rhs_call_name": "get_warnings_state", "annotation": ""}, "snippet": " self._warnings_state = get_warnings_state()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99063:FunctionDef_L338_C4", "label": "restore_warnings_state", "type": "function", "loc": [338, 343], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99063:ClassDef_L240_C0", "vector": [2, 1, 0.5413, 0.0095, 1, 0.62, 0.5294, 473, 0, 1, 0, 0, 0, 0, 1], "semantic": {"name": "restore_warnings_state", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def restore_warnings_state(self):\n \"\"\"\n Restores the sate of the warnings module to the state\n saved by save_warnings_state()\n \"\"\"\n restore_warnings_state(self._warnings_state)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99063:Expr_L339_C8", "label": "expression", "type": "expression", "loc": [339, 342], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99063:FunctionDef_L338_C4", "vector": [8, 2, 0.5413, 0.0064, 2, 0.23, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"\n Restores the sate of the warnings module to the state\n saved by save_warnings_state()\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99063:Expr_L343_C8", "label": "restore_warnings_state()", "type": "expression", "loc": [343, 343], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99063:FunctionDef_L338_C4", "vector": [8, 2, 0.5453, 0.0016, 2, 0.23, 1.0, 473, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "restore_warnings_state", "arg_names": [], "import_names": [], "rhs_call_name": "restore_warnings_state", "annotation": ""}, "snippet": " restore_warnings_state(self._warnings_state)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99063:FunctionDef_L345_C4", "label": "assertRedirects", "type": "function", "loc": [345, 401], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99063:ClassDef_L240_C0", "vector": [2, 1, 0.593, 0.0906, 1, 0.62, 0.5882, 580, 0, 7, 0, 0, 0, 0, 13], "semantic": {"name": "assertRedirects", "arg_names": ["self", "response", "expected_url", "status_code", "target_status_code", "host", "msg_prefix"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def assertRedirects(self, response, expected_url, status_code=302,\n target_status_code=200, host=None, msg_prefix=''):\n \"\"\"Asserts that a response redirected to a specific URL, and that the\n redirect URL can be loaded.\n\n Note that assertRedirects won't work for external links since it uses\n TestClient to do a request.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99063:Expr_L347_C8", "label": "expression", "type": "expression", "loc": [347, 352], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99063:FunctionDef_L345_C4", "vector": [8, 2, 0.5556, 0.0095, 2, 0.15, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Asserts that a response redirected to a specific URL, and that the\n redirect URL can be loaded.\n\n Note that assertRedirects won't work for external links since it uses\n TestClient to do a request.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99063:If_L353_C8", "label": "if", "type": "if", "loc": [353, 354], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99063:FunctionDef_L345_C4", "vector": [4, 2, 0.562, 0.0032, 2, 0.15, 0.2, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if msg_prefix:\n msg_prefix += \": \""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99063:If_L356_C8", "label": "if", "type": "if", "loc": [356, 392], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99063:FunctionDef_L345_C4", "vector": [4, 2, 0.5946, 0.0588, 2, 0.15, 0.4, 0, 3, 0, 0, 0, 0, 0, 10], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if hasattr(response, 'redirect_chain'):\n # The request was a followed redirect\n self.failUnless(len(response.redirect_chain) > 0,\n msg_prefix + \"Response didn't redirect as expected: Response\"\n \" code was %d (expected %d)\" %\n (response.status_code, status_code))\n\n self.assertEqual(response.redirect_chain[0][1], status_code,"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99063:Expr_L358_C12", "label": "failUnless()", "type": "expression", "loc": [358, 361], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99063:If_L356_C8", "vector": [8, 3, 0.5715, 0.0064, 3, 0.71, 0.0, 252, 3, 2, 0, 0, 0, 0, 2], "semantic": {"name": "failUnless", "arg_names": [], "import_names": [], "rhs_call_name": "failUnless", "annotation": ""}, "snippet": " self.failUnless(len(response.redirect_chain) > 0,\n msg_prefix + \"Response didn't redirect as expected: Response\"\n \" code was %d (expected %d)\" %\n (response.status_code, status_code))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99063:Expr_L363_C12", "label": "assertEqual()", "type": "expression", "loc": [363, 366], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99063:If_L356_C8", "vector": [8, 3, 0.5795, 0.0064, 3, 0.71, 0.125, 299, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "assertEqual", "arg_names": [], "import_names": [], "rhs_call_name": "assertEqual", "annotation": ""}, "snippet": " self.assertEqual(response.redirect_chain[0][1], status_code,\n msg_prefix + \"Initial response didn't redirect as expected:\"\n \" Response code was %d (expected %d)\" %\n (response.redirect_chain[0][1], status_code))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99063:Assign_L368_C12", "label": "url, status_code =", "type": "assigned_variable", "loc": [368, 368], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99063:If_L356_C8", "vector": [14, 3, 0.5851, 0.0016, 3, 0.71, 0.25, 737, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "url, status_code", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " url, status_code = response.redirect_chain[-1]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99063:Expr_L370_C12", "label": "assertEqual()", "type": "expression", "loc": [370, 373], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99063:If_L356_C8", "vector": [8, 3, 0.5906, 0.0064, 3, 0.71, 0.375, 299, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "assertEqual", "arg_names": [], "import_names": [], "rhs_call_name": "assertEqual", "annotation": ""}, "snippet": " self.assertEqual(response.status_code, target_status_code,\n msg_prefix + \"Response didn't redirect as expected: Final\"\n \" Response code was %d (expected %d)\" %\n (response.status_code, target_status_code))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99063:Expr_L377_C12", "label": "assertEqual()", "type": "expression", "loc": [377, 380], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99063:If_L356_C8", "vector": [8, 3, 0.6017, 0.0064, 3, 0.71, 0.5, 299, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "assertEqual", "arg_names": [], "import_names": [], "rhs_call_name": "assertEqual", "annotation": ""}, "snippet": " self.assertEqual(response.status_code, status_code,\n msg_prefix + \"Response didn't redirect as expected: Response\"\n \" code was %d (expected %d)\" %\n (response.status_code, status_code))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99063:Assign_L382_C12", "label": "url =", "type": "assigned_variable", "loc": [382, 382], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99063:If_L356_C8", "vector": [14, 3, 0.6073, 0.0016, 3, 0.71, 0.625, 789, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "url", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " url = response['Location']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99063:Assign_L383_C12", "label": "scheme, netloc, path, query, fragment = urlsplit()", "type": "assigned_variable", "loc": [383, 383], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99063:If_L356_C8", "vector": [14, 3, 0.6089, 0.0016, 3, 0.71, 0.75, 538, 3, 1, 0, 0, 637, 10, 1], "semantic": {"name": "scheme, netloc, path, query, fragment", "arg_names": [], "import_names": [], "rhs_call_name": "urlsplit", "annotation": ""}, "snippet": " scheme, netloc, path, query, fragment = urlsplit(url)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99063:Assign_L385_C12", "label": "redirect_response = get()", "type": "assigned_variable", "loc": [385, 385], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99063:If_L356_C8", "vector": [14, 3, 0.6121, 0.0016, 3, 0.71, 0.875, 59, 3, 2, 0, 0, 607, 10, 2], "semantic": {"name": "redirect_response", "arg_names": [], "import_names": [], "rhs_call_name": "get", "annotation": ""}, "snippet": " redirect_response = response.client.get(path, QueryDict(query))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99063:Expr_L389_C12", "label": "assertEqual()", "type": "expression", "loc": [389, 392], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99063:If_L356_C8", "vector": [8, 3, 0.6208, 0.0064, 3, 0.71, 1.0, 299, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "assertEqual", "arg_names": [], "import_names": [], "rhs_call_name": "assertEqual", "annotation": ""}, "snippet": " self.assertEqual(redirect_response.status_code, target_status_code,\n msg_prefix + \"Couldn't retrieve redirection page '%s':\"\n \" response code was %d (expected %d)\" %\n (path, redirect_response.status_code, target_status_code))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99063:Assign_L394_C8", "label": "e_scheme, e_netloc, e_path, e_query, e_fragment = urlsplit()", "type": "assigned_variable", "loc": [394, 394], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99063:FunctionDef_L345_C4", "vector": [14, 2, 0.6264, 0.0016, 2, 0.15, 0.6, 963, 3, 1, 0, 0, 637, 10, 1], "semantic": {"name": "e_scheme, e_netloc, e_path, e_query, e_fragment", "arg_names": [], "import_names": [], "rhs_call_name": "urlsplit", "annotation": ""}, "snippet": " e_scheme, e_netloc, e_path, e_query, e_fragment = urlsplit(expected_url)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99063:If_L395_C8", "label": "if", "type": "if", "loc": [395, 397], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99063:FunctionDef_L345_C4", "vector": [4, 2, 0.6296, 0.0048, 2, 0.15, 0.8, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not (e_scheme or e_netloc):\n expected_url = urlunsplit(('http', host or 'testserver', e_path,\n e_query, e_fragment))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99063:Assign_L396_C12", "label": "expected_url = urlunsplit()", "type": "assigned_variable", "loc": [396, 397], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99063:If_L395_C8", "vector": [14, 3, 0.6304, 0.0032, 3, 0.18, 0.0, 898, 3, 1, 0, 0, 302, 10, 1], "semantic": {"name": "expected_url", "arg_names": [], "import_names": [], "rhs_call_name": "urlunsplit", "annotation": ""}, "snippet": " expected_url = urlunsplit(('http', host or 'testserver', e_path,\n e_query, e_fragment))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99063:Expr_L399_C8", "label": "assertEqual()", "type": "expression", "loc": [399, 401], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99063:FunctionDef_L345_C4", "vector": [8, 2, 0.6359, 0.0048, 2, 0.15, 1.0, 299, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "assertEqual", "arg_names": [], "import_names": [], "rhs_call_name": "assertEqual", "annotation": ""}, "snippet": " self.assertEqual(url, expected_url,\n msg_prefix + \"Response redirected to '%s', expected '%s'\" %\n (url, expected_url))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99063:FunctionDef_L403_C4", "label": "assertContains", "type": "function", "loc": [403, 426], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99063:ClassDef_L240_C0", "vector": [2, 1, 0.659, 0.0382, 1, 0.62, 0.6471, 335, 0, 6, 0, 0, 0, 0, 5], "semantic": {"name": "assertContains", "arg_names": ["self", "response", "text", "count", "status_code", "msg_prefix"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def assertContains(self, response, text, count=None, status_code=200,\n msg_prefix=''):\n \"\"\"\n Asserts that a response indicates that some content was retrieved\n successfully, (i.e., the HTTP status code was as expected), and that\n ``text`` occurs ``count`` times in the content of the response.\n If ``count`` is None, the count doesn't matter - the assertion is true\n if the text occurs at least once in the response."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99063:Expr_L405_C8", "label": "expression", "type": "expression", "loc": [405, 411], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99063:FunctionDef_L403_C4", "vector": [8, 2, 0.6486, 0.0111, 2, 0.23, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"\n Asserts that a response indicates that some content was retrieved\n successfully, (i.e., the HTTP status code was as expected), and that\n ``text`` occurs ``count`` times in the content of the response.\n If ``count`` is None, the count doesn't matter - the assertion is true\n if the text occurs at least once in the response.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99063:If_L412_C8", "label": "if", "type": "if", "loc": [412, 413], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99063:FunctionDef_L403_C4", "vector": [4, 2, 0.6558, 0.0032, 2, 0.23, 0.2, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if msg_prefix:\n msg_prefix += \": \""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99063:Expr_L415_C8", "label": "assertEqual()", "type": "expression", "loc": [415, 417], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99063:FunctionDef_L403_C4", "vector": [8, 2, 0.6614, 0.0048, 2, 0.23, 0.4, 299, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "assertEqual", "arg_names": [], "import_names": [], "rhs_call_name": "assertEqual", "annotation": ""}, "snippet": " self.assertEqual(response.status_code, status_code,\n msg_prefix + \"Couldn't retrieve content: Response code was %d\"\n \" (expected %d)\" % (response.status_code, status_code))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99063:Assign_L418_C8", "label": "text = smart_str()", "type": "assigned_variable", "loc": [418, 418], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99063:FunctionDef_L403_C4", "vector": [14, 2, 0.6645, 0.0016, 2, 0.23, 0.6, 439, 3, 2, 0, 0, 820, 10, 1], "semantic": {"name": "text", "arg_names": [], "import_names": [], "rhs_call_name": "smart_str", "annotation": ""}, "snippet": " text = smart_str(text, response._charset)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99063:Assign_L419_C8", "label": "real_count = count()", "type": "assigned_variable", "loc": [419, 419], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99063:FunctionDef_L403_C4", "vector": [14, 2, 0.6661, 0.0016, 2, 0.23, 0.8, 950, 3, 1, 0, 0, 778, 10, 1], "semantic": {"name": "real_count", "arg_names": [], "import_names": [], "rhs_call_name": "count", "annotation": ""}, "snippet": " real_count = response.content.count(text)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99063:If_L420_C8", "label": "if", "type": "if", "loc": [420, 426], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99063:FunctionDef_L403_C4", "vector": [4, 2, 0.6725, 0.0111, 2, 0.23, 1.0, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if count is not None:\n self.assertEqual(real_count, count,\n msg_prefix + \"Found %d instances of '%s' in response\"\n \" (expected %d)\" % (real_count, text, count))\n else:\n self.assertTrue(real_count != 0,\n msg_prefix + \"Couldn't find '%s' in response\" % text)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99063:Expr_L421_C12", "label": "assertEqual()", "type": "expression", "loc": [421, 423], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99063:If_L420_C8", "vector": [8, 3, 0.6709, 0.0048, 3, 0.31, 0.0, 299, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "assertEqual", "arg_names": [], "import_names": [], "rhs_call_name": "assertEqual", "annotation": ""}, "snippet": " self.assertEqual(real_count, count,\n msg_prefix + \"Found %d instances of '%s' in response\"\n \" (expected %d)\" % (real_count, text, count))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99063:Expr_L425_C12", "label": "assertTrue()", "type": "expression", "loc": [425, 426], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99063:If_L420_C8", "vector": [8, 3, 0.6765, 0.0032, 3, 0.31, 1.0, 170, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "assertTrue", "arg_names": [], "import_names": [], "rhs_call_name": "assertTrue", "annotation": ""}, "snippet": " self.assertTrue(real_count != 0,\n msg_prefix + \"Couldn't find '%s' in response\" % text)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99063:FunctionDef_L428_C4", "label": "assertNotContains", "type": "function", "loc": [428, 443], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99063:ClassDef_L240_C0", "vector": [2, 1, 0.6924, 0.0254, 1, 0.62, 0.7059, 351, 0, 5, 0, 0, 0, 0, 4], "semantic": {"name": "assertNotContains", "arg_names": ["self", "response", "text", "status_code", "msg_prefix"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def assertNotContains(self, response, text, status_code=200,\n msg_prefix=''):\n \"\"\"\n Asserts that a response indicates that some content was retrieved\n successfully, (i.e., the HTTP status code was as expected), and that\n ``text`` doesn't occurs in the content of the response.\n \"\"\"\n if msg_prefix:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99063:Expr_L430_C8", "label": "expression", "type": "expression", "loc": [430, 434], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99063:FunctionDef_L428_C4", "vector": [8, 2, 0.6868, 0.0079, 2, 0.42, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"\n Asserts that a response indicates that some content was retrieved\n successfully, (i.e., the HTTP status code was as expected), and that\n ``text`` doesn't occurs in the content of the response.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99063:If_L435_C8", "label": "if", "type": "if", "loc": [435, 436], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99063:FunctionDef_L428_C4", "vector": [4, 2, 0.6924, 0.0032, 2, 0.42, 0.25, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if msg_prefix:\n msg_prefix += \": \""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99063:Expr_L438_C8", "label": "assertEqual()", "type": "expression", "loc": [438, 440], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99063:FunctionDef_L428_C4", "vector": [8, 2, 0.6979, 0.0048, 2, 0.42, 0.5, 299, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "assertEqual", "arg_names": [], "import_names": [], "rhs_call_name": "assertEqual", "annotation": ""}, "snippet": " self.assertEqual(response.status_code, status_code,\n msg_prefix + \"Couldn't retrieve content: Response code was %d\"\n \" (expected %d)\" % (response.status_code, status_code))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99063:Assign_L441_C8", "label": "text = smart_str()", "type": "assigned_variable", "loc": [441, 441], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99063:FunctionDef_L428_C4", "vector": [14, 2, 0.7011, 0.0016, 2, 0.42, 0.75, 439, 3, 2, 0, 0, 820, 10, 1], "semantic": {"name": "text", "arg_names": [], "import_names": [], "rhs_call_name": "smart_str", "annotation": ""}, "snippet": " text = smart_str(text, response._charset)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99063:Expr_L442_C8", "label": "assertEqual()", "type": "expression", "loc": [442, 443], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99063:FunctionDef_L428_C4", "vector": [8, 2, 0.7035, 0.0032, 2, 0.42, 1.0, 299, 3, 3, 0, 0, 0, 0, 2], "semantic": {"name": "assertEqual", "arg_names": [], "import_names": [], "rhs_call_name": "assertEqual", "annotation": ""}, "snippet": " self.assertEqual(response.content.count(text), 0,\n msg_prefix + \"Response should not contain '%s'\" % text)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99063:FunctionDef_L445_C4", "label": "assertFormError", "type": "function", "loc": [445, 494], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99063:ClassDef_L240_C0", "vector": [2, 1, 0.7464, 0.0795, 1, 0.62, 0.7647, 630, 0, 6, 0, 0, 0, 0, 11], "semantic": {"name": "assertFormError", "arg_names": ["self", "response", "form", "field", "errors", "msg_prefix"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def assertFormError(self, response, form, field, errors, msg_prefix=''):\n \"\"\"\n Asserts that a form used to render the response has a specific field\n error.\n \"\"\"\n if msg_prefix:\n msg_prefix += \": \"\n"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99063:Expr_L446_C8", "label": "expression", "type": "expression", "loc": [446, 449], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99063:FunctionDef_L445_C4", "vector": [8, 2, 0.7114, 0.0064, 2, 0.53, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"\n Asserts that a form used to render the response has a specific field\n error.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99063:If_L450_C8", "label": "if", "type": "if", "loc": [450, 451], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99063:FunctionDef_L445_C4", "vector": [4, 2, 0.7162, 0.0032, 2, 0.53, 0.1429, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if msg_prefix:\n msg_prefix += \": \""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99063:Assign_L454_C8", "label": "contexts = to_list()", "type": "assigned_variable", "loc": [454, 454], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99063:FunctionDef_L445_C4", "vector": [14, 2, 0.7218, 0.0016, 2, 0.53, 0.2857, 214, 3, 1, 0, 0, 64, 10, 1], "semantic": {"name": "contexts", "arg_names": [], "import_names": [], "rhs_call_name": "to_list", "annotation": ""}, "snippet": " contexts = to_list(response.context)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99063:If_L455_C8", "label": "if", "type": "if", "loc": [455, 457], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99063:FunctionDef_L445_C4", "vector": [4, 2, 0.725, 0.0048, 2, 0.53, 0.4286, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not contexts:\n self.fail(msg_prefix + \"Response did not use any contexts to \"\n \"render the response\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99063:Expr_L456_C12", "label": "fail()", "type": "expression", "loc": [456, 457], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99063:If_L455_C8", "vector": [8, 3, 0.7258, 0.0032, 3, 0.93, 0.0, 364, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "fail", "arg_names": [], "import_names": [], "rhs_call_name": "fail", "annotation": ""}, "snippet": " self.fail(msg_prefix + \"Response did not use any contexts to \"\n \"render the response\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99063:Assign_L460_C8", "label": "errors = to_list()", "type": "assigned_variable", "loc": [460, 460], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99063:FunctionDef_L445_C4", "vector": [14, 2, 0.7313, 0.0016, 2, 0.53, 0.5714, 841, 3, 1, 0, 0, 64, 10, 1], "semantic": {"name": "errors", "arg_names": [], "import_names": [], "rhs_call_name": "to_list", "annotation": ""}, "snippet": " errors = to_list(errors)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99063:Assign_L463_C8", "label": "found_form =", "type": "assigned_variable", "loc": [463, 463], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99063:FunctionDef_L445_C4", "vector": [14, 2, 0.7361, 0.0016, 2, 0.53, 0.7143, 48, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "found_form", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " found_form = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99063:For_L464_C8", "label": "for i, context", "type": "for", "loc": [464, 491], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99063:FunctionDef_L445_C4", "vector": [6, 2, 0.7591, 0.0445, 2, 0.53, 0.8571, 953, 3, 0, 0, 0, 0, 0, 7], "semantic": {"name": "i, context", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for i,context in enumerate(contexts):\n if form not in context:\n continue\n found_form = True\n for err in errors:\n if field:\n if field in context[form].errors:\n field_errors = context[form].errors[field]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99063:If_L465_C12", "label": "if", "type": "if", "loc": [465, 466], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99063:For_L464_C8", "vector": [4, 3, 0.7401, 0.0032, 3, 0.55, 0.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if form not in context:\n continue"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99063:Assign_L467_C12", "label": "found_form =", "type": "assigned_variable", "loc": [467, 467], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99063:For_L464_C8", "vector": [14, 3, 0.7424, 0.0016, 3, 0.55, 0.5, 48, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "found_form", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " found_form = True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99063:For_L468_C12", "label": "for err", "type": "for", "loc": [468, 491], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99063:For_L464_C8", "vector": [6, 3, 0.7623, 0.0382, 3, 0.55, 1.0, 541, 2, 0, 0, 0, 0, 0, 6], "semantic": {"name": "err", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for err in errors:\n if field:\n if field in context[form].errors:\n field_errors = context[form].errors[field]\n self.failUnless(err in field_errors,\n msg_prefix + \"The field '%s' on form '%s' in\"\n \" context %d does not contain the error '%s'\"\n \" (actual errors: %s)\" %"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99063:If_L469_C16", "label": "if", "type": "if", "loc": [469, 491], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99063:For_L468_C12", "vector": [4, 4, 0.7631, 0.0366, 4, 0.29, 0.0, 0, 2, 0, 0, 0, 0, 0, 6], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if field:\n if field in context[form].errors:\n field_errors = context[form].errors[field]\n self.failUnless(err in field_errors,\n msg_prefix + \"The field '%s' on form '%s' in\"\n \" context %d does not contain the error '%s'\"\n \" (actual errors: %s)\" %\n (field, form, i, err, repr(field_errors)))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99063:If_L470_C20", "label": "if", "type": "if", "loc": [470, 484], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99063:If_L469_C16", "vector": [4, 5, 0.7583, 0.0238, 5, 0.26, 0.0, 0, 0, 0, 0, 0, 0, 0, 4], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if field in context[form].errors:\n field_errors = context[form].errors[field]\n self.failUnless(err in field_errors,\n msg_prefix + \"The field '%s' on form '%s' in\"\n \" context %d does not contain the error '%s'\"\n \" (actual errors: %s)\" %\n (field, form, i, err, repr(field_errors)))\n elif field in context[form].fields:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99063:Assign_L471_C24", "label": "field_errors =", "type": "assigned_variable", "loc": [471, 471], "level": 6, "parent": "ajibawa-2023/Python-Code-Large/train/row_99063:If_L470_C20", "vector": [14, 6, 0.7488, 0.0016, 6, 0.48, 0.0, 558, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "field_errors", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " field_errors = context[form].errors[field]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99063:Expr_L472_C24", "label": "failUnless()", "type": "expression", "loc": [472, 476], "level": 6, "parent": "ajibawa-2023/Python-Code-Large/train/row_99063:If_L470_C20", "vector": [8, 6, 0.7536, 0.0079, 6, 0.48, 0.5, 252, 3, 2, 0, 0, 0, 0, 2], "semantic": {"name": "failUnless", "arg_names": [], "import_names": [], "rhs_call_name": "failUnless", "annotation": ""}, "snippet": " self.failUnless(err in field_errors,\n msg_prefix + \"The field '%s' on form '%s' in\"\n \" context %d does not contain the error '%s'\"\n \" (actual errors: %s)\" %\n (field, form, i, err, repr(field_errors)))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99063:If_L477_C20", "label": "if", "type": "if", "loc": [477, 484], "level": 6, "parent": "ajibawa-2023/Python-Code-Large/train/row_99063:If_L470_C20", "vector": [4, 6, 0.7639, 0.0127, 6, 0.48, 1.0, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " elif field in context[form].fields:\n self.fail(msg_prefix + \"The field '%s' on form '%s'\"\n \" in context %d contains no errors\" %\n (field, form, i))\n else:\n self.fail(msg_prefix + \"The form '%s' in context %d\"\n \" does not contain the field '%s'\" %\n (form, i, field))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99063:Expr_L478_C24", "label": "fail()", "type": "expression", "loc": [478, 480], "level": 7, "parent": "ajibawa-2023/Python-Code-Large/train/row_99063:If_L477_C20", "vector": [8, 7, 0.7615, 0.0048, 7, 0.93, 0.0, 364, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "fail", "arg_names": [], "import_names": [], "rhs_call_name": "fail", "annotation": ""}, "snippet": " self.fail(msg_prefix + \"The field '%s' on form '%s'\"\n \" in context %d contains no errors\" %\n (field, form, i))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99063:Expr_L482_C24", "label": "fail()", "type": "expression", "loc": [482, 484], "level": 7, "parent": "ajibawa-2023/Python-Code-Large/train/row_99063:If_L477_C20", "vector": [8, 7, 0.7679, 0.0048, 7, 0.93, 1.0, 364, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "fail", "arg_names": [], "import_names": [], "rhs_call_name": "fail", "annotation": ""}, "snippet": " self.fail(msg_prefix + \"The form '%s' in context %d\"\n \" does not contain the field '%s'\" %\n (form, i, field))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99063:Assign_L486_C20", "label": "non_field_errors = non_field_errors()", "type": "assigned_variable", "loc": [486, 486], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99063:If_L469_C16", "vector": [14, 5, 0.7727, 0.0016, 5, 0.26, 0.5, 983, 3, 0, 0, 0, 983, 10, 1], "semantic": {"name": "non_field_errors", "arg_names": [], "import_names": [], "rhs_call_name": "non_field_errors", "annotation": ""}, "snippet": " non_field_errors = context[form].non_field_errors()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99063:Expr_L487_C20", "label": "failUnless()", "type": "expression", "loc": [487, 491], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99063:If_L469_C16", "vector": [8, 5, 0.7774, 0.0079, 5, 0.26, 1.0, 252, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "failUnless", "arg_names": [], "import_names": [], "rhs_call_name": "failUnless", "annotation": ""}, "snippet": " self.failUnless(err in non_field_errors,\n msg_prefix + \"The form '%s' in context %d does not\"\n \" contain the non-field error '%s'\"\n \" (actual errors: %s)\" %\n (form, i, err, non_field_errors))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99063:If_L492_C8", "label": "if", "type": "if", "loc": [492, 494], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99063:FunctionDef_L445_C4", "vector": [4, 2, 0.7838, 0.0048, 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 not found_form:\n self.fail(msg_prefix + \"The form '%s' was not used to render the\"\n \" response\" % form)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99063:Expr_L493_C12", "label": "fail()", "type": "expression", "loc": [493, 494], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99063:If_L492_C8", "vector": [8, 3, 0.7846, 0.0032, 3, 0.66, 0.0, 364, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "fail", "arg_names": [], "import_names": [], "rhs_call_name": "fail", "annotation": ""}, "snippet": " self.fail(msg_prefix + \"The form '%s' was not used to render the\"\n \" response\" % form)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99063:FunctionDef_L496_C4", "label": "assertTemplateUsed", "type": "function", "loc": [496, 510], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99063:ClassDef_L240_C0", "vector": [2, 1, 0.7997, 0.0238, 1, 0.62, 0.8235, 849, 0, 4, 0, 0, 0, 0, 3], "semantic": {"name": "assertTemplateUsed", "arg_names": ["self", "response", "template_name", "msg_prefix"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def assertTemplateUsed(self, response, template_name, msg_prefix=''):\n \"\"\"\n Asserts that the template with the provided name was used in rendering\n the response.\n \"\"\"\n if msg_prefix:\n msg_prefix += \": \"\n"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99063:Expr_L497_C8", "label": "expression", "type": "expression", "loc": [497, 500], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99063:FunctionDef_L496_C4", "vector": [8, 2, 0.7925, 0.0064, 2, 0.04, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"\n Asserts that the template with the provided name was used in rendering\n the response.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99063:If_L501_C8", "label": "if", "type": "if", "loc": [501, 502], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99063:FunctionDef_L496_C4", "vector": [4, 2, 0.7973, 0.0032, 2, 0.04, 0.25, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if msg_prefix:\n msg_prefix += \": \""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99063:Assign_L504_C8", "label": "template_names =", "type": "assigned_variable", "loc": [504, 504], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99063:FunctionDef_L496_C4", "vector": [14, 2, 0.8013, 0.0016, 2, 0.04, 0.5, 666, 5, 0, 0, 0, 0, 0, 0], "semantic": {"name": "template_names", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " template_names = [t.name for t in response.templates]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99063:If_L505_C8", "label": "if", "type": "if", "loc": [505, 506], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99063:FunctionDef_L496_C4", "vector": [4, 2, 0.8037, 0.0032, 2, 0.04, 0.75, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not template_names:\n self.fail(msg_prefix + \"No templates used to render the response\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99063:Expr_L506_C12", "label": "fail()", "type": "expression", "loc": [506, 506], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99063:If_L505_C8", "vector": [8, 3, 0.8045, 0.0016, 3, 0.02, 0.0, 364, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "fail", "arg_names": [], "import_names": [], "rhs_call_name": "fail", "annotation": ""}, "snippet": " self.fail(msg_prefix + \"No templates used to render the response\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99063:Expr_L507_C8", "label": "failUnless()", "type": "expression", "loc": [507, 510], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99063:FunctionDef_L496_C4", "vector": [8, 2, 0.8084, 0.0064, 2, 0.04, 1.0, 252, 3, 2, 0, 0, 0, 0, 2], "semantic": {"name": "failUnless", "arg_names": [], "import_names": [], "rhs_call_name": "failUnless", "annotation": ""}, "snippet": " self.failUnless(template_name in template_names,\n msg_prefix + \"Template '%s' was not a template used to render\"\n \" the response. Actual template(s) used: %s\" %\n (template_name, u', '.join(template_names)))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99063:FunctionDef_L512_C4", "label": "assertTemplateNotUsed", "type": "function", "loc": [512, 523], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99063:ClassDef_L240_C0", "vector": [2, 1, 0.8227, 0.0191, 1, 0.62, 0.8824, 574, 0, 4, 0, 0, 0, 0, 1], "semantic": {"name": "assertTemplateNotUsed", "arg_names": ["self", "response", "template_name", "msg_prefix"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def assertTemplateNotUsed(self, response, template_name, msg_prefix=''):\n \"\"\"\n Asserts that the template with the provided name was NOT used in\n rendering the response.\n \"\"\"\n if msg_prefix:\n msg_prefix += \": \"\n"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99063:Expr_L513_C8", "label": "expression", "type": "expression", "loc": [513, 516], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99063:FunctionDef_L512_C4", "vector": [8, 2, 0.818, 0.0064, 2, 0.69, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"\n Asserts that the template with the provided name was NOT used in\n rendering the response.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99063:If_L517_C8", "label": "if", "type": "if", "loc": [517, 518], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99063:FunctionDef_L512_C4", "vector": [4, 2, 0.8227, 0.0032, 2, 0.69, 0.3333, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if msg_prefix:\n msg_prefix += \": \""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99063:Assign_L520_C8", "label": "template_names =", "type": "assigned_variable", "loc": [520, 520], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99063:FunctionDef_L512_C4", "vector": [14, 2, 0.8267, 0.0016, 2, 0.69, 0.6667, 666, 5, 0, 0, 0, 0, 0, 0], "semantic": {"name": "template_names", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " template_names = [t.name for t in response.templates]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99063:Expr_L521_C8", "label": "failIf()", "type": "expression", "loc": [521, 523], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99063:FunctionDef_L512_C4", "vector": [8, 2, 0.8299, 0.0048, 2, 0.69, 1.0, 360, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "failIf", "arg_names": [], "import_names": [], "rhs_call_name": "failIf", "annotation": ""}, "snippet": " self.failIf(template_name in template_names,\n msg_prefix + \"Template '%s' was used unexpectedly in rendering\"\n \" the response\" % template_name)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99063:FunctionDef_L525_C4", "label": "assertQuerysetEqual", "type": "function", "loc": [525, 526], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99063:ClassDef_L240_C0", "vector": [2, 1, 0.8355, 0.0032, 1, 0.62, 0.9412, 856, 0, 4, 1, 0, 0, 0, 2], "semantic": {"name": "assertQuerysetEqual", "arg_names": ["self", "qs", "values", "transform"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def assertQuerysetEqual(self, qs, values, transform=repr):\n return self.assertEqual(map(transform, qs), values)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99063:Return_L526_C8", "label": "return", "type": "return", "loc": [526, 526], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99063:FunctionDef_L525_C4", "vector": [13, 2, 0.8362, 0.0016, 2, 0.13, 0.0, 0, 3, 0, 0, 0, 0, 10, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self.assertEqual(map(transform, qs), values)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99063:FunctionDef_L528_C4", "label": "assertNumQueries", "type": "function", "loc": [528, 545], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99063:ClassDef_L240_C0", "vector": [2, 1, 0.8529, 0.0286, 1, 0.62, 1.0, 365, 0, 5, 1, 0, 0, 0, 8], "semantic": {"name": "assertNumQueries", "arg_names": ["self", "num", "func", "args", "kwargs"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def assertNumQueries(self, num, func=None, *args, **kwargs):\n using = kwargs.pop(\"using\", DEFAULT_DB_ALIAS)\n connection = connections[using]\n\n context = _AssertNumQueriesContext(self, num, connection)\n if func is None:\n return context\n"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99063:Assign_L529_C8", "label": "using = pop()", "type": "assigned_variable", "loc": [529, 529], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99063:FunctionDef_L528_C4", "vector": [14, 2, 0.841, 0.0016, 2, 0.15, 0.0, 699, 3, 2, 0, 0, 969, 10, 1], "semantic": {"name": "using", "arg_names": [], "import_names": [], "rhs_call_name": "pop", "annotation": ""}, "snippet": " using = kwargs.pop(\"using\", DEFAULT_DB_ALIAS)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99063:Assign_L530_C8", "label": "connection =", "type": "assigned_variable", "loc": [530, 530], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99063:FunctionDef_L528_C4", "vector": [14, 2, 0.8426, 0.0016, 2, 0.15, 0.2, 351, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "connection", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " connection = connections[using]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99063:Assign_L532_C8", "label": "context = _AssertNumQueriesContext()", "type": "assigned_variable", "loc": [532, 532], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99063:FunctionDef_L528_C4", "vector": [14, 2, 0.8458, 0.0016, 2, 0.15, 0.4, 954, 3, 3, 0, 0, 863, 10, 1], "semantic": {"name": "context", "arg_names": [], "import_names": [], "rhs_call_name": "_AssertNumQueriesContext", "annotation": ""}, "snippet": " context = _AssertNumQueriesContext(self, num, connection)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99063:If_L533_C8", "label": "if", "type": "if", "loc": [533, 534], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99063:FunctionDef_L528_C4", "vector": [4, 2, 0.8482, 0.0032, 2, 0.15, 0.6, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if func is None:\n return context"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99063:Return_L534_C12", "label": "return", "type": "return", "loc": [534, 534], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99063:If_L533_C8", "vector": [13, 3, 0.849, 0.0016, 3, 0.3, 0.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return context"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99063:Expr_L538_C8", "label": "__enter__()", "type": "expression", "loc": [538, 538], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99063:FunctionDef_L528_C4", "vector": [8, 2, 0.8553, 0.0016, 2, 0.15, 0.8, 230, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "__enter__", "arg_names": [], "import_names": [], "rhs_call_name": "__enter__", "annotation": ""}, "snippet": " context.__enter__()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99063:Try_L539_C8", "label": "try", "type": "try", "loc": [539, 545], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99063:FunctionDef_L528_C4", "vector": [7, 2, 0.8617, 0.0111, 2, 0.15, 1.0, 0, 0, 1, 0, 0, 0, 0, 5], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " try:\n func(*args, **kwargs)\n except:\n context.__exit__(*sys.exc_info())\n raise\n else:\n context.__exit__(*sys.exc_info())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99063:Expr_L540_C12", "label": "func()", "type": "expression", "loc": [540, 540], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99063:Try_L539_C8", "vector": [8, 3, 0.8585, 0.0016, 3, 0.74, 0.0, 856, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "func", "arg_names": [], "import_names": [], "rhs_call_name": "func", "annotation": ""}, "snippet": " func(*args, **kwargs)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99063:Expr_L542_C12", "label": "__exit__()", "type": "expression", "loc": [542, 542], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99063:Try_L539_C8", "vector": [8, 3, 0.8617, 0.0016, 3, 0.74, 0.0, 12, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "__exit__", "arg_names": [], "import_names": [], "rhs_call_name": "__exit__", "annotation": ""}, "snippet": " context.__exit__(*sys.exc_info())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99063:Expr_L545_C12", "label": "__exit__()", "type": "expression", "loc": [545, 545], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99063:Try_L539_C8", "vector": [8, 3, 0.8665, 0.0016, 3, 0.74, 1.0, 12, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "__exit__", "arg_names": [], "import_names": [], "rhs_call_name": "__exit__", "annotation": ""}, "snippet": " context.__exit__(*sys.exc_info())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99063:FunctionDef_L547_C0", "label": "connections_support_transactions", "type": "function", "loc": [547, 553], "level": 0, "parent": null, "vector": [2, 0, 0.8744, 0.0111, 0, 0.66, 0.8919, 943, 0, 0, 1, 0, 0, 0, 2], "semantic": {"name": "connections_support_transactions", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def connections_support_transactions():\n \"\"\"\n Returns True if all connections support transactions. This is messy\n because 2.4 doesn't support any or all.\n \"\"\"\n return all(conn.features.supports_transactions\n for conn in connections.all())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99063:Expr_L548_C4", "label": "expression", "type": "expression", "loc": [548, 551], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99063:FunctionDef_L547_C0", "vector": [8, 1, 0.8736, 0.0064, 1, 0.43, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"\n Returns True if all connections support transactions. This is messy\n because 2.4 doesn't support any or all.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99063:Return_L552_C4", "label": "return", "type": "return", "loc": [552, 553], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99063:FunctionDef_L547_C0", "vector": [13, 1, 0.8784, 0.0032, 1, 0.43, 1.0, 0, 3, 0, 0, 0, 0, 10, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return all(conn.features.supports_transactions\n for conn in connections.all())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99063:ClassDef_L555_C0", "label": "TestCase", "type": "class", "loc": [555, 604], "level": 0, "parent": null, "vector": [3, 0, 0.9213, 0.0795, 0, 0.66, 0.9189, 3, 0, 2, 0, 0, 98, 0, 17], "semantic": {"name": "TestCase", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class TestCase(TransactionTestCase):\n \"\"\"\n Does basically the same as TransactionTestCase, but surrounds every test\n with a transaction, monkey-patches the real transaction management routines to\n do nothing, and rollsback the test transaction at the end of the test. You have\n to use TransactionTestCase, if you need transaction management inside a test.\n \"\"\"\n"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99063:Expr_L556_C4", "label": "expression", "type": "expression", "loc": [556, 561], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99063:ClassDef_L555_C0", "vector": [8, 1, 0.8879, 0.0095, 1, 0.59, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"\n Does basically the same as TransactionTestCase, but surrounds every test\n with a transaction, monkey-patches the real transaction management routines to\n do nothing, and rollsback the test transaction at the end of the test. You have\n to use TransactionTestCase, if you need transaction management inside a test.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99063:FunctionDef_L563_C4", "label": "_fixture_setup", "type": "function", "loc": [563, 588], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99063:ClassDef_L555_C0", "vector": [2, 1, 0.9149, 0.0413, 1, 0.59, 0.5, 173, 0, 1, 1, 0, 0, 0, 10], "semantic": {"name": "_fixture_setup", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _fixture_setup(self):\n if not connections_support_transactions():\n return super(TestCase, self)._fixture_setup()\n\n # If the test case has a multi_db=True flag, setup all databases.\n # Otherwise, just use default.\n if getattr(self, 'multi_db', False):\n databases = connections"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99063:If_L564_C8", "label": "if", "type": "if", "loc": [564, 565], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99063:FunctionDef_L563_C4", "vector": [4, 2, 0.8975, 0.0032, 2, 0.05, 0.0, 0, 0, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not connections_support_transactions():\n return super(TestCase, self)._fixture_setup()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99063:Return_L565_C12", "label": "return", "type": "return", "loc": [565, 565], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99063:If_L564_C8", "vector": [13, 3, 0.8983, 0.0016, 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 super(TestCase, self)._fixture_setup()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99063:If_L569_C8", "label": "if", "type": "if", "loc": [569, 572], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99063:FunctionDef_L563_C4", "vector": [4, 2, 0.907, 0.0064, 2, 0.05, 0.1667, 0, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if getattr(self, 'multi_db', False):\n databases = connections\n else:\n databases = [DEFAULT_DB_ALIAS]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99063:Assign_L570_C12", "label": "databases =", "type": "assigned_variable", "loc": [570, 570], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99063:If_L569_C8", "vector": [14, 3, 0.9062, 0.0016, 3, 0.72, 0.0, 95, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "databases", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " databases = connections"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99063:Assign_L572_C12", "label": "databases =", "type": "assigned_variable", "loc": [572, 572], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99063:If_L569_C8", "vector": [14, 3, 0.9094, 0.0016, 3, 0.72, 1.0, 95, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "databases", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " databases = [DEFAULT_DB_ALIAS]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99063:For_L574_C8", "label": "for db", "type": "for", "loc": [574, 576], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99063:FunctionDef_L563_C4", "vector": [6, 2, 0.9141, 0.0048, 2, 0.05, 0.3333, 761, 2, 0, 0, 0, 0, 0, 2], "semantic": {"name": "db", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for db in databases:\n transaction.enter_transaction_management(using=db)\n transaction.managed(True, using=db)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99063:Expr_L575_C12", "label": "enter_transaction_management()", "type": "expression", "loc": [575, 575], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99063:For_L574_C8", "vector": [8, 3, 0.9141, 0.0016, 3, 0.35, 0.0, 871, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "enter_transaction_management", "arg_names": [], "import_names": [], "rhs_call_name": "enter_transaction_management", "annotation": ""}, "snippet": " transaction.enter_transaction_management(using=db)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99063:Expr_L576_C12", "label": "managed()", "type": "expression", "loc": [576, 576], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99063:For_L574_C8", "vector": [8, 3, 0.9157, 0.0016, 3, 0.35, 1.0, 503, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "managed", "arg_names": [], "import_names": [], "rhs_call_name": "managed", "annotation": ""}, "snippet": " transaction.managed(True, using=db)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99063:Expr_L577_C8", "label": "disable_transaction_methods()", "type": "expression", "loc": [577, 577], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99063:FunctionDef_L563_C4", "vector": [8, 2, 0.9173, 0.0016, 2, 0.05, 0.5, 699, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "disable_transaction_methods", "arg_names": [], "import_names": [], "rhs_call_name": "disable_transaction_methods", "annotation": ""}, "snippet": " disable_transaction_methods()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99063:ImportFrom_L579_C8", "label": "from django.contrib.sites.models import Site", "type": "import", "loc": [579, 579], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99063:FunctionDef_L563_C4", "vector": [1, 2, 0.9205, 0.0016, 2, 0.05, 0.6667, 890, 0, 1, 0, 0, 890, 0, 0], "semantic": {"name": "django.contrib.sites.models", "arg_names": [], "import_names": ["Site"], "rhs_call_name": "", "annotation": ""}, "snippet": " from django.contrib.sites.models import Site"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99063:Expr_L580_C8", "label": "clear_cache()", "type": "expression", "loc": [580, 580], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99063:FunctionDef_L563_C4", "vector": [8, 2, 0.9221, 0.0016, 2, 0.05, 0.8333, 808, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "clear_cache", "arg_names": [], "import_names": [], "rhs_call_name": "clear_cache", "annotation": ""}, "snippet": " Site.objects.clear_cache()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99063:For_L582_C8", "label": "for db", "type": "for", "loc": [582, 588], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99063:FunctionDef_L563_C4", "vector": [6, 2, 0.93, 0.0111, 2, 0.05, 1.0, 761, 2, 0, 0, 0, 0, 0, 2], "semantic": {"name": "db", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for db in databases:\n if hasattr(self, 'fixtures'):\n call_command('loaddata', *self.fixtures, **{\n 'verbosity': 0,\n 'commit': False,\n 'database': db\n })"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99063:If_L583_C12", "label": "if", "type": "if", "loc": [583, 588], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99063:For_L582_C8", "vector": [4, 3, 0.9308, 0.0095, 3, 0.68, 0.0, 0, 3, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if hasattr(self, 'fixtures'):\n call_command('loaddata', *self.fixtures, **{\n 'verbosity': 0,\n 'commit': False,\n 'database': db\n })"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99063:Expr_L584_C16", "label": "call_command()", "type": "expression", "loc": [584, 588], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99063:If_L583_C12", "vector": [8, 4, 0.9316, 0.0079, 4, 0.05, 0.0, 587, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "call_command", "arg_names": [], "import_names": [], "rhs_call_name": "call_command", "annotation": ""}, "snippet": " call_command('loaddata', *self.fixtures, **{\n 'verbosity': 0,\n 'commit': False,\n 'database': db\n })"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99063:FunctionDef_L590_C4", "label": "_fixture_teardown", "type": "function", "loc": [590, 604], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99063:ClassDef_L555_C0", "vector": [2, 1, 0.9491, 0.0238, 1, 0.59, 1.0, 656, 0, 1, 1, 0, 0, 0, 7], "semantic": {"name": "_fixture_teardown", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _fixture_teardown(self):\n if not connections_support_transactions():\n return super(TestCase, self)._fixture_teardown()\n\n # If the test case has a multi_db=True flag, teardown all databases.\n # Otherwise, just teardown default.\n if getattr(self, 'multi_db', False):\n databases = connections"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99063:If_L591_C8", "label": "if", "type": "if", "loc": [591, 592], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99063:FunctionDef_L590_C4", "vector": [4, 2, 0.9404, 0.0032, 2, 0.22, 0.0, 0, 0, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not connections_support_transactions():\n return super(TestCase, self)._fixture_teardown()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99063:Return_L592_C12", "label": "return", "type": "return", "loc": [592, 592], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99063:If_L591_C8", "vector": [13, 3, 0.9412, 0.0016, 3, 0.14, 0.0, 0, 3, 0, 0, 0, 0, 10, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return super(TestCase, self)._fixture_teardown()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99063:If_L596_C8", "label": "if", "type": "if", "loc": [596, 599], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99063:FunctionDef_L590_C4", "vector": [4, 2, 0.9499, 0.0064, 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 getattr(self, 'multi_db', False):\n databases = connections\n else:\n databases = [DEFAULT_DB_ALIAS]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99063:Assign_L597_C12", "label": "databases =", "type": "assigned_variable", "loc": [597, 597], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99063:If_L596_C8", "vector": [14, 3, 0.9491, 0.0016, 3, 0.69, 0.0, 95, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "databases", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " databases = connections"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99063:Assign_L599_C12", "label": "databases =", "type": "assigned_variable", "loc": [599, 599], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99063:If_L596_C8", "vector": [14, 3, 0.9523, 0.0016, 3, 0.69, 1.0, 95, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "databases", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " databases = [DEFAULT_DB_ALIAS]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99063:Expr_L601_C8", "label": "restore_transaction_methods()", "type": "expression", "loc": [601, 601], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99063:FunctionDef_L590_C4", "vector": [8, 2, 0.9555, 0.0016, 2, 0.22, 0.6667, 701, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "restore_transaction_methods", "arg_names": [], "import_names": [], "rhs_call_name": "restore_transaction_methods", "annotation": ""}, "snippet": " restore_transaction_methods()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99063:For_L602_C8", "label": "for db", "type": "for", "loc": [602, 604], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99063:FunctionDef_L590_C4", "vector": [6, 2, 0.9587, 0.0048, 2, 0.22, 1.0, 761, 2, 0, 0, 0, 0, 0, 2], "semantic": {"name": "db", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for db in databases:\n transaction.rollback(using=db)\n transaction.leave_transaction_management(using=db)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99063:Expr_L603_C12", "label": "rollback()", "type": "expression", "loc": [603, 603], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99063:For_L602_C8", "vector": [8, 3, 0.9587, 0.0016, 3, 0.29, 0.0, 484, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "rollback", "arg_names": [], "import_names": [], "rhs_call_name": "rollback", "annotation": ""}, "snippet": " transaction.rollback(using=db)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99063:Expr_L604_C12", "label": "leave_transaction_management()", "type": "expression", "loc": [604, 604], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99063:For_L602_C8", "vector": [8, 3, 0.9603, 0.0016, 3, 0.29, 1.0, 780, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "leave_transaction_management", "arg_names": [], "import_names": [], "rhs_call_name": "leave_transaction_management", "annotation": ""}, "snippet": " transaction.leave_transaction_management(using=db)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99063:FunctionDef_L606_C0", "label": "_deferredSkip", "type": "function", "loc": [606, 619], "level": 0, "parent": null, "vector": [2, 0, 0.9738, 0.0223, 0, 0.66, 0.9459, 678, 0, 2, 1, 0, 0, 0, 6], "semantic": {"name": "_deferredSkip", "arg_names": ["condition", "reason"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def _deferredSkip(condition, reason):\n def decorator(test_func):\n if not (isinstance(test_func, type) and issubclass(test_func, TestCase)):\n @wraps(test_func)\n def skip_wrapper(*args, **kwargs):\n if condition():\n raise ut2.SkipTest(reason)\n return test_func(*args, **kwargs)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99063:FunctionDef_L607_C4", "label": "decorator", "type": "function", "loc": [607, 618], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99063:FunctionDef_L606_C0", "vector": [2, 1, 0.9738, 0.0191, 1, 0.12, 0.0, 373, 0, 1, 1, 0, 0, 0, 6], "semantic": {"name": "decorator", "arg_names": ["test_func"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def decorator(test_func):\n if not (isinstance(test_func, type) and issubclass(test_func, TestCase)):\n @wraps(test_func)\n def skip_wrapper(*args, **kwargs):\n if condition():\n raise ut2.SkipTest(reason)\n return test_func(*args, **kwargs)\n test_item = skip_wrapper"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99063:If_L608_C8", "label": "if", "type": "if", "loc": [608, 616], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99063:FunctionDef_L607_C4", "vector": [4, 2, 0.973, 0.0143, 2, 0.75, 0.0, 0, 0, 0, 0, 0, 0, 0, 6], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not (isinstance(test_func, type) and issubclass(test_func, TestCase)):\n @wraps(test_func)\n def skip_wrapper(*args, **kwargs):\n if condition():\n raise ut2.SkipTest(reason)\n return test_func(*args, **kwargs)\n test_item = skip_wrapper\n else:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99063:FunctionDef_L610_C12", "label": "skip_wrapper", "type": "function", "loc": [610, 613], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99063:If_L608_C8", "vector": [2, 3, 0.9722, 0.0064, 3, 0.63, 0.0, 869, 0, 2, 1, 0, 0, 0, 4], "semantic": {"name": "skip_wrapper", "arg_names": ["args", "kwargs"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def skip_wrapper(*args, **kwargs):\n if condition():\n raise ut2.SkipTest(reason)\n return test_func(*args, **kwargs)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99063:If_L611_C16", "label": "if", "type": "if", "loc": [611, 612], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99063:FunctionDef_L610_C12", "vector": [4, 4, 0.9722, 0.0032, 4, 0.81, 0.0, 0, 3, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if condition():\n raise ut2.SkipTest(reason)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99063:Return_L613_C16", "label": "return", "type": "return", "loc": [613, 613], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99063:FunctionDef_L610_C12", "vector": [13, 4, 0.9746, 0.0016, 4, 0.81, 1.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return test_func(*args, **kwargs)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99063:Assign_L614_C12", "label": "test_item =", "type": "assigned_variable", "loc": [614, 614], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99063:If_L608_C8", "vector": [14, 3, 0.9762, 0.0016, 3, 0.63, 0.5, 37, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "test_item", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " test_item = skip_wrapper"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99063:Assign_L616_C12", "label": "test_item =", "type": "assigned_variable", "loc": [616, 616], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99063:If_L608_C8", "vector": [14, 3, 0.9793, 0.0016, 3, 0.63, 1.0, 37, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "test_item", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " test_item = test_func"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99063:Assign_L617_C8", "label": "test_item.__unittest_skip_why__ =", "type": "assigned_variable", "loc": [617, 617], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99063:FunctionDef_L607_C4", "vector": [14, 2, 0.9809, 0.0016, 2, 0.75, 0.5, 121, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "test_item.__unittest_skip_why__", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " test_item.__unittest_skip_why__ = reason"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99063:Return_L618_C8", "label": "return", "type": "return", "loc": [618, 618], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99063:FunctionDef_L607_C4", "vector": [13, 2, 0.9825, 0.0016, 2, 0.75, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return test_item"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99063:Return_L619_C4", "label": "return", "type": "return", "loc": [619, 619], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99063:FunctionDef_L606_C0", "vector": [13, 1, 0.9841, 0.0016, 1, 0.12, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return decorator"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99063:FunctionDef_L621_C0", "label": "skipIfDBFeature", "type": "function", "loc": [621, 624], "level": 0, "parent": null, "vector": [2, 0, 0.9897, 0.0064, 0, 0.66, 0.973, 735, 0, 1, 1, 0, 0, 0, 2], "semantic": {"name": "skipIfDBFeature", "arg_names": ["feature"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def skipIfDBFeature(feature):\n \"Skip a test if a database has the named feature\"\n return _deferredSkip(lambda: getattr(connection.features, feature),\n \"Database has feature %s\" % feature)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99063:Expr_L622_C4", "label": "expression", "type": "expression", "loc": [622, 622], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99063:FunctionDef_L621_C0", "vector": [8, 1, 0.9889, 0.0016, 1, 0.42, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"Skip a test if a database has the named feature\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99063:Return_L623_C4", "label": "return", "type": "return", "loc": [623, 624], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99063:FunctionDef_L621_C0", "vector": [13, 1, 0.9913, 0.0032, 1, 0.42, 1.0, 0, 3, 0, 0, 0, 0, 10, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return _deferredSkip(lambda: getattr(connection.features, feature),\n \"Database has feature %s\" % feature)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99063:FunctionDef_L626_C0", "label": "skipUnlessDBFeature", "type": "function", "loc": [626, 629], "level": 0, "parent": null, "vector": [2, 0, 0.9976, 0.0064, 0, 0.66, 1.0, 310, 0, 1, 1, 0, 0, 0, 2], "semantic": {"name": "skipUnlessDBFeature", "arg_names": ["feature"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def skipUnlessDBFeature(feature):\n \"Skip a test unless a database has the named feature\"\n return _deferredSkip(lambda: not getattr(connection.features, feature),\n \"Database doesn't support feature %s\" % feature)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99063:Expr_L627_C4", "label": "expression", "type": "expression", "loc": [627, 627], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99063:FunctionDef_L626_C0", "vector": [8, 1, 0.9968, 0.0016, 1, 0.63, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"Skip a test unless a database has the named feature\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99063:Return_L628_C4", "label": "return", "type": "return", "loc": [628, 629], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99063:FunctionDef_L626_C0", "vector": [13, 1, 0.9992, 0.0032, 1, 0.63, 1.0, 0, 3, 0, 0, 0, 0, 10, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return _deferredSkip(lambda: not getattr(connection.features, feature),\n \"Database doesn't support feature %s\" % feature)"}]
[{"f": "ajibawa-2023/Python-Code-Large/train/row_99063:Try_L23_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99063:Expr_L24_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99063:Try_L23_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99063:ImportFrom_L26_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99063:FunctionDef_L32_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99063:Expr_L33_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99063:FunctionDef_L32_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99063:If_L37_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99063:If_L37_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99063:Assign_L38_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99063:If_L37_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99063:If_L39_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99063:If_L39_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99063:Assign_L40_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99063:FunctionDef_L32_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99063:Return_L41_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99063:FunctionDef_L49_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99063:Return_L50_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99063:FunctionDef_L52_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99063:Assign_L53_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99063:FunctionDef_L52_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99063:Assign_L54_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99063:FunctionDef_L52_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99063:Assign_L55_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99063:FunctionDef_L52_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99063:Assign_L56_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99063:FunctionDef_L52_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99063:Assign_L57_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99063:FunctionDef_L59_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99063:Assign_L60_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99063:FunctionDef_L59_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99063:Assign_L61_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99063:FunctionDef_L59_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99063:Assign_L62_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99063:FunctionDef_L59_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99063:Assign_L63_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99063:FunctionDef_L59_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99063:Assign_L64_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99063:ClassDef_L66_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99063:FunctionDef_L67_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99063:FunctionDef_L67_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99063:Expr_L68_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99063:FunctionDef_L67_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99063:Assign_L69_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99063:FunctionDef_L67_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99063:For_L73_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99063:For_L73_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99063:If_L74_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99063:If_L74_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99063:Return_L75_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99063:FunctionDef_L67_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99063:Return_L76_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99063:ClassDef_L66_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99063:FunctionDef_L78_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99063:FunctionDef_L78_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99063:Expr_L79_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99063:FunctionDef_L78_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99063:Return_L80_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99063:ClassDef_L66_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99063:FunctionDef_L82_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99063:FunctionDef_L82_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99063:Expr_L83_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99063:FunctionDef_L82_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99063:Return_L89_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99063:ClassDef_L66_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99063:FunctionDef_L94_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99063:FunctionDef_L94_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99063:Expr_L95_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99063:FunctionDef_L94_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99063:Assign_L101_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99063:FunctionDef_L94_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99063:FunctionDef_L102_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99063:FunctionDef_L102_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99063:Return_L103_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99063:FunctionDef_L94_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99063:FunctionDef_L105_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99063:FunctionDef_L105_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99063:Return_L106_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99063:FunctionDef_L94_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99063:FunctionDef_L109_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99063:FunctionDef_L109_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99063:Return_L110_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99063:FunctionDef_L94_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99063:FunctionDef_L113_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99063:FunctionDef_L113_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99063:Return_L114_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99063:FunctionDef_L94_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99063:FunctionDef_L116_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99063:FunctionDef_L116_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99063:Return_L117_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99063:FunctionDef_L94_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99063:FunctionDef_L119_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99063:FunctionDef_L119_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99063:If_L120_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99063:If_L120_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99063:Return_L121_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99063:FunctionDef_L119_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99063:If_L122_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99063:If_L122_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99063:Return_L123_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99063:FunctionDef_L119_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99063:If_L124_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99063:If_L124_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99063:Return_L125_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99063:FunctionDef_L119_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99063:Assign_L126_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99063:FunctionDef_L119_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99063:Assign_L127_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99063:FunctionDef_L119_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99063:If_L128_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99063:If_L128_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99063:Return_L129_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99063:FunctionDef_L119_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99063:For_L130_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99063:For_L130_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99063:If_L131_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99063:If_L131_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99063:Return_L132_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99063:FunctionDef_L119_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99063:Return_L133_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99063:FunctionDef_L94_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99063:Assign_L135_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99063:FunctionDef_L94_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99063:Assign_L136_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99063:FunctionDef_L94_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99063:Assign_L137_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99063:FunctionDef_L94_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99063:If_L141_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99063:If_L141_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99063:Assign_L142_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99063:If_L141_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99063:Assign_L143_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99063:If_L141_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99063:Assign_L144_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99063:FunctionDef_L94_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99063:Try_L147_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99063:Try_L147_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99063:Assign_L148_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99063:Try_L147_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99063:Assign_L149_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99063:Try_L147_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99063:Return_L151_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99063:FunctionDef_L94_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99063:Return_L152_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99063:ClassDef_L66_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99063:FunctionDef_L154_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99063:FunctionDef_L154_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99063:Expr_L155_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99063:FunctionDef_L154_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99063:Assign_L156_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99063:FunctionDef_L154_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99063:Try_L157_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99063:Try_L157_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99063:Assign_L158_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99063:Try_L157_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99063:Assign_L159_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99063:Try_L157_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99063:Return_L161_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99063:FunctionDef_L154_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99063:Return_L162_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99063:ClassDef_L66_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99063:FunctionDef_L164_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99063:FunctionDef_L164_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99063:Expr_L165_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99063:FunctionDef_L164_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99063:FunctionDef_L178_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99063:FunctionDef_L178_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99063:Assign_L179_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99063:FunctionDef_L178_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99063:Return_L180_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99063:FunctionDef_L164_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99063:FunctionDef_L184_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99063:FunctionDef_L184_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99063:Assign_L185_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99063:FunctionDef_L184_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99063:Return_L186_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99063:FunctionDef_L164_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99063:If_L191_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99063:If_L191_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99063:Assign_L192_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99063:If_L191_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99063:Assign_L193_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99063:If_L191_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99063:If_L194_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99063:If_L194_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99063:Assign_L195_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99063:If_L194_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99063:Assign_L196_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99063:FunctionDef_L164_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99063:Return_L197_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99063:ClassDef_L200_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99063:FunctionDef_L201_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99063:FunctionDef_L201_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99063:Expr_L202_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99063:FunctionDef_L201_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99063:Assign_L203_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99063:ClassDef_L200_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99063:FunctionDef_L205_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99063:FunctionDef_L205_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99063:Expr_L206_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99063:FunctionDef_L205_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99063:For_L210_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99063:For_L210_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99063:Expr_L211_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99063:ClassDef_L213_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99063:FunctionDef_L214_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99063:FunctionDef_L214_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99063:Assign_L215_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99063:FunctionDef_L214_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99063:Assign_L216_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99063:FunctionDef_L214_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99063:Assign_L217_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99063:ClassDef_L213_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99063:FunctionDef_L219_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99063:FunctionDef_L219_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99063:Assign_L220_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99063:FunctionDef_L219_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99063:Assign_L221_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99063:FunctionDef_L219_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99063:Assign_L222_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99063:FunctionDef_L219_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99063:Return_L223_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99063:ClassDef_L213_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99063:FunctionDef_L225_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99063:FunctionDef_L225_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99063:Assign_L226_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99063:FunctionDef_L225_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99063:If_L227_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99063:If_L227_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99063:Return_L228_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99063:FunctionDef_L225_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99063:Assign_L230_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99063:FunctionDef_L225_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99063:Assign_L231_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99063:FunctionDef_L225_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99063:Expr_L233_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99063:ClassDef_L240_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99063:Assign_L243_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99063:ClassDef_L240_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99063:FunctionDef_L245_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99063:FunctionDef_L245_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99063:Expr_L246_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99063:FunctionDef_L245_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99063:Expr_L255_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99063:FunctionDef_L245_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99063:Expr_L256_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99063:FunctionDef_L245_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99063:Assign_L257_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99063:ClassDef_L240_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99063:FunctionDef_L259_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99063:FunctionDef_L259_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99063:If_L262_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99063:If_L262_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99063:Assign_L263_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99063:If_L262_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99063:Assign_L265_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99063:FunctionDef_L259_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99063:For_L266_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99063:For_L266_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99063:Expr_L267_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99063:For_L266_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99063:If_L269_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99063:If_L269_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99063:Expr_L272_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99063:ClassDef_L240_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99063:FunctionDef_L274_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99063:FunctionDef_L274_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99063:If_L275_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99063:If_L275_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99063:Assign_L276_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99063:If_L275_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99063:Assign_L277_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99063:If_L275_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99063:Expr_L278_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99063:ClassDef_L240_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99063:FunctionDef_L280_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99063:FunctionDef_L280_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99063:Expr_L281_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99063:FunctionDef_L280_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99063:Assign_L286_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99063:FunctionDef_L280_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99063:Try_L287_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99063:Try_L287_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99063:Expr_L288_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99063:Try_L287_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99063:Import_L292_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99063:Try_L287_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99063:Expr_L293_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99063:Try_L287_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99063:Return_L294_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99063:FunctionDef_L280_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99063:Expr_L295_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99063:FunctionDef_L280_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99063:Try_L296_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99063:Try_L296_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99063:Expr_L297_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99063:Try_L296_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99063:Import_L301_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99063:Try_L296_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99063:Expr_L302_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99063:Try_L296_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99063:Return_L303_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99063:ClassDef_L240_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99063:FunctionDef_L305_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99063:FunctionDef_L305_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99063:Expr_L306_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99063:FunctionDef_L305_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99063:Expr_L312_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99063:FunctionDef_L305_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99063:Expr_L313_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99063:FunctionDef_L305_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99063:For_L321_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99063:For_L321_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99063:Expr_L322_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99063:ClassDef_L240_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99063:FunctionDef_L324_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99063:ClassDef_L240_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99063:FunctionDef_L327_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99063:FunctionDef_L327_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99063:If_L328_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99063:If_L328_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99063:Assign_L329_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99063:If_L328_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99063:Expr_L330_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99063:ClassDef_L240_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99063:FunctionDef_L332_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99063:FunctionDef_L332_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99063:Expr_L333_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99063:FunctionDef_L332_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99063:Assign_L336_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99063:ClassDef_L240_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99063:FunctionDef_L338_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99063:FunctionDef_L338_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99063:Expr_L339_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99063:FunctionDef_L338_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99063:Expr_L343_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99063:ClassDef_L240_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99063:FunctionDef_L345_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99063:FunctionDef_L345_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99063:Expr_L347_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99063:FunctionDef_L345_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99063:If_L353_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99063:FunctionDef_L345_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99063:If_L356_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99063:If_L356_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99063:Expr_L358_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99063:If_L356_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99063:Expr_L363_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99063:If_L356_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99063:Assign_L368_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99063:If_L356_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99063:Expr_L370_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99063:If_L356_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99063:Expr_L377_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99063:If_L356_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99063:Assign_L382_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99063:If_L356_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99063:Assign_L383_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99063:If_L356_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99063:Assign_L385_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99063:If_L356_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99063:Expr_L389_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99063:FunctionDef_L345_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99063:Assign_L394_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99063:FunctionDef_L345_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99063:If_L395_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99063:If_L395_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99063:Assign_L396_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99063:FunctionDef_L345_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99063:Expr_L399_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99063:ClassDef_L240_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99063:FunctionDef_L403_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99063:FunctionDef_L403_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99063:Expr_L405_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99063:FunctionDef_L403_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99063:If_L412_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99063:FunctionDef_L403_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99063:Expr_L415_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99063:FunctionDef_L403_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99063:Assign_L418_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99063:FunctionDef_L403_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99063:Assign_L419_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99063:FunctionDef_L403_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99063:If_L420_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99063:If_L420_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99063:Expr_L421_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99063:If_L420_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99063:Expr_L425_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99063:ClassDef_L240_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99063:FunctionDef_L428_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99063:FunctionDef_L428_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99063:Expr_L430_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99063:FunctionDef_L428_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99063:If_L435_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99063:FunctionDef_L428_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99063:Expr_L438_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99063:FunctionDef_L428_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99063:Assign_L441_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99063:FunctionDef_L428_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99063:Expr_L442_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99063:ClassDef_L240_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99063:FunctionDef_L445_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99063:FunctionDef_L445_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99063:Expr_L446_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99063:FunctionDef_L445_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99063:If_L450_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99063:FunctionDef_L445_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99063:Assign_L454_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99063:FunctionDef_L445_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99063:If_L455_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99063:If_L455_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99063:Expr_L456_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99063:FunctionDef_L445_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99063:Assign_L460_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99063:FunctionDef_L445_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99063:Assign_L463_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99063:FunctionDef_L445_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99063:For_L464_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99063:For_L464_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99063:If_L465_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99063:For_L464_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99063:Assign_L467_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99063:For_L464_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99063:For_L468_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99063:For_L468_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99063:If_L469_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99063:If_L469_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99063:If_L470_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99063:If_L470_C20", "t": "ajibawa-2023/Python-Code-Large/train/row_99063:Assign_L471_C24"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99063:If_L470_C20", "t": "ajibawa-2023/Python-Code-Large/train/row_99063:Expr_L472_C24"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99063:If_L470_C20", "t": "ajibawa-2023/Python-Code-Large/train/row_99063:If_L477_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99063:If_L477_C20", "t": "ajibawa-2023/Python-Code-Large/train/row_99063:Expr_L478_C24"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99063:If_L477_C20", "t": "ajibawa-2023/Python-Code-Large/train/row_99063:Expr_L482_C24"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99063:If_L469_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99063:Assign_L486_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99063:If_L469_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99063:Expr_L487_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99063:FunctionDef_L445_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99063:If_L492_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99063:If_L492_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99063:Expr_L493_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99063:ClassDef_L240_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99063:FunctionDef_L496_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99063:FunctionDef_L496_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99063:Expr_L497_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99063:FunctionDef_L496_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99063:If_L501_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99063:FunctionDef_L496_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99063:Assign_L504_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99063:FunctionDef_L496_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99063:If_L505_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99063:If_L505_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99063:Expr_L506_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99063:FunctionDef_L496_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99063:Expr_L507_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99063:ClassDef_L240_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99063:FunctionDef_L512_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99063:FunctionDef_L512_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99063:Expr_L513_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99063:FunctionDef_L512_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99063:If_L517_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99063:FunctionDef_L512_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99063:Assign_L520_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99063:FunctionDef_L512_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99063:Expr_L521_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99063:ClassDef_L240_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99063:FunctionDef_L525_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99063:FunctionDef_L525_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99063:Return_L526_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99063:ClassDef_L240_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99063:FunctionDef_L528_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99063:FunctionDef_L528_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99063:Assign_L529_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99063:FunctionDef_L528_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99063:Assign_L530_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99063:FunctionDef_L528_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99063:Assign_L532_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99063:FunctionDef_L528_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99063:If_L533_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99063:If_L533_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99063:Return_L534_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99063:FunctionDef_L528_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99063:Expr_L538_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99063:FunctionDef_L528_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99063:Try_L539_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99063:Try_L539_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99063:Expr_L540_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99063:Try_L539_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99063:Expr_L542_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99063:Try_L539_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99063:Expr_L545_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99063:FunctionDef_L547_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99063:Expr_L548_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99063:FunctionDef_L547_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99063:Return_L552_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99063:ClassDef_L555_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99063:Expr_L556_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99063:ClassDef_L555_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99063:FunctionDef_L563_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99063:FunctionDef_L563_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99063:If_L564_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99063:If_L564_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99063:Return_L565_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99063:FunctionDef_L563_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99063:If_L569_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99063:If_L569_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99063:Assign_L570_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99063:If_L569_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99063:Assign_L572_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99063:FunctionDef_L563_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99063:For_L574_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99063:For_L574_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99063:Expr_L575_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99063:For_L574_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99063:Expr_L576_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99063:FunctionDef_L563_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99063:Expr_L577_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99063:FunctionDef_L563_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99063:ImportFrom_L579_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99063:FunctionDef_L563_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99063:Expr_L580_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99063:FunctionDef_L563_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99063:For_L582_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99063:For_L582_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99063:If_L583_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99063:If_L583_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99063:Expr_L584_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99063:ClassDef_L555_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99063:FunctionDef_L590_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99063:FunctionDef_L590_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99063:If_L591_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99063:If_L591_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99063:Return_L592_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99063:FunctionDef_L590_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99063:If_L596_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99063:If_L596_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99063:Assign_L597_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99063:If_L596_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99063:Assign_L599_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99063:FunctionDef_L590_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99063:Expr_L601_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99063:FunctionDef_L590_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99063:For_L602_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99063:For_L602_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99063:Expr_L603_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99063:For_L602_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99063:Expr_L604_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99063:FunctionDef_L606_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99063:FunctionDef_L607_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99063:FunctionDef_L607_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99063:If_L608_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99063:If_L608_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99063:FunctionDef_L610_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99063:FunctionDef_L610_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99063:If_L611_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99063:FunctionDef_L610_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99063:Return_L613_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99063:If_L608_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99063:Assign_L614_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99063:If_L608_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99063:Assign_L616_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99063:FunctionDef_L607_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99063:Assign_L617_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99063:FunctionDef_L607_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99063:Return_L618_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99063:FunctionDef_L606_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99063:Return_L619_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99063:FunctionDef_L621_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99063:Expr_L622_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99063:FunctionDef_L621_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99063:Return_L623_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99063:FunctionDef_L626_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99063:Expr_L627_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99063:FunctionDef_L626_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99063:Return_L628_C4"}]
from django.dispatch import Signal template_rendered = Signal(providing_args=["template", "context"])
ajibawa-2023/Python-Code-Large/train/row_99067
2
3
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_99067:ImportFrom_L1_C0", "label": "from django.dispatch import Signal", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.3333, 0.3333, 0, 0.66, 0.0, 548, 0, 1, 0, 0, 548, 0, 0], "semantic": {"name": "django.dispatch", "arg_names": [], "import_names": ["Signal"], "rhs_call_name": "", "annotation": ""}, "snippet": "from django.dispatch import Signal"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99067:Assign_L3_C0", "label": "template_rendered = Signal()", "type": "assigned_variable", "loc": [3, 3], "level": 0, "parent": null, "vector": [14, 0, 1.0, 0.3333, 0, 0.66, 1.0, 139, 3, 1, 0, 0, 592, 10, 1], "semantic": {"name": "template_rendered", "arg_names": [], "import_names": [], "rhs_call_name": "Signal", "annotation": ""}, "snippet": "template_rendered = Signal(providing_args=[\"template\", \"context\"])"}]
[]
import sys import time import os import warnings from django.conf import settings from django.core import mail from django.core.mail.backends import locmem from django.test import signals from django.template import Template from django.utils.translation import deactivate __all__ = ('Approximate', 'ContextList', 'setup_test_environment', 'teardown_test_environment', 'get_runner') class Approximate(object): def __init__(self, val, places=7): self.val = val self.places = places def __repr__(self): return repr(self.val) def __eq__(self, other): if self.val == other: return True return round(abs(self.val-other), self.places) == 0 class ContextList(list): """A wrapper that provides direct key access to context items contained in a list of context objects. """ def __getitem__(self, key): if isinstance(key, basestring): for subcontext in self: if key in subcontext: return subcontext[key] raise KeyError(key) else: return super(ContextList, self).__getitem__(key) def __contains__(self, key): try: value = self[key] except KeyError: return False return True def instrumented_test_render(self, context): """ An instrumented Template render method, providing a signal that can be intercepted by the test system Client """ signals.template_rendered.send(sender=self, template=self, context=context) return self.nodelist.render(context) def setup_test_environment(): """Perform any global pre-test setup. This involves: - Installing the instrumented test renderer - Set the email backend to the locmem email backend. - Setting the active locale to match the LANGUAGE_CODE setting. """ Template.original_render = Template._render Template._render = instrumented_test_render mail.original_SMTPConnection = mail.SMTPConnection mail.SMTPConnection = locmem.EmailBackend mail.original_email_backend = settings.EMAIL_BACKEND settings.EMAIL_BACKEND = 'django.core.mail.backends.locmem.EmailBackend' mail.outbox = [] deactivate() def teardown_test_environment(): """Perform any global post-test teardown. This involves: - Restoring the original test renderer - Restoring the email sending functions """ Template._render = Template.original_render del Template.original_render mail.SMTPConnection = mail.original_SMTPConnection del mail.original_SMTPConnection settings.EMAIL_BACKEND = mail.original_email_backend del mail.original_email_backend del mail.outbox def get_warnings_state(): """ Returns an object containing the state of the warnings module """ # There is no public interface for doing this, but this implementation of # get_warnings_state and restore_warnings_state appears to work on Python # 2.4 to 2.7. return warnings.filters[:] def restore_warnings_state(state): """ Restores the state of the warnings module when passed an object that was returned by get_warnings_state() """ warnings.filters = state[:] def get_runner(settings): test_path = settings.TEST_RUNNER.split('.') # Allow for Python 2.5 relative paths if len(test_path) > 1: test_module_name = '.'.join(test_path[:-1]) else: test_module_name = '.' test_module = __import__(test_module_name, {}, {}, test_path[-1]) test_runner = getattr(test_module, test_path[-1]) return test_runner
ajibawa-2023/Python-Code-Large/train/row_99068
67
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_99068:Import_L1_C0", "label": "sys import sys", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0079, 0.0079, 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_99068:Import_L2_C0", "label": "time import time", "type": "import", "loc": [2, 2], "level": 0, "parent": null, "vector": [1, 0, 0.0157, 0.0079, 0, 0.66, 0.0556, 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_99068:Import_L3_C0", "label": "os import os", "type": "import", "loc": [3, 3], "level": 0, "parent": null, "vector": [1, 0, 0.0236, 0.0079, 0, 0.66, 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_99068:Import_L4_C0", "label": "warnings import warnings", "type": "import", "loc": [4, 4], "level": 0, "parent": null, "vector": [1, 0, 0.0315, 0.0079, 0, 0.66, 0.1667, 358, 0, 1, 0, 0, 358, 0, 0], "semantic": {"name": "warnings", "arg_names": [], "import_names": ["warnings"], "rhs_call_name": "", "annotation": ""}, "snippet": "import warnings"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99068:ImportFrom_L5_C0", "label": "from django.conf import settings", "type": "import", "loc": [5, 5], "level": 0, "parent": null, "vector": [1, 0, 0.0394, 0.0079, 0, 0.66, 0.2222, 128, 0, 1, 0, 0, 128, 0, 0], "semantic": {"name": "django.conf", "arg_names": [], "import_names": ["settings"], "rhs_call_name": "", "annotation": ""}, "snippet": "from django.conf import settings"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99068:ImportFrom_L6_C0", "label": "from django.core import mail", "type": "import", "loc": [6, 6], "level": 0, "parent": null, "vector": [1, 0, 0.0472, 0.0079, 0, 0.66, 0.2778, 913, 0, 1, 0, 0, 913, 0, 0], "semantic": {"name": "django.core", "arg_names": [], "import_names": ["mail"], "rhs_call_name": "", "annotation": ""}, "snippet": "from django.core import mail"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99068:ImportFrom_L7_C0", "label": "from django.core.mail.backends import locmem", "type": "import", "loc": [7, 7], "level": 0, "parent": null, "vector": [1, 0, 0.0551, 0.0079, 0, 0.66, 0.3333, 172, 0, 1, 0, 0, 172, 0, 0], "semantic": {"name": "django.core.mail.backends", "arg_names": [], "import_names": ["locmem"], "rhs_call_name": "", "annotation": ""}, "snippet": "from django.core.mail.backends import locmem"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99068:ImportFrom_L8_C0", "label": "from django.test import signals", "type": "import", "loc": [8, 8], "level": 0, "parent": null, "vector": [1, 0, 0.063, 0.0079, 0, 0.66, 0.3889, 944, 0, 1, 0, 0, 944, 0, 0], "semantic": {"name": "django.test", "arg_names": [], "import_names": ["signals"], "rhs_call_name": "", "annotation": ""}, "snippet": "from django.test import signals"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99068:ImportFrom_L9_C0", "label": "from django.template import Template", "type": "import", "loc": [9, 9], "level": 0, "parent": null, "vector": [1, 0, 0.0709, 0.0079, 0, 0.66, 0.4444, 213, 0, 1, 0, 0, 213, 0, 0], "semantic": {"name": "django.template", "arg_names": [], "import_names": ["Template"], "rhs_call_name": "", "annotation": ""}, "snippet": "from django.template import Template"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99068:ImportFrom_L10_C0", "label": "from django.utils.translation import deactivate", "type": "import", "loc": [10, 10], "level": 0, "parent": null, "vector": [1, 0, 0.0787, 0.0079, 0, 0.66, 0.5, 389, 0, 1, 0, 0, 389, 0, 0], "semantic": {"name": "django.utils.translation", "arg_names": [], "import_names": ["deactivate"], "rhs_call_name": "", "annotation": ""}, "snippet": "from django.utils.translation import deactivate"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99068:Assign_L12_C0", "label": "__all__ =", "type": "assigned_variable", "loc": [12, 13], "level": 0, "parent": null, "vector": [14, 0, 0.0984, 0.0157, 0, 0.66, 0.5556, 272, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "__all__", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "__all__ = ('Approximate', 'ContextList', 'setup_test_environment',\n 'teardown_test_environment', 'get_runner')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99068:ClassDef_L16_C0", "label": "Approximate", "type": "class", "loc": [16, 27], "level": 0, "parent": null, "vector": [3, 0, 0.1693, 0.0945, 0, 0.66, 0.6111, 158, 0, 3, 0, 0, 186, 0, 3], "semantic": {"name": "Approximate", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class Approximate(object):\n def __init__(self, val, places=7):\n self.val = val\n self.places = places\n\n def __repr__(self):\n return repr(self.val)\n"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99068:FunctionDef_L17_C4", "label": "__init__", "type": "function", "loc": [17, 19], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99068:ClassDef_L16_C0", "vector": [2, 1, 0.1417, 0.0236, 1, 0.25, 0.0, 555, 0, 3, 0, 0, 0, 0, 0], "semantic": {"name": "__init__", "arg_names": ["self", "val", "places"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, val, places=7):\n self.val = val\n self.places = places"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99068:Assign_L18_C8", "label": "self.val =", "type": "assigned_variable", "loc": [18, 18], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99068:FunctionDef_L17_C4", "vector": [14, 2, 0.1417, 0.0079, 2, 0.8, 0.0, 305, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.val", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.val = val"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99068:Assign_L19_C8", "label": "self.places =", "type": "assigned_variable", "loc": [19, 19], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99068:FunctionDef_L17_C4", "vector": [14, 2, 0.1496, 0.0079, 2, 0.8, 1.0, 903, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.places", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.places = places"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99068:FunctionDef_L21_C4", "label": "__repr__", "type": "function", "loc": [21, 22], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99068:ClassDef_L16_C0", "vector": [2, 1, 0.1693, 0.0157, 1, 0.25, 0.5, 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.val)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99068:Return_L22_C8", "label": "return", "type": "return", "loc": [22, 22], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99068:FunctionDef_L21_C4", "vector": [13, 2, 0.1732, 0.0079, 2, 0.09, 0.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return repr(self.val)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99068:FunctionDef_L24_C4", "label": "__eq__", "type": "function", "loc": [24, 27], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99068:ClassDef_L16_C0", "vector": [2, 1, 0.2008, 0.0315, 1, 0.25, 1.0, 763, 0, 2, 1, 0, 0, 0, 2], "semantic": {"name": "__eq__", "arg_names": ["self", "other"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __eq__(self, other):\n if self.val == other:\n return True\n return round(abs(self.val-other), self.places) == 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99068:If_L25_C8", "label": "if", "type": "if", "loc": [25, 26], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99068:FunctionDef_L24_C4", "vector": [4, 2, 0.2008, 0.0157, 2, 0.78, 0.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self.val == other:\n return True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99068:Return_L26_C12", "label": "return", "type": "return", "loc": [26, 26], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99068:If_L25_C8", "vector": [13, 3, 0.2047, 0.0079, 3, 0.84, 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_99068:Return_L27_C8", "label": "return", "type": "return", "loc": [27, 27], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99068:FunctionDef_L24_C4", "vector": [13, 2, 0.2126, 0.0079, 2, 0.78, 1.0, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return round(abs(self.val-other), self.places) == 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99068:ClassDef_L30_C0", "label": "ContextList", "type": "class", "loc": [30, 48], "level": 0, "parent": null, "vector": [3, 0, 0.3071, 0.1496, 0, 0.66, 0.6667, 75, 0, 2, 0, 0, 430, 0, 4], "semantic": {"name": "ContextList", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class ContextList(list):\n \"\"\"A wrapper that provides direct key access to context items contained\n in a list of context objects.\n \"\"\"\n def __getitem__(self, key):\n if isinstance(key, basestring):\n for subcontext in self:\n if key in subcontext:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99068:Expr_L31_C4", "label": "expression", "type": "expression", "loc": [31, 33], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99068:ClassDef_L30_C0", "vector": [8, 1, 0.252, 0.0236, 1, 0.89, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"A wrapper that provides direct key access to context items contained\n in a list of context objects.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99068:FunctionDef_L34_C4", "label": "__getitem__", "type": "function", "loc": [34, 41], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99068:ClassDef_L30_C0", "vector": [2, 1, 0.2953, 0.063, 1, 0.89, 0.5, 698, 0, 2, 1, 0, 0, 0, 4], "semantic": {"name": "__getitem__", "arg_names": ["self", "key"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __getitem__(self, key):\n if isinstance(key, basestring):\n for subcontext in self:\n if key in subcontext:\n return subcontext[key]\n raise KeyError(key)\n else:\n return super(ContextList, self).__getitem__(key)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99068:If_L35_C8", "label": "if", "type": "if", "loc": [35, 41], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99068:FunctionDef_L34_C4", "vector": [4, 2, 0.2992, 0.0551, 2, 0.33, 0.0, 0, 3, 0, 0, 0, 0, 0, 4], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if isinstance(key, basestring):\n for subcontext in self:\n if key in subcontext:\n return subcontext[key]\n raise KeyError(key)\n else:\n return super(ContextList, self).__getitem__(key)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99068:For_L36_C12", "label": "for subcontext", "type": "for", "loc": [36, 38], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99068:If_L35_C8", "vector": [6, 3, 0.2913, 0.0236, 3, 0.62, 0.0, 785, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "subcontext", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for subcontext in self:\n if key in subcontext:\n return subcontext[key]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99068:If_L37_C16", "label": "if", "type": "if", "loc": [37, 38], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99068:For_L36_C12", "vector": [4, 4, 0.2953, 0.0157, 4, 0.66, 0.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if key in subcontext:\n return subcontext[key]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99068:Return_L38_C20", "label": "return", "type": "return", "loc": [38, 38], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99068:If_L37_C16", "vector": [13, 5, 0.2992, 0.0079, 5, 0.69, 0.0, 0, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return subcontext[key]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99068:Return_L41_C12", "label": "return", "type": "return", "loc": [41, 41], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99068:If_L35_C8", "vector": [13, 3, 0.3228, 0.0079, 3, 0.62, 1.0, 0, 3, 0, 0, 0, 0, 10, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return super(ContextList, self).__getitem__(key)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99068:FunctionDef_L43_C4", "label": "__contains__", "type": "function", "loc": [43, 48], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99068:ClassDef_L30_C0", "vector": [2, 1, 0.3583, 0.0472, 1, 0.89, 1.0, 456, 0, 2, 1, 0, 0, 0, 0], "semantic": {"name": "__contains__", "arg_names": ["self", "key"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __contains__(self, key):\n try:\n value = self[key]\n except KeyError:\n return False\n return True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99068:Try_L44_C8", "label": "try", "type": "try", "loc": [44, 47], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99068:FunctionDef_L43_C4", "vector": [7, 2, 0.3583, 0.0315, 2, 0.16, 0.0, 0, 0, 1, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " try:\n value = self[key]\n except KeyError:\n return False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99068:Assign_L45_C12", "label": "value =", "type": "assigned_variable", "loc": [45, 45], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99068:Try_L44_C8", "vector": [14, 3, 0.3543, 0.0079, 3, 0.45, 0.0, 441, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "value", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " value = self[key]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99068:Return_L47_C12", "label": "return", "type": "return", "loc": [47, 47], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99068:Try_L44_C8", "vector": [13, 3, 0.3701, 0.0079, 3, 0.45, 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_99068:Return_L48_C8", "label": "return", "type": "return", "loc": [48, 48], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99068:FunctionDef_L43_C4", "vector": [13, 2, 0.378, 0.0079, 2, 0.16, 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_99068:FunctionDef_L51_C0", "label": "instrumented_test_render", "type": "function", "loc": [51, 57], "level": 0, "parent": null, "vector": [2, 0, 0.4252, 0.0551, 0, 0.66, 0.7222, 568, 0, 2, 1, 0, 0, 0, 2], "semantic": {"name": "instrumented_test_render", "arg_names": ["self", "context"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def instrumented_test_render(self, context):\n \"\"\"\n An instrumented Template render method, providing a signal\n that can be intercepted by the test system Client\n \"\"\"\n signals.template_rendered.send(sender=self, template=self, context=context)\n return self.nodelist.render(context)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99068:Expr_L52_C4", "label": "expression", "type": "expression", "loc": [52, 55], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99068:FunctionDef_L51_C0", "vector": [8, 1, 0.4213, 0.0315, 1, 0.63, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"\n An instrumented Template render method, providing a signal\n that can be intercepted by the test system Client\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99068:Expr_L56_C4", "label": "send()", "type": "expression", "loc": [56, 56], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99068:FunctionDef_L51_C0", "vector": [8, 1, 0.4409, 0.0079, 1, 0.63, 0.5, 826, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "send", "arg_names": [], "import_names": [], "rhs_call_name": "send", "annotation": ""}, "snippet": " signals.template_rendered.send(sender=self, template=self, context=context)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99068:Return_L57_C4", "label": "return", "type": "return", "loc": [57, 57], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99068:FunctionDef_L51_C0", "vector": [13, 1, 0.4488, 0.0079, 1, 0.63, 1.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self.nodelist.render(context)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99068:FunctionDef_L60_C0", "label": "setup_test_environment", "type": "function", "loc": [60, 78], "level": 0, "parent": null, "vector": [2, 0, 0.5433, 0.1496, 0, 0.66, 0.7778, 182, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "setup_test_environment", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def setup_test_environment():\n \"\"\"Perform any global pre-test setup. This involves:\n\n - Installing the instrumented test renderer\n - Set the email backend to the locmem email backend.\n - Setting the active locale to match the LANGUAGE_CODE setting.\n \"\"\"\n Template.original_render = Template._render"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99068:Expr_L61_C4", "label": "expression", "type": "expression", "loc": [61, 66], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99068:FunctionDef_L60_C0", "vector": [8, 1, 0.5, 0.0472, 1, 0.96, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Perform any global pre-test setup. This involves:\n\n - Installing the instrumented test renderer\n - Set the email backend to the locmem email backend.\n - Setting the active locale to match the LANGUAGE_CODE setting.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99068:Assign_L67_C4", "label": "Template.original_render =", "type": "assigned_variable", "loc": [67, 67], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99068:FunctionDef_L60_C0", "vector": [14, 1, 0.5276, 0.0079, 1, 0.96, 0.125, 864, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "Template.original_render", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " Template.original_render = Template._render"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99068:Assign_L68_C4", "label": "Template._render =", "type": "assigned_variable", "loc": [68, 68], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99068:FunctionDef_L60_C0", "vector": [14, 1, 0.5354, 0.0079, 1, 0.96, 0.25, 928, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "Template._render", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " Template._render = instrumented_test_render"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99068:Assign_L70_C4", "label": "mail.original_SMTPConnection =", "type": "assigned_variable", "loc": [70, 70], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99068:FunctionDef_L60_C0", "vector": [14, 1, 0.5512, 0.0079, 1, 0.96, 0.375, 790, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "mail.original_SMTPConnection", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " mail.original_SMTPConnection = mail.SMTPConnection"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99068:Assign_L71_C4", "label": "mail.SMTPConnection =", "type": "assigned_variable", "loc": [71, 71], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99068:FunctionDef_L60_C0", "vector": [14, 1, 0.5591, 0.0079, 1, 0.96, 0.5, 466, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "mail.SMTPConnection", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " mail.SMTPConnection = locmem.EmailBackend"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99068:Assign_L73_C4", "label": "mail.original_email_backend =", "type": "assigned_variable", "loc": [73, 73], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99068:FunctionDef_L60_C0", "vector": [14, 1, 0.5748, 0.0079, 1, 0.96, 0.625, 625, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "mail.original_email_backend", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " mail.original_email_backend = settings.EMAIL_BACKEND"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99068:Assign_L74_C4", "label": "settings.EMAIL_BACKEND =", "type": "assigned_variable", "loc": [74, 74], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99068:FunctionDef_L60_C0", "vector": [14, 1, 0.5827, 0.0079, 1, 0.96, 0.75, 270, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "settings.EMAIL_BACKEND", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " settings.EMAIL_BACKEND = 'django.core.mail.backends.locmem.EmailBackend'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99068:Assign_L76_C4", "label": "mail.outbox =", "type": "assigned_variable", "loc": [76, 76], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99068:FunctionDef_L60_C0", "vector": [14, 1, 0.5984, 0.0079, 1, 0.96, 0.875, 227, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "mail.outbox", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " mail.outbox = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99068:Expr_L78_C4", "label": "deactivate()", "type": "expression", "loc": [78, 78], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99068:FunctionDef_L60_C0", "vector": [8, 1, 0.6142, 0.0079, 1, 0.96, 1.0, 499, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "deactivate", "arg_names": [], "import_names": [], "rhs_call_name": "deactivate", "annotation": ""}, "snippet": " deactivate()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99068:FunctionDef_L81_C0", "label": "teardown_test_environment", "type": "function", "loc": [81, 97], "level": 0, "parent": null, "vector": [2, 0, 0.7008, 0.1339, 0, 0.66, 0.8333, 187, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "teardown_test_environment", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def teardown_test_environment():\n \"\"\"Perform any global post-test teardown. This involves:\n\n - Restoring the original test renderer\n - Restoring the email sending functions\n\n \"\"\"\n Template._render = Template.original_render"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99068:Expr_L82_C4", "label": "expression", "type": "expression", "loc": [82, 87], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99068:FunctionDef_L81_C0", "vector": [8, 1, 0.6654, 0.0472, 1, 0.17, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Perform any global post-test teardown. This involves:\n\n - Restoring the original test renderer\n - Restoring the email sending functions\n\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99068:Assign_L88_C4", "label": "Template._render =", "type": "assigned_variable", "loc": [88, 88], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99068:FunctionDef_L81_C0", "vector": [14, 1, 0.6929, 0.0079, 1, 0.17, 0.3333, 928, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "Template._render", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " Template._render = Template.original_render"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99068:Assign_L91_C4", "label": "mail.SMTPConnection =", "type": "assigned_variable", "loc": [91, 91], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99068:FunctionDef_L81_C0", "vector": [14, 1, 0.7165, 0.0079, 1, 0.17, 0.6667, 466, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "mail.SMTPConnection", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " mail.SMTPConnection = mail.original_SMTPConnection"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99068:Assign_L94_C4", "label": "settings.EMAIL_BACKEND =", "type": "assigned_variable", "loc": [94, 94], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99068:FunctionDef_L81_C0", "vector": [14, 1, 0.7402, 0.0079, 1, 0.17, 1.0, 270, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "settings.EMAIL_BACKEND", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " settings.EMAIL_BACKEND = mail.original_email_backend"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99068:FunctionDef_L100_C0", "label": "get_warnings_state", "type": "function", "loc": [100, 107], "level": 0, "parent": null, "vector": [2, 0, 0.815, 0.063, 0, 0.66, 0.8889, 629, 0, 0, 1, 0, 0, 0, 0], "semantic": {"name": "get_warnings_state", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def get_warnings_state():\n \"\"\"\n Returns an object containing the state of the warnings module\n \"\"\"\n # There is no public interface for doing this, but this implementation of\n # get_warnings_state and restore_warnings_state appears to work on Python\n # 2.4 to 2.7.\n return warnings.filters[:]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99068:Expr_L101_C4", "label": "expression", "type": "expression", "loc": [101, 103], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99068:FunctionDef_L100_C0", "vector": [8, 1, 0.8031, 0.0236, 1, 0.16, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"\n Returns an object containing the state of the warnings module\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99068:Return_L107_C4", "label": "return", "type": "return", "loc": [107, 107], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99068:FunctionDef_L100_C0", "vector": [13, 1, 0.8425, 0.0079, 1, 0.16, 1.0, 0, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return warnings.filters[:]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99068:FunctionDef_L110_C0", "label": "restore_warnings_state", "type": "function", "loc": [110, 115], "level": 0, "parent": null, "vector": [2, 0, 0.8858, 0.0472, 0, 0.66, 0.9444, 473, 0, 1, 0, 0, 0, 0, 0], "semantic": {"name": "restore_warnings_state", "arg_names": ["state"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def restore_warnings_state(state):\n \"\"\"\n Restores the state of the warnings module when passed an object that was\n returned by get_warnings_state()\n \"\"\"\n warnings.filters = state[:]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99068:Expr_L111_C4", "label": "expression", "type": "expression", "loc": [111, 114], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99068:FunctionDef_L110_C0", "vector": [8, 1, 0.8858, 0.0315, 1, 0.64, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"\n Restores the state of the warnings module when passed an object that was\n returned by get_warnings_state()\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99068:Assign_L115_C4", "label": "warnings.filters =", "type": "assigned_variable", "loc": [115, 115], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99068:FunctionDef_L110_C0", "vector": [14, 1, 0.9055, 0.0079, 1, 0.64, 1.0, 386, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "warnings.filters", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " warnings.filters = state[:]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99068:FunctionDef_L118_C0", "label": "get_runner", "type": "function", "loc": [118, 127], "level": 0, "parent": null, "vector": [2, 0, 0.9646, 0.0787, 0, 0.66, 1.0, 122, 0, 1, 1, 0, 0, 0, 5], "semantic": {"name": "get_runner", "arg_names": ["settings"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def get_runner(settings):\n test_path = settings.TEST_RUNNER.split('.')\n # Allow for Python 2.5 relative paths\n if len(test_path) > 1:\n test_module_name = '.'.join(test_path[:-1])\n else:\n test_module_name = '.'\n test_module = __import__(test_module_name, {}, {}, test_path[-1])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99068:Assign_L119_C4", "label": "test_path = split()", "type": "assigned_variable", "loc": [119, 119], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99068:FunctionDef_L118_C0", "vector": [14, 1, 0.937, 0.0079, 1, 0.43, 0.0, 643, 3, 1, 0, 0, 908, 10, 1], "semantic": {"name": "test_path", "arg_names": [], "import_names": [], "rhs_call_name": "split", "annotation": ""}, "snippet": " test_path = settings.TEST_RUNNER.split('.')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99068:If_L121_C4", "label": "if", "type": "if", "loc": [121, 124], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99068:FunctionDef_L118_C0", "vector": [4, 1, 0.9646, 0.0315, 1, 0.43, 0.25, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if len(test_path) > 1:\n test_module_name = '.'.join(test_path[:-1])\n else:\n test_module_name = '.'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99068:Assign_L122_C8", "label": "test_module_name = join()", "type": "assigned_variable", "loc": [122, 122], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99068:If_L121_C4", "vector": [14, 2, 0.9606, 0.0079, 2, 0.35, 0.0, 325, 3, 1, 0, 0, 933, 10, 1], "semantic": {"name": "test_module_name", "arg_names": [], "import_names": [], "rhs_call_name": "join", "annotation": ""}, "snippet": " test_module_name = '.'.join(test_path[:-1])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99068:Assign_L124_C8", "label": "test_module_name =", "type": "assigned_variable", "loc": [124, 124], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99068:If_L121_C4", "vector": [14, 2, 0.9764, 0.0079, 2, 0.35, 1.0, 325, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "test_module_name", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " test_module_name = '.'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99068:Assign_L125_C4", "label": "test_module = __import__()", "type": "assigned_variable", "loc": [125, 125], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99068:FunctionDef_L118_C0", "vector": [14, 1, 0.9843, 0.0079, 1, 0.43, 0.5, 56, 3, 4, 0, 0, 744, 10, 1], "semantic": {"name": "test_module", "arg_names": [], "import_names": [], "rhs_call_name": "__import__", "annotation": ""}, "snippet": " test_module = __import__(test_module_name, {}, {}, test_path[-1])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99068:Assign_L126_C4", "label": "test_runner = getattr()", "type": "assigned_variable", "loc": [126, 126], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99068:FunctionDef_L118_C0", "vector": [14, 1, 0.9921, 0.0079, 1, 0.43, 0.75, 530, 3, 2, 0, 0, 121, 10, 1], "semantic": {"name": "test_runner", "arg_names": [], "import_names": [], "rhs_call_name": "getattr", "annotation": ""}, "snippet": " test_runner = getattr(test_module, test_path[-1])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99068:Return_L127_C4", "label": "return", "type": "return", "loc": [127, 127], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99068:FunctionDef_L118_C0", "vector": [13, 1, 1.0, 0.0079, 1, 0.43, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return test_runner"}]
[{"f": "ajibawa-2023/Python-Code-Large/train/row_99068:ClassDef_L16_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99068:FunctionDef_L17_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99068:FunctionDef_L17_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99068:Assign_L18_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99068:FunctionDef_L17_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99068:Assign_L19_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99068:ClassDef_L16_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99068:FunctionDef_L21_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99068:FunctionDef_L21_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99068:Return_L22_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99068:ClassDef_L16_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99068:FunctionDef_L24_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99068:FunctionDef_L24_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99068:If_L25_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99068:If_L25_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99068:Return_L26_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99068:FunctionDef_L24_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99068:Return_L27_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99068:ClassDef_L30_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99068:Expr_L31_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99068:ClassDef_L30_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99068:FunctionDef_L34_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99068:FunctionDef_L34_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99068:If_L35_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99068:If_L35_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99068:For_L36_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99068:For_L36_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99068:If_L37_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99068:If_L37_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99068:Return_L38_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99068:If_L35_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99068:Return_L41_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99068:ClassDef_L30_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99068:FunctionDef_L43_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99068:FunctionDef_L43_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99068:Try_L44_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99068:Try_L44_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99068:Assign_L45_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99068:Try_L44_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99068:Return_L47_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99068:FunctionDef_L43_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99068:Return_L48_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99068:FunctionDef_L51_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99068:Expr_L52_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99068:FunctionDef_L51_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99068:Expr_L56_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99068:FunctionDef_L51_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99068:Return_L57_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99068:FunctionDef_L60_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99068:Expr_L61_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99068:FunctionDef_L60_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99068:Assign_L67_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99068:FunctionDef_L60_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99068:Assign_L68_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99068:FunctionDef_L60_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99068:Assign_L70_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99068:FunctionDef_L60_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99068:Assign_L71_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99068:FunctionDef_L60_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99068:Assign_L73_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99068:FunctionDef_L60_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99068:Assign_L74_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99068:FunctionDef_L60_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99068:Assign_L76_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99068:FunctionDef_L60_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99068:Expr_L78_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99068:FunctionDef_L81_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99068:Expr_L82_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99068:FunctionDef_L81_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99068:Assign_L88_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99068:FunctionDef_L81_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99068:Assign_L91_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99068:FunctionDef_L81_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99068:Assign_L94_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99068:FunctionDef_L100_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99068:Expr_L101_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99068:FunctionDef_L100_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99068:Return_L107_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99068:FunctionDef_L110_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99068:Expr_L111_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99068:FunctionDef_L110_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99068:Assign_L115_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99068:FunctionDef_L118_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99068:Assign_L119_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99068:FunctionDef_L118_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99068:If_L121_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99068:If_L121_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99068:Assign_L122_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99068:If_L121_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99068:Assign_L124_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99068:FunctionDef_L118_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99068:Assign_L125_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99068:FunctionDef_L118_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99068:Assign_L126_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99068:FunctionDef_L118_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99068:Return_L127_C4"}]
""" Django Unit Test and Doctest framework. """ from django.test.client import Client, RequestFactory from django.test.testcases import TestCase, TransactionTestCase, skipIfDBFeature, skipUnlessDBFeature from django.test.utils import Approximate
ajibawa-2023/Python-Code-Large/train/row_99069
4
7
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_99069:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 3], "level": 0, "parent": null, "vector": [8, 0, 0.2857, 0.4286, 0, 0.66, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\"\"\"\nDjango Unit Test and Doctest framework.\n\"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99069:ImportFrom_L5_C0", "label": "from django.test.client import Client, RequestFactory", "type": "import", "loc": [5, 5], "level": 0, "parent": null, "vector": [1, 0, 0.7143, 0.1429, 0, 0.66, 0.3333, 479, 0, 2, 0, 0, 479, 0, 0], "semantic": {"name": "django.test.client", "arg_names": [], "import_names": ["Client", "RequestFactory"], "rhs_call_name": "", "annotation": ""}, "snippet": "from django.test.client import Client, RequestFactory"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99069:ImportFrom_L6_C0", "label": "from django.test.testcases import TestCase, TransactionTestCase, skipIfDBFeature\u2026", "type": "import", "loc": [6, 6], "level": 0, "parent": null, "vector": [1, 0, 0.8571, 0.1429, 0, 0.66, 0.6667, 373, 0, 4, 0, 0, 373, 0, 0], "semantic": {"name": "django.test.testcases", "arg_names": [], "import_names": ["TestCase", "TransactionTestCase", "skipIfDBFeature", "skipUnlessDBFeature"], "rhs_call_name": "", "annotation": ""}, "snippet": "from django.test.testcases import TestCase, TransactionTestCase, skipIfDBFeature, skipUnlessDBFeature"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99069:ImportFrom_L7_C0", "label": "from django.test.utils import Approximate", "type": "import", "loc": [7, 7], "level": 0, "parent": null, "vector": [1, 0, 1.0, 0.1429, 0, 0.66, 1.0, 768, 0, 1, 0, 0, 768, 0, 0], "semantic": {"name": "django.test.utils", "arg_names": [], "import_names": ["Approximate"], "rhs_call_name": "", "annotation": ""}, "snippet": "from django.test.utils import Approximate"}]
[]
#!/usr/bin/python # # Copyright (C) 2012 Google Inc. # # 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. __author__ = 'afshar@google.com (Ali Afshar)' import os import httplib2 import sessions from google.appengine.ext import db from google.appengine.ext.webapp import template from apiclient.discovery import build_from_document from apiclient.http import MediaUpload from oauth2client import client from oauth2client.appengine import CredentialsProperty from oauth2client.appengine import StorageByKeyName from oauth2client.appengine import simplejson as json APIS_BASE = 'https://www.googleapis.com' ALL_SCOPES = ('https://www.googleapis.com/auth/drive.file ' 'https://www.googleapis.com/auth/userinfo.email ' 'https://www.googleapis.com/auth/userinfo.profile') CODE_PARAMETER = 'code' STATE_PARAMETER = 'state' SESSION_SECRET = open('session.secret').read() DRIVE_DISCOVERY_DOC = open('drive.json').read() USERS_DISCOVERY_DOC = open('users.json').read() class Credentials(db.Model): """Datastore entity for storing OAuth2.0 credentials.""" credentials = CredentialsProperty() def CreateOAuthFlow(request): """Create OAuth2.0 flow controller Args: request: HTTP request to create OAuth2.0 flow for Returns: OAuth2.0 Flow instance suitable for performing OAuth2.0. """ flow = client.flow_from_clientsecrets('client-debug.json', scope='') flow.redirect_uri = request.url.split('?', 1)[0].rstrip('/') return flow def GetCodeCredentials(request): """Create OAuth2.0 credentials by extracting a code and performing OAuth2.0. Args: request: HTTP request used for extracting an authorization code. Returns: OAuth2.0 credentials suitable for authorizing clients. """ code = request.get(CODE_PARAMETER) if code: oauth_flow = CreateOAuthFlow(request) creds = oauth_flow.step2_exchange(code) users_service = CreateService(USERS_DISCOVERY_DOC, creds) userid = users_service.userinfo().get().execute().get('id') request.session.set_secure_cookie(name='userid', value=userid) StorageByKeyName(Credentials, userid, 'credentials').put(creds) return creds def GetSessionCredentials(request): """Get OAuth2.0 credentials for an HTTP session. Args: request: HTTP request to use session from. Returns: OAuth2.0 credentials suitable for authorizing clients. """ userid = request.session.get_secure_cookie(name='userid') if userid: creds = StorageByKeyName(Credentials, userid, 'credentials').get() if creds and not creds.invalid: return creds def CreateService(discovery_doc, creds): """Create a Google API service. Args: discovery_doc: Discovery doc used to configure service. creds: Credentials used to authorize service. Returns: Authorized Google API service. """ http = httplib2.Http() creds.authorize(http) return build_from_document(discovery_doc, APIS_BASE, http=http) def RedirectAuth(handler): """Redirect a handler to an authorization page. Args: handler: webapp.RequestHandler to redirect. """ flow = CreateOAuthFlow(handler.request) flow.scope = ALL_SCOPES uri = flow.step1_get_authorize_url(flow.redirect_uri) handler.redirect(uri) def CreateDrive(handler): """Create a fully authorized drive service for this handler. Args: handler: RequestHandler from which drive service is generated. Returns: Authorized drive service, generated from the handler request. """ request = handler.request request.session = sessions.LilCookies(handler, SESSION_SECRET) creds = GetCodeCredentials(request) or GetSessionCredentials(request) if creds: return CreateService(DRIVE_DISCOVERY_DOC, creds) else: RedirectAuth(handler) def ServiceEnabled(view): """Decorator to inject an authorized service into an HTTP handler. Args: view: HTTP request handler method. Returns: Decorated handler which accepts the service as a parameter. """ def ServiceDecoratedView(handler, view=view): service = CreateDrive(handler) response_data = view(handler, service) handler.response.headers['Content-Type'] = 'text/html' handler.response.out.write(response_data) return ServiceDecoratedView def ServiceEnabledJson(view): """Decorator to inject an authorized service into a JSON HTTP handler. Args: view: HTTP request handler method. Returns: Decorated handler which accepts the service as a parameter. """ def ServiceDecoratedView(handler, view=view): service = CreateDrive(handler) if handler.request.body: data = json.loads(handler.request.body) else: data = None response_data = json.dumps(view(handler, service, data)) handler.response.headers['Content-Type'] = 'application/json' handler.response.out.write(response_data) return ServiceDecoratedView class DriveState(object): """Store state provided by Drive.""" def __init__(self, state): self.ParseState(state) @classmethod def FromRequest(cls, request): """Create a Drive State instance from an HTTP request. Args: cls: Type this class method is called against. request: HTTP request. """ return DriveState(request.get(STATE_PARAMETER)) def ParseState(self, state): """Parse a state parameter and set internal values. Args: state: State parameter to parse. """ if state.startswith('{'): self.ParseJsonState(state) else: self.ParsePlainState(state) def ParseJsonState(self, state): """Parse a state parameter that is JSON. Args: state: State parameter to parse """ state_data = json.loads(state) self.action = state_data['action'] self.ids = map(str, state_data.get('ids', [])) def ParsePlainState(self, state): """Parse a state parameter that is a plain resource id or missing. Args: state: State parameter to parse """ if state: self.action = 'open' self.ids = [state] else: self.action = 'create' self.ids = [] class MediaInMemoryUpload(MediaUpload): """MediaUpload for a chunk of bytes. Construct a MediaFileUpload and pass as the media_body parameter of the method. For example, if we had a service that allowed plain text: """ def __init__(self, body, mimetype='application/octet-stream', chunksize=256*1024, resumable=False): """Create a new MediaBytesUpload. Args: body: string, Bytes of body content. mimetype: string, Mime-type of the file or default of 'application/octet-stream'. chunksize: int, File will be uploaded in chunks of this many bytes. Only used if resumable=True. resumable: bool, True if this is a resumable upload. False means upload in a single request. """ self._body = body self._mimetype = mimetype self._resumable = resumable self._chunksize = chunksize def chunksize(self): """Chunk size for resumable uploads. Returns: Chunk size in bytes. """ return self._chunksize def mimetype(self): """Mime type of the body. Returns: Mime type. """ return self._mimetype def size(self): """Size of upload. Returns: Size of the body. """ return len(self._body) def resumable(self): """Whether this upload is resumable. Returns: True if resumable upload or False. """ return self._resumable def getbytes(self, begin, length): """Get bytes from the media. Args: begin: int, offset from beginning of file. length: int, number of bytes to read, starting at begin. Returns: A string of bytes read. May be shorter than length if EOF was reached first. """ return self._body[begin:begin + length] def RenderTemplate(name, **context): """Render a named template in a context. Args: name: Template name. context: Keyword arguments to render as template variables. """ return template.render(name, context)
ajibawa-2023/Python-Code-Large/train/row_99070
133
305
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_99070:Assign_L17_C0", "label": "__author__ =", "type": "assigned_variable", "loc": [17, 17], "level": 0, "parent": null, "vector": [14, 0, 0.0557, 0.0033, 0, 0.66, 0.0, 777, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "__author__", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "__author__ = 'afshar@google.com (Ali Afshar)'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99070:Import_L21_C0", "label": "os import os", "type": "import", "loc": [21, 21], "level": 0, "parent": null, "vector": [1, 0, 0.0689, 0.0033, 0, 0.66, 0.0333, 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_99070:Import_L22_C0", "label": "httplib2 import httplib2", "type": "import", "loc": [22, 22], "level": 0, "parent": null, "vector": [1, 0, 0.0721, 0.0033, 0, 0.66, 0.0667, 273, 0, 1, 0, 0, 273, 0, 0], "semantic": {"name": "httplib2", "arg_names": [], "import_names": ["httplib2"], "rhs_call_name": "", "annotation": ""}, "snippet": "import httplib2"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99070:Import_L23_C0", "label": "sessions import sessions", "type": "import", "loc": [23, 23], "level": 0, "parent": null, "vector": [1, 0, 0.0754, 0.0033, 0, 0.66, 0.1, 787, 0, 1, 0, 0, 787, 0, 0], "semantic": {"name": "sessions", "arg_names": [], "import_names": ["sessions"], "rhs_call_name": "", "annotation": ""}, "snippet": "import sessions"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99070:ImportFrom_L24_C0", "label": "from google.appengine.ext import db", "type": "import", "loc": [24, 24], "level": 0, "parent": null, "vector": [1, 0, 0.0787, 0.0033, 0, 0.66, 0.1333, 167, 0, 1, 0, 0, 167, 0, 0], "semantic": {"name": "google.appengine.ext", "arg_names": [], "import_names": ["db"], "rhs_call_name": "", "annotation": ""}, "snippet": "from google.appengine.ext import db"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99070:ImportFrom_L25_C0", "label": "from google.appengine.ext.webapp import template", "type": "import", "loc": [25, 25], "level": 0, "parent": null, "vector": [1, 0, 0.082, 0.0033, 0, 0.66, 0.1667, 8, 0, 1, 0, 0, 8, 0, 0], "semantic": {"name": "google.appengine.ext.webapp", "arg_names": [], "import_names": ["template"], "rhs_call_name": "", "annotation": ""}, "snippet": "from google.appengine.ext.webapp import template"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99070:ImportFrom_L26_C0", "label": "from apiclient.discovery import build_from_document", "type": "import", "loc": [26, 26], "level": 0, "parent": null, "vector": [1, 0, 0.0852, 0.0033, 0, 0.66, 0.2, 78, 0, 1, 0, 0, 78, 0, 0], "semantic": {"name": "apiclient.discovery", "arg_names": [], "import_names": ["build_from_document"], "rhs_call_name": "", "annotation": ""}, "snippet": "from apiclient.discovery import build_from_document"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99070:ImportFrom_L27_C0", "label": "from apiclient.http import MediaUpload", "type": "import", "loc": [27, 27], "level": 0, "parent": null, "vector": [1, 0, 0.0885, 0.0033, 0, 0.66, 0.2333, 670, 0, 1, 0, 0, 670, 0, 0], "semantic": {"name": "apiclient.http", "arg_names": [], "import_names": ["MediaUpload"], "rhs_call_name": "", "annotation": ""}, "snippet": "from apiclient.http import MediaUpload"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99070:ImportFrom_L28_C0", "label": "from oauth2client import client", "type": "import", "loc": [28, 28], "level": 0, "parent": null, "vector": [1, 0, 0.0918, 0.0033, 0, 0.66, 0.2667, 90, 0, 1, 0, 0, 90, 0, 0], "semantic": {"name": "oauth2client", "arg_names": [], "import_names": ["client"], "rhs_call_name": "", "annotation": ""}, "snippet": "from oauth2client import client"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99070:ImportFrom_L29_C0", "label": "from oauth2client.appengine import CredentialsProperty", "type": "import", "loc": [29, 29], "level": 0, "parent": null, "vector": [1, 0, 0.0951, 0.0033, 0, 0.66, 0.3, 953, 0, 1, 0, 0, 953, 0, 0], "semantic": {"name": "oauth2client.appengine", "arg_names": [], "import_names": ["CredentialsProperty"], "rhs_call_name": "", "annotation": ""}, "snippet": "from oauth2client.appengine import CredentialsProperty"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99070:ImportFrom_L30_C0", "label": "from oauth2client.appengine import StorageByKeyName", "type": "import", "loc": [30, 30], "level": 0, "parent": null, "vector": [1, 0, 0.0984, 0.0033, 0, 0.66, 0.3333, 953, 0, 1, 0, 0, 953, 0, 0], "semantic": {"name": "oauth2client.appengine", "arg_names": [], "import_names": ["StorageByKeyName"], "rhs_call_name": "", "annotation": ""}, "snippet": "from oauth2client.appengine import StorageByKeyName"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99070:ImportFrom_L31_C0", "label": "from oauth2client.appengine import json", "type": "import", "loc": [31, 31], "level": 0, "parent": null, "vector": [1, 0, 0.1016, 0.0033, 0, 0.66, 0.3667, 953, 0, 1, 0, 0, 953, 0, 0], "semantic": {"name": "oauth2client.appengine", "arg_names": [], "import_names": ["json"], "rhs_call_name": "", "annotation": ""}, "snippet": "from oauth2client.appengine import simplejson as json"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99070:Assign_L34_C0", "label": "APIS_BASE =", "type": "assigned_variable", "loc": [34, 34], "level": 0, "parent": null, "vector": [14, 0, 0.1115, 0.0033, 0, 0.66, 0.4, 209, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "APIS_BASE", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "APIS_BASE = 'https://www.googleapis.com'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99070:Assign_L35_C0", "label": "ALL_SCOPES =", "type": "assigned_variable", "loc": [35, 37], "level": 0, "parent": null, "vector": [14, 0, 0.118, 0.0098, 0, 0.66, 0.4333, 422, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "ALL_SCOPES", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "ALL_SCOPES = ('https://www.googleapis.com/auth/drive.file '\n 'https://www.googleapis.com/auth/userinfo.email '\n 'https://www.googleapis.com/auth/userinfo.profile')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99070:Assign_L38_C0", "label": "CODE_PARAMETER =", "type": "assigned_variable", "loc": [38, 38], "level": 0, "parent": null, "vector": [14, 0, 0.1246, 0.0033, 0, 0.66, 0.4667, 689, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "CODE_PARAMETER", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "CODE_PARAMETER = 'code'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99070:Assign_L39_C0", "label": "STATE_PARAMETER =", "type": "assigned_variable", "loc": [39, 39], "level": 0, "parent": null, "vector": [14, 0, 0.1279, 0.0033, 0, 0.66, 0.5, 433, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "STATE_PARAMETER", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "STATE_PARAMETER = 'state'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99070:Assign_L40_C0", "label": "SESSION_SECRET = read()", "type": "assigned_variable", "loc": [40, 40], "level": 0, "parent": null, "vector": [14, 0, 0.1311, 0.0033, 0, 0.66, 0.5333, 330, 3, 0, 0, 0, 453, 10, 2], "semantic": {"name": "SESSION_SECRET", "arg_names": [], "import_names": [], "rhs_call_name": "read", "annotation": ""}, "snippet": "SESSION_SECRET = open('session.secret').read()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99070:Assign_L41_C0", "label": "DRIVE_DISCOVERY_DOC = read()", "type": "assigned_variable", "loc": [41, 41], "level": 0, "parent": null, "vector": [14, 0, 0.1344, 0.0033, 0, 0.66, 0.5667, 873, 3, 0, 0, 0, 453, 10, 2], "semantic": {"name": "DRIVE_DISCOVERY_DOC", "arg_names": [], "import_names": [], "rhs_call_name": "read", "annotation": ""}, "snippet": "DRIVE_DISCOVERY_DOC = open('drive.json').read()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99070:Assign_L42_C0", "label": "USERS_DISCOVERY_DOC = read()", "type": "assigned_variable", "loc": [42, 42], "level": 0, "parent": null, "vector": [14, 0, 0.1377, 0.0033, 0, 0.66, 0.6, 375, 3, 0, 0, 0, 453, 10, 2], "semantic": {"name": "USERS_DISCOVERY_DOC", "arg_names": [], "import_names": [], "rhs_call_name": "read", "annotation": ""}, "snippet": "USERS_DISCOVERY_DOC = open('users.json').read()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99070:ClassDef_L45_C0", "label": "Credentials", "type": "class", "loc": [45, 47], "level": 0, "parent": null, "vector": [3, 0, 0.1508, 0.0098, 0, 0.66, 0.6333, 309, 0, 0, 0, 0, 697, 0, 1], "semantic": {"name": "Credentials", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class Credentials(db.Model):\n \"\"\"Datastore entity for storing OAuth2.0 credentials.\"\"\"\n credentials = CredentialsProperty()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99070:Expr_L46_C2", "label": "expression", "type": "expression", "loc": [46, 46], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99070:ClassDef_L45_C0", "vector": [8, 1, 0.1508, 0.0033, 1, 0.89, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Datastore entity for storing OAuth2.0 credentials.\"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99070:Assign_L47_C2", "label": "credentials = CredentialsProperty()", "type": "assigned_variable", "loc": [47, 47], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99070:ClassDef_L45_C0", "vector": [14, 1, 0.1541, 0.0033, 1, 0.89, 1.0, 198, 3, 0, 0, 0, 135, 10, 1], "semantic": {"name": "credentials", "arg_names": [], "import_names": [], "rhs_call_name": "CredentialsProperty", "annotation": ""}, "snippet": " credentials = CredentialsProperty()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99070:FunctionDef_L50_C0", "label": "CreateOAuthFlow", "type": "function", "loc": [50, 60], "level": 0, "parent": null, "vector": [2, 0, 0.1803, 0.0361, 0, 0.66, 0.6667, 672, 0, 1, 1, 0, 0, 0, 3], "semantic": {"name": "CreateOAuthFlow", "arg_names": ["request"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def CreateOAuthFlow(request):\n \"\"\"Create OAuth2.0 flow controller\n\n Args:\n request: HTTP request to create OAuth2.0 flow for\n Returns:\n OAuth2.0 Flow instance suitable for performing OAuth2.0.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99070:Expr_L51_C2", "label": "expression", "type": "expression", "loc": [51, 57], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99070:FunctionDef_L50_C0", "vector": [8, 1, 0.177, 0.023, 1, 0.73, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Create OAuth2.0 flow controller\n\n Args:\n request: HTTP request to create OAuth2.0 flow for\n Returns:\n OAuth2.0 Flow instance suitable for performing OAuth2.0.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99070:Assign_L58_C2", "label": "flow = flow_from_clientsecrets()", "type": "assigned_variable", "loc": [58, 58], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99070:FunctionDef_L50_C0", "vector": [14, 1, 0.1902, 0.0033, 1, 0.73, 0.3333, 258, 3, 2, 0, 0, 355, 10, 1], "semantic": {"name": "flow", "arg_names": [], "import_names": [], "rhs_call_name": "flow_from_clientsecrets", "annotation": ""}, "snippet": " flow = client.flow_from_clientsecrets('client-debug.json', scope='')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99070:Assign_L59_C2", "label": "flow.redirect_uri = rstrip()", "type": "assigned_variable", "loc": [59, 59], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99070:FunctionDef_L50_C0", "vector": [14, 1, 0.1934, 0.0033, 1, 0.73, 0.6667, 890, 3, 1, 0, 0, 807, 10, 2], "semantic": {"name": "flow.redirect_uri", "arg_names": [], "import_names": [], "rhs_call_name": "rstrip", "annotation": ""}, "snippet": " flow.redirect_uri = request.url.split('?', 1)[0].rstrip('/')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99070:Return_L60_C2", "label": "return", "type": "return", "loc": [60, 60], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99070:FunctionDef_L50_C0", "vector": [13, 1, 0.1967, 0.0033, 1, 0.73, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return flow"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99070:FunctionDef_L63_C0", "label": "GetCodeCredentials", "type": "function", "loc": [63, 79], "level": 0, "parent": null, "vector": [2, 0, 0.2328, 0.0557, 0, 0.66, 0.7, 113, 0, 1, 1, 0, 0, 0, 11], "semantic": {"name": "GetCodeCredentials", "arg_names": ["request"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def GetCodeCredentials(request):\n \"\"\"Create OAuth2.0 credentials by extracting a code and performing OAuth2.0.\n\n Args:\n request: HTTP request used for extracting an authorization code.\n Returns:\n OAuth2.0 credentials suitable for authorizing clients.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99070:Expr_L64_C2", "label": "expression", "type": "expression", "loc": [64, 70], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99070:FunctionDef_L63_C0", "vector": [8, 1, 0.2197, 0.023, 1, 0.74, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Create OAuth2.0 credentials by extracting a code and performing OAuth2.0.\n\n Args:\n request: HTTP request used for extracting an authorization code.\n Returns:\n OAuth2.0 credentials suitable for authorizing clients.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99070:Assign_L71_C2", "label": "code = get()", "type": "assigned_variable", "loc": [71, 71], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99070:FunctionDef_L63_C0", "vector": [14, 1, 0.2328, 0.0033, 1, 0.74, 0.5, 44, 3, 1, 0, 0, 607, 10, 1], "semantic": {"name": "code", "arg_names": [], "import_names": [], "rhs_call_name": "get", "annotation": ""}, "snippet": " code = request.get(CODE_PARAMETER)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99070:If_L72_C2", "label": "if", "type": "if", "loc": [72, 79], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99070:FunctionDef_L63_C0", "vector": [4, 1, 0.2475, 0.0262, 1, 0.74, 1.0, 0, 2, 0, 0, 0, 0, 0, 10], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if code:\n oauth_flow = CreateOAuthFlow(request)\n creds = oauth_flow.step2_exchange(code)\n users_service = CreateService(USERS_DISCOVERY_DOC, creds)\n userid = users_service.userinfo().get().execute().get('id')\n request.session.set_secure_cookie(name='userid', value=userid)\n StorageByKeyName(Credentials, userid, 'credentials').put(creds)\n return creds"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99070:Assign_L73_C4", "label": "oauth_flow = CreateOAuthFlow()", "type": "assigned_variable", "loc": [73, 73], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99070:If_L72_C2", "vector": [14, 2, 0.2393, 0.0033, 2, 0.45, 0.0, 725, 3, 1, 0, 0, 672, 10, 1], "semantic": {"name": "oauth_flow", "arg_names": [], "import_names": [], "rhs_call_name": "CreateOAuthFlow", "annotation": ""}, "snippet": " oauth_flow = CreateOAuthFlow(request)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99070:Assign_L74_C4", "label": "creds = step2_exchange()", "type": "assigned_variable", "loc": [74, 74], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99070:If_L72_C2", "vector": [14, 2, 0.2426, 0.0033, 2, 0.45, 0.1667, 394, 3, 1, 0, 0, 471, 10, 1], "semantic": {"name": "creds", "arg_names": [], "import_names": [], "rhs_call_name": "step2_exchange", "annotation": ""}, "snippet": " creds = oauth_flow.step2_exchange(code)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99070:Assign_L75_C4", "label": "users_service = CreateService()", "type": "assigned_variable", "loc": [75, 75], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99070:If_L72_C2", "vector": [14, 2, 0.2459, 0.0033, 2, 0.45, 0.3333, 630, 3, 2, 0, 0, 493, 10, 1], "semantic": {"name": "users_service", "arg_names": [], "import_names": [], "rhs_call_name": "CreateService", "annotation": ""}, "snippet": " users_service = CreateService(USERS_DISCOVERY_DOC, creds)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99070:Assign_L76_C4", "label": "userid = get()", "type": "assigned_variable", "loc": [76, 76], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99070:If_L72_C2", "vector": [14, 2, 0.2492, 0.0033, 2, 0.45, 0.5, 403, 3, 1, 0, 0, 607, 10, 4], "semantic": {"name": "userid", "arg_names": [], "import_names": [], "rhs_call_name": "get", "annotation": ""}, "snippet": " userid = users_service.userinfo().get().execute().get('id')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99070:Expr_L77_C4", "label": "set_secure_cookie()", "type": "expression", "loc": [77, 77], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99070:If_L72_C2", "vector": [8, 2, 0.2525, 0.0033, 2, 0.45, 0.6667, 330, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "set_secure_cookie", "arg_names": [], "import_names": [], "rhs_call_name": "set_secure_cookie", "annotation": ""}, "snippet": " request.session.set_secure_cookie(name='userid', value=userid)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99070:Expr_L78_C4", "label": "put()", "type": "expression", "loc": [78, 78], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99070:If_L72_C2", "vector": [8, 2, 0.2557, 0.0033, 2, 0.45, 0.8333, 636, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "put", "arg_names": [], "import_names": [], "rhs_call_name": "put", "annotation": ""}, "snippet": " StorageByKeyName(Credentials, userid, 'credentials').put(creds)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99070:Return_L79_C4", "label": "return", "type": "return", "loc": [79, 79], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99070:If_L72_C2", "vector": [13, 2, 0.259, 0.0033, 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 creds"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99070:FunctionDef_L82_C0", "label": "GetSessionCredentials", "type": "function", "loc": [82, 94], "level": 0, "parent": null, "vector": [2, 0, 0.2885, 0.0426, 0, 0.66, 0.7333, 208, 0, 1, 1, 0, 0, 0, 3], "semantic": {"name": "GetSessionCredentials", "arg_names": ["request"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def GetSessionCredentials(request):\n \"\"\"Get OAuth2.0 credentials for an HTTP session.\n\n Args:\n request: HTTP request to use session from.\n Returns:\n OAuth2.0 credentials suitable for authorizing clients.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99070:Expr_L83_C2", "label": "expression", "type": "expression", "loc": [83, 89], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99070:FunctionDef_L82_C0", "vector": [8, 1, 0.282, 0.023, 1, 0.27, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Get OAuth2.0 credentials for an HTTP session.\n\n Args:\n request: HTTP request to use session from.\n Returns:\n OAuth2.0 credentials suitable for authorizing clients.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99070:Assign_L90_C2", "label": "userid = get_secure_cookie()", "type": "assigned_variable", "loc": [90, 90], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99070:FunctionDef_L82_C0", "vector": [14, 1, 0.2951, 0.0033, 1, 0.27, 0.5, 403, 3, 1, 0, 0, 71, 10, 1], "semantic": {"name": "userid", "arg_names": [], "import_names": [], "rhs_call_name": "get_secure_cookie", "annotation": ""}, "snippet": " userid = request.session.get_secure_cookie(name='userid')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99070:If_L91_C2", "label": "if", "type": "if", "loc": [91, 94], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99070:FunctionDef_L82_C0", "vector": [4, 1, 0.3033, 0.0131, 1, 0.27, 1.0, 0, 2, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if userid:\n creds = StorageByKeyName(Credentials, userid, 'credentials').get()\n if creds and not creds.invalid:\n return creds"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99070:Assign_L92_C4", "label": "creds = get()", "type": "assigned_variable", "loc": [92, 92], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99070:If_L91_C2", "vector": [14, 2, 0.3016, 0.0033, 2, 0.78, 0.0, 394, 3, 0, 0, 0, 607, 10, 2], "semantic": {"name": "creds", "arg_names": [], "import_names": [], "rhs_call_name": "get", "annotation": ""}, "snippet": " creds = StorageByKeyName(Credentials, userid, 'credentials').get()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99070:If_L93_C4", "label": "if", "type": "if", "loc": [93, 94], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99070:If_L91_C2", "vector": [4, 2, 0.3066, 0.0066, 2, 0.78, 1.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if creds and not creds.invalid:\n return creds"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99070:Return_L94_C6", "label": "return", "type": "return", "loc": [94, 94], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99070:If_L93_C4", "vector": [13, 3, 0.3082, 0.0033, 3, 0.32, 0.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return creds"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99070:FunctionDef_L97_C0", "label": "CreateService", "type": "function", "loc": [97, 108], "level": 0, "parent": null, "vector": [2, 0, 0.3361, 0.0393, 0, 0.66, 0.7667, 493, 0, 2, 1, 0, 0, 0, 3], "semantic": {"name": "CreateService", "arg_names": ["discovery_doc", "creds"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def CreateService(discovery_doc, creds):\n \"\"\"Create a Google API service.\n\n Args:\n discovery_doc: Discovery doc used to configure service.\n creds: Credentials used to authorize service.\n Returns:\n Authorized Google API service."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99070:Expr_L98_C2", "label": "expression", "type": "expression", "loc": [98, 105], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99070:FunctionDef_L97_C0", "vector": [8, 1, 0.3328, 0.0262, 1, 0.02, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Create a Google API service.\n\n Args:\n discovery_doc: Discovery doc used to configure service.\n creds: Credentials used to authorize service.\n Returns:\n Authorized Google API service.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99070:Assign_L106_C2", "label": "http = Http()", "type": "assigned_variable", "loc": [106, 106], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99070:FunctionDef_L97_C0", "vector": [14, 1, 0.3475, 0.0033, 1, 0.02, 0.3333, 415, 3, 0, 0, 0, 967, 10, 1], "semantic": {"name": "http", "arg_names": [], "import_names": [], "rhs_call_name": "Http", "annotation": ""}, "snippet": " http = httplib2.Http()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99070:Expr_L107_C2", "label": "authorize()", "type": "expression", "loc": [107, 107], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99070:FunctionDef_L97_C0", "vector": [8, 1, 0.3508, 0.0033, 1, 0.02, 0.6667, 880, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "authorize", "arg_names": [], "import_names": [], "rhs_call_name": "authorize", "annotation": ""}, "snippet": " creds.authorize(http)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99070:Return_L108_C2", "label": "return", "type": "return", "loc": [108, 108], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99070:FunctionDef_L97_C0", "vector": [13, 1, 0.3541, 0.0033, 1, 0.02, 1.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return build_from_document(discovery_doc, APIS_BASE, http=http)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99070:FunctionDef_L111_C0", "label": "RedirectAuth", "type": "function", "loc": [111, 120], "level": 0, "parent": null, "vector": [2, 0, 0.3787, 0.0328, 0, 0.66, 0.8, 681, 0, 1, 0, 0, 0, 0, 3], "semantic": {"name": "RedirectAuth", "arg_names": ["handler"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def RedirectAuth(handler):\n \"\"\"Redirect a handler to an authorization page.\n\n Args:\n handler: webapp.RequestHandler to redirect.\n \"\"\"\n flow = CreateOAuthFlow(handler.request)\n flow.scope = ALL_SCOPES"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99070:Expr_L112_C2", "label": "expression", "type": "expression", "loc": [112, 116], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99070:FunctionDef_L111_C0", "vector": [8, 1, 0.3738, 0.0164, 1, 0.07, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Redirect a handler to an authorization page.\n\n Args:\n handler: webapp.RequestHandler to redirect.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99070:Assign_L117_C2", "label": "flow = CreateOAuthFlow()", "type": "assigned_variable", "loc": [117, 117], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99070:FunctionDef_L111_C0", "vector": [14, 1, 0.3836, 0.0033, 1, 0.07, 0.25, 258, 3, 1, 0, 0, 672, 10, 1], "semantic": {"name": "flow", "arg_names": [], "import_names": [], "rhs_call_name": "CreateOAuthFlow", "annotation": ""}, "snippet": " flow = CreateOAuthFlow(handler.request)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99070:Assign_L118_C2", "label": "flow.scope =", "type": "assigned_variable", "loc": [118, 118], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99070:FunctionDef_L111_C0", "vector": [14, 1, 0.3869, 0.0033, 1, 0.07, 0.5, 584, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "flow.scope", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " flow.scope = ALL_SCOPES"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99070:Assign_L119_C2", "label": "uri = step1_get_authorize_url()", "type": "assigned_variable", "loc": [119, 119], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99070:FunctionDef_L111_C0", "vector": [14, 1, 0.3902, 0.0033, 1, 0.07, 0.75, 600, 3, 1, 0, 0, 752, 10, 1], "semantic": {"name": "uri", "arg_names": [], "import_names": [], "rhs_call_name": "step1_get_authorize_url", "annotation": ""}, "snippet": " uri = flow.step1_get_authorize_url(flow.redirect_uri)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99070:Expr_L120_C2", "label": "redirect()", "type": "expression", "loc": [120, 120], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99070:FunctionDef_L111_C0", "vector": [8, 1, 0.3934, 0.0033, 1, 0.07, 1.0, 206, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "redirect", "arg_names": [], "import_names": [], "rhs_call_name": "redirect", "annotation": ""}, "snippet": " handler.redirect(uri)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99070:FunctionDef_L123_C0", "label": "CreateDrive", "type": "function", "loc": [123, 137], "level": 0, "parent": null, "vector": [2, 0, 0.4262, 0.0492, 0, 0.66, 0.8333, 839, 0, 1, 1, 0, 0, 0, 5], "semantic": {"name": "CreateDrive", "arg_names": ["handler"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def CreateDrive(handler):\n \"\"\"Create a fully authorized drive service for this handler.\n\n Args:\n handler: RequestHandler from which drive service is generated.\n Returns:\n Authorized drive service, generated from the handler request.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99070:Expr_L124_C2", "label": "expression", "type": "expression", "loc": [124, 130], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99070:FunctionDef_L123_C0", "vector": [8, 1, 0.4164, 0.023, 1, 0.06, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Create a fully authorized drive service for this handler.\n\n Args:\n handler: RequestHandler from which drive service is generated.\n Returns:\n Authorized drive service, generated from the handler request.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99070:Assign_L131_C2", "label": "request =", "type": "assigned_variable", "loc": [131, 131], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99070:FunctionDef_L123_C0", "vector": [14, 1, 0.4295, 0.0033, 1, 0.06, 0.25, 50, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "request", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " request = handler.request"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99070:Assign_L132_C2", "label": "request.session = LilCookies()", "type": "assigned_variable", "loc": [132, 132], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99070:FunctionDef_L123_C0", "vector": [14, 1, 0.4328, 0.0033, 1, 0.06, 0.5, 591, 3, 2, 0, 0, 220, 10, 1], "semantic": {"name": "request.session", "arg_names": [], "import_names": [], "rhs_call_name": "LilCookies", "annotation": ""}, "snippet": " request.session = sessions.LilCookies(handler, SESSION_SECRET)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99070:Assign_L133_C2", "label": "creds =", "type": "assigned_variable", "loc": [133, 133], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99070:FunctionDef_L123_C0", "vector": [14, 1, 0.4361, 0.0033, 1, 0.06, 0.75, 394, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "creds", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " creds = GetCodeCredentials(request) or GetSessionCredentials(request)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99070:If_L134_C2", "label": "if", "type": "if", "loc": [134, 137], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99070:FunctionDef_L123_C0", "vector": [4, 1, 0.4443, 0.0131, 1, 0.06, 1.0, 0, 2, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if creds:\n return CreateService(DRIVE_DISCOVERY_DOC, creds)\n else:\n RedirectAuth(handler)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99070:Return_L135_C4", "label": "return", "type": "return", "loc": [135, 135], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99070:If_L134_C2", "vector": [13, 2, 0.4426, 0.0033, 2, 0.56, 0.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return CreateService(DRIVE_DISCOVERY_DOC, creds)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99070:Expr_L137_C4", "label": "RedirectAuth()", "type": "expression", "loc": [137, 137], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99070:If_L134_C2", "vector": [8, 2, 0.4492, 0.0033, 2, 0.56, 1.0, 681, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "RedirectAuth", "arg_names": [], "import_names": [], "rhs_call_name": "RedirectAuth", "annotation": ""}, "snippet": " RedirectAuth(handler)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99070:FunctionDef_L140_C0", "label": "ServiceEnabled", "type": "function", "loc": [140, 153], "level": 0, "parent": null, "vector": [2, 0, 0.4803, 0.0459, 0, 0.66, 0.8667, 562, 0, 1, 1, 0, 0, 0, 3], "semantic": {"name": "ServiceEnabled", "arg_names": ["view"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def ServiceEnabled(view):\n \"\"\"Decorator to inject an authorized service into an HTTP handler.\n\n Args:\n view: HTTP request handler method.\n Returns:\n Decorated handler which accepts the service as a parameter.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99070:Expr_L141_C2", "label": "expression", "type": "expression", "loc": [141, 147], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99070:FunctionDef_L140_C0", "vector": [8, 1, 0.4721, 0.023, 1, 0.54, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Decorator to inject an authorized service into an HTTP handler.\n\n Args:\n view: HTTP request handler method.\n Returns:\n Decorated handler which accepts the service as a parameter.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99070:FunctionDef_L148_C2", "label": "ServiceDecoratedView", "type": "function", "loc": [148, 152], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99070:FunctionDef_L140_C0", "vector": [2, 1, 0.4918, 0.0164, 1, 0.54, 0.5, 667, 0, 2, 0, 0, 0, 0, 3], "semantic": {"name": "ServiceDecoratedView", "arg_names": ["handler", "view"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def ServiceDecoratedView(handler, view=view):\n service = CreateDrive(handler)\n response_data = view(handler, service)\n handler.response.headers['Content-Type'] = 'text/html'\n handler.response.out.write(response_data)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99070:Assign_L149_C4", "label": "service = CreateDrive()", "type": "assigned_variable", "loc": [149, 149], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99070:FunctionDef_L148_C2", "vector": [14, 2, 0.4885, 0.0033, 2, 0.55, 0.0, 314, 3, 1, 0, 0, 839, 10, 1], "semantic": {"name": "service", "arg_names": [], "import_names": [], "rhs_call_name": "CreateDrive", "annotation": ""}, "snippet": " service = CreateDrive(handler)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99070:Assign_L150_C4", "label": "response_data = view()", "type": "assigned_variable", "loc": [150, 150], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99070:FunctionDef_L148_C2", "vector": [14, 2, 0.4918, 0.0033, 2, 0.55, 0.3333, 701, 3, 2, 0, 0, 781, 10, 1], "semantic": {"name": "response_data", "arg_names": [], "import_names": [], "rhs_call_name": "view", "annotation": ""}, "snippet": " response_data = view(handler, service)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99070:Assign_L151_C4", "label": "assign", "type": "assigned_variable", "loc": [151, 151], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99070:FunctionDef_L148_C2", "vector": [14, 2, 0.4951, 0.0033, 2, 0.55, 0.6667, 0, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " handler.response.headers['Content-Type'] = 'text/html'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99070:Expr_L152_C4", "label": "write()", "type": "expression", "loc": [152, 152], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99070:FunctionDef_L148_C2", "vector": [8, 2, 0.4984, 0.0033, 2, 0.55, 1.0, 837, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "write", "arg_names": [], "import_names": [], "rhs_call_name": "write", "annotation": ""}, "snippet": " handler.response.out.write(response_data)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99070:Return_L153_C2", "label": "return", "type": "return", "loc": [153, 153], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99070:FunctionDef_L140_C0", "vector": [13, 1, 0.5016, 0.0033, 1, 0.54, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return ServiceDecoratedView"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99070:FunctionDef_L156_C0", "label": "ServiceEnabledJson", "type": "function", "loc": [156, 173], "level": 0, "parent": null, "vector": [2, 0, 0.5393, 0.059, 0, 0.66, 0.9, 499, 0, 1, 1, 0, 0, 0, 5], "semantic": {"name": "ServiceEnabledJson", "arg_names": ["view"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def ServiceEnabledJson(view):\n \"\"\"Decorator to inject an authorized service into a JSON HTTP handler.\n\n Args:\n view: HTTP request handler method.\n Returns:\n Decorated handler which accepts the service as a parameter.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99070:Expr_L157_C2", "label": "expression", "type": "expression", "loc": [157, 163], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99070:FunctionDef_L156_C0", "vector": [8, 1, 0.5246, 0.023, 1, 0.43, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Decorator to inject an authorized service into a JSON HTTP handler.\n\n Args:\n view: HTTP request handler method.\n Returns:\n Decorated handler which accepts the service as a parameter.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99070:FunctionDef_L164_C2", "label": "ServiceDecoratedView", "type": "function", "loc": [164, 172], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99070:FunctionDef_L156_C0", "vector": [2, 1, 0.5508, 0.0295, 1, 0.43, 0.5, 667, 0, 2, 0, 0, 0, 0, 5], "semantic": {"name": "ServiceDecoratedView", "arg_names": ["handler", "view"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def ServiceDecoratedView(handler, view=view):\n service = CreateDrive(handler)\n if handler.request.body:\n data = json.loads(handler.request.body)\n else:\n data = None\n response_data = json.dumps(view(handler, service, data))\n handler.response.headers['Content-Type'] = 'application/json'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99070:Assign_L165_C4", "label": "service = CreateDrive()", "type": "assigned_variable", "loc": [165, 165], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99070:FunctionDef_L164_C2", "vector": [14, 2, 0.541, 0.0033, 2, 0.11, 0.0, 314, 3, 1, 0, 0, 839, 10, 1], "semantic": {"name": "service", "arg_names": [], "import_names": [], "rhs_call_name": "CreateDrive", "annotation": ""}, "snippet": " service = CreateDrive(handler)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99070:If_L166_C4", "label": "if", "type": "if", "loc": [166, 169], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99070:FunctionDef_L164_C2", "vector": [4, 2, 0.5492, 0.0131, 2, 0.11, 0.25, 0, 7, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if handler.request.body:\n data = json.loads(handler.request.body)\n else:\n data = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99070:Assign_L167_C6", "label": "data = loads()", "type": "assigned_variable", "loc": [167, 167], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99070:If_L166_C4", "vector": [14, 3, 0.5475, 0.0033, 3, 0.24, 0.0, 929, 3, 1, 0, 0, 88, 10, 1], "semantic": {"name": "data", "arg_names": [], "import_names": [], "rhs_call_name": "loads", "annotation": ""}, "snippet": " data = json.loads(handler.request.body)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99070:Assign_L169_C6", "label": "data =", "type": "assigned_variable", "loc": [169, 169], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99070:If_L166_C4", "vector": [14, 3, 0.5541, 0.0033, 3, 0.24, 1.0, 929, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "data", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " data = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99070:Assign_L170_C4", "label": "response_data = dumps()", "type": "assigned_variable", "loc": [170, 170], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99070:FunctionDef_L164_C2", "vector": [14, 2, 0.5574, 0.0033, 2, 0.11, 0.5, 701, 3, 1, 0, 0, 160, 10, 2], "semantic": {"name": "response_data", "arg_names": [], "import_names": [], "rhs_call_name": "dumps", "annotation": ""}, "snippet": " response_data = json.dumps(view(handler, service, data))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99070:Assign_L171_C4", "label": "assign", "type": "assigned_variable", "loc": [171, 171], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99070:FunctionDef_L164_C2", "vector": [14, 2, 0.5607, 0.0033, 2, 0.11, 0.75, 0, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " handler.response.headers['Content-Type'] = 'application/json'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99070:Expr_L172_C4", "label": "write()", "type": "expression", "loc": [172, 172], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99070:FunctionDef_L164_C2", "vector": [8, 2, 0.5639, 0.0033, 2, 0.11, 1.0, 837, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "write", "arg_names": [], "import_names": [], "rhs_call_name": "write", "annotation": ""}, "snippet": " handler.response.out.write(response_data)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99070:Return_L173_C2", "label": "return", "type": "return", "loc": [173, 173], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99070:FunctionDef_L156_C0", "vector": [13, 1, 0.5672, 0.0033, 1, 0.43, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return ServiceDecoratedView"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99070:ClassDef_L176_C0", "label": "DriveState", "type": "class", "loc": [176, 224], "level": 0, "parent": null, "vector": [3, 0, 0.6557, 0.1607, 0, 0.66, 0.9333, 620, 0, 5, 0, 0, 186, 0, 9], "semantic": {"name": "DriveState", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class DriveState(object):\n \"\"\"Store state provided by Drive.\"\"\"\n\n def __init__(self, state):\n self.ParseState(state)\n\n @classmethod\n def FromRequest(cls, request):"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99070:Expr_L177_C2", "label": "expression", "type": "expression", "loc": [177, 177], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99070:ClassDef_L176_C0", "vector": [8, 1, 0.5803, 0.0033, 1, 0.38, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Store state provided by Drive.\"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99070:FunctionDef_L179_C2", "label": "__init__", "type": "function", "loc": [179, 180], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99070:ClassDef_L176_C0", "vector": [2, 1, 0.5885, 0.0066, 1, 0.38, 0.2, 555, 0, 2, 0, 0, 0, 0, 1], "semantic": {"name": "__init__", "arg_names": ["self", "state"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, state):\n self.ParseState(state)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99070:Expr_L180_C4", "label": "ParseState()", "type": "expression", "loc": [180, 180], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99070:FunctionDef_L179_C2", "vector": [8, 2, 0.5902, 0.0033, 2, 0.2, 0.0, 17, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "ParseState", "arg_names": [], "import_names": [], "rhs_call_name": "ParseState", "annotation": ""}, "snippet": " self.ParseState(state)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99070:FunctionDef_L183_C2", "label": "FromRequest", "type": "function", "loc": [183, 190], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99070:ClassDef_L176_C0", "vector": [2, 1, 0.6115, 0.0262, 1, 0.38, 0.4, 504, 0, 2, 1, 0, 0, 0, 2], "semantic": {"name": "FromRequest", "arg_names": ["cls", "request"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def FromRequest(cls, request):\n \"\"\"Create a Drive State instance from an HTTP request.\n\n Args:\n cls: Type this class method is called against.\n request: HTTP request.\n \"\"\"\n return DriveState(request.get(STATE_PARAMETER))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99070:Expr_L184_C4", "label": "expression", "type": "expression", "loc": [184, 189], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99070:FunctionDef_L183_C2", "vector": [8, 2, 0.6115, 0.0197, 2, 0.66, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Create a Drive State instance from an HTTP request.\n\n Args:\n cls: Type this class method is called against.\n request: HTTP request.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99070:Return_L190_C4", "label": "return", "type": "return", "loc": [190, 190], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99070:FunctionDef_L183_C2", "vector": [13, 2, 0.623, 0.0033, 2, 0.66, 1.0, 0, 3, 0, 0, 0, 0, 10, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return DriveState(request.get(STATE_PARAMETER))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99070:FunctionDef_L192_C2", "label": "ParseState", "type": "function", "loc": [192, 201], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99070:ClassDef_L176_C0", "vector": [2, 1, 0.6443, 0.0328, 1, 0.38, 0.6, 17, 0, 2, 0, 0, 0, 0, 3], "semantic": {"name": "ParseState", "arg_names": ["self", "state"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def ParseState(self, state):\n \"\"\"Parse a state parameter and set internal values.\n\n Args:\n state: State parameter to parse.\n \"\"\"\n if state.startswith('{'):\n self.ParseJsonState(state)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99070:Expr_L193_C4", "label": "expression", "type": "expression", "loc": [193, 197], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99070:FunctionDef_L192_C2", "vector": [8, 2, 0.6393, 0.0164, 2, 0.29, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Parse a state parameter and set internal values.\n\n Args:\n state: State parameter to parse.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99070:If_L198_C4", "label": "if", "type": "if", "loc": [198, 201], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99070:FunctionDef_L192_C2", "vector": [4, 2, 0.6541, 0.0131, 2, 0.29, 1.0, 0, 3, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if state.startswith('{'):\n self.ParseJsonState(state)\n else:\n self.ParsePlainState(state)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99070:Expr_L199_C6", "label": "ParseJsonState()", "type": "expression", "loc": [199, 199], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99070:If_L198_C4", "vector": [8, 3, 0.6525, 0.0033, 3, 0.06, 0.0, 406, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "ParseJsonState", "arg_names": [], "import_names": [], "rhs_call_name": "ParseJsonState", "annotation": ""}, "snippet": " self.ParseJsonState(state)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99070:Expr_L201_C6", "label": "ParsePlainState()", "type": "expression", "loc": [201, 201], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99070:If_L198_C4", "vector": [8, 3, 0.659, 0.0033, 3, 0.06, 1.0, 786, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "ParsePlainState", "arg_names": [], "import_names": [], "rhs_call_name": "ParsePlainState", "annotation": ""}, "snippet": " self.ParsePlainState(state)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99070:FunctionDef_L203_C2", "label": "ParseJsonState", "type": "function", "loc": [203, 211], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99070:ClassDef_L176_C0", "vector": [2, 1, 0.6787, 0.0295, 1, 0.38, 0.8, 406, 0, 2, 0, 0, 0, 0, 3], "semantic": {"name": "ParseJsonState", "arg_names": ["self", "state"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def ParseJsonState(self, state):\n \"\"\"Parse a state parameter that is JSON.\n\n Args:\n state: State parameter to parse\n \"\"\"\n state_data = json.loads(state)\n self.action = state_data['action']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99070:Expr_L204_C4", "label": "expression", "type": "expression", "loc": [204, 208], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99070:FunctionDef_L203_C2", "vector": [8, 2, 0.6754, 0.0164, 2, 0.17, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Parse a state parameter that is JSON.\n\n Args:\n state: State parameter to parse\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99070:Assign_L209_C4", "label": "state_data = loads()", "type": "assigned_variable", "loc": [209, 209], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99070:FunctionDef_L203_C2", "vector": [14, 2, 0.6852, 0.0033, 2, 0.17, 0.3333, 203, 3, 1, 0, 0, 88, 10, 1], "semantic": {"name": "state_data", "arg_names": [], "import_names": [], "rhs_call_name": "loads", "annotation": ""}, "snippet": " state_data = json.loads(state)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99070:Assign_L210_C4", "label": "self.action =", "type": "assigned_variable", "loc": [210, 210], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99070:FunctionDef_L203_C2", "vector": [14, 2, 0.6885, 0.0033, 2, 0.17, 0.6667, 222, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.action", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.action = state_data['action']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99070:Assign_L211_C4", "label": "self.ids = map()", "type": "assigned_variable", "loc": [211, 211], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99070:FunctionDef_L203_C2", "vector": [14, 2, 0.6918, 0.0033, 2, 0.17, 1.0, 806, 3, 2, 0, 0, 53, 10, 2], "semantic": {"name": "self.ids", "arg_names": [], "import_names": [], "rhs_call_name": "map", "annotation": ""}, "snippet": " self.ids = map(str, state_data.get('ids', []))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99070:FunctionDef_L213_C2", "label": "ParsePlainState", "type": "function", "loc": [213, 224], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99070:ClassDef_L176_C0", "vector": [2, 1, 0.7164, 0.0393, 1, 0.38, 1.0, 786, 0, 2, 0, 0, 0, 0, 0], "semantic": {"name": "ParsePlainState", "arg_names": ["self", "state"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def ParsePlainState(self, state):\n \"\"\"Parse a state parameter that is a plain resource id or missing.\n\n Args:\n state: State parameter to parse\n \"\"\"\n if state:\n self.action = 'open'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99070:Expr_L214_C4", "label": "expression", "type": "expression", "loc": [214, 218], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99070:FunctionDef_L213_C2", "vector": [8, 2, 0.7082, 0.0164, 2, 0.58, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Parse a state parameter that is a plain resource id or missing.\n\n Args:\n state: State parameter to parse\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99070:If_L219_C4", "label": "if", "type": "if", "loc": [219, 224], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99070:FunctionDef_L213_C2", "vector": [4, 2, 0.7262, 0.0197, 2, 0.58, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if state:\n self.action = 'open'\n self.ids = [state]\n else:\n self.action = 'create'\n self.ids = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99070:Assign_L220_C6", "label": "self.action =", "type": "assigned_variable", "loc": [220, 220], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99070:If_L219_C4", "vector": [14, 3, 0.7213, 0.0033, 3, 0.47, 0.0, 222, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "self.action", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.action = 'open'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99070:Assign_L221_C6", "label": "self.ids =", "type": "assigned_variable", "loc": [221, 221], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99070:If_L219_C4", "vector": [14, 3, 0.7246, 0.0033, 3, 0.47, 0.3333, 806, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "self.ids", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.ids = [state]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99070:Assign_L223_C6", "label": "self.action =", "type": "assigned_variable", "loc": [223, 223], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99070:If_L219_C4", "vector": [14, 3, 0.7311, 0.0033, 3, 0.47, 0.6667, 222, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "self.action", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.action = 'create'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99070:Assign_L224_C6", "label": "self.ids =", "type": "assigned_variable", "loc": [224, 224], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99070:If_L219_C4", "vector": [14, 3, 0.7344, 0.0033, 3, 0.47, 1.0, 806, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "self.ids", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.ids = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99070:ClassDef_L227_C0", "label": "MediaInMemoryUpload", "type": "class", "loc": [227, 295], "level": 0, "parent": null, "vector": [3, 0, 0.8557, 0.2262, 0, 0.66, 0.9667, 833, 0, 6, 0, 0, 102, 0, 1], "semantic": {"name": "MediaInMemoryUpload", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class MediaInMemoryUpload(MediaUpload):\n \"\"\"MediaUpload for a chunk of bytes.\n\n Construct a MediaFileUpload and pass as the media_body parameter of the\n method. For example, if we had a service that allowed plain text:\n \"\"\"\n\n def __init__(self, body, mimetype='application/octet-stream',"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99070:Expr_L228_C2", "label": "expression", "type": "expression", "loc": [228, 232], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99070:ClassDef_L227_C0", "vector": [8, 1, 0.7541, 0.0164, 1, 0.46, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"MediaUpload for a chunk of bytes.\n\n Construct a MediaFileUpload and pass as the media_body parameter of the\n method. For example, if we had a service that allowed plain text:\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99070:FunctionDef_L234_C2", "label": "__init__", "type": "function", "loc": [234, 250], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99070:ClassDef_L227_C0", "vector": [2, 1, 0.7934, 0.0557, 1, 0.46, 0.1667, 555, 0, 5, 0, 0, 0, 0, 0], "semantic": {"name": "__init__", "arg_names": ["self", "body", "mimetype", "chunksize", "resumable"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, body, mimetype='application/octet-stream',\n chunksize=256*1024, resumable=False):\n \"\"\"Create a new MediaBytesUpload.\n\n Args:\n body: string, Bytes of body content.\n mimetype: string, Mime-type of the file or default of\n 'application/octet-stream'."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99070:Expr_L236_C4", "label": "expression", "type": "expression", "loc": [236, 246], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99070:FunctionDef_L234_C2", "vector": [8, 2, 0.7902, 0.0361, 2, 0.15, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Create a new MediaBytesUpload.\n\n Args:\n body: string, Bytes of body content.\n mimetype: string, Mime-type of the file or default of\n 'application/octet-stream'.\n chunksize: int, File will be uploaded in chunks of this many bytes. Only\n used if resumable=True."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99070:Assign_L247_C4", "label": "self._body =", "type": "assigned_variable", "loc": [247, 247], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99070:FunctionDef_L234_C2", "vector": [14, 2, 0.8098, 0.0033, 2, 0.15, 0.25, 36, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self._body", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self._body = body"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99070:Assign_L248_C4", "label": "self._mimetype =", "type": "assigned_variable", "loc": [248, 248], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99070:FunctionDef_L234_C2", "vector": [14, 2, 0.8131, 0.0033, 2, 0.15, 0.5, 699, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self._mimetype", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self._mimetype = mimetype"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99070:Assign_L249_C4", "label": "self._resumable =", "type": "assigned_variable", "loc": [249, 249], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99070:FunctionDef_L234_C2", "vector": [14, 2, 0.8164, 0.0033, 2, 0.15, 0.75, 847, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self._resumable", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self._resumable = resumable"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99070:Assign_L250_C4", "label": "self._chunksize =", "type": "assigned_variable", "loc": [250, 250], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99070:FunctionDef_L234_C2", "vector": [14, 2, 0.8197, 0.0033, 2, 0.15, 1.0, 383, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self._chunksize", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self._chunksize = chunksize"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99070:FunctionDef_L252_C2", "label": "chunksize", "type": "function", "loc": [252, 258], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99070:ClassDef_L227_C0", "vector": [2, 1, 0.8361, 0.023, 1, 0.46, 0.3333, 120, 0, 1, 1, 0, 0, 0, 0], "semantic": {"name": "chunksize", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def chunksize(self):\n \"\"\"Chunk size for resumable uploads.\n\n Returns:\n Chunk size in bytes.\n \"\"\"\n return self._chunksize"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99070:Expr_L253_C4", "label": "expression", "type": "expression", "loc": [253, 257], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99070:FunctionDef_L252_C2", "vector": [8, 2, 0.8361, 0.0164, 2, 0.5, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Chunk size for resumable uploads.\n\n Returns:\n Chunk size in bytes.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99070:Return_L258_C4", "label": "return", "type": "return", "loc": [258, 258], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99070:FunctionDef_L252_C2", "vector": [13, 2, 0.8459, 0.0033, 2, 0.5, 1.0, 0, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self._chunksize"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99070:FunctionDef_L260_C2", "label": "mimetype", "type": "function", "loc": [260, 266], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99070:ClassDef_L227_C0", "vector": [2, 1, 0.8623, 0.023, 1, 0.46, 0.5, 290, 0, 1, 1, 0, 0, 0, 0], "semantic": {"name": "mimetype", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def mimetype(self):\n \"\"\"Mime type of the body.\n\n Returns:\n Mime type.\n \"\"\"\n return self._mimetype"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99070:Expr_L261_C4", "label": "expression", "type": "expression", "loc": [261, 265], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99070:FunctionDef_L260_C2", "vector": [8, 2, 0.8623, 0.0164, 2, 0.06, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Mime type of the body.\n\n Returns:\n Mime type.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99070:Return_L266_C4", "label": "return", "type": "return", "loc": [266, 266], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99070:FunctionDef_L260_C2", "vector": [13, 2, 0.8721, 0.0033, 2, 0.06, 1.0, 0, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self._mimetype"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99070:FunctionDef_L268_C2", "label": "size", "type": "function", "loc": [268, 274], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99070:ClassDef_L227_C0", "vector": [2, 1, 0.8885, 0.023, 1, 0.46, 0.6667, 714, 0, 1, 1, 0, 0, 0, 1], "semantic": {"name": "size", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def size(self):\n \"\"\"Size of upload.\n\n Returns:\n Size of the body.\n \"\"\"\n return len(self._body)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99070:Expr_L269_C4", "label": "expression", "type": "expression", "loc": [269, 273], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99070:FunctionDef_L268_C2", "vector": [8, 2, 0.8885, 0.0164, 2, 0.67, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Size of upload.\n\n Returns:\n Size of the body.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99070:Return_L274_C4", "label": "return", "type": "return", "loc": [274, 274], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99070:FunctionDef_L268_C2", "vector": [13, 2, 0.8984, 0.0033, 2, 0.67, 1.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return len(self._body)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99070:FunctionDef_L276_C2", "label": "resumable", "type": "function", "loc": [276, 282], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99070:ClassDef_L227_C0", "vector": [2, 1, 0.9148, 0.023, 1, 0.46, 0.8333, 471, 0, 1, 1, 0, 0, 0, 0], "semantic": {"name": "resumable", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def resumable(self):\n \"\"\"Whether this upload is resumable.\n\n Returns:\n True if resumable upload or False.\n \"\"\"\n return self._resumable"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99070:Expr_L277_C4", "label": "expression", "type": "expression", "loc": [277, 281], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99070:FunctionDef_L276_C2", "vector": [8, 2, 0.9148, 0.0164, 2, 0.84, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Whether this upload is resumable.\n\n Returns:\n True if resumable upload or False.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99070:Return_L282_C4", "label": "return", "type": "return", "loc": [282, 282], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99070:FunctionDef_L276_C2", "vector": [13, 2, 0.9246, 0.0033, 2, 0.84, 1.0, 0, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self._resumable"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99070:FunctionDef_L284_C2", "label": "getbytes", "type": "function", "loc": [284, 295], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99070:ClassDef_L227_C0", "vector": [2, 1, 0.9492, 0.0393, 1, 0.46, 1.0, 626, 0, 3, 1, 0, 0, 0, 0], "semantic": {"name": "getbytes", "arg_names": ["self", "begin", "length"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def getbytes(self, begin, length):\n \"\"\"Get bytes from the media.\n\n Args:\n begin: int, offset from beginning of file.\n length: int, number of bytes to read, starting at begin.\n\n Returns:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99070:Expr_L285_C4", "label": "expression", "type": "expression", "loc": [285, 294], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99070:FunctionDef_L284_C2", "vector": [8, 2, 0.9492, 0.0328, 2, 0.82, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Get bytes from the media.\n\n Args:\n begin: int, offset from beginning of file.\n length: int, number of bytes to read, starting at begin.\n\n Returns:\n A string of bytes read. May be shorter than length if EOF was reached"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99070:Return_L295_C4", "label": "return", "type": "return", "loc": [295, 295], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99070:FunctionDef_L284_C2", "vector": [13, 2, 0.9672, 0.0033, 2, 0.82, 1.0, 0, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self._body[begin:begin + length]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99070:FunctionDef_L298_C0", "label": "RenderTemplate", "type": "function", "loc": [298, 305], "level": 0, "parent": null, "vector": [2, 0, 0.9885, 0.0262, 0, 0.66, 1.0, 734, 0, 2, 1, 0, 0, 0, 1], "semantic": {"name": "RenderTemplate", "arg_names": ["name", "context"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def RenderTemplate(name, **context):\n \"\"\"Render a named template in a context.\n\n Args:\n name: Template name.\n context: Keyword arguments to render as template variables.\n \"\"\"\n return template.render(name, context)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99070:Expr_L299_C2", "label": "expression", "type": "expression", "loc": [299, 304], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99070:FunctionDef_L298_C0", "vector": [8, 1, 0.9885, 0.0197, 1, 0.52, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Render a named template in a context.\n\n Args:\n name: Template name.\n context: Keyword arguments to render as template variables.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99070:Return_L305_C2", "label": "return", "type": "return", "loc": [305, 305], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99070:FunctionDef_L298_C0", "vector": [13, 1, 1.0, 0.0033, 1, 0.52, 1.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return template.render(name, context)"}]
[{"f": "ajibawa-2023/Python-Code-Large/train/row_99070:ClassDef_L45_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99070:Expr_L46_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99070:ClassDef_L45_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99070:Assign_L47_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99070:FunctionDef_L50_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99070:Expr_L51_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99070:FunctionDef_L50_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99070:Assign_L58_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99070:FunctionDef_L50_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99070:Assign_L59_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99070:FunctionDef_L50_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99070:Return_L60_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99070:FunctionDef_L63_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99070:Expr_L64_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99070:FunctionDef_L63_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99070:Assign_L71_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99070:FunctionDef_L63_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99070:If_L72_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99070:If_L72_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99070:Assign_L73_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99070:If_L72_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99070:Assign_L74_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99070:If_L72_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99070:Assign_L75_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99070:If_L72_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99070:Assign_L76_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99070:If_L72_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99070:Expr_L77_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99070:If_L72_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99070:Expr_L78_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99070:If_L72_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99070:Return_L79_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99070:FunctionDef_L82_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99070:Expr_L83_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99070:FunctionDef_L82_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99070:Assign_L90_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99070:FunctionDef_L82_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99070:If_L91_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99070:If_L91_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99070:Assign_L92_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99070:If_L91_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99070:If_L93_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99070:If_L93_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99070:Return_L94_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99070:FunctionDef_L97_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99070:Expr_L98_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99070:FunctionDef_L97_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99070:Assign_L106_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99070:FunctionDef_L97_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99070:Expr_L107_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99070:FunctionDef_L97_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99070:Return_L108_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99070:FunctionDef_L111_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99070:Expr_L112_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99070:FunctionDef_L111_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99070:Assign_L117_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99070:FunctionDef_L111_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99070:Assign_L118_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99070:FunctionDef_L111_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99070:Assign_L119_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99070:FunctionDef_L111_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99070:Expr_L120_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99070:FunctionDef_L123_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99070:Expr_L124_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99070:FunctionDef_L123_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99070:Assign_L131_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99070:FunctionDef_L123_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99070:Assign_L132_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99070:FunctionDef_L123_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99070:Assign_L133_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99070:FunctionDef_L123_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99070:If_L134_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99070:If_L134_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99070:Return_L135_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99070:If_L134_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99070:Expr_L137_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99070:FunctionDef_L140_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99070:Expr_L141_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99070:FunctionDef_L140_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99070:FunctionDef_L148_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99070:FunctionDef_L148_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99070:Assign_L149_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99070:FunctionDef_L148_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99070:Assign_L150_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99070:FunctionDef_L148_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99070:Assign_L151_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99070:FunctionDef_L148_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99070:Expr_L152_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99070:FunctionDef_L140_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99070:Return_L153_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99070:FunctionDef_L156_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99070:Expr_L157_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99070:FunctionDef_L156_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99070:FunctionDef_L164_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99070:FunctionDef_L164_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99070:Assign_L165_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99070:FunctionDef_L164_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99070:If_L166_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99070:If_L166_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99070:Assign_L167_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99070:If_L166_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99070:Assign_L169_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99070:FunctionDef_L164_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99070:Assign_L170_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99070:FunctionDef_L164_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99070:Assign_L171_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99070:FunctionDef_L164_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99070:Expr_L172_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99070:FunctionDef_L156_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99070:Return_L173_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99070:ClassDef_L176_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99070:Expr_L177_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99070:ClassDef_L176_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99070:FunctionDef_L179_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99070:FunctionDef_L179_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99070:Expr_L180_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99070:ClassDef_L176_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99070:FunctionDef_L183_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99070:FunctionDef_L183_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99070:Expr_L184_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99070:FunctionDef_L183_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99070:Return_L190_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99070:ClassDef_L176_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99070:FunctionDef_L192_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99070:FunctionDef_L192_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99070:Expr_L193_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99070:FunctionDef_L192_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99070:If_L198_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99070:If_L198_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99070:Expr_L199_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99070:If_L198_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99070:Expr_L201_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99070:ClassDef_L176_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99070:FunctionDef_L203_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99070:FunctionDef_L203_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99070:Expr_L204_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99070:FunctionDef_L203_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99070:Assign_L209_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99070:FunctionDef_L203_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99070:Assign_L210_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99070:FunctionDef_L203_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99070:Assign_L211_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99070:ClassDef_L176_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99070:FunctionDef_L213_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99070:FunctionDef_L213_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99070:Expr_L214_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99070:FunctionDef_L213_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99070:If_L219_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99070:If_L219_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99070:Assign_L220_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99070:If_L219_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99070:Assign_L221_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99070:If_L219_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99070:Assign_L223_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99070:If_L219_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99070:Assign_L224_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99070:ClassDef_L227_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99070:Expr_L228_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99070:ClassDef_L227_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99070:FunctionDef_L234_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99070:FunctionDef_L234_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99070:Expr_L236_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99070:FunctionDef_L234_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99070:Assign_L247_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99070:FunctionDef_L234_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99070:Assign_L248_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99070:FunctionDef_L234_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99070:Assign_L249_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99070:FunctionDef_L234_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99070:Assign_L250_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99070:ClassDef_L227_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99070:FunctionDef_L252_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99070:FunctionDef_L252_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99070:Expr_L253_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99070:FunctionDef_L252_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99070:Return_L258_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99070:ClassDef_L227_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99070:FunctionDef_L260_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99070:FunctionDef_L260_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99070:Expr_L261_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99070:FunctionDef_L260_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99070:Return_L266_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99070:ClassDef_L227_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99070:FunctionDef_L268_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99070:FunctionDef_L268_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99070:Expr_L269_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99070:FunctionDef_L268_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99070:Return_L274_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99070:ClassDef_L227_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99070:FunctionDef_L276_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99070:FunctionDef_L276_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99070:Expr_L277_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99070:FunctionDef_L276_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99070:Return_L282_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99070:ClassDef_L227_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99070:FunctionDef_L284_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99070:FunctionDef_L284_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99070:Expr_L285_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99070:FunctionDef_L284_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99070:Return_L295_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99070:FunctionDef_L298_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99070:Expr_L299_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99070:FunctionDef_L298_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99070:Return_L305_C2"}]
#!/usr/bin/python # # Copyright (C) 2012 Google Inc. # # 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. __author__ = 'afshar@google.com (Ali Afshar)' # Add the library location to the path import sys sys.path.insert(0, 'lib') import os import httplib2 import sessions from google.appengine.ext import webapp from google.appengine.ext.webapp.util import run_wsgi_app from google.appengine.ext import db from google.appengine.ext.webapp import template from apiclient.discovery import build from apiclient.http import MediaUpload from oauth2client.client import flow_from_clientsecrets from oauth2client.client import FlowExchangeError from oauth2client.client import AccessTokenRefreshError from oauth2client.appengine import CredentialsProperty from oauth2client.appengine import StorageByKeyName from oauth2client.appengine import simplejson as json ALL_SCOPES = ('https://www.googleapis.com/auth/drive.file ' 'https://www.googleapis.com/auth/userinfo.email ' 'https://www.googleapis.com/auth/userinfo.profile') def SibPath(name): """Generate a path that is a sibling of this file. Args: name: Name of sibling file. Returns: Path to sibling file. """ return os.path.join(os.path.dirname(__file__), name) # Load the secret that is used for client side sessions # Create one of these for yourself with, for example: # python -c "import os; print os.urandom(64)" > session-secret SESSION_SECRET = open(SibPath('session.secret')).read() INDEX_HTML = open(SibPath('index.html')).read() class Credentials(db.Model): """Datastore entity for storing OAuth2.0 credentials. The CredentialsProperty is provided by the Google API Python Client, and is used by the Storage classes to store OAuth 2.0 credentials in the data store.""" credentials = CredentialsProperty() def CreateService(service, version, creds): """Create a Google API service. Load an API service from a discovery document and authorize it with the provided credentials. Args: service: Service name (e.g 'drive', 'oauth2'). version: Service version (e.g 'v1'). creds: Credentials used to authorize service. Returns: Authorized Google API service. """ # Instantiate an Http instance http = httplib2.Http() # Authorize the Http instance with the passed credentials creds.authorize(http) # Build a service from the passed discovery document path return build(service, version, http=http) class DriveState(object): """Store state provided by Drive.""" def __init__(self, state): """Create a new instance of drive state. Parse and load the JSON state parameter. Args: state: State query parameter as a string. """ if state: state_data = json.loads(state) self.action = state_data['action'] self.ids = map(str, state_data.get('ids', [])) else: self.action = 'create' self.ids = [] @classmethod def FromRequest(cls, request): """Create a Drive State instance from an HTTP request. Args: cls: Type this class method is called against. request: HTTP request. """ return DriveState(request.get('state')) class BaseDriveHandler(webapp.RequestHandler): """Base request handler for drive applications. Adds Authorization support for Drive. """ def CreateOAuthFlow(self): """Create OAuth2.0 flow controller This controller can be used to perform all parts of the OAuth 2.0 dance including exchanging an Authorization code. Args: request: HTTP request to create OAuth2.0 flow for Returns: OAuth2.0 Flow instance suitable for performing OAuth2.0. """ flow = flow_from_clientsecrets('client_secrets.json', scope='') # Dynamically set the redirect_uri based on the request URL. This is extremely # convenient for debugging to an alternative host without manually setting the # redirect URI. flow.redirect_uri = self.request.url.split('?', 1)[0].rsplit('/', 1)[0] return flow def GetCodeCredentials(self): """Create OAuth 2.0 credentials by extracting a code and performing OAuth2.0. The authorization code is extracted form the URI parameters. If it is absent, None is returned immediately. Otherwise, if it is present, it is used to perform step 2 of the OAuth 2.0 web server flow. Once a token is received, the user information is fetched from the userinfo service and stored in the session. The token is saved in the datastore against the user ID received from the userinfo service. Args: request: HTTP request used for extracting an authorization code and the session information. Returns: OAuth2.0 credentials suitable for authorizing clients or None if Authorization could not take place. """ # Other frameworks use different API to get a query parameter. code = self.request.get('code') if not code: # returns None to indicate that no code was passed from Google Drive. return None # Auth flow is a controller that is loaded with the client information, # including client_id, client_secret, redirect_uri etc oauth_flow = self.CreateOAuthFlow() # Perform the exchange of the code. If there is a failure with exchanging # the code, return None. try: creds = oauth_flow.step2_exchange(code) except FlowExchangeError: return None # Create an API service that can use the userinfo API. Authorize it with our # credentials that we gained from the code exchange. users_service = CreateService('oauth2', 'v2', creds) # Make a call against the userinfo service to retrieve the user's information. # In this case we are interested in the user's "id" field. userid = users_service.userinfo().get().execute().get('id') # Store the user id in the user's cookie-based session. session = sessions.LilCookies(self, SESSION_SECRET) session.set_secure_cookie(name='userid', value=userid) # Store the credentials in the data store using the userid as the key. StorageByKeyName(Credentials, userid, 'credentials').put(creds) return creds def GetSessionCredentials(self): """Get OAuth 2.0 credentials for an HTTP session. If the user has a user id stored in their cookie session, extract that value and use it to load that user's credentials from the data store. Args: request: HTTP request to use session from. Returns: OAuth2.0 credentials suitable for authorizing clients. """ # Try to load the user id from the session session = sessions.LilCookies(self, SESSION_SECRET) userid = session.get_secure_cookie(name='userid') if not userid: # return None to indicate that no credentials could be loaded from the # session. return None # Load the credentials from the data store, using the userid as a key. creds = StorageByKeyName(Credentials, userid, 'credentials').get() # if the credentials are invalid, return None to indicate that the credentials # cannot be used. if creds and creds.invalid: return None return creds def RedirectAuth(self): """Redirect a handler to an authorization page. Used when a handler fails to fetch credentials suitable for making Drive API requests. The request is redirected to an OAuth 2.0 authorization approval page and on approval, are returned to application. Args: handler: webapp.RequestHandler to redirect. """ flow = self.CreateOAuthFlow() # Manually add the required scopes. Since this redirect does not originate # from the Google Drive UI, which authomatically sets the scopes that are # listed in the API Console. flow.scope = ALL_SCOPES # Create the redirect URI by performing step 1 of the OAuth 2.0 web server # flow. uri = flow.step1_get_authorize_url(flow.redirect_uri) # Perform the redirect. self.redirect(uri) def RespondJSON(self, data): """Generate a JSON response and return it to the client. Args: data: The data that will be converted to JSON to return. """ self.response.headers['Content-Type'] = 'application/json' self.response.out.write(json.dumps(data)) def CreateAuthorizedService(self, service, version): """Create an authorize service instance. The service can only ever retrieve the credentials from the session. Args: service: Service name (e.g 'drive', 'oauth2'). version: Service version (e.g 'v1'). Returns: Authorized service or redirect to authorization flow if no credentials. """ # For the service, the session holds the credentials creds = self.GetSessionCredentials() if creds: # If the session contains credentials, use them to create a Drive service # instance. return CreateService(service, version, creds) else: # If no credentials could be loaded from the session, redirect the user to # the authorization page. self.RedirectAuth() def CreateDrive(self): """Create a drive client instance.""" return self.CreateAuthorizedService('drive', 'v2') def CreateUserInfo(self): """Create a user info client instance.""" return self.CreateAuthorizedService('oauth2', 'v2') class MainPage(BaseDriveHandler): """Web handler for the main page. Handles requests and returns the user interface for Open With and Create cases. Responsible for parsing the state provided from the Drive UI and acting appropriately. """ def get(self): """Handle GET for Create New and Open With. This creates an authorized client, and checks whether a resource id has been passed or not. If a resource ID has been passed, this is the Open With use-case, otherwise it is the Create New use-case. """ # Generate a state instance for the request, this includes the action, and # the file id(s) that have been sent from the Drive user interface. drive_state = DriveState.FromRequest(self.request) if drive_state.action == 'open' and len(drive_state.ids) > 0: code = self.request.get('code') if code: code = '?code=%s' % code self.redirect('/#edit/%s%s' % (drive_state.ids[0], code)) return # Fetch the credentials by extracting an OAuth 2.0 authorization code from # the request URL. If the code is not present, redirect to the OAuth 2.0 # authorization URL. creds = self.GetCodeCredentials() if not creds: return self.RedirectAuth() # Extract the numerical portion of the client_id from the stored value in # the OAuth flow. You could also store this value as a separate variable # somewhere. client_id = self.CreateOAuthFlow().client_id.split('.')[0].split('-')[0] self.RenderTemplate() def RenderTemplate(self): """Render a named template in a context.""" self.response.headers['Content-Type'] = 'text/html' self.response.out.write(INDEX_HTML) class ServiceHandler(BaseDriveHandler): """Web handler for the service to read and write to Drive.""" def post(self): """Called when HTTP POST requests are received by the web application. The POST body is JSON which is deserialized and used as values to create a new file in Drive. The authorization access token for this action is retreived from the data store. """ # Create a Drive service service = self.CreateDrive() if service is None: return # Load the data that has been posted as JSON data = self.RequestJSON() # Create a new file data structure. resource = { 'title': data['title'], 'description': data['description'], 'mimeType': data['mimeType'], } try: # Make an insert request to create a new file. A MediaInMemoryUpload # instance is used to upload the file body. resource = service.files().insert( body=resource, media_body=MediaInMemoryUpload( data.get('content', ''), data['mimeType'], resumable=True) ).execute() # Respond with the new file id as JSON. self.RespondJSON(resource['id']) except AccessTokenRefreshError: # In cases where the access token has expired and cannot be refreshed # (e.g. manual token revoking) redirect the user to the authorization page # to authorize. self.RedirectAuth() def get(self): """Called when HTTP GET requests are received by the web application. Use the query parameter file_id to fetch the required file's metadata then content and return it as a JSON object. Since DrEdit deals with text files, it is safe to dump the content directly into JSON, but this is not the case with binary files, where something like Base64 encoding is more appropriate. """ # Create a Drive service service = self.CreateDrive() if service is None: return try: # Requests are expected to pass the file_id query parameter. file_id = self.request.get('file_id') if file_id: # Fetch the file metadata by making the service.files().get method of # the Drive API. f = service.files().get(fileId=file_id).execute() downloadUrl = f.get('downloadUrl') # If a download URL is provided in the file metadata, use it to make an # authorized request to fetch the file ontent. Set this content in the # data to return as the 'content' field. If there is no downloadUrl, # just set empty content. if downloadUrl: resp, f['content'] = service._http.request(downloadUrl) else: f['content'] = '' else: f = None # Generate a JSON response with the file data and return to the client. self.RespondJSON(f) except AccessTokenRefreshError: # Catch AccessTokenRefreshError which occurs when the API client library # fails to refresh a token. This occurs, for example, when a refresh token # is revoked. When this happens the user is redirected to the # Authorization URL. self.RedirectAuth() def put(self): """Called when HTTP PUT requests are received by the web application. The PUT body is JSON which is deserialized and used as values to update a file in Drive. The authorization access token for this action is retreived from the data store. """ # Create a Drive service service = self.CreateDrive() if service is None: return # Load the data that has been posted as JSON data = self.RequestJSON() try: # Create a new file data structure. content = data.get('content') if 'content' in data: data.pop('content') if content is not None: # Make an update request to update the file. A MediaInMemoryUpload # instance is used to upload the file body. Because of a limitation, this # request must be made in two parts, the first to update the metadata, and # the second to update the body. resource = service.files().update( fileId=data['resource_id'], newRevision=self.request.get('newRevision', False), body=data, media_body=MediaInMemoryUpload( content, data['mimeType'], resumable=True) ).execute() else: # Only update the metadata, a patch request is prefered but not yet # supported on Google App Engine; see # http://code.google.com/p/googleappengine/issues/detail?id=6316. resource = service.files().update( fileId=data['resource_id'], newRevision=self.request.get('newRevision', False), body=data).execute() # Respond with the new file id as JSON. self.RespondJSON(resource['id']) except AccessTokenRefreshError: # In cases where the access token has expired and cannot be refreshed # (e.g. manual token revoking) redirect the user to the authorization page # to authorize. self.RedirectAuth() def RequestJSON(self): """Load the request body as JSON. Returns: Request body loaded as JSON or None if there is no request body. """ if self.request.body: return json.loads(self.request.body) class UserHandler(BaseDriveHandler): """Web handler for the service to read user information.""" def get(self): """Called when HTTP GET requests are received by the web application.""" # Create a Drive service service = self.CreateUserInfo() if service is None: return try: result = service.userinfo().get().execute() # Generate a JSON response with the file data and return to the client. self.RespondJSON(result) except AccessTokenRefreshError: # Catch AccessTokenRefreshError which occurs when the API client library # fails to refresh a token. This occurs, for example, when a refresh token # is revoked. When this happens the user is redirected to the # Authorization URL. self.RedirectAuth() class AboutHandler(BaseDriveHandler): """Web handler for the service to read user information.""" def get(self): """Called when HTTP GET requests are received by the web application.""" # Create a Drive service service = self.CreateDrive() if service is None: return try: result = service.about().get().execute() # Generate a JSON response with the file data and return to the client. self.RespondJSON(result) except AccessTokenRefreshError: # Catch AccessTokenRefreshError which occurs when the API client library # fails to refresh a token. This occurs, for example, when a refresh token # is revoked. When this happens the user is redirected to the # Authorization URL. self.RedirectAuth() class MediaInMemoryUpload(MediaUpload): """MediaUpload for a chunk of bytes. Construct a MediaFileUpload and pass as the media_body parameter of the method. For example, if we had a service that allowed plain text: """ def __init__(self, body, mimetype='application/octet-stream', chunksize=256*1024, resumable=False): """Create a new MediaBytesUpload. Args: body: string, Bytes of body content. mimetype: string, Mime-type of the file or default of 'application/octet-stream'. chunksize: int, File will be uploaded in chunks of this many bytes. Only used if resumable=True. resumable: bool, True if this is a resumable upload. False means upload in a single request. """ self._body = body self._mimetype = mimetype self._resumable = resumable self._chunksize = chunksize def chunksize(self): """Chunk size for resumable uploads. Returns: Chunk size in bytes. """ return self._chunksize def mimetype(self): """Mime type of the body. Returns: Mime type. """ return self._mimetype def size(self): """Size of upload. Returns: Size of the body. """ return len(self._body) def resumable(self): """Whether this upload is resumable. Returns: True if resumable upload or False. """ return self._resumable def getbytes(self, begin, length): """Get bytes from the media. Args: begin: int, offset from beginning of file. length: int, number of bytes to read, starting at begin. Returns: A string of bytes read. May be shorter than length if EOF was reached first. """ return self._body[begin:begin + length] # Create an WSGI application suitable for running on App Engine application = webapp.WSGIApplication( [('/', MainPage), ('/svc', ServiceHandler), ('/about', AboutHandler), ('/user', UserHandler)], # XXX Set to False in production. debug=True ) def main(): """Main entry point for executing a request with this handler.""" run_wsgi_app(application) if __name__ == "__main__": main()
ajibawa-2023/Python-Code-Large/train/row_99071
218
605
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_99071:Assign_L17_C0", "label": "__author__ =", "type": "assigned_variable", "loc": [17, 17], "level": 0, "parent": null, "vector": [14, 0, 0.0281, 0.0017, 0, 0.66, 0.0, 777, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "__author__", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "__author__ = 'afshar@google.com (Ali Afshar)'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99071:Import_L21_C0", "label": "sys import sys", "type": "import", "loc": [21, 21], "level": 0, "parent": null, "vector": [1, 0, 0.0347, 0.0017, 0, 0.66, 0.0303, 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_99071:Expr_L22_C0", "label": "insert()", "type": "expression", "loc": [22, 22], "level": 0, "parent": null, "vector": [8, 0, 0.0364, 0.0017, 0, 0.66, 0.0606, 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, 'lib')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99071:Import_L24_C0", "label": "os import os", "type": "import", "loc": [24, 24], "level": 0, "parent": null, "vector": [1, 0, 0.0397, 0.0017, 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_99071:Import_L25_C0", "label": "httplib2 import httplib2", "type": "import", "loc": [25, 25], "level": 0, "parent": null, "vector": [1, 0, 0.0413, 0.0017, 0, 0.66, 0.1212, 273, 0, 1, 0, 0, 273, 0, 0], "semantic": {"name": "httplib2", "arg_names": [], "import_names": ["httplib2"], "rhs_call_name": "", "annotation": ""}, "snippet": "import httplib2"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99071:Import_L26_C0", "label": "sessions import sessions", "type": "import", "loc": [26, 26], "level": 0, "parent": null, "vector": [1, 0, 0.043, 0.0017, 0, 0.66, 0.1515, 787, 0, 1, 0, 0, 787, 0, 0], "semantic": {"name": "sessions", "arg_names": [], "import_names": ["sessions"], "rhs_call_name": "", "annotation": ""}, "snippet": "import sessions"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99071:ImportFrom_L27_C0", "label": "from google.appengine.ext import webapp", "type": "import", "loc": [27, 27], "level": 0, "parent": null, "vector": [1, 0, 0.0446, 0.0017, 0, 0.66, 0.1818, 167, 0, 1, 0, 0, 167, 0, 0], "semantic": {"name": "google.appengine.ext", "arg_names": [], "import_names": ["webapp"], "rhs_call_name": "", "annotation": ""}, "snippet": "from google.appengine.ext import webapp"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99071:ImportFrom_L28_C0", "label": "from google.appengine.ext.webapp.util import run_wsgi_app", "type": "import", "loc": [28, 28], "level": 0, "parent": null, "vector": [1, 0, 0.0463, 0.0017, 0, 0.66, 0.2121, 327, 0, 1, 0, 0, 327, 0, 0], "semantic": {"name": "google.appengine.ext.webapp.util", "arg_names": [], "import_names": ["run_wsgi_app"], "rhs_call_name": "", "annotation": ""}, "snippet": "from google.appengine.ext.webapp.util import run_wsgi_app"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99071:ImportFrom_L29_C0", "label": "from google.appengine.ext import db", "type": "import", "loc": [29, 29], "level": 0, "parent": null, "vector": [1, 0, 0.0479, 0.0017, 0, 0.66, 0.2424, 167, 0, 1, 0, 0, 167, 0, 0], "semantic": {"name": "google.appengine.ext", "arg_names": [], "import_names": ["db"], "rhs_call_name": "", "annotation": ""}, "snippet": "from google.appengine.ext import db"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99071:ImportFrom_L30_C0", "label": "from google.appengine.ext.webapp import template", "type": "import", "loc": [30, 30], "level": 0, "parent": null, "vector": [1, 0, 0.0496, 0.0017, 0, 0.66, 0.2727, 8, 0, 1, 0, 0, 8, 0, 0], "semantic": {"name": "google.appengine.ext.webapp", "arg_names": [], "import_names": ["template"], "rhs_call_name": "", "annotation": ""}, "snippet": "from google.appengine.ext.webapp import template"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99071:ImportFrom_L31_C0", "label": "from apiclient.discovery import build", "type": "import", "loc": [31, 31], "level": 0, "parent": null, "vector": [1, 0, 0.0512, 0.0017, 0, 0.66, 0.303, 78, 0, 1, 0, 0, 78, 0, 0], "semantic": {"name": "apiclient.discovery", "arg_names": [], "import_names": ["build"], "rhs_call_name": "", "annotation": ""}, "snippet": "from apiclient.discovery import build"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99071:ImportFrom_L32_C0", "label": "from apiclient.http import MediaUpload", "type": "import", "loc": [32, 32], "level": 0, "parent": null, "vector": [1, 0, 0.0529, 0.0017, 0, 0.66, 0.3333, 670, 0, 1, 0, 0, 670, 0, 0], "semantic": {"name": "apiclient.http", "arg_names": [], "import_names": ["MediaUpload"], "rhs_call_name": "", "annotation": ""}, "snippet": "from apiclient.http import MediaUpload"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99071:ImportFrom_L33_C0", "label": "from oauth2client.client import flow_from_clientsecrets", "type": "import", "loc": [33, 33], "level": 0, "parent": null, "vector": [1, 0, 0.0545, 0.0017, 0, 0.66, 0.3636, 340, 0, 1, 0, 0, 340, 0, 0], "semantic": {"name": "oauth2client.client", "arg_names": [], "import_names": ["flow_from_clientsecrets"], "rhs_call_name": "", "annotation": ""}, "snippet": "from oauth2client.client import flow_from_clientsecrets"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99071:ImportFrom_L34_C0", "label": "from oauth2client.client import FlowExchangeError", "type": "import", "loc": [34, 34], "level": 0, "parent": null, "vector": [1, 0, 0.0562, 0.0017, 0, 0.66, 0.3939, 340, 0, 1, 0, 0, 340, 0, 0], "semantic": {"name": "oauth2client.client", "arg_names": [], "import_names": ["FlowExchangeError"], "rhs_call_name": "", "annotation": ""}, "snippet": "from oauth2client.client import FlowExchangeError"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99071:ImportFrom_L35_C0", "label": "from oauth2client.client import AccessTokenRefreshError", "type": "import", "loc": [35, 35], "level": 0, "parent": null, "vector": [1, 0, 0.0579, 0.0017, 0, 0.66, 0.4242, 340, 0, 1, 0, 0, 340, 0, 0], "semantic": {"name": "oauth2client.client", "arg_names": [], "import_names": ["AccessTokenRefreshError"], "rhs_call_name": "", "annotation": ""}, "snippet": "from oauth2client.client import AccessTokenRefreshError"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99071:ImportFrom_L36_C0", "label": "from oauth2client.appengine import CredentialsProperty", "type": "import", "loc": [36, 36], "level": 0, "parent": null, "vector": [1, 0, 0.0595, 0.0017, 0, 0.66, 0.4545, 953, 0, 1, 0, 0, 953, 0, 0], "semantic": {"name": "oauth2client.appengine", "arg_names": [], "import_names": ["CredentialsProperty"], "rhs_call_name": "", "annotation": ""}, "snippet": "from oauth2client.appengine import CredentialsProperty"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99071:ImportFrom_L37_C0", "label": "from oauth2client.appengine import StorageByKeyName", "type": "import", "loc": [37, 37], "level": 0, "parent": null, "vector": [1, 0, 0.0612, 0.0017, 0, 0.66, 0.4848, 953, 0, 1, 0, 0, 953, 0, 0], "semantic": {"name": "oauth2client.appengine", "arg_names": [], "import_names": ["StorageByKeyName"], "rhs_call_name": "", "annotation": ""}, "snippet": "from oauth2client.appengine import StorageByKeyName"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99071:ImportFrom_L38_C0", "label": "from oauth2client.appengine import json", "type": "import", "loc": [38, 38], "level": 0, "parent": null, "vector": [1, 0, 0.0628, 0.0017, 0, 0.66, 0.5152, 953, 0, 1, 0, 0, 953, 0, 0], "semantic": {"name": "oauth2client.appengine", "arg_names": [], "import_names": ["json"], "rhs_call_name": "", "annotation": ""}, "snippet": "from oauth2client.appengine import simplejson as json"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99071:Assign_L41_C0", "label": "ALL_SCOPES =", "type": "assigned_variable", "loc": [41, 43], "level": 0, "parent": null, "vector": [14, 0, 0.0694, 0.005, 0, 0.66, 0.5455, 422, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "ALL_SCOPES", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "ALL_SCOPES = ('https://www.googleapis.com/auth/drive.file '\n 'https://www.googleapis.com/auth/userinfo.email '\n 'https://www.googleapis.com/auth/userinfo.profile')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99071:FunctionDef_L46_C0", "label": "SibPath", "type": "function", "loc": [46, 54], "level": 0, "parent": null, "vector": [2, 0, 0.0826, 0.0149, 0, 0.66, 0.5758, 38, 0, 1, 1, 0, 0, 0, 2], "semantic": {"name": "SibPath", "arg_names": ["name"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def SibPath(name):\n \"\"\"Generate a path that is a sibling of this file.\n\n Args:\n name: Name of sibling file.\n Returns:\n Path to sibling file.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99071:Expr_L47_C2", "label": "expression", "type": "expression", "loc": [47, 53], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99071:FunctionDef_L46_C0", "vector": [8, 1, 0.0826, 0.0116, 1, 0.77, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Generate a path that is a sibling of this file.\n\n Args:\n name: Name of sibling file.\n Returns:\n Path to sibling file.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99071:Return_L54_C2", "label": "return", "type": "return", "loc": [54, 54], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99071:FunctionDef_L46_C0", "vector": [13, 1, 0.0893, 0.0017, 1, 0.77, 1.0, 0, 3, 0, 0, 0, 0, 10, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return os.path.join(os.path.dirname(__file__), name)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99071:Assign_L60_C0", "label": "SESSION_SECRET = read()", "type": "assigned_variable", "loc": [60, 60], "level": 0, "parent": null, "vector": [14, 0, 0.0992, 0.0017, 0, 0.66, 0.6061, 330, 3, 0, 0, 0, 453, 10, 3], "semantic": {"name": "SESSION_SECRET", "arg_names": [], "import_names": [], "rhs_call_name": "read", "annotation": ""}, "snippet": "SESSION_SECRET = open(SibPath('session.secret')).read()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99071:Assign_L61_C0", "label": "INDEX_HTML = read()", "type": "assigned_variable", "loc": [61, 61], "level": 0, "parent": null, "vector": [14, 0, 0.1008, 0.0017, 0, 0.66, 0.6364, 221, 3, 0, 0, 0, 453, 10, 3], "semantic": {"name": "INDEX_HTML", "arg_names": [], "import_names": [], "rhs_call_name": "read", "annotation": ""}, "snippet": "INDEX_HTML = open(SibPath('index.html')).read()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99071:ClassDef_L64_C0", "label": "Credentials", "type": "class", "loc": [64, 69], "level": 0, "parent": null, "vector": [3, 0, 0.1099, 0.0099, 0, 0.66, 0.6667, 309, 0, 0, 0, 0, 697, 0, 1], "semantic": {"name": "Credentials", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class Credentials(db.Model):\n \"\"\"Datastore entity for storing OAuth2.0 credentials.\n\n The CredentialsProperty is provided by the Google API Python Client, and is\n used by the Storage classes to store OAuth 2.0 credentials in the data store.\"\"\"\n credentials = CredentialsProperty()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99071:Expr_L65_C2", "label": "expression", "type": "expression", "loc": [65, 68], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99071:ClassDef_L64_C0", "vector": [8, 1, 0.1099, 0.0066, 1, 0.23, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Datastore entity for storing OAuth2.0 credentials.\n\n The CredentialsProperty is provided by the Google API Python Client, and is\n used by the Storage classes to store OAuth 2.0 credentials in the data store.\"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99071:Assign_L69_C2", "label": "credentials = CredentialsProperty()", "type": "assigned_variable", "loc": [69, 69], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99071:ClassDef_L64_C0", "vector": [14, 1, 0.114, 0.0017, 1, 0.23, 1.0, 198, 3, 0, 0, 0, 135, 10, 1], "semantic": {"name": "credentials", "arg_names": [], "import_names": [], "rhs_call_name": "CredentialsProperty", "annotation": ""}, "snippet": " credentials = CredentialsProperty()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99071:FunctionDef_L72_C0", "label": "CreateService", "type": "function", "loc": [72, 92], "level": 0, "parent": null, "vector": [2, 0, 0.1355, 0.0347, 0, 0.66, 0.697, 493, 0, 3, 1, 0, 0, 0, 3], "semantic": {"name": "CreateService", "arg_names": ["service", "version", "creds"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def CreateService(service, version, creds):\n \"\"\"Create a Google API service.\n\n Load an API service from a discovery document and authorize it with the\n provided credentials.\n\n Args:\n service: Service name (e.g 'drive', 'oauth2')."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99071:Expr_L73_C2", "label": "expression", "type": "expression", "loc": [73, 84], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99071:FunctionDef_L72_C0", "vector": [8, 1, 0.1298, 0.0198, 1, 0.64, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Create a Google API service.\n\n Load an API service from a discovery document and authorize it with the\n provided credentials.\n\n Args:\n service: Service name (e.g 'drive', 'oauth2').\n version: Service version (e.g 'v1')."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99071:Assign_L86_C2", "label": "http = Http()", "type": "assigned_variable", "loc": [86, 86], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99071:FunctionDef_L72_C0", "vector": [14, 1, 0.1421, 0.0017, 1, 0.64, 0.3333, 415, 3, 0, 0, 0, 967, 10, 1], "semantic": {"name": "http", "arg_names": [], "import_names": [], "rhs_call_name": "Http", "annotation": ""}, "snippet": " http = httplib2.Http()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99071:Expr_L89_C2", "label": "authorize()", "type": "expression", "loc": [89, 89], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99071:FunctionDef_L72_C0", "vector": [8, 1, 0.1471, 0.0017, 1, 0.64, 0.6667, 880, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "authorize", "arg_names": [], "import_names": [], "rhs_call_name": "authorize", "annotation": ""}, "snippet": " creds.authorize(http)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99071:Return_L92_C2", "label": "return", "type": "return", "loc": [92, 92], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99071:FunctionDef_L72_C0", "vector": [13, 1, 0.1521, 0.0017, 1, 0.64, 1.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return build(service, version, http=http)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99071:ClassDef_L95_C0", "label": "DriveState", "type": "class", "loc": [95, 122], "level": 0, "parent": null, "vector": [3, 0, 0.1793, 0.0463, 0, 0.66, 0.7273, 620, 0, 2, 0, 0, 186, 0, 5], "semantic": {"name": "DriveState", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class DriveState(object):\n \"\"\"Store state provided by Drive.\"\"\"\n\n def __init__(self, state):\n \"\"\"Create a new instance of drive state.\n\n Parse and load the JSON state parameter.\n"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99071:Expr_L96_C2", "label": "expression", "type": "expression", "loc": [96, 96], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99071:ClassDef_L95_C0", "vector": [8, 1, 0.1587, 0.0017, 1, 0.85, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Store state provided by Drive.\"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99071:FunctionDef_L98_C2", "label": "__init__", "type": "function", "loc": [98, 112], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99071:ClassDef_L95_C0", "vector": [2, 1, 0.1736, 0.0248, 1, 0.85, 0.5, 555, 0, 2, 0, 0, 0, 0, 3], "semantic": {"name": "__init__", "arg_names": ["self", "state"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, state):\n \"\"\"Create a new instance of drive state.\n\n Parse and load the JSON state parameter.\n\n Args:\n state: State query parameter as a string.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99071:Expr_L99_C4", "label": "expression", "type": "expression", "loc": [99, 105], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99071:FunctionDef_L98_C2", "vector": [8, 2, 0.1686, 0.0116, 2, 0.43, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Create a new instance of drive state.\n\n Parse and load the JSON state parameter.\n\n Args:\n state: State query parameter as a string.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99071:If_L106_C4", "label": "if", "type": "if", "loc": [106, 112], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99071:FunctionDef_L98_C2", "vector": [4, 2, 0.1802, 0.0116, 2, 0.43, 1.0, 0, 2, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if state:\n state_data = json.loads(state)\n self.action = state_data['action']\n self.ids = map(str, state_data.get('ids', []))\n else:\n self.action = 'create'\n self.ids = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99071:Assign_L107_C6", "label": "state_data = loads()", "type": "assigned_variable", "loc": [107, 107], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99071:If_L106_C4", "vector": [14, 3, 0.1769, 0.0017, 3, 0.05, 0.0, 203, 3, 1, 0, 0, 88, 10, 1], "semantic": {"name": "state_data", "arg_names": [], "import_names": [], "rhs_call_name": "loads", "annotation": ""}, "snippet": " state_data = json.loads(state)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99071:Assign_L108_C6", "label": "self.action =", "type": "assigned_variable", "loc": [108, 108], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99071:If_L106_C4", "vector": [14, 3, 0.1785, 0.0017, 3, 0.05, 0.25, 222, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.action", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.action = state_data['action']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99071:Assign_L109_C6", "label": "self.ids = map()", "type": "assigned_variable", "loc": [109, 109], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99071:If_L106_C4", "vector": [14, 3, 0.1802, 0.0017, 3, 0.05, 0.5, 806, 3, 2, 0, 0, 53, 10, 2], "semantic": {"name": "self.ids", "arg_names": [], "import_names": [], "rhs_call_name": "map", "annotation": ""}, "snippet": " self.ids = map(str, state_data.get('ids', []))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99071:Assign_L111_C6", "label": "self.action =", "type": "assigned_variable", "loc": [111, 111], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99071:If_L106_C4", "vector": [14, 3, 0.1835, 0.0017, 3, 0.05, 0.75, 222, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "self.action", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.action = 'create'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99071:Assign_L112_C6", "label": "self.ids =", "type": "assigned_variable", "loc": [112, 112], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99071:If_L106_C4", "vector": [14, 3, 0.1851, 0.0017, 3, 0.05, 1.0, 806, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "self.ids", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.ids = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99071:FunctionDef_L115_C2", "label": "FromRequest", "type": "function", "loc": [115, 122], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99071:ClassDef_L95_C0", "vector": [2, 1, 0.1959, 0.0132, 1, 0.85, 1.0, 504, 0, 2, 1, 0, 0, 0, 2], "semantic": {"name": "FromRequest", "arg_names": ["cls", "request"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def FromRequest(cls, request):\n \"\"\"Create a Drive State instance from an HTTP request.\n\n Args:\n cls: Type this class method is called against.\n request: HTTP request.\n \"\"\"\n return DriveState(request.get('state'))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99071:Expr_L116_C4", "label": "expression", "type": "expression", "loc": [116, 121], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99071:FunctionDef_L115_C2", "vector": [8, 2, 0.1959, 0.0099, 2, 0.02, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Create a Drive State instance from an HTTP request.\n\n Args:\n cls: Type this class method is called against.\n request: HTTP request.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99071:Return_L122_C4", "label": "return", "type": "return", "loc": [122, 122], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99071:FunctionDef_L115_C2", "vector": [13, 2, 0.2017, 0.0017, 2, 0.02, 1.0, 0, 3, 0, 0, 0, 0, 10, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return DriveState(request.get('state'))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99071:ClassDef_L126_C0", "label": "BaseDriveHandler", "type": "class", "loc": [126, 291], "level": 0, "parent": null, "vector": [3, 0, 0.3446, 0.2744, 0, 0.66, 0.7576, 266, 0, 8, 0, 0, 256, 0, 29], "semantic": {"name": "BaseDriveHandler", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class BaseDriveHandler(webapp.RequestHandler):\n \"\"\"Base request handler for drive applications.\n\n Adds Authorization support for Drive.\n \"\"\"\n\n def CreateOAuthFlow(self):\n \"\"\"Create OAuth2.0 flow controller"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99071:Expr_L127_C2", "label": "expression", "type": "expression", "loc": [127, 130], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99071:ClassDef_L126_C0", "vector": [8, 1, 0.2124, 0.0066, 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 request handler for drive applications.\n\n Adds Authorization support for Drive.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99071:FunctionDef_L132_C2", "label": "CreateOAuthFlow", "type": "function", "loc": [132, 148], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99071:ClassDef_L126_C0", "vector": [2, 1, 0.2314, 0.0281, 1, 0.0, 0.125, 672, 0, 1, 1, 0, 0, 0, 3], "semantic": {"name": "CreateOAuthFlow", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def CreateOAuthFlow(self):\n \"\"\"Create OAuth2.0 flow controller\n\n This controller can be used to perform all parts of the OAuth 2.0 dance\n including exchanging an Authorization code.\n\n Args:\n request: HTTP request to create OAuth2.0 flow for"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99071:Expr_L133_C4", "label": "expression", "type": "expression", "loc": [133, 142], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99071:FunctionDef_L132_C2", "vector": [8, 2, 0.2273, 0.0165, 2, 0.27, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Create OAuth2.0 flow controller\n\n This controller can be used to perform all parts of the OAuth 2.0 dance\n including exchanging an Authorization code.\n\n Args:\n request: HTTP request to create OAuth2.0 flow for\n Returns:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99071:Assign_L143_C4", "label": "flow = flow_from_clientsecrets()", "type": "assigned_variable", "loc": [143, 143], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99071:FunctionDef_L132_C2", "vector": [14, 2, 0.2364, 0.0017, 2, 0.27, 0.3333, 258, 3, 2, 0, 0, 355, 10, 1], "semantic": {"name": "flow", "arg_names": [], "import_names": [], "rhs_call_name": "flow_from_clientsecrets", "annotation": ""}, "snippet": " flow = flow_from_clientsecrets('client_secrets.json', scope='')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99071:Assign_L147_C4", "label": "flow.redirect_uri =", "type": "assigned_variable", "loc": [147, 147], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99071:FunctionDef_L132_C2", "vector": [14, 2, 0.243, 0.0017, 2, 0.27, 0.6667, 890, 6, 0, 0, 0, 0, 0, 2], "semantic": {"name": "flow.redirect_uri", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " flow.redirect_uri = self.request.url.split('?', 1)[0].rsplit('/', 1)[0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99071:Return_L148_C4", "label": "return", "type": "return", "loc": [148, 148], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99071:FunctionDef_L132_C2", "vector": [13, 2, 0.2446, 0.0017, 2, 0.27, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return flow"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99071:FunctionDef_L150_C2", "label": "GetCodeCredentials", "type": "function", "loc": [150, 199], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99071:ClassDef_L126_C0", "vector": [2, 1, 0.2884, 0.0826, 1, 0.0, 0.25, 113, 0, 1, 1, 0, 0, 0, 12], "semantic": {"name": "GetCodeCredentials", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def GetCodeCredentials(self):\n \"\"\"Create OAuth 2.0 credentials by extracting a code and performing OAuth2.0.\n\n The authorization code is extracted form the URI parameters. If it is absent,\n None is returned immediately. Otherwise, if it is present, it is used to\n perform step 2 of the OAuth 2.0 web server flow.\n\n Once a token is received, the user information is fetched from the userinfo"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99071:Expr_L151_C4", "label": "expression", "type": "expression", "loc": [151, 167], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99071:FunctionDef_L150_C2", "vector": [8, 2, 0.2628, 0.0281, 2, 0.99, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Create OAuth 2.0 credentials by extracting a code and performing OAuth2.0.\n\n The authorization code is extracted form the URI parameters. If it is absent,\n None is returned immediately. Otherwise, if it is present, it is used to\n perform step 2 of the OAuth 2.0 web server flow.\n\n Once a token is received, the user information is fetched from the userinfo\n service and stored in the session. The token is saved in the datastore against"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99071:Assign_L169_C4", "label": "code = get()", "type": "assigned_variable", "loc": [169, 169], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99071:FunctionDef_L150_C2", "vector": [14, 2, 0.2793, 0.0017, 2, 0.99, 0.1, 44, 3, 1, 0, 0, 607, 10, 1], "semantic": {"name": "code", "arg_names": [], "import_names": [], "rhs_call_name": "get", "annotation": ""}, "snippet": " code = self.request.get('code')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99071:If_L170_C4", "label": "if", "type": "if", "loc": [170, 172], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99071:FunctionDef_L150_C2", "vector": [4, 2, 0.2826, 0.005, 2, 0.99, 0.2, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not code:\n # returns None to indicate that no code was passed from Google Drive.\n return None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99071:Return_L172_C6", "label": "return", "type": "return", "loc": [172, 172], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99071:If_L170_C4", "vector": [13, 3, 0.2843, 0.0017, 3, 0.09, 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_99071:Assign_L176_C4", "label": "oauth_flow = CreateOAuthFlow()", "type": "assigned_variable", "loc": [176, 176], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99071:FunctionDef_L150_C2", "vector": [14, 2, 0.2909, 0.0017, 2, 0.99, 0.3, 725, 3, 0, 0, 0, 672, 10, 1], "semantic": {"name": "oauth_flow", "arg_names": [], "import_names": [], "rhs_call_name": "CreateOAuthFlow", "annotation": ""}, "snippet": " oauth_flow = self.CreateOAuthFlow()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99071:Try_L180_C4", "label": "try", "type": "try", "loc": [180, 183], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99071:FunctionDef_L150_C2", "vector": [7, 2, 0.3, 0.0066, 2, 0.99, 0.4, 0, 0, 1, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " try:\n creds = oauth_flow.step2_exchange(code)\n except FlowExchangeError:\n return None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99071:Assign_L181_C6", "label": "creds = step2_exchange()", "type": "assigned_variable", "loc": [181, 181], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99071:Try_L180_C4", "vector": [14, 3, 0.2992, 0.0017, 3, 0.83, 0.0, 394, 3, 1, 0, 0, 471, 10, 1], "semantic": {"name": "creds", "arg_names": [], "import_names": [], "rhs_call_name": "step2_exchange", "annotation": ""}, "snippet": " creds = oauth_flow.step2_exchange(code)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99071:Return_L183_C6", "label": "return", "type": "return", "loc": [183, 183], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99071:Try_L180_C4", "vector": [13, 3, 0.3025, 0.0017, 3, 0.83, 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_99071:Assign_L187_C4", "label": "users_service = CreateService()", "type": "assigned_variable", "loc": [187, 187], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99071:FunctionDef_L150_C2", "vector": [14, 2, 0.3091, 0.0017, 2, 0.99, 0.5, 630, 3, 3, 0, 0, 493, 10, 1], "semantic": {"name": "users_service", "arg_names": [], "import_names": [], "rhs_call_name": "CreateService", "annotation": ""}, "snippet": " users_service = CreateService('oauth2', 'v2', creds)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99071:Assign_L191_C4", "label": "userid = get()", "type": "assigned_variable", "loc": [191, 191], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99071:FunctionDef_L150_C2", "vector": [14, 2, 0.3157, 0.0017, 2, 0.99, 0.6, 403, 3, 1, 0, 0, 607, 10, 4], "semantic": {"name": "userid", "arg_names": [], "import_names": [], "rhs_call_name": "get", "annotation": ""}, "snippet": " userid = users_service.userinfo().get().execute().get('id')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99071:Assign_L194_C4", "label": "session = LilCookies()", "type": "assigned_variable", "loc": [194, 194], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99071:FunctionDef_L150_C2", "vector": [14, 2, 0.3207, 0.0017, 2, 0.99, 0.7, 83, 3, 2, 0, 0, 220, 10, 1], "semantic": {"name": "session", "arg_names": [], "import_names": [], "rhs_call_name": "LilCookies", "annotation": ""}, "snippet": " session = sessions.LilCookies(self, SESSION_SECRET)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99071:Expr_L195_C4", "label": "set_secure_cookie()", "type": "expression", "loc": [195, 195], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99071:FunctionDef_L150_C2", "vector": [8, 2, 0.3223, 0.0017, 2, 0.99, 0.8, 330, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "set_secure_cookie", "arg_names": [], "import_names": [], "rhs_call_name": "set_secure_cookie", "annotation": ""}, "snippet": " session.set_secure_cookie(name='userid', value=userid)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99071:Expr_L198_C4", "label": "put()", "type": "expression", "loc": [198, 198], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99071:FunctionDef_L150_C2", "vector": [8, 2, 0.3273, 0.0017, 2, 0.99, 0.9, 636, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "put", "arg_names": [], "import_names": [], "rhs_call_name": "put", "annotation": ""}, "snippet": " StorageByKeyName(Credentials, userid, 'credentials').put(creds)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99071:Return_L199_C4", "label": "return", "type": "return", "loc": [199, 199], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99071:FunctionDef_L150_C2", "vector": [13, 2, 0.3289, 0.0017, 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 creds"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99071:FunctionDef_L201_C2", "label": "GetSessionCredentials", "type": "function", "loc": [201, 228], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99071:ClassDef_L126_C0", "vector": [2, 1, 0.3545, 0.0463, 1, 0.0, 0.375, 208, 0, 1, 1, 0, 0, 0, 4], "semantic": {"name": "GetSessionCredentials", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def GetSessionCredentials(self):\n \"\"\"Get OAuth 2.0 credentials for an HTTP session.\n\n If the user has a user id stored in their cookie session, extract that value\n and use it to load that user's credentials from the data store.\n\n Args:\n request: HTTP request to use session from."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99071:Expr_L202_C4", "label": "expression", "type": "expression", "loc": [202, 211], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99071:FunctionDef_L201_C2", "vector": [8, 2, 0.3413, 0.0165, 2, 0.14, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Get OAuth 2.0 credentials for an HTTP session.\n\n If the user has a user id stored in their cookie session, extract that value\n and use it to load that user's credentials from the data store.\n\n Args:\n request: HTTP request to use session from.\n Returns:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99071:Assign_L213_C4", "label": "session = LilCookies()", "type": "assigned_variable", "loc": [213, 213], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99071:FunctionDef_L201_C2", "vector": [14, 2, 0.3521, 0.0017, 2, 0.14, 0.1667, 83, 3, 2, 0, 0, 220, 10, 1], "semantic": {"name": "session", "arg_names": [], "import_names": [], "rhs_call_name": "LilCookies", "annotation": ""}, "snippet": " session = sessions.LilCookies(self, SESSION_SECRET)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99071:Assign_L214_C4", "label": "userid = get_secure_cookie()", "type": "assigned_variable", "loc": [214, 214], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99071:FunctionDef_L201_C2", "vector": [14, 2, 0.3537, 0.0017, 2, 0.14, 0.3333, 403, 3, 1, 0, 0, 71, 10, 1], "semantic": {"name": "userid", "arg_names": [], "import_names": [], "rhs_call_name": "get_secure_cookie", "annotation": ""}, "snippet": " userid = session.get_secure_cookie(name='userid')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99071:If_L215_C4", "label": "if", "type": "if", "loc": [215, 218], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99071:FunctionDef_L201_C2", "vector": [4, 2, 0.3579, 0.0066, 2, 0.14, 0.5, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not userid:\n # return None to indicate that no credentials could be loaded from the\n # session.\n return None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99071:Return_L218_C6", "label": "return", "type": "return", "loc": [218, 218], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99071:If_L215_C4", "vector": [13, 3, 0.3603, 0.0017, 3, 0.6, 0.0, 0, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99071:Assign_L221_C4", "label": "creds = get()", "type": "assigned_variable", "loc": [221, 221], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99071:FunctionDef_L201_C2", "vector": [14, 2, 0.3653, 0.0017, 2, 0.14, 0.6667, 394, 3, 0, 0, 0, 607, 10, 2], "semantic": {"name": "creds", "arg_names": [], "import_names": [], "rhs_call_name": "get", "annotation": ""}, "snippet": " creds = StorageByKeyName(Credentials, userid, 'credentials').get()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99071:If_L225_C4", "label": "if", "type": "if", "loc": [225, 226], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99071:FunctionDef_L201_C2", "vector": [4, 2, 0.3727, 0.0033, 2, 0.14, 0.8333, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if creds and creds.invalid:\n return None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99071:Return_L226_C6", "label": "return", "type": "return", "loc": [226, 226], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99071:If_L225_C4", "vector": [13, 3, 0.3736, 0.0017, 3, 0.57, 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_99071:Return_L228_C4", "label": "return", "type": "return", "loc": [228, 228], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99071:FunctionDef_L201_C2", "vector": [13, 2, 0.3769, 0.0017, 2, 0.14, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return creds"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99071:FunctionDef_L230_C2", "label": "RedirectAuth", "type": "function", "loc": [230, 252], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99071:ClassDef_L126_C0", "vector": [2, 1, 0.3983, 0.038, 1, 0.0, 0.5, 681, 0, 1, 0, 0, 0, 0, 3], "semantic": {"name": "RedirectAuth", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def RedirectAuth(self):\n \"\"\"Redirect a handler to an authorization page.\n\n Used when a handler fails to fetch credentials suitable for making Drive API\n requests. The request is redirected to an OAuth 2.0 authorization approval\n page and on approval, are returned to application.\n\n Args:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99071:Expr_L231_C4", "label": "expression", "type": "expression", "loc": [231, 239], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99071:FunctionDef_L230_C2", "vector": [8, 2, 0.3884, 0.0149, 2, 0.44, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Redirect a handler to an authorization page.\n\n Used when a handler fails to fetch credentials suitable for making Drive API\n requests. The request is redirected to an OAuth 2.0 authorization approval\n page and on approval, are returned to application.\n\n Args:\n handler: webapp.RequestHandler to redirect."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99071:Assign_L240_C4", "label": "flow = CreateOAuthFlow()", "type": "assigned_variable", "loc": [240, 240], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99071:FunctionDef_L230_C2", "vector": [14, 2, 0.3967, 0.0017, 2, 0.44, 0.25, 258, 3, 0, 0, 0, 672, 10, 1], "semantic": {"name": "flow", "arg_names": [], "import_names": [], "rhs_call_name": "CreateOAuthFlow", "annotation": ""}, "snippet": " flow = self.CreateOAuthFlow()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99071:Assign_L245_C4", "label": "flow.scope =", "type": "assigned_variable", "loc": [245, 245], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99071:FunctionDef_L230_C2", "vector": [14, 2, 0.405, 0.0017, 2, 0.44, 0.5, 584, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "flow.scope", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " flow.scope = ALL_SCOPES"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99071:Assign_L249_C4", "label": "uri = step1_get_authorize_url()", "type": "assigned_variable", "loc": [249, 249], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99071:FunctionDef_L230_C2", "vector": [14, 2, 0.4116, 0.0017, 2, 0.44, 0.75, 600, 3, 1, 0, 0, 752, 10, 1], "semantic": {"name": "uri", "arg_names": [], "import_names": [], "rhs_call_name": "step1_get_authorize_url", "annotation": ""}, "snippet": " uri = flow.step1_get_authorize_url(flow.redirect_uri)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99071:Expr_L252_C4", "label": "redirect()", "type": "expression", "loc": [252, 252], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99071:FunctionDef_L230_C2", "vector": [8, 2, 0.4165, 0.0017, 2, 0.44, 1.0, 206, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "redirect", "arg_names": [], "import_names": [], "rhs_call_name": "redirect", "annotation": ""}, "snippet": " self.redirect(uri)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99071:FunctionDef_L254_C2", "label": "RespondJSON", "type": "function", "loc": [254, 261], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99071:ClassDef_L126_C0", "vector": [2, 1, 0.4256, 0.0132, 1, 0.0, 0.625, 530, 0, 2, 0, 0, 0, 0, 2], "semantic": {"name": "RespondJSON", "arg_names": ["self", "data"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def RespondJSON(self, data):\n \"\"\"Generate a JSON response and return it to the client.\n\n Args:\n data: The data that will be converted to JSON to return.\n \"\"\"\n self.response.headers['Content-Type'] = 'application/json'\n self.response.out.write(json.dumps(data))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99071:Expr_L255_C4", "label": "expression", "type": "expression", "loc": [255, 259], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99071:FunctionDef_L254_C2", "vector": [8, 2, 0.4248, 0.0083, 2, 0.09, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Generate a JSON response and return it to the client.\n\n Args:\n data: The data that will be converted to JSON to return.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99071:Assign_L260_C4", "label": "assign", "type": "assigned_variable", "loc": [260, 260], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99071:FunctionDef_L254_C2", "vector": [14, 2, 0.4298, 0.0017, 2, 0.09, 0.5, 0, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.response.headers['Content-Type'] = 'application/json'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99071:Expr_L261_C4", "label": "write()", "type": "expression", "loc": [261, 261], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99071:FunctionDef_L254_C2", "vector": [8, 2, 0.4314, 0.0017, 2, 0.09, 1.0, 837, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "write", "arg_names": [], "import_names": [], "rhs_call_name": "write", "annotation": ""}, "snippet": " self.response.out.write(json.dumps(data))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99071:FunctionDef_L263_C2", "label": "CreateAuthorizedService", "type": "function", "loc": [263, 283], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99071:ClassDef_L126_C0", "vector": [2, 1, 0.4512, 0.0347, 1, 0.0, 0.75, 947, 0, 3, 1, 0, 0, 0, 3], "semantic": {"name": "CreateAuthorizedService", "arg_names": ["self", "service", "version"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def CreateAuthorizedService(self, service, version):\n \"\"\"Create an authorize service instance.\n\n The service can only ever retrieve the credentials from the session.\n\n Args:\n service: Service name (e.g 'drive', 'oauth2').\n version: Service version (e.g 'v1')."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99071:Expr_L264_C4", "label": "expression", "type": "expression", "loc": [264, 273], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99071:FunctionDef_L263_C2", "vector": [8, 2, 0.4438, 0.0165, 2, 0.82, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Create an authorize service instance.\n\n The service can only ever retrieve the credentials from the session.\n\n Args:\n service: Service name (e.g 'drive', 'oauth2').\n version: Service version (e.g 'v1').\n Returns:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99071:Assign_L275_C4", "label": "creds = GetSessionCredentials()", "type": "assigned_variable", "loc": [275, 275], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99071:FunctionDef_L263_C2", "vector": [14, 2, 0.4545, 0.0017, 2, 0.82, 0.5, 394, 3, 0, 0, 0, 208, 10, 1], "semantic": {"name": "creds", "arg_names": [], "import_names": [], "rhs_call_name": "GetSessionCredentials", "annotation": ""}, "snippet": " creds = self.GetSessionCredentials()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99071:If_L276_C4", "label": "if", "type": "if", "loc": [276, 283], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99071:FunctionDef_L263_C2", "vector": [4, 2, 0.462, 0.0132, 2, 0.82, 1.0, 0, 2, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if creds:\n # If the session contains credentials, use them to create a Drive service\n # instance.\n return CreateService(service, version, creds)\n else:\n # If no credentials could be loaded from the session, redirect the user to\n # the authorization page.\n self.RedirectAuth()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99071:Return_L279_C6", "label": "return", "type": "return", "loc": [279, 279], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99071:If_L276_C4", "vector": [13, 3, 0.4612, 0.0017, 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 CreateService(service, version, creds)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99071:Expr_L283_C6", "label": "RedirectAuth()", "type": "expression", "loc": [283, 283], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99071:If_L276_C4", "vector": [8, 3, 0.4678, 0.0017, 3, 0.26, 1.0, 681, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "RedirectAuth", "arg_names": [], "import_names": [], "rhs_call_name": "RedirectAuth", "annotation": ""}, "snippet": " self.RedirectAuth()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99071:FunctionDef_L285_C2", "label": "CreateDrive", "type": "function", "loc": [285, 287], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99071:ClassDef_L126_C0", "vector": [2, 1, 0.4727, 0.005, 1, 0.0, 0.875, 839, 0, 1, 1, 0, 0, 0, 1], "semantic": {"name": "CreateDrive", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def CreateDrive(self):\n \"\"\"Create a drive client instance.\"\"\"\n return self.CreateAuthorizedService('drive', 'v2')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99071:Expr_L286_C4", "label": "expression", "type": "expression", "loc": [286, 286], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99071:FunctionDef_L285_C2", "vector": [8, 2, 0.4727, 0.0017, 2, 0.49, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Create a drive client instance.\"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99071:Return_L287_C4", "label": "return", "type": "return", "loc": [287, 287], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99071:FunctionDef_L285_C2", "vector": [13, 2, 0.4744, 0.0017, 2, 0.49, 1.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self.CreateAuthorizedService('drive', 'v2')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99071:FunctionDef_L289_C2", "label": "CreateUserInfo", "type": "function", "loc": [289, 291], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99071:ClassDef_L126_C0", "vector": [2, 1, 0.4793, 0.005, 1, 0.0, 1.0, 15, 0, 1, 1, 0, 0, 0, 1], "semantic": {"name": "CreateUserInfo", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def CreateUserInfo(self):\n \"\"\"Create a user info client instance.\"\"\"\n return self.CreateAuthorizedService('oauth2', 'v2')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99071:Expr_L290_C4", "label": "expression", "type": "expression", "loc": [290, 290], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99071:FunctionDef_L289_C2", "vector": [8, 2, 0.4793, 0.0017, 2, 0.7, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Create a user info client instance.\"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99071:Return_L291_C4", "label": "return", "type": "return", "loc": [291, 291], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99071:FunctionDef_L289_C2", "vector": [13, 2, 0.481, 0.0017, 2, 0.7, 1.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self.CreateAuthorizedService('oauth2', 'v2')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99071:ClassDef_L294_C0", "label": "MainPage", "type": "class", "loc": [294, 334], "level": 0, "parent": null, "vector": [3, 0, 0.519, 0.0678, 0, 0.66, 0.7879, 516, 0, 2, 0, 0, 266, 0, 11], "semantic": {"name": "MainPage", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class MainPage(BaseDriveHandler):\n \"\"\"Web handler for the main page.\n\n Handles requests and returns the user interface for Open With and Create\n cases. Responsible for parsing the state provided from the Drive UI and acting\n appropriately.\n \"\"\"\n"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99071:Expr_L295_C2", "label": "expression", "type": "expression", "loc": [295, 300], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99071:ClassDef_L294_C0", "vector": [8, 1, 0.4917, 0.0099, 1, 0.08, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Web handler for the main page.\n\n Handles requests and returns the user interface for Open With and Create\n cases. Responsible for parsing the state provided from the Drive UI and acting\n appropriately.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99071:FunctionDef_L302_C2", "label": "get", "type": "function", "loc": [302, 329], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99071:ClassDef_L294_C0", "vector": [2, 1, 0.5215, 0.0463, 1, 0.08, 0.5, 607, 0, 1, 1, 0, 0, 0, 10], "semantic": {"name": "get", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def get(self):\n \"\"\"Handle GET for Create New and Open With.\n\n This creates an authorized client, and checks whether a resource id has\n been passed or not. If a resource ID has been passed, this is the Open\n With use-case, otherwise it is the Create New use-case.\n \"\"\"\n # Generate a state instance for the request, this includes the action, and"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99071:Expr_L303_C4", "label": "expression", "type": "expression", "loc": [303, 308], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99071:FunctionDef_L302_C2", "vector": [8, 2, 0.505, 0.0099, 2, 0.56, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Handle GET for Create New and Open With.\n\n This creates an authorized client, and checks whether a resource id has\n been passed or not. If a resource ID has been passed, this is the Open\n With use-case, otherwise it is the Create New use-case.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99071:Assign_L311_C4", "label": "drive_state = FromRequest()", "type": "assigned_variable", "loc": [311, 311], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99071:FunctionDef_L302_C2", "vector": [14, 2, 0.514, 0.0017, 2, 0.56, 0.1667, 359, 3, 1, 0, 0, 504, 10, 1], "semantic": {"name": "drive_state", "arg_names": [], "import_names": [], "rhs_call_name": "FromRequest", "annotation": ""}, "snippet": " drive_state = DriveState.FromRequest(self.request)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99071:If_L312_C4", "label": "if", "type": "if", "loc": [312, 317], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99071:FunctionDef_L302_C2", "vector": [4, 2, 0.5198, 0.0099, 2, 0.56, 0.3333, 0, 0, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if drive_state.action == 'open' and len(drive_state.ids) > 0:\n code = self.request.get('code')\n if code:\n code = '?code=%s' % code\n self.redirect('/#edit/%s%s' % (drive_state.ids[0], code))\n return"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99071:Assign_L313_C6", "label": "code = get()", "type": "assigned_variable", "loc": [313, 313], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99071:If_L312_C4", "vector": [14, 3, 0.5174, 0.0017, 3, 0.02, 0.0, 44, 3, 1, 0, 0, 607, 10, 1], "semantic": {"name": "code", "arg_names": [], "import_names": [], "rhs_call_name": "get", "annotation": ""}, "snippet": " code = self.request.get('code')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99071:If_L314_C6", "label": "if", "type": "if", "loc": [314, 315], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99071:If_L312_C4", "vector": [4, 3, 0.5198, 0.0033, 3, 0.02, 0.3333, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if code:\n code = '?code=%s' % code"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99071:Assign_L315_C8", "label": "code =", "type": "assigned_variable", "loc": [315, 315], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99071:If_L314_C6", "vector": [14, 4, 0.5207, 0.0017, 4, 0.77, 0.0, 44, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "code", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " code = '?code=%s' % code"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99071:Expr_L316_C6", "label": "redirect()", "type": "expression", "loc": [316, 316], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99071:If_L312_C4", "vector": [8, 3, 0.5223, 0.0017, 3, 0.02, 0.6667, 206, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "redirect", "arg_names": [], "import_names": [], "rhs_call_name": "redirect", "annotation": ""}, "snippet": " self.redirect('/#edit/%s%s' % (drive_state.ids[0], code))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99071:Return_L317_C6", "label": "return", "type": "return", "loc": [317, 317], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99071:If_L312_C4", "vector": [13, 3, 0.524, 0.0017, 3, 0.02, 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_99071:Assign_L321_C4", "label": "creds = GetCodeCredentials()", "type": "assigned_variable", "loc": [321, 321], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99071:FunctionDef_L302_C2", "vector": [14, 2, 0.5306, 0.0017, 2, 0.56, 0.5, 394, 3, 0, 0, 0, 113, 10, 1], "semantic": {"name": "creds", "arg_names": [], "import_names": [], "rhs_call_name": "GetCodeCredentials", "annotation": ""}, "snippet": " creds = self.GetCodeCredentials()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99071:If_L322_C4", "label": "if", "type": "if", "loc": [322, 323], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99071:FunctionDef_L302_C2", "vector": [4, 2, 0.5331, 0.0033, 2, 0.56, 0.6667, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not creds:\n return self.RedirectAuth()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99071:Return_L323_C6", "label": "return", "type": "return", "loc": [323, 323], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99071:If_L322_C4", "vector": [13, 3, 0.5339, 0.0017, 3, 0.45, 0.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self.RedirectAuth()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99071:Assign_L328_C4", "label": "client_id =", "type": "assigned_variable", "loc": [328, 328], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99071:FunctionDef_L302_C2", "vector": [14, 2, 0.5421, 0.0017, 2, 0.56, 0.8333, 542, 6, 0, 0, 0, 0, 0, 3], "semantic": {"name": "client_id", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " client_id = self.CreateOAuthFlow().client_id.split('.')[0].split('-')[0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99071:Expr_L329_C4", "label": "RenderTemplate()", "type": "expression", "loc": [329, 329], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99071:FunctionDef_L302_C2", "vector": [8, 2, 0.5438, 0.0017, 2, 0.56, 1.0, 734, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "RenderTemplate", "arg_names": [], "import_names": [], "rhs_call_name": "RenderTemplate", "annotation": ""}, "snippet": " self.RenderTemplate()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99071:FunctionDef_L331_C2", "label": "RenderTemplate", "type": "function", "loc": [331, 334], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99071:ClassDef_L294_C0", "vector": [2, 1, 0.5496, 0.0066, 1, 0.08, 1.0, 734, 0, 1, 0, 0, 0, 0, 1], "semantic": {"name": "RenderTemplate", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def RenderTemplate(self):\n \"\"\"Render a named template in a context.\"\"\"\n self.response.headers['Content-Type'] = 'text/html'\n self.response.out.write(INDEX_HTML)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99071:Expr_L332_C4", "label": "expression", "type": "expression", "loc": [332, 332], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99071:FunctionDef_L331_C2", "vector": [8, 2, 0.5488, 0.0017, 2, 0.97, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Render a named template in a context.\"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99071:Assign_L333_C4", "label": "assign", "type": "assigned_variable", "loc": [333, 333], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99071:FunctionDef_L331_C2", "vector": [14, 2, 0.5504, 0.0017, 2, 0.97, 0.5, 0, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.response.headers['Content-Type'] = 'text/html'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99071:Expr_L334_C4", "label": "write()", "type": "expression", "loc": [334, 334], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99071:FunctionDef_L331_C2", "vector": [8, 2, 0.5521, 0.0017, 2, 0.97, 1.0, 837, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "write", "arg_names": [], "import_names": [], "rhs_call_name": "write", "annotation": ""}, "snippet": " self.response.out.write(INDEX_HTML)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99071:ClassDef_L337_C0", "label": "ServiceHandler", "type": "class", "loc": [337, 473], "level": 0, "parent": null, "vector": [3, 0, 0.6694, 0.2264, 0, 0.66, 0.8182, 115, 0, 4, 0, 0, 266, 0, 34], "semantic": {"name": "ServiceHandler", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class ServiceHandler(BaseDriveHandler):\n \"\"\"Web handler for the service to read and write to Drive.\"\"\"\n\n def post(self):\n \"\"\"Called when HTTP POST requests are received by the web application.\n\n The POST body is JSON which is deserialized and used as values to create a\n new file in Drive. The authorization access token for this action is"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99071:Expr_L338_C2", "label": "expression", "type": "expression", "loc": [338, 338], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99071:ClassDef_L337_C0", "vector": [8, 1, 0.5587, 0.0017, 1, 0.64, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Web handler for the service to read and write to Drive.\"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99071:FunctionDef_L340_C2", "label": "post", "type": "function", "loc": [340, 377], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99071:ClassDef_L337_C0", "vector": [2, 1, 0.5926, 0.0628, 1, 0.64, 0.25, 304, 0, 1, 0, 0, 0, 0, 9], "semantic": {"name": "post", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def post(self):\n \"\"\"Called when HTTP POST requests are received by the web application.\n\n The POST body is JSON which is deserialized and used as values to create a\n new file in Drive. The authorization access token for this action is\n retreived from the data store.\n \"\"\"\n # Create a Drive service"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99071:Expr_L341_C4", "label": "expression", "type": "expression", "loc": [341, 346], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99071:FunctionDef_L340_C2", "vector": [8, 2, 0.5678, 0.0099, 2, 0.93, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Called when HTTP POST requests are received by the web application.\n\n The POST body is JSON which is deserialized and used as values to create a\n new file in Drive. The authorization access token for this action is\n retreived from the data store.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99071:Assign_L348_C4", "label": "service = CreateDrive()", "type": "assigned_variable", "loc": [348, 348], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99071:FunctionDef_L340_C2", "vector": [14, 2, 0.5752, 0.0017, 2, 0.93, 0.2, 314, 3, 0, 0, 0, 839, 10, 1], "semantic": {"name": "service", "arg_names": [], "import_names": [], "rhs_call_name": "CreateDrive", "annotation": ""}, "snippet": " service = self.CreateDrive()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99071:If_L349_C4", "label": "if", "type": "if", "loc": [349, 350], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99071:FunctionDef_L340_C2", "vector": [4, 2, 0.5777, 0.0033, 2, 0.93, 0.4, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if service is None:\n return"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99071:Return_L350_C6", "label": "return", "type": "return", "loc": [350, 350], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99071:If_L349_C4", "vector": [13, 3, 0.5785, 0.0017, 3, 0.56, 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_99071:Assign_L353_C4", "label": "data = RequestJSON()", "type": "assigned_variable", "loc": [353, 353], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99071:FunctionDef_L340_C2", "vector": [14, 2, 0.5835, 0.0017, 2, 0.93, 0.6, 929, 3, 0, 0, 0, 552, 10, 1], "semantic": {"name": "data", "arg_names": [], "import_names": [], "rhs_call_name": "RequestJSON", "annotation": ""}, "snippet": " data = self.RequestJSON()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99071:Assign_L356_C4", "label": "resource =", "type": "assigned_variable", "loc": [356, 360], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99071:FunctionDef_L340_C2", "vector": [14, 2, 0.5917, 0.0083, 2, 0.93, 0.8, 559, 0, 0, 0, 0, 0, 6, 0], "semantic": {"name": "resource", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " resource = {\n 'title': data['title'],\n 'description': data['description'],\n 'mimeType': data['mimeType'],\n }"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99071:Try_L361_C4", "label": "try", "type": "try", "loc": [361, 377], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99071:FunctionDef_L340_C2", "vector": [7, 2, 0.6099, 0.0281, 2, 0.93, 1.0, 0, 0, 1, 0, 0, 0, 0, 7], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " try:\n # Make an insert request to create a new file. A MediaInMemoryUpload\n # instance is used to upload the file body.\n resource = service.files().insert(\n body=resource,\n media_body=MediaInMemoryUpload(\n data.get('content', ''),\n data['mimeType'],"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99071:Assign_L364_C6", "label": "resource = execute()", "type": "assigned_variable", "loc": [364, 370], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99071:Try_L361_C4", "vector": [14, 3, 0.6066, 0.0116, 3, 0.94, 0.0, 559, 3, 0, 0, 0, 569, 10, 5], "semantic": {"name": "resource", "arg_names": [], "import_names": [], "rhs_call_name": "execute", "annotation": ""}, "snippet": " resource = service.files().insert(\n body=resource,\n media_body=MediaInMemoryUpload(\n data.get('content', ''),\n data['mimeType'],\n resumable=True)\n ).execute()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99071:Expr_L372_C6", "label": "RespondJSON()", "type": "expression", "loc": [372, 372], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99071:Try_L361_C4", "vector": [8, 3, 0.6149, 0.0017, 3, 0.94, 1.0, 530, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "RespondJSON", "arg_names": [], "import_names": [], "rhs_call_name": "RespondJSON", "annotation": ""}, "snippet": " self.RespondJSON(resource['id'])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99071:Expr_L377_C6", "label": "RedirectAuth()", "type": "expression", "loc": [377, 377], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99071:Try_L361_C4", "vector": [8, 3, 0.6231, 0.0017, 3, 0.94, 0.0, 681, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "RedirectAuth", "arg_names": [], "import_names": [], "rhs_call_name": "RedirectAuth", "annotation": ""}, "snippet": " self.RedirectAuth()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99071:FunctionDef_L379_C2", "label": "get", "type": "function", "loc": [379, 418], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99071:ClassDef_L337_C0", "vector": [2, 1, 0.6587, 0.0661, 1, 0.64, 0.5, 607, 0, 1, 0, 0, 0, 0, 9], "semantic": {"name": "get", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def get(self):\n \"\"\"Called when HTTP GET requests are received by the web application.\n\n Use the query parameter file_id to fetch the required file's metadata then\n content and return it as a JSON object.\n\n Since DrEdit deals with text files, it is safe to dump the content directly\n into JSON, but this is not the case with binary files, where something like"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99071:Expr_L380_C4", "label": "expression", "type": "expression", "loc": [380, 388], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99071:FunctionDef_L379_C2", "vector": [8, 2, 0.6347, 0.0149, 2, 0.07, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Called when HTTP GET requests are received by the web application.\n\n Use the query parameter file_id to fetch the required file's metadata then\n content and return it as a JSON object.\n\n Since DrEdit deals with text files, it is safe to dump the content directly\n into JSON, but this is not the case with binary files, where something like\n Base64 encoding is more appropriate."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99071:Assign_L390_C4", "label": "service = CreateDrive()", "type": "assigned_variable", "loc": [390, 390], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99071:FunctionDef_L379_C2", "vector": [14, 2, 0.6446, 0.0017, 2, 0.07, 0.3333, 314, 3, 0, 0, 0, 839, 10, 1], "semantic": {"name": "service", "arg_names": [], "import_names": [], "rhs_call_name": "CreateDrive", "annotation": ""}, "snippet": " service = self.CreateDrive()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99071:If_L391_C4", "label": "if", "type": "if", "loc": [391, 392], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99071:FunctionDef_L379_C2", "vector": [4, 2, 0.6471, 0.0033, 2, 0.07, 0.6667, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if service is None:\n return"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99071:Return_L392_C6", "label": "return", "type": "return", "loc": [392, 392], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99071:If_L391_C4", "vector": [13, 3, 0.6479, 0.0017, 3, 0.96, 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_99071:Try_L393_C4", "label": "try", "type": "try", "loc": [393, 418], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99071:FunctionDef_L379_C2", "vector": [7, 2, 0.6702, 0.043, 2, 0.07, 1.0, 0, 0, 1, 0, 0, 0, 0, 8], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " try:\n # Requests are expected to pass the file_id query parameter.\n file_id = self.request.get('file_id')\n if file_id:\n # Fetch the file metadata by making the service.files().get method of\n # the Drive API.\n f = service.files().get(fileId=file_id).execute()\n downloadUrl = f.get('downloadUrl')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99071:Assign_L395_C6", "label": "file_id = get()", "type": "assigned_variable", "loc": [395, 395], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99071:Try_L393_C4", "vector": [14, 3, 0.6529, 0.0017, 3, 0.83, 0.0, 375, 3, 1, 0, 0, 607, 10, 1], "semantic": {"name": "file_id", "arg_names": [], "import_names": [], "rhs_call_name": "get", "annotation": ""}, "snippet": " file_id = self.request.get('file_id')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99071:If_L396_C6", "label": "if", "type": "if", "loc": [396, 410], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99071:Try_L393_C4", "vector": [4, 3, 0.6661, 0.0248, 3, 0.83, 0.5, 0, 2, 0, 0, 0, 0, 0, 5], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if file_id:\n # Fetch the file metadata by making the service.files().get method of\n # the Drive API.\n f = service.files().get(fileId=file_id).execute()\n downloadUrl = f.get('downloadUrl')\n # If a download URL is provided in the file metadata, use it to make an\n # authorized request to fetch the file ontent. Set this content in the\n # data to return as the 'content' field. If there is no downloadUrl,"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99071:Assign_L399_C8", "label": "f = execute()", "type": "assigned_variable", "loc": [399, 399], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99071:If_L396_C6", "vector": [14, 4, 0.6595, 0.0017, 4, 0.03, 0.0, 899, 3, 0, 0, 0, 569, 10, 3], "semantic": {"name": "f", "arg_names": [], "import_names": [], "rhs_call_name": "execute", "annotation": ""}, "snippet": " f = service.files().get(fileId=file_id).execute()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99071:Assign_L400_C8", "label": "downloadUrl = get()", "type": "assigned_variable", "loc": [400, 400], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99071:If_L396_C6", "vector": [14, 4, 0.6612, 0.0017, 4, 0.03, 0.3333, 667, 3, 1, 0, 0, 607, 10, 1], "semantic": {"name": "downloadUrl", "arg_names": [], "import_names": [], "rhs_call_name": "get", "annotation": ""}, "snippet": " downloadUrl = f.get('downloadUrl')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99071:If_L405_C8", "label": "if", "type": "if", "loc": [405, 408], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99071:If_L396_C6", "vector": [4, 4, 0.6719, 0.0066, 4, 0.03, 0.6667, 0, 2, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if downloadUrl:\n resp, f['content'] = service._http.request(downloadUrl)\n else:\n f['content'] = ''"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99071:Assign_L406_C10", "label": "resp = request()", "type": "assigned_variable", "loc": [406, 406], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99071:If_L405_C8", "vector": [14, 5, 0.6711, 0.0017, 5, 0.5, 0.0, 48, 3, 1, 0, 0, 50, 10, 1], "semantic": {"name": "resp", "arg_names": [], "import_names": [], "rhs_call_name": "request", "annotation": ""}, "snippet": " resp, f['content'] = service._http.request(downloadUrl)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99071:Assign_L408_C10", "label": "assign", "type": "assigned_variable", "loc": [408, 408], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99071:If_L405_C8", "vector": [14, 5, 0.6744, 0.0017, 5, 0.5, 1.0, 0, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " f['content'] = ''"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99071:Assign_L410_C8", "label": "f =", "type": "assigned_variable", "loc": [410, 410], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99071:If_L396_C6", "vector": [14, 4, 0.6777, 0.0017, 4, 0.03, 1.0, 899, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "f", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " f = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99071:Expr_L412_C6", "label": "RespondJSON()", "type": "expression", "loc": [412, 412], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99071:Try_L393_C4", "vector": [8, 3, 0.681, 0.0017, 3, 0.83, 1.0, 530, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "RespondJSON", "arg_names": [], "import_names": [], "rhs_call_name": "RespondJSON", "annotation": ""}, "snippet": " self.RespondJSON(f)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99071:Expr_L418_C6", "label": "RedirectAuth()", "type": "expression", "loc": [418, 418], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99071:Try_L393_C4", "vector": [8, 3, 0.6909, 0.0017, 3, 0.83, 0.0, 681, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "RedirectAuth", "arg_names": [], "import_names": [], "rhs_call_name": "RedirectAuth", "annotation": ""}, "snippet": " self.RedirectAuth()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99071:FunctionDef_L420_C2", "label": "put", "type": "function", "loc": [420, 464], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99071:ClassDef_L337_C0", "vector": [2, 1, 0.7306, 0.0744, 1, 0.64, 0.75, 636, 0, 1, 0, 0, 0, 0, 15], "semantic": {"name": "put", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def put(self):\n \"\"\"Called when HTTP PUT requests are received by the web application.\n\n The PUT body is JSON which is deserialized and used as values to update\n a file in Drive. The authorization access token for this action is\n retreived from the data store.\n \"\"\"\n # Create a Drive service"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99071:Expr_L421_C4", "label": "expression", "type": "expression", "loc": [421, 426], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99071:FunctionDef_L420_C2", "vector": [8, 2, 0.7, 0.0099, 2, 0.55, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Called when HTTP PUT requests are received by the web application.\n\n The PUT body is JSON which is deserialized and used as values to update\n a file in Drive. The authorization access token for this action is\n retreived from the data store.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99071:Assign_L428_C4", "label": "service = CreateDrive()", "type": "assigned_variable", "loc": [428, 428], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99071:FunctionDef_L420_C2", "vector": [14, 2, 0.7074, 0.0017, 2, 0.55, 0.25, 314, 3, 0, 0, 0, 839, 10, 1], "semantic": {"name": "service", "arg_names": [], "import_names": [], "rhs_call_name": "CreateDrive", "annotation": ""}, "snippet": " service = self.CreateDrive()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99071:If_L429_C4", "label": "if", "type": "if", "loc": [429, 430], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99071:FunctionDef_L420_C2", "vector": [4, 2, 0.7099, 0.0033, 2, 0.55, 0.5, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if service is None:\n return"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99071:Return_L430_C6", "label": "return", "type": "return", "loc": [430, 430], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99071:If_L429_C4", "vector": [13, 3, 0.7107, 0.0017, 3, 0.38, 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_99071:Assign_L432_C4", "label": "data = RequestJSON()", "type": "assigned_variable", "loc": [432, 432], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99071:FunctionDef_L420_C2", "vector": [14, 2, 0.714, 0.0017, 2, 0.55, 0.75, 929, 3, 0, 0, 0, 552, 10, 1], "semantic": {"name": "data", "arg_names": [], "import_names": [], "rhs_call_name": "RequestJSON", "annotation": ""}, "snippet": " data = self.RequestJSON()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99071:Try_L433_C4", "label": "try", "type": "try", "loc": [433, 464], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99071:FunctionDef_L420_C2", "vector": [7, 2, 0.7413, 0.0529, 2, 0.55, 1.0, 0, 0, 1, 0, 0, 0, 0, 13], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " try:\n # Create a new file data structure.\n content = data.get('content')\n if 'content' in data:\n data.pop('content')\n if content is not None:\n # Make an update request to update the file. A MediaInMemoryUpload\n # instance is used to upload the file body. Because of a limitation, this"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99071:Assign_L435_C6", "label": "content = get()", "type": "assigned_variable", "loc": [435, 435], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99071:Try_L433_C4", "vector": [14, 3, 0.719, 0.0017, 3, 0.94, 0.0, 273, 3, 1, 0, 0, 607, 10, 1], "semantic": {"name": "content", "arg_names": [], "import_names": [], "rhs_call_name": "get", "annotation": ""}, "snippet": " content = data.get('content')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99071:If_L436_C6", "label": "if", "type": "if", "loc": [436, 437], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99071:Try_L433_C4", "vector": [4, 3, 0.7215, 0.0033, 3, 0.94, 0.3333, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if 'content' in data:\n data.pop('content')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99071:Expr_L437_C8", "label": "pop()", "type": "expression", "loc": [437, 437], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99071:If_L436_C6", "vector": [8, 4, 0.7223, 0.0017, 4, 0.32, 0.0, 969, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "pop", "arg_names": [], "import_names": [], "rhs_call_name": "pop", "annotation": ""}, "snippet": " data.pop('content')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99071:If_L438_C6", "label": "if", "type": "if", "loc": [438, 457], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99071:Try_L433_C4", "vector": [4, 3, 0.7397, 0.0331, 3, 0.94, 0.6667, 0, 0, 0, 0, 0, 0, 0, 9], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if content is not None:\n # Make an update request to update the file. A MediaInMemoryUpload\n # instance is used to upload the file body. Because of a limitation, this\n # request must be made in two parts, the first to update the metadata, and\n # the second to update the body.\n resource = service.files().update(\n fileId=data['resource_id'],\n newRevision=self.request.get('newRevision', False),"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99071:Assign_L443_C8", "label": "resource = execute()", "type": "assigned_variable", "loc": [443, 449], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99071:If_L438_C6", "vector": [14, 4, 0.7372, 0.0116, 4, 0.8, 0.0, 559, 3, 0, 0, 0, 569, 10, 5], "semantic": {"name": "resource", "arg_names": [], "import_names": [], "rhs_call_name": "execute", "annotation": ""}, "snippet": " resource = service.files().update(\n fileId=data['resource_id'],\n newRevision=self.request.get('newRevision', False),\n body=data,\n media_body=MediaInMemoryUpload(\n content, data['mimeType'], resumable=True)\n ).execute()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99071:Assign_L454_C8", "label": "resource = execute()", "type": "assigned_variable", "loc": [454, 457], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99071:If_L438_C6", "vector": [14, 4, 0.7529, 0.0066, 4, 0.8, 1.0, 559, 3, 0, 0, 0, 569, 10, 4], "semantic": {"name": "resource", "arg_names": [], "import_names": [], "rhs_call_name": "execute", "annotation": ""}, "snippet": " resource = service.files().update(\n fileId=data['resource_id'],\n newRevision=self.request.get('newRevision', False),\n body=data).execute()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99071:Expr_L459_C6", "label": "RespondJSON()", "type": "expression", "loc": [459, 459], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99071:Try_L433_C4", "vector": [8, 3, 0.7587, 0.0017, 3, 0.94, 1.0, 530, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "RespondJSON", "arg_names": [], "import_names": [], "rhs_call_name": "RespondJSON", "annotation": ""}, "snippet": " self.RespondJSON(resource['id'])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99071:Expr_L464_C6", "label": "RedirectAuth()", "type": "expression", "loc": [464, 464], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99071:Try_L433_C4", "vector": [8, 3, 0.7669, 0.0017, 3, 0.94, 0.0, 681, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "RedirectAuth", "arg_names": [], "import_names": [], "rhs_call_name": "RedirectAuth", "annotation": ""}, "snippet": " self.RedirectAuth()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99071:FunctionDef_L466_C2", "label": "RequestJSON", "type": "function", "loc": [466, 473], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99071:ClassDef_L337_C0", "vector": [2, 1, 0.776, 0.0132, 1, 0.64, 1.0, 552, 0, 1, 1, 0, 0, 0, 1], "semantic": {"name": "RequestJSON", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def RequestJSON(self):\n \"\"\"Load the request body as JSON.\n\n Returns:\n Request body loaded as JSON or None if there is no request body.\n \"\"\"\n if self.request.body:\n return json.loads(self.request.body)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99071:Expr_L467_C4", "label": "expression", "type": "expression", "loc": [467, 471], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99071:FunctionDef_L466_C2", "vector": [8, 2, 0.7752, 0.0083, 2, 0.88, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Load the request body as JSON.\n\n Returns:\n Request body loaded as JSON or None if there is no request body.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99071:If_L472_C4", "label": "if", "type": "if", "loc": [472, 473], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99071:FunctionDef_L466_C2", "vector": [4, 2, 0.781, 0.0033, 2, 0.88, 1.0, 0, 7, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self.request.body:\n return json.loads(self.request.body)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99071:Return_L473_C6", "label": "return", "type": "return", "loc": [473, 473], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99071:If_L472_C4", "vector": [13, 3, 0.7818, 0.0017, 3, 0.12, 0.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return json.loads(self.request.body)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99071:ClassDef_L476_C0", "label": "UserHandler", "type": "class", "loc": [476, 494], "level": 0, "parent": null, "vector": [3, 0, 0.8017, 0.0314, 0, 0.66, 0.8485, 299, 0, 1, 0, 0, 266, 0, 6], "semantic": {"name": "UserHandler", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class UserHandler(BaseDriveHandler):\n \"\"\"Web handler for the service to read user information.\"\"\"\n\n def get(self):\n \"\"\"Called when HTTP GET requests are received by the web application.\"\"\"\n # Create a Drive service\n service = self.CreateUserInfo()\n if service is None:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99071:Expr_L477_C2", "label": "expression", "type": "expression", "loc": [477, 477], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99071:ClassDef_L476_C0", "vector": [8, 1, 0.7884, 0.0017, 1, 0.8, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Web handler for the service to read user information.\"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99071:FunctionDef_L479_C2", "label": "get", "type": "function", "loc": [479, 494], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99071:ClassDef_L476_C0", "vector": [2, 1, 0.8041, 0.0264, 1, 0.8, 1.0, 607, 0, 1, 0, 0, 0, 0, 6], "semantic": {"name": "get", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def get(self):\n \"\"\"Called when HTTP GET requests are received by the web application.\"\"\"\n # Create a Drive service\n service = self.CreateUserInfo()\n if service is None:\n return\n try:\n result = service.userinfo().get().execute()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99071:Expr_L480_C4", "label": "expression", "type": "expression", "loc": [480, 480], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99071:FunctionDef_L479_C2", "vector": [8, 2, 0.7934, 0.0017, 2, 0.81, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Called when HTTP GET requests are received by the web application.\"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99071:Assign_L482_C4", "label": "service = CreateUserInfo()", "type": "assigned_variable", "loc": [482, 482], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99071:FunctionDef_L479_C2", "vector": [14, 2, 0.7967, 0.0017, 2, 0.81, 0.3333, 314, 3, 0, 0, 0, 15, 10, 1], "semantic": {"name": "service", "arg_names": [], "import_names": [], "rhs_call_name": "CreateUserInfo", "annotation": ""}, "snippet": " service = self.CreateUserInfo()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99071:If_L483_C4", "label": "if", "type": "if", "loc": [483, 484], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99071:FunctionDef_L479_C2", "vector": [4, 2, 0.7992, 0.0033, 2, 0.81, 0.6667, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if service is None:\n return"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99071:Return_L484_C6", "label": "return", "type": "return", "loc": [484, 484], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99071:If_L483_C4", "vector": [13, 3, 0.8, 0.0017, 3, 0.34, 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_99071:Try_L485_C4", "label": "try", "type": "try", "loc": [485, 494], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99071:FunctionDef_L479_C2", "vector": [7, 2, 0.8091, 0.0165, 2, 0.81, 1.0, 0, 0, 1, 0, 0, 0, 0, 5], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " try:\n result = service.userinfo().get().execute()\n # Generate a JSON response with the file data and return to the client.\n self.RespondJSON(result)\n except AccessTokenRefreshError:\n # Catch AccessTokenRefreshError which occurs when the API client library\n # fails to refresh a token. This occurs, for example, when a refresh token\n # is revoked. When this happens the user is redirected to the"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99071:Assign_L486_C6", "label": "result = execute()", "type": "assigned_variable", "loc": [486, 486], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99071:Try_L485_C4", "vector": [14, 3, 0.8033, 0.0017, 3, 0.35, 0.0, 51, 3, 0, 0, 0, 569, 10, 3], "semantic": {"name": "result", "arg_names": [], "import_names": [], "rhs_call_name": "execute", "annotation": ""}, "snippet": " result = service.userinfo().get().execute()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99071:Expr_L488_C6", "label": "RespondJSON()", "type": "expression", "loc": [488, 488], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99071:Try_L485_C4", "vector": [8, 3, 0.8066, 0.0017, 3, 0.35, 1.0, 530, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "RespondJSON", "arg_names": [], "import_names": [], "rhs_call_name": "RespondJSON", "annotation": ""}, "snippet": " self.RespondJSON(result)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99071:Expr_L494_C6", "label": "RedirectAuth()", "type": "expression", "loc": [494, 494], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99071:Try_L485_C4", "vector": [8, 3, 0.8165, 0.0017, 3, 0.35, 0.0, 681, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "RedirectAuth", "arg_names": [], "import_names": [], "rhs_call_name": "RedirectAuth", "annotation": ""}, "snippet": " self.RedirectAuth()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99071:ClassDef_L497_C0", "label": "AboutHandler", "type": "class", "loc": [497, 515], "level": 0, "parent": null, "vector": [3, 0, 0.8364, 0.0314, 0, 0.66, 0.8788, 925, 0, 1, 0, 0, 266, 0, 6], "semantic": {"name": "AboutHandler", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class AboutHandler(BaseDriveHandler):\n \"\"\"Web handler for the service to read user information.\"\"\"\n\n def get(self):\n \"\"\"Called when HTTP GET requests are received by the web application.\"\"\"\n # Create a Drive service\n service = self.CreateDrive()\n if service is None:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99071:Expr_L498_C2", "label": "expression", "type": "expression", "loc": [498, 498], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99071:ClassDef_L497_C0", "vector": [8, 1, 0.8231, 0.0017, 1, 0.04, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Web handler for the service to read user information.\"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99071:FunctionDef_L500_C2", "label": "get", "type": "function", "loc": [500, 515], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99071:ClassDef_L497_C0", "vector": [2, 1, 0.8388, 0.0264, 1, 0.04, 1.0, 607, 0, 1, 0, 0, 0, 0, 6], "semantic": {"name": "get", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def get(self):\n \"\"\"Called when HTTP GET requests are received by the web application.\"\"\"\n # Create a Drive service\n service = self.CreateDrive()\n if service is None:\n return\n try:\n result = service.about().get().execute()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99071:Expr_L501_C4", "label": "expression", "type": "expression", "loc": [501, 501], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99071:FunctionDef_L500_C2", "vector": [8, 2, 0.8281, 0.0017, 2, 0.28, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Called when HTTP GET requests are received by the web application.\"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99071:Assign_L503_C4", "label": "service = CreateDrive()", "type": "assigned_variable", "loc": [503, 503], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99071:FunctionDef_L500_C2", "vector": [14, 2, 0.8314, 0.0017, 2, 0.28, 0.3333, 314, 3, 0, 0, 0, 839, 10, 1], "semantic": {"name": "service", "arg_names": [], "import_names": [], "rhs_call_name": "CreateDrive", "annotation": ""}, "snippet": " service = self.CreateDrive()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99071:If_L504_C4", "label": "if", "type": "if", "loc": [504, 505], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99071:FunctionDef_L500_C2", "vector": [4, 2, 0.8339, 0.0033, 2, 0.28, 0.6667, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if service is None:\n return"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99071:Return_L505_C6", "label": "return", "type": "return", "loc": [505, 505], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99071:If_L504_C4", "vector": [13, 3, 0.8347, 0.0017, 3, 0.91, 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_99071:Try_L506_C4", "label": "try", "type": "try", "loc": [506, 515], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99071:FunctionDef_L500_C2", "vector": [7, 2, 0.8438, 0.0165, 2, 0.28, 1.0, 0, 0, 1, 0, 0, 0, 0, 5], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " try:\n result = service.about().get().execute()\n # Generate a JSON response with the file data and return to the client.\n self.RespondJSON(result)\n except AccessTokenRefreshError:\n # Catch AccessTokenRefreshError which occurs when the API client library\n # fails to refresh a token. This occurs, for example, when a refresh token\n # is revoked. When this happens the user is redirected to the"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99071:Assign_L507_C6", "label": "result = execute()", "type": "assigned_variable", "loc": [507, 507], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99071:Try_L506_C4", "vector": [14, 3, 0.838, 0.0017, 3, 0.74, 0.0, 51, 3, 0, 0, 0, 569, 10, 3], "semantic": {"name": "result", "arg_names": [], "import_names": [], "rhs_call_name": "execute", "annotation": ""}, "snippet": " result = service.about().get().execute()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99071:Expr_L509_C6", "label": "RespondJSON()", "type": "expression", "loc": [509, 509], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99071:Try_L506_C4", "vector": [8, 3, 0.8413, 0.0017, 3, 0.74, 1.0, 530, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "RespondJSON", "arg_names": [], "import_names": [], "rhs_call_name": "RespondJSON", "annotation": ""}, "snippet": " self.RespondJSON(result)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99071:Expr_L515_C6", "label": "RedirectAuth()", "type": "expression", "loc": [515, 515], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99071:Try_L506_C4", "vector": [8, 3, 0.8512, 0.0017, 3, 0.74, 0.0, 681, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "RedirectAuth", "arg_names": [], "import_names": [], "rhs_call_name": "RedirectAuth", "annotation": ""}, "snippet": " self.RedirectAuth()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99071:ClassDef_L518_C0", "label": "MediaInMemoryUpload", "type": "class", "loc": [518, 586], "level": 0, "parent": null, "vector": [3, 0, 0.9124, 0.114, 0, 0.66, 0.9091, 833, 0, 6, 0, 0, 102, 0, 1], "semantic": {"name": "MediaInMemoryUpload", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class MediaInMemoryUpload(MediaUpload):\n \"\"\"MediaUpload for a chunk of bytes.\n\n Construct a MediaFileUpload and pass as the media_body parameter of the\n method. For example, if we had a service that allowed plain text:\n \"\"\"\n\n def __init__(self, body, mimetype='application/octet-stream',"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99071:Expr_L519_C2", "label": "expression", "type": "expression", "loc": [519, 523], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99071:ClassDef_L518_C0", "vector": [8, 1, 0.8612, 0.0083, 1, 0.38, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"MediaUpload for a chunk of bytes.\n\n Construct a MediaFileUpload and pass as the media_body parameter of the\n method. For example, if we had a service that allowed plain text:\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99071:FunctionDef_L525_C2", "label": "__init__", "type": "function", "loc": [525, 541], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99071:ClassDef_L518_C0", "vector": [2, 1, 0.881, 0.0281, 1, 0.38, 0.1667, 555, 0, 5, 0, 0, 0, 0, 0], "semantic": {"name": "__init__", "arg_names": ["self", "body", "mimetype", "chunksize", "resumable"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, body, mimetype='application/octet-stream',\n chunksize=256*1024, resumable=False):\n \"\"\"Create a new MediaBytesUpload.\n\n Args:\n body: string, Bytes of body content.\n mimetype: string, Mime-type of the file or default of\n 'application/octet-stream'."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99071:Expr_L527_C4", "label": "expression", "type": "expression", "loc": [527, 537], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99071:FunctionDef_L525_C2", "vector": [8, 2, 0.8793, 0.0182, 2, 0.81, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Create a new MediaBytesUpload.\n\n Args:\n body: string, Bytes of body content.\n mimetype: string, Mime-type of the file or default of\n 'application/octet-stream'.\n chunksize: int, File will be uploaded in chunks of this many bytes. Only\n used if resumable=True."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99071:Assign_L538_C4", "label": "self._body =", "type": "assigned_variable", "loc": [538, 538], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99071:FunctionDef_L525_C2", "vector": [14, 2, 0.8893, 0.0017, 2, 0.81, 0.25, 36, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self._body", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self._body = body"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99071:Assign_L539_C4", "label": "self._mimetype =", "type": "assigned_variable", "loc": [539, 539], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99071:FunctionDef_L525_C2", "vector": [14, 2, 0.8909, 0.0017, 2, 0.81, 0.5, 699, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self._mimetype", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self._mimetype = mimetype"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99071:Assign_L540_C4", "label": "self._resumable =", "type": "assigned_variable", "loc": [540, 540], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99071:FunctionDef_L525_C2", "vector": [14, 2, 0.8926, 0.0017, 2, 0.81, 0.75, 847, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self._resumable", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self._resumable = resumable"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99071:Assign_L541_C4", "label": "self._chunksize =", "type": "assigned_variable", "loc": [541, 541], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99071:FunctionDef_L525_C2", "vector": [14, 2, 0.8942, 0.0017, 2, 0.81, 1.0, 383, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self._chunksize", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self._chunksize = chunksize"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99071:FunctionDef_L543_C2", "label": "chunksize", "type": "function", "loc": [543, 549], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99071:ClassDef_L518_C0", "vector": [2, 1, 0.9025, 0.0116, 1, 0.38, 0.3333, 120, 0, 1, 1, 0, 0, 0, 0], "semantic": {"name": "chunksize", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def chunksize(self):\n \"\"\"Chunk size for resumable uploads.\n\n Returns:\n Chunk size in bytes.\n \"\"\"\n return self._chunksize"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99071:Expr_L544_C4", "label": "expression", "type": "expression", "loc": [544, 548], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99071:FunctionDef_L543_C2", "vector": [8, 2, 0.9025, 0.0083, 2, 0.79, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Chunk size for resumable uploads.\n\n Returns:\n Chunk size in bytes.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99071:Return_L549_C4", "label": "return", "type": "return", "loc": [549, 549], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99071:FunctionDef_L543_C2", "vector": [13, 2, 0.9074, 0.0017, 2, 0.79, 1.0, 0, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self._chunksize"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99071:FunctionDef_L551_C2", "label": "mimetype", "type": "function", "loc": [551, 557], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99071:ClassDef_L518_C0", "vector": [2, 1, 0.9157, 0.0116, 1, 0.38, 0.5, 290, 0, 1, 1, 0, 0, 0, 0], "semantic": {"name": "mimetype", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def mimetype(self):\n \"\"\"Mime type of the body.\n\n Returns:\n Mime type.\n \"\"\"\n return self._mimetype"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99071:Expr_L552_C4", "label": "expression", "type": "expression", "loc": [552, 556], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99071:FunctionDef_L551_C2", "vector": [8, 2, 0.9157, 0.0083, 2, 0.46, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Mime type of the body.\n\n Returns:\n Mime type.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99071:Return_L557_C4", "label": "return", "type": "return", "loc": [557, 557], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99071:FunctionDef_L551_C2", "vector": [13, 2, 0.9207, 0.0017, 2, 0.46, 1.0, 0, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self._mimetype"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99071:FunctionDef_L559_C2", "label": "size", "type": "function", "loc": [559, 565], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99071:ClassDef_L518_C0", "vector": [2, 1, 0.9289, 0.0116, 1, 0.38, 0.6667, 714, 0, 1, 1, 0, 0, 0, 1], "semantic": {"name": "size", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def size(self):\n \"\"\"Size of upload.\n\n Returns:\n Size of the body.\n \"\"\"\n return len(self._body)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99071:Expr_L560_C4", "label": "expression", "type": "expression", "loc": [560, 564], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99071:FunctionDef_L559_C2", "vector": [8, 2, 0.9289, 0.0083, 2, 0.11, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Size of upload.\n\n Returns:\n Size of the body.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99071:Return_L565_C4", "label": "return", "type": "return", "loc": [565, 565], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99071:FunctionDef_L559_C2", "vector": [13, 2, 0.9339, 0.0017, 2, 0.11, 1.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return len(self._body)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99071:FunctionDef_L567_C2", "label": "resumable", "type": "function", "loc": [567, 573], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99071:ClassDef_L518_C0", "vector": [2, 1, 0.9421, 0.0116, 1, 0.38, 0.8333, 471, 0, 1, 1, 0, 0, 0, 0], "semantic": {"name": "resumable", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def resumable(self):\n \"\"\"Whether this upload is resumable.\n\n Returns:\n True if resumable upload or False.\n \"\"\"\n return self._resumable"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99071:Expr_L568_C4", "label": "expression", "type": "expression", "loc": [568, 572], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99071:FunctionDef_L567_C2", "vector": [8, 2, 0.9421, 0.0083, 2, 0.88, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Whether this upload is resumable.\n\n Returns:\n True if resumable upload or False.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99071:Return_L573_C4", "label": "return", "type": "return", "loc": [573, 573], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99071:FunctionDef_L567_C2", "vector": [13, 2, 0.9471, 0.0017, 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._resumable"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99071:FunctionDef_L575_C2", "label": "getbytes", "type": "function", "loc": [575, 586], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99071:ClassDef_L518_C0", "vector": [2, 1, 0.9595, 0.0198, 1, 0.38, 1.0, 626, 0, 3, 1, 0, 0, 0, 0], "semantic": {"name": "getbytes", "arg_names": ["self", "begin", "length"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def getbytes(self, begin, length):\n \"\"\"Get bytes from the media.\n\n Args:\n begin: int, offset from beginning of file.\n length: int, number of bytes to read, starting at begin.\n\n Returns:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99071:Expr_L576_C4", "label": "expression", "type": "expression", "loc": [576, 585], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99071:FunctionDef_L575_C2", "vector": [8, 2, 0.9595, 0.0165, 2, 0.39, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Get bytes from the media.\n\n Args:\n begin: int, offset from beginning of file.\n length: int, number of bytes to read, starting at begin.\n\n Returns:\n A string of bytes read. May be shorter than length if EOF was reached"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99071:Return_L586_C4", "label": "return", "type": "return", "loc": [586, 586], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99071:FunctionDef_L575_C2", "vector": [13, 2, 0.9686, 0.0017, 2, 0.39, 1.0, 0, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self._body[begin:begin + length]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99071:Assign_L591_C0", "label": "application = WSGIApplication()", "type": "assigned_variable", "loc": [591, 596], "level": 0, "parent": null, "vector": [14, 0, 0.981, 0.0099, 0, 0.66, 0.9394, 244, 3, 2, 0, 0, 623, 10, 1], "semantic": {"name": "application", "arg_names": [], "import_names": [], "rhs_call_name": "WSGIApplication", "annotation": ""}, "snippet": "application = webapp.WSGIApplication(\n [('/', MainPage), ('/svc', ServiceHandler), ('/about', AboutHandler),\n ('/user', UserHandler)],\n # XXX Set to False in production.\n debug=True\n)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99071:FunctionDef_L599_C0", "label": "main", "type": "function", "loc": [599, 601], "level": 0, "parent": null, "vector": [2, 0, 0.9917, 0.005, 0, 0.66, 0.9697, 624, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "main", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def main():\n \"\"\"Main entry point for executing a request with this handler.\"\"\"\n run_wsgi_app(application)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99071:Expr_L600_C2", "label": "expression", "type": "expression", "loc": [600, 600], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99071:FunctionDef_L599_C0", "vector": [8, 1, 0.9917, 0.0017, 1, 0.04, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Main entry point for executing a request with this handler.\"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99071:Expr_L601_C2", "label": "run_wsgi_app()", "type": "expression", "loc": [601, 601], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99071:FunctionDef_L599_C0", "vector": [8, 1, 0.9934, 0.0017, 1, 0.04, 1.0, 563, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "run_wsgi_app", "arg_names": [], "import_names": [], "rhs_call_name": "run_wsgi_app", "annotation": ""}, "snippet": " run_wsgi_app(application)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99071:If_L604_C0", "label": "if", "type": "if", "loc": [604, 605], "level": 0, "parent": null, "vector": [4, 0, 0.9992, 0.0033, 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_99071:Expr_L605_C4", "label": "main()", "type": "expression", "loc": [605, 605], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99071:If_L604_C0", "vector": [8, 1, 1.0, 0.0017, 1, 0.57, 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_99071:FunctionDef_L46_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99071:Expr_L47_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99071:FunctionDef_L46_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99071:Return_L54_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99071:ClassDef_L64_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99071:Expr_L65_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99071:ClassDef_L64_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99071:Assign_L69_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99071:FunctionDef_L72_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99071:Expr_L73_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99071:FunctionDef_L72_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99071:Assign_L86_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99071:FunctionDef_L72_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99071:Expr_L89_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99071:FunctionDef_L72_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99071:Return_L92_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99071:ClassDef_L95_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99071:Expr_L96_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99071:ClassDef_L95_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99071:FunctionDef_L98_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99071:FunctionDef_L98_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99071:Expr_L99_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99071:FunctionDef_L98_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99071:If_L106_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99071:If_L106_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99071:Assign_L107_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99071:If_L106_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99071:Assign_L108_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99071:If_L106_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99071:Assign_L109_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99071:If_L106_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99071:Assign_L111_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99071:If_L106_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99071:Assign_L112_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99071:ClassDef_L95_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99071:FunctionDef_L115_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99071:FunctionDef_L115_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99071:Expr_L116_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99071:FunctionDef_L115_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99071:Return_L122_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99071:ClassDef_L126_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99071:Expr_L127_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99071:ClassDef_L126_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99071:FunctionDef_L132_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99071:FunctionDef_L132_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99071:Expr_L133_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99071:FunctionDef_L132_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99071:Assign_L143_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99071:FunctionDef_L132_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99071:Assign_L147_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99071:FunctionDef_L132_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99071:Return_L148_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99071:ClassDef_L126_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99071:FunctionDef_L150_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99071:FunctionDef_L150_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99071:Expr_L151_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99071:FunctionDef_L150_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99071:Assign_L169_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99071:FunctionDef_L150_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99071:If_L170_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99071:If_L170_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99071:Return_L172_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99071:FunctionDef_L150_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99071:Assign_L176_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99071:FunctionDef_L150_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99071:Try_L180_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99071:Try_L180_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99071:Assign_L181_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99071:Try_L180_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99071:Return_L183_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99071:FunctionDef_L150_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99071:Assign_L187_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99071:FunctionDef_L150_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99071:Assign_L191_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99071:FunctionDef_L150_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99071:Assign_L194_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99071:FunctionDef_L150_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99071:Expr_L195_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99071:FunctionDef_L150_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99071:Expr_L198_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99071:FunctionDef_L150_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99071:Return_L199_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99071:ClassDef_L126_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99071:FunctionDef_L201_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99071:FunctionDef_L201_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99071:Expr_L202_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99071:FunctionDef_L201_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99071:Assign_L213_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99071:FunctionDef_L201_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99071:Assign_L214_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99071:FunctionDef_L201_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99071:If_L215_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99071:If_L215_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99071:Return_L218_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99071:FunctionDef_L201_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99071:Assign_L221_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99071:FunctionDef_L201_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99071:If_L225_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99071:If_L225_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99071:Return_L226_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99071:FunctionDef_L201_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99071:Return_L228_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99071:ClassDef_L126_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99071:FunctionDef_L230_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99071:FunctionDef_L230_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99071:Expr_L231_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99071:FunctionDef_L230_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99071:Assign_L240_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99071:FunctionDef_L230_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99071:Assign_L245_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99071:FunctionDef_L230_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99071:Assign_L249_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99071:FunctionDef_L230_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99071:Expr_L252_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99071:ClassDef_L126_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99071:FunctionDef_L254_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99071:FunctionDef_L254_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99071:Expr_L255_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99071:FunctionDef_L254_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99071:Assign_L260_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99071:FunctionDef_L254_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99071:Expr_L261_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99071:ClassDef_L126_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99071:FunctionDef_L263_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99071:FunctionDef_L263_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99071:Expr_L264_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99071:FunctionDef_L263_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99071:Assign_L275_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99071:FunctionDef_L263_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99071:If_L276_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99071:If_L276_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99071:Return_L279_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99071:If_L276_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99071:Expr_L283_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99071:ClassDef_L126_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99071:FunctionDef_L285_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99071:FunctionDef_L285_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99071:Expr_L286_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99071:FunctionDef_L285_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99071:Return_L287_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99071:ClassDef_L126_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99071:FunctionDef_L289_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99071:FunctionDef_L289_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99071:Expr_L290_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99071:FunctionDef_L289_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99071:Return_L291_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99071:ClassDef_L294_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99071:Expr_L295_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99071:ClassDef_L294_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99071:FunctionDef_L302_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99071:FunctionDef_L302_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99071:Expr_L303_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99071:FunctionDef_L302_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99071:Assign_L311_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99071:FunctionDef_L302_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99071:If_L312_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99071:If_L312_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99071:Assign_L313_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99071:If_L312_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99071:If_L314_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99071:If_L314_C6", "t": "ajibawa-2023/Python-Code-Large/train/row_99071:Assign_L315_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99071:If_L312_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99071:Expr_L316_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99071:If_L312_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99071:Return_L317_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99071:FunctionDef_L302_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99071:Assign_L321_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99071:FunctionDef_L302_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99071:If_L322_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99071:If_L322_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99071:Return_L323_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99071:FunctionDef_L302_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99071:Assign_L328_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99071:FunctionDef_L302_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99071:Expr_L329_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99071:ClassDef_L294_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99071:FunctionDef_L331_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99071:FunctionDef_L331_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99071:Expr_L332_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99071:FunctionDef_L331_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99071:Assign_L333_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99071:FunctionDef_L331_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99071:Expr_L334_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99071:ClassDef_L337_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99071:Expr_L338_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99071:ClassDef_L337_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99071:FunctionDef_L340_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99071:FunctionDef_L340_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99071:Expr_L341_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99071:FunctionDef_L340_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99071:Assign_L348_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99071:FunctionDef_L340_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99071:If_L349_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99071:If_L349_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99071:Return_L350_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99071:FunctionDef_L340_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99071:Assign_L353_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99071:FunctionDef_L340_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99071:Assign_L356_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99071:FunctionDef_L340_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99071:Try_L361_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99071:Try_L361_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99071:Assign_L364_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99071:Try_L361_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99071:Expr_L372_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99071:Try_L361_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99071:Expr_L377_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99071:ClassDef_L337_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99071:FunctionDef_L379_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99071:FunctionDef_L379_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99071:Expr_L380_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99071:FunctionDef_L379_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99071:Assign_L390_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99071:FunctionDef_L379_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99071:If_L391_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99071:If_L391_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99071:Return_L392_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99071:FunctionDef_L379_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99071:Try_L393_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99071:Try_L393_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99071:Assign_L395_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99071:Try_L393_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99071:If_L396_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99071:If_L396_C6", "t": "ajibawa-2023/Python-Code-Large/train/row_99071:Assign_L399_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99071:If_L396_C6", "t": "ajibawa-2023/Python-Code-Large/train/row_99071:Assign_L400_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99071:If_L396_C6", "t": "ajibawa-2023/Python-Code-Large/train/row_99071:If_L405_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99071:If_L405_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99071:Assign_L406_C10"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99071:If_L405_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99071:Assign_L408_C10"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99071:If_L396_C6", "t": "ajibawa-2023/Python-Code-Large/train/row_99071:Assign_L410_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99071:Try_L393_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99071:Expr_L412_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99071:Try_L393_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99071:Expr_L418_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99071:ClassDef_L337_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99071:FunctionDef_L420_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99071:FunctionDef_L420_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99071:Expr_L421_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99071:FunctionDef_L420_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99071:Assign_L428_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99071:FunctionDef_L420_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99071:If_L429_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99071:If_L429_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99071:Return_L430_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99071:FunctionDef_L420_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99071:Assign_L432_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99071:FunctionDef_L420_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99071:Try_L433_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99071:Try_L433_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99071:Assign_L435_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99071:Try_L433_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99071:If_L436_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99071:If_L436_C6", "t": "ajibawa-2023/Python-Code-Large/train/row_99071:Expr_L437_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99071:Try_L433_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99071:If_L438_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99071:If_L438_C6", "t": "ajibawa-2023/Python-Code-Large/train/row_99071:Assign_L443_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99071:If_L438_C6", "t": "ajibawa-2023/Python-Code-Large/train/row_99071:Assign_L454_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99071:Try_L433_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99071:Expr_L459_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99071:Try_L433_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99071:Expr_L464_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99071:ClassDef_L337_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99071:FunctionDef_L466_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99071:FunctionDef_L466_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99071:Expr_L467_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99071:FunctionDef_L466_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99071:If_L472_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99071:If_L472_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99071:Return_L473_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99071:ClassDef_L476_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99071:Expr_L477_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99071:ClassDef_L476_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99071:FunctionDef_L479_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99071:FunctionDef_L479_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99071:Expr_L480_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99071:FunctionDef_L479_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99071:Assign_L482_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99071:FunctionDef_L479_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99071:If_L483_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99071:If_L483_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99071:Return_L484_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99071:FunctionDef_L479_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99071:Try_L485_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99071:Try_L485_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99071:Assign_L486_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99071:Try_L485_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99071:Expr_L488_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99071:Try_L485_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99071:Expr_L494_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99071:ClassDef_L497_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99071:Expr_L498_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99071:ClassDef_L497_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99071:FunctionDef_L500_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99071:FunctionDef_L500_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99071:Expr_L501_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99071:FunctionDef_L500_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99071:Assign_L503_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99071:FunctionDef_L500_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99071:If_L504_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99071:If_L504_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99071:Return_L505_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99071:FunctionDef_L500_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99071:Try_L506_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99071:Try_L506_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99071:Assign_L507_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99071:Try_L506_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99071:Expr_L509_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99071:Try_L506_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99071:Expr_L515_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99071:ClassDef_L518_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99071:Expr_L519_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99071:ClassDef_L518_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99071:FunctionDef_L525_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99071:FunctionDef_L525_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99071:Expr_L527_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99071:FunctionDef_L525_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99071:Assign_L538_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99071:FunctionDef_L525_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99071:Assign_L539_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99071:FunctionDef_L525_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99071:Assign_L540_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99071:FunctionDef_L525_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99071:Assign_L541_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99071:ClassDef_L518_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99071:FunctionDef_L543_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99071:FunctionDef_L543_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99071:Expr_L544_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99071:FunctionDef_L543_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99071:Return_L549_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99071:ClassDef_L518_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99071:FunctionDef_L551_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99071:FunctionDef_L551_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99071:Expr_L552_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99071:FunctionDef_L551_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99071:Return_L557_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99071:ClassDef_L518_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99071:FunctionDef_L559_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99071:FunctionDef_L559_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99071:Expr_L560_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99071:FunctionDef_L559_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99071:Return_L565_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99071:ClassDef_L518_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99071:FunctionDef_L567_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99071:FunctionDef_L567_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99071:Expr_L568_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99071:FunctionDef_L567_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99071:Return_L573_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99071:ClassDef_L518_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99071:FunctionDef_L575_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99071:FunctionDef_L575_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99071:Expr_L576_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99071:FunctionDef_L575_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99071:Return_L586_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99071:FunctionDef_L599_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99071:Expr_L600_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99071:FunctionDef_L599_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99071:Expr_L601_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99071:If_L604_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99071:Expr_L605_C4"}]
#!/usr/bin/env python # Copyright (c) 2010, Google Inc. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above copyright # notice, this list of conditions and the following disclaimer. # * Redistributions in binary form must reproduce the above # copyright notice, this list of conditions and the following disclaimer # in the documentation and/or other materials provided with the # distribution. # * Neither the name of Google Inc. nor the names of its # contributors may be used to endorse or promote products derived from # this software without specific prior written permission. # # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR # A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT # OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. """Module to enforce different constraints on flags. A validator represents an invariant, enforced over a one or more flags. See 'FLAGS VALIDATORS' in gflags.py's docstring for a usage manual. """ __author__ = 'olexiy@google.com (Olexiy Oryeshko)' class Error(Exception): """Thrown If validator constraint is not satisfied.""" class Validator(object): """Base class for flags validators. Users should NOT overload these classes, and use gflags.Register... methods instead. """ # Used to assign each validator an unique insertion_index validators_count = 0 def __init__(self, checker, message): """Constructor to create all validators. Args: checker: function to verify the constraint. Input of this method varies, see SimpleValidator and DictionaryValidator for a detailed description. message: string, error message to be shown to the user """ self.checker = checker self.message = message Validator.validators_count += 1 # Used to assert validators in the order they were registered (CL/18694236) self.insertion_index = Validator.validators_count def Verify(self, flag_values): """Verify that constraint is satisfied. flags library calls this method to verify Validator's constraint. Args: flag_values: gflags.FlagValues, containing all flags Raises: Error: if constraint is not satisfied. """ param = self._GetInputToCheckerFunction(flag_values) if not self.checker(param): raise Error(self.message) def GetFlagsNames(self): """Return the names of the flags checked by this validator. Returns: [string], names of the flags """ raise NotImplementedError('This method should be overloaded') def PrintFlagsWithValues(self, flag_values): raise NotImplementedError('This method should be overloaded') def _GetInputToCheckerFunction(self, flag_values): """Given flag values, construct the input to be given to checker. Args: flag_values: gflags.FlagValues, containing all flags. Returns: Return type depends on the specific validator. """ raise NotImplementedError('This method should be overloaded') class SimpleValidator(Validator): """Validator behind RegisterValidator() method. Validates that a single flag passes its checker function. The checker function takes the flag value and returns True (if value looks fine) or, if flag value is not valid, either returns False or raises an Exception.""" def __init__(self, flag_name, checker, message): """Constructor. Args: flag_name: string, name of the flag. checker: function to verify the validator. input - value of the corresponding flag (string, boolean, etc). output - Boolean. Must return True if validator constraint is satisfied. If constraint is not satisfied, it should either return False or raise Error. message: string, error message to be shown to the user if validator's condition is not satisfied """ super(SimpleValidator, self).__init__(checker, message) self.flag_name = flag_name def GetFlagsNames(self): return [self.flag_name] def PrintFlagsWithValues(self, flag_values): return 'flag --%s=%s' % (self.flag_name, flag_values[self.flag_name].value) def _GetInputToCheckerFunction(self, flag_values): """Given flag values, construct the input to be given to checker. Args: flag_values: gflags.FlagValues Returns: value of the corresponding flag. """ return flag_values[self.flag_name].value class DictionaryValidator(Validator): """Validator behind RegisterDictionaryValidator method. Validates that flag values pass their common checker function. The checker function takes flag values and returns True (if values look fine) or, if values are not valid, either returns False or raises an Exception. """ def __init__(self, flag_names, checker, message): """Constructor. Args: flag_names: [string], containing names of the flags used by checker. checker: function to verify the validator. input - dictionary, with keys() being flag_names, and value for each key being the value of the corresponding flag (string, boolean, etc). output - Boolean. Must return True if validator constraint is satisfied. If constraint is not satisfied, it should either return False or raise Error. message: string, error message to be shown to the user if validator's condition is not satisfied """ super(DictionaryValidator, self).__init__(checker, message) self.flag_names = flag_names def _GetInputToCheckerFunction(self, flag_values): """Given flag values, construct the input to be given to checker. Args: flag_values: gflags.FlagValues Returns: dictionary, with keys() being self.lag_names, and value for each key being the value of the corresponding flag (string, boolean, etc). """ return dict([key, flag_values[key].value] for key in self.flag_names) def PrintFlagsWithValues(self, flag_values): prefix = 'flags ' flags_with_values = [] for key in self.flag_names: flags_with_values.append('%s=%s' % (key, flag_values[key].value)) return prefix + ', '.join(flags_with_values) def GetFlagsNames(self): return self.flag_names
ajibawa-2023/Python-Code-Large/train/row_99073
51
187
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_99073:Expr_L32_C0", "label": "expression", "type": "expression", "loc": [32, 36], "level": 0, "parent": null, "vector": [8, 0, 0.1818, 0.0267, 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 enforce different constraints on flags.\n\nA validator represents an invariant, enforced over a one or more flags.\nSee 'FLAGS VALIDATORS' in gflags.py's docstring for a usage manual.\n\"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99073:Assign_L38_C0", "label": "__author__ =", "type": "assigned_variable", "loc": [38, 38], "level": 0, "parent": null, "vector": [14, 0, 0.2032, 0.0053, 0, 0.66, 0.2, 777, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "__author__", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "__author__ = 'olexiy@google.com (Olexiy Oryeshko)'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99073:ClassDef_L41_C0", "label": "Error", "type": "class", "loc": [41, 42], "level": 0, "parent": null, "vector": [3, 0, 0.2219, 0.0107, 0, 0.66, 0.4, 529, 0, 0, 0, 0, 645, 0, 0], "semantic": {"name": "Error", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class Error(Exception):\n \"\"\"Thrown If validator constraint is not satisfied.\"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99073:Expr_L42_C2", "label": "expression", "type": "expression", "loc": [42, 42], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99073:ClassDef_L41_C0", "vector": [8, 1, 0.2246, 0.0053, 1, 0.42, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Thrown If validator constraint is not satisfied.\"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99073:ClassDef_L45_C0", "label": "Validator", "type": "class", "loc": [45, 102], "level": 0, "parent": null, "vector": [3, 0, 0.393, 0.3102, 0, 0.66, 0.6, 957, 0, 5, 0, 0, 186, 0, 6], "semantic": {"name": "Validator", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class Validator(object):\n \"\"\"Base class for flags validators.\n\n Users should NOT overload these classes, and use gflags.Register...\n methods instead.\n \"\"\"\n\n # Used to assign each validator an unique insertion_index"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99073:Expr_L46_C2", "label": "expression", "type": "expression", "loc": [46, 50], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99073:ClassDef_L45_C0", "vector": [8, 1, 0.2567, 0.0267, 1, 0.44, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Base class for flags validators.\n\n Users should NOT overload these classes, and use gflags.Register...\n methods instead.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99073:Assign_L53_C2", "label": "validators_count =", "type": "assigned_variable", "loc": [53, 53], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99073:ClassDef_L45_C0", "vector": [14, 1, 0.2834, 0.0053, 1, 0.44, 0.1667, 986, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "validators_count", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " validators_count = 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99073:FunctionDef_L55_C2", "label": "__init__", "type": "function", "loc": [55, 68], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99073:ClassDef_L45_C0", "vector": [2, 1, 0.3289, 0.0749, 1, 0.44, 0.3333, 555, 0, 3, 0, 0, 0, 0, 0], "semantic": {"name": "__init__", "arg_names": ["self", "checker", "message"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, checker, message):\n \"\"\"Constructor to create all validators.\n\n Args:\n checker: function to verify the constraint.\n Input of this method varies, see SimpleValidator and\n DictionaryValidator for a detailed description.\n message: string, error message to be shown to the user"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99073:Expr_L56_C4", "label": "expression", "type": "expression", "loc": [56, 63], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99073:FunctionDef_L55_C2", "vector": [8, 2, 0.3182, 0.0428, 2, 0.29, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Constructor to create all validators.\n\n Args:\n checker: function to verify the constraint.\n Input of this method varies, see SimpleValidator and\n DictionaryValidator for a detailed description.\n message: string, error message to be shown to the user\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99073:Assign_L64_C4", "label": "self.checker =", "type": "assigned_variable", "loc": [64, 64], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99073:FunctionDef_L55_C2", "vector": [14, 2, 0.3422, 0.0053, 2, 0.29, 0.3333, 563, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.checker", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.checker = checker"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99073:Assign_L65_C4", "label": "self.message =", "type": "assigned_variable", "loc": [65, 65], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99073:FunctionDef_L55_C2", "vector": [14, 2, 0.3476, 0.0053, 2, 0.29, 0.6667, 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_99073:Assign_L68_C4", "label": "self.insertion_index =", "type": "assigned_variable", "loc": [68, 68], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99073:FunctionDef_L55_C2", "vector": [14, 2, 0.3636, 0.0053, 2, 0.29, 1.0, 860, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.insertion_index", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.insertion_index = Validator.validators_count"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99073:FunctionDef_L70_C2", "label": "Verify", "type": "function", "loc": [70, 81], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99073:ClassDef_L45_C0", "vector": [2, 1, 0.4037, 0.0642, 1, 0.44, 0.5, 865, 0, 2, 0, 0, 0, 0, 3], "semantic": {"name": "Verify", "arg_names": ["self", "flag_values"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def Verify(self, flag_values):\n \"\"\"Verify that constraint is satisfied.\n\n flags library calls this method to verify Validator's constraint.\n Args:\n flag_values: gflags.FlagValues, containing all flags\n Raises:\n Error: if constraint is not satisfied."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99073:Expr_L71_C4", "label": "expression", "type": "expression", "loc": [71, 78], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99073:FunctionDef_L70_C2", "vector": [8, 2, 0.3984, 0.0428, 2, 0.37, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Verify that constraint is satisfied.\n\n flags library calls this method to verify Validator's constraint.\n Args:\n flag_values: gflags.FlagValues, containing all flags\n Raises:\n Error: if constraint is not satisfied.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99073:Assign_L79_C4", "label": "param = _GetInputToCheckerFunction()", "type": "assigned_variable", "loc": [79, 79], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99073:FunctionDef_L70_C2", "vector": [14, 2, 0.4225, 0.0053, 2, 0.37, 0.5, 841, 3, 1, 0, 0, 382, 10, 1], "semantic": {"name": "param", "arg_names": [], "import_names": [], "rhs_call_name": "_GetInputToCheckerFunction", "annotation": ""}, "snippet": " param = self._GetInputToCheckerFunction(flag_values)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99073:If_L80_C4", "label": "if", "type": "if", "loc": [80, 81], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99073:FunctionDef_L70_C2", "vector": [4, 2, 0.4305, 0.0107, 2, 0.37, 1.0, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not self.checker(param):\n raise Error(self.message)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99073:FunctionDef_L83_C2", "label": "GetFlagsNames", "type": "function", "loc": [83, 89], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99073:ClassDef_L45_C0", "vector": [2, 1, 0.4599, 0.0374, 1, 0.44, 0.6667, 150, 0, 1, 0, 0, 0, 0, 1], "semantic": {"name": "GetFlagsNames", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def GetFlagsNames(self):\n \"\"\"Return the names of the flags checked by this validator.\n\n Returns:\n [string], names of the flags\n \"\"\"\n raise NotImplementedError('This method should be overloaded')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99073:Expr_L84_C4", "label": "expression", "type": "expression", "loc": [84, 88], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99073:FunctionDef_L83_C2", "vector": [8, 2, 0.4599, 0.0267, 2, 0.48, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Return the names of the flags checked by this validator.\n\n Returns:\n [string], names of the flags\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99073:FunctionDef_L91_C2", "label": "PrintFlagsWithValues", "type": "function", "loc": [91, 92], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99073:ClassDef_L45_C0", "vector": [2, 1, 0.4893, 0.0107, 1, 0.44, 0.8333, 379, 0, 2, 0, 0, 0, 0, 1], "semantic": {"name": "PrintFlagsWithValues", "arg_names": ["self", "flag_values"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def PrintFlagsWithValues(self, flag_values):\n raise NotImplementedError('This method should be overloaded')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99073:FunctionDef_L94_C2", "label": "_GetInputToCheckerFunction", "type": "function", "loc": [94, 102], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99073:ClassDef_L45_C0", "vector": [2, 1, 0.5241, 0.0481, 1, 0.44, 1.0, 382, 0, 2, 0, 0, 0, 0, 1], "semantic": {"name": "_GetInputToCheckerFunction", "arg_names": ["self", "flag_values"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _GetInputToCheckerFunction(self, flag_values):\n \"\"\"Given flag values, construct the input to be given to checker.\n\n Args:\n flag_values: gflags.FlagValues, containing all flags.\n Returns:\n Return type depends on the specific validator.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99073:Expr_L95_C4", "label": "expression", "type": "expression", "loc": [95, 101], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99073:FunctionDef_L94_C2", "vector": [8, 2, 0.5241, 0.0374, 2, 0.62, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Given flag values, construct the input to be given to checker.\n\n Args:\n flag_values: gflags.FlagValues, containing all flags.\n Returns:\n Return type depends on the specific validator.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99073:ClassDef_L105_C0", "label": "SimpleValidator", "type": "class", "loc": [105, 141], "level": 0, "parent": null, "vector": [3, 0, 0.6578, 0.1979, 0, 0.66, 0.8, 334, 0, 4, 0, 0, 957, 0, 2], "semantic": {"name": "SimpleValidator", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class SimpleValidator(Validator):\n \"\"\"Validator behind RegisterValidator() method.\n\n Validates that a single flag passes its checker function. The checker function\n takes the flag value and returns True (if value looks fine) or, if flag value\n is not valid, either returns False or raises an Exception.\"\"\"\n def __init__(self, flag_name, checker, message):\n \"\"\"Constructor."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99073:Expr_L106_C2", "label": "expression", "type": "expression", "loc": [106, 110], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99073:ClassDef_L105_C0", "vector": [8, 1, 0.5775, 0.0267, 1, 0.14, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Validator behind RegisterValidator() method.\n\n Validates that a single flag passes its checker function. The checker function\n takes the flag value and returns True (if value looks fine) or, if flag value\n is not valid, either returns False or raises an Exception.\"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99073:FunctionDef_L111_C2", "label": "__init__", "type": "function", "loc": [111, 125], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99073:ClassDef_L105_C0", "vector": [2, 1, 0.631, 0.0802, 1, 0.14, 0.25, 555, 0, 4, 0, 0, 0, 0, 2], "semantic": {"name": "__init__", "arg_names": ["self", "flag_name", "checker", "message"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, flag_name, checker, message):\n \"\"\"Constructor.\n\n Args:\n flag_name: string, name of the flag.\n checker: function to verify the validator.\n input - value of the corresponding flag (string, boolean, etc).\n output - Boolean. Must return True if validator constraint is satisfied."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99073:Expr_L112_C4", "label": "expression", "type": "expression", "loc": [112, 123], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99073:FunctionDef_L111_C2", "vector": [8, 2, 0.6283, 0.0642, 2, 0.02, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Constructor.\n\n Args:\n flag_name: string, name of the flag.\n checker: function to verify the validator.\n input - value of the corresponding flag (string, boolean, etc).\n output - Boolean. Must return True if validator constraint is satisfied.\n If constraint is not satisfied, it should either return False or"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99073:Expr_L124_C4", "label": "__init__()", "type": "expression", "loc": [124, 124], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99073:FunctionDef_L111_C2", "vector": [8, 2, 0.6631, 0.0053, 2, 0.02, 0.5, 555, 3, 2, 0, 0, 0, 0, 2], "semantic": {"name": "__init__", "arg_names": [], "import_names": [], "rhs_call_name": "__init__", "annotation": ""}, "snippet": " super(SimpleValidator, self).__init__(checker, message)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99073:Assign_L125_C4", "label": "self.flag_name =", "type": "assigned_variable", "loc": [125, 125], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99073:FunctionDef_L111_C2", "vector": [14, 2, 0.6684, 0.0053, 2, 0.02, 1.0, 231, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.flag_name", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.flag_name = flag_name"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99073:FunctionDef_L127_C2", "label": "GetFlagsNames", "type": "function", "loc": [127, 128], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99073:ClassDef_L105_C0", "vector": [2, 1, 0.6818, 0.0107, 1, 0.14, 0.5, 150, 0, 1, 1, 0, 0, 0, 0], "semantic": {"name": "GetFlagsNames", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def GetFlagsNames(self):\n return [self.flag_name]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99073:Return_L128_C4", "label": "return", "type": "return", "loc": [128, 128], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99073:FunctionDef_L127_C2", "vector": [13, 2, 0.6845, 0.0053, 2, 0.19, 0.0, 0, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return [self.flag_name]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99073:FunctionDef_L130_C2", "label": "PrintFlagsWithValues", "type": "function", "loc": [130, 131], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99073:ClassDef_L105_C0", "vector": [2, 1, 0.6979, 0.0107, 1, 0.14, 0.75, 379, 0, 2, 1, 0, 0, 0, 0], "semantic": {"name": "PrintFlagsWithValues", "arg_names": ["self", "flag_values"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def PrintFlagsWithValues(self, flag_values):\n return 'flag --%s=%s' % (self.flag_name, flag_values[self.flag_name].value)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99073:Return_L131_C4", "label": "return", "type": "return", "loc": [131, 131], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99073:FunctionDef_L130_C2", "vector": [13, 2, 0.7005, 0.0053, 2, 0.54, 0.0, 0, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return 'flag --%s=%s' % (self.flag_name, flag_values[self.flag_name].value)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99073:FunctionDef_L133_C2", "label": "_GetInputToCheckerFunction", "type": "function", "loc": [133, 141], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99073:ClassDef_L105_C0", "vector": [2, 1, 0.7326, 0.0481, 1, 0.14, 1.0, 382, 0, 2, 1, 0, 0, 0, 0], "semantic": {"name": "_GetInputToCheckerFunction", "arg_names": ["self", "flag_values"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _GetInputToCheckerFunction(self, flag_values):\n \"\"\"Given flag values, construct the input to be given to checker.\n\n Args:\n flag_values: gflags.FlagValues\n Returns:\n value of the corresponding flag.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99073:Expr_L134_C4", "label": "expression", "type": "expression", "loc": [134, 140], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99073:FunctionDef_L133_C2", "vector": [8, 2, 0.7326, 0.0374, 2, 0.1, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Given flag values, construct the input to be given to checker.\n\n Args:\n flag_values: gflags.FlagValues\n Returns:\n value of the corresponding flag.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99073:Return_L141_C4", "label": "return", "type": "return", "loc": [141, 141], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99073:FunctionDef_L133_C2", "vector": [13, 2, 0.754, 0.0053, 2, 0.1, 1.0, 0, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return flag_values[self.flag_name].value"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99073:ClassDef_L144_C0", "label": "DictionaryValidator", "type": "class", "loc": [144, 187], "level": 0, "parent": null, "vector": [3, 0, 0.885, 0.2353, 0, 0.66, 1.0, 971, 0, 4, 0, 0, 957, 0, 5], "semantic": {"name": "DictionaryValidator", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class DictionaryValidator(Validator):\n \"\"\"Validator behind RegisterDictionaryValidator method.\n\n Validates that flag values pass their common checker function. The checker\n function takes flag values and returns True (if values look fine) or,\n if values are not valid, either returns False or raises an Exception.\n \"\"\"\n def __init__(self, flag_names, checker, message):"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99073:Expr_L145_C2", "label": "expression", "type": "expression", "loc": [145, 150], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99073:ClassDef_L144_C0", "vector": [8, 1, 0.7888, 0.0321, 1, 0.36, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Validator behind RegisterDictionaryValidator method.\n\n Validates that flag values pass their common checker function. The checker\n function takes flag values and returns True (if values look fine) or,\n if values are not valid, either returns False or raises an Exception.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99073:FunctionDef_L151_C2", "label": "__init__", "type": "function", "loc": [151, 166], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99073:ClassDef_L144_C0", "vector": [2, 1, 0.8476, 0.0856, 1, 0.36, 0.25, 555, 0, 4, 0, 0, 0, 0, 2], "semantic": {"name": "__init__", "arg_names": ["self", "flag_names", "checker", "message"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, flag_names, checker, message):\n \"\"\"Constructor.\n\n Args:\n flag_names: [string], containing names of the flags used by checker.\n checker: function to verify the validator.\n input - dictionary, with keys() being flag_names, and value for each\n key being the value of the corresponding flag (string, boolean, etc)."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99073:Expr_L152_C4", "label": "expression", "type": "expression", "loc": [152, 164], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99073:FunctionDef_L151_C2", "vector": [8, 2, 0.8449, 0.0695, 2, 0.37, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Constructor.\n\n Args:\n flag_names: [string], containing names of the flags used by checker.\n checker: function to verify the validator.\n input - dictionary, with keys() being flag_names, and value for each\n key being the value of the corresponding flag (string, boolean, etc).\n output - Boolean. Must return True if validator constraint is satisfied."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99073:Expr_L165_C4", "label": "__init__()", "type": "expression", "loc": [165, 165], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99073:FunctionDef_L151_C2", "vector": [8, 2, 0.8824, 0.0053, 2, 0.37, 0.5, 555, 3, 2, 0, 0, 0, 0, 2], "semantic": {"name": "__init__", "arg_names": [], "import_names": [], "rhs_call_name": "__init__", "annotation": ""}, "snippet": " super(DictionaryValidator, self).__init__(checker, message)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99073:Assign_L166_C4", "label": "self.flag_names =", "type": "assigned_variable", "loc": [166, 166], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99073:FunctionDef_L151_C2", "vector": [14, 2, 0.8877, 0.0053, 2, 0.37, 1.0, 268, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.flag_names", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.flag_names = flag_names"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99073:FunctionDef_L168_C2", "label": "_GetInputToCheckerFunction", "type": "function", "loc": [168, 177], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99073:ClassDef_L144_C0", "vector": [2, 1, 0.9225, 0.0535, 1, 0.36, 0.5, 382, 0, 2, 1, 0, 0, 0, 1], "semantic": {"name": "_GetInputToCheckerFunction", "arg_names": ["self", "flag_values"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _GetInputToCheckerFunction(self, flag_values):\n \"\"\"Given flag values, construct the input to be given to checker.\n\n Args:\n flag_values: gflags.FlagValues\n Returns:\n dictionary, with keys() being self.lag_names, and value for each key\n being the value of the corresponding flag (string, boolean, etc)."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99073:Expr_L169_C4", "label": "expression", "type": "expression", "loc": [169, 176], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99073:FunctionDef_L168_C2", "vector": [8, 2, 0.9225, 0.0428, 2, 0.77, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Given flag values, construct the input to be given to checker.\n\n Args:\n flag_values: gflags.FlagValues\n Returns:\n dictionary, with keys() being self.lag_names, and value for each key\n being the value of the corresponding flag (string, boolean, etc).\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99073:Return_L177_C4", "label": "return", "type": "return", "loc": [177, 177], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99073:FunctionDef_L168_C2", "vector": [13, 2, 0.9465, 0.0053, 2, 0.77, 1.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return dict([key, flag_values[key].value] for key in self.flag_names)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99073:FunctionDef_L179_C2", "label": "PrintFlagsWithValues", "type": "function", "loc": [179, 184], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99073:ClassDef_L144_C0", "vector": [2, 1, 0.9706, 0.0321, 1, 0.36, 0.75, 379, 0, 2, 1, 0, 0, 0, 2], "semantic": {"name": "PrintFlagsWithValues", "arg_names": ["self", "flag_values"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def PrintFlagsWithValues(self, flag_values):\n prefix = 'flags '\n flags_with_values = []\n for key in self.flag_names:\n flags_with_values.append('%s=%s' % (key, flag_values[key].value))\n return prefix + ', '.join(flags_with_values)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99073:Assign_L180_C4", "label": "prefix =", "type": "assigned_variable", "loc": [180, 180], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99073:FunctionDef_L179_C2", "vector": [14, 2, 0.9626, 0.0053, 2, 0.7, 0.0, 284, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "prefix", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " prefix = 'flags '"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99073:Assign_L181_C4", "label": "flags_with_values =", "type": "assigned_variable", "loc": [181, 181], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99073:FunctionDef_L179_C2", "vector": [14, 2, 0.9679, 0.0053, 2, 0.7, 0.3333, 533, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "flags_with_values", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " flags_with_values = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99073:For_L182_C4", "label": "for key", "type": "for", "loc": [182, 183], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99073:FunctionDef_L179_C2", "vector": [6, 2, 0.9759, 0.0107, 2, 0.7, 0.6667, 230, 7, 0, 0, 0, 0, 0, 1], "semantic": {"name": "key", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for key in self.flag_names:\n flags_with_values.append('%s=%s' % (key, flag_values[key].value))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99073:Expr_L183_C6", "label": "append()", "type": "expression", "loc": [183, 183], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99073:For_L182_C4", "vector": [8, 3, 0.9786, 0.0053, 3, 0.1, 0.0, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " flags_with_values.append('%s=%s' % (key, flag_values[key].value))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99073:Return_L184_C4", "label": "return", "type": "return", "loc": [184, 184], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99073:FunctionDef_L179_C2", "vector": [13, 2, 0.984, 0.0053, 2, 0.7, 1.0, 0, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return prefix + ', '.join(flags_with_values)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99073:FunctionDef_L186_C2", "label": "GetFlagsNames", "type": "function", "loc": [186, 187], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99073:ClassDef_L144_C0", "vector": [2, 1, 0.9973, 0.0107, 1, 0.36, 1.0, 150, 0, 1, 1, 0, 0, 0, 0], "semantic": {"name": "GetFlagsNames", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def GetFlagsNames(self):\n return self.flag_names"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99073:Return_L187_C4", "label": "return", "type": "return", "loc": [187, 187], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99073:FunctionDef_L186_C2", "vector": [13, 2, 1.0, 0.0053, 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.flag_names"}]
[{"f": "ajibawa-2023/Python-Code-Large/train/row_99073:ClassDef_L41_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99073:Expr_L42_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99073:ClassDef_L45_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99073:Expr_L46_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99073:ClassDef_L45_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99073:Assign_L53_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99073:ClassDef_L45_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99073:FunctionDef_L55_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99073:FunctionDef_L55_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99073:Expr_L56_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99073:FunctionDef_L55_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99073:Assign_L64_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99073:FunctionDef_L55_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99073:Assign_L65_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99073:FunctionDef_L55_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99073:Assign_L68_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99073:ClassDef_L45_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99073:FunctionDef_L70_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99073:FunctionDef_L70_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99073:Expr_L71_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99073:FunctionDef_L70_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99073:Assign_L79_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99073:FunctionDef_L70_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99073:If_L80_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99073:ClassDef_L45_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99073:FunctionDef_L83_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99073:FunctionDef_L83_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99073:Expr_L84_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99073:ClassDef_L45_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99073:FunctionDef_L91_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99073:ClassDef_L45_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99073:FunctionDef_L94_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99073:FunctionDef_L94_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99073:Expr_L95_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99073:ClassDef_L105_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99073:Expr_L106_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99073:ClassDef_L105_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99073:FunctionDef_L111_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99073:FunctionDef_L111_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99073:Expr_L112_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99073:FunctionDef_L111_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99073:Expr_L124_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99073:FunctionDef_L111_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99073:Assign_L125_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99073:ClassDef_L105_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99073:FunctionDef_L127_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99073:FunctionDef_L127_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99073:Return_L128_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99073:ClassDef_L105_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99073:FunctionDef_L130_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99073:FunctionDef_L130_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99073:Return_L131_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99073:ClassDef_L105_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99073:FunctionDef_L133_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99073:FunctionDef_L133_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99073:Expr_L134_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99073:FunctionDef_L133_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99073:Return_L141_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99073:ClassDef_L144_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99073:Expr_L145_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99073:ClassDef_L144_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99073:FunctionDef_L151_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99073:FunctionDef_L151_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99073:Expr_L152_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99073:FunctionDef_L151_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99073:Expr_L165_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99073:FunctionDef_L151_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99073:Assign_L166_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99073:ClassDef_L144_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99073:FunctionDef_L168_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99073:FunctionDef_L168_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99073:Expr_L169_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99073:FunctionDef_L168_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99073:Return_L177_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99073:ClassDef_L144_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99073:FunctionDef_L179_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99073:FunctionDef_L179_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99073:Assign_L180_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99073:FunctionDef_L179_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99073:Assign_L181_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99073:FunctionDef_L179_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99073:For_L182_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99073:For_L182_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99073:Expr_L183_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99073:FunctionDef_L179_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99073:Return_L184_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99073:ClassDef_L144_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99073:FunctionDef_L186_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99073:FunctionDef_L186_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99073:Return_L187_C4"}]
#!/usr/bin/python2.4 # -*- coding: utf-8 -*- # # Copyright (C) 2011 Google Inc. # # 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 base64 import hashlib import logging import time from OpenSSL import crypto from anyjson import simplejson CLOCK_SKEW_SECS = 300 # 5 minutes in seconds AUTH_TOKEN_LIFETIME_SECS = 300 # 5 minutes in seconds MAX_TOKEN_LIFETIME_SECS = 86400 # 1 day in seconds class AppIdentityError(Exception): pass class Verifier(object): """Verifies the signature on a message.""" def __init__(self, pubkey): """Constructor. Args: pubkey, OpenSSL.crypto.PKey, The public key to verify with. """ self._pubkey = pubkey def verify(self, message, signature): """Verifies a message against a signature. Args: message: string, The message to verify. signature: string, The signature on the message. Returns: True if message was singed by the private key associated with the public key that this object was constructed with. """ try: crypto.verify(self._pubkey, signature, message, 'sha256') return True except: return False @staticmethod def from_string(key_pem, is_x509_cert): """Construct a Verified instance from a string. Args: key_pem: string, public key in PEM format. is_x509_cert: bool, True if key_pem is an X509 cert, otherwise it is expected to be an RSA key in PEM format. Returns: Verifier instance. Raises: OpenSSL.crypto.Error if the key_pem can't be parsed. """ if is_x509_cert: pubkey = crypto.load_certificate(crypto.FILETYPE_PEM, key_pem) else: pubkey = crypto.load_privatekey(crypto.FILETYPE_PEM, key_pem) return Verifier(pubkey) class Signer(object): """Signs messages with a private key.""" def __init__(self, pkey): """Constructor. Args: pkey, OpenSSL.crypto.PKey, The private key to sign with. """ self._key = pkey def sign(self, message): """Signs a message. Args: message: string, Message to be signed. Returns: string, The signature of the message for the given key. """ return crypto.sign(self._key, message, 'sha256') @staticmethod def from_string(key, password='notasecret'): """Construct a Signer instance from a string. Args: key: string, private key in P12 format. password: string, password for the private key file. Returns: Signer instance. Raises: OpenSSL.crypto.Error if the key can't be parsed. """ pkey = crypto.load_pkcs12(key, password).get_privatekey() return Signer(pkey) def _urlsafe_b64encode(raw_bytes): return base64.urlsafe_b64encode(raw_bytes).rstrip('=') def _urlsafe_b64decode(b64string): # Guard against unicode strings, which base64 can't handle. b64string = b64string.encode('ascii') padded = b64string + '=' * (4 - len(b64string) % 4) return base64.urlsafe_b64decode(padded) def _json_encode(data): return simplejson.dumps(data, separators = (',', ':')) def make_signed_jwt(signer, payload): """Make a signed JWT. See http://self-issued.info/docs/draft-jones-json-web-token.html. Args: signer: crypt.Signer, Cryptographic signer. payload: dict, Dictionary of data to convert to JSON and then sign. Returns: string, The JWT for the payload. """ header = {'typ': 'JWT', 'alg': 'RS256'} segments = [ _urlsafe_b64encode(_json_encode(header)), _urlsafe_b64encode(_json_encode(payload)), ] signing_input = '.'.join(segments) signature = signer.sign(signing_input) segments.append(_urlsafe_b64encode(signature)) logging.debug(str(segments)) return '.'.join(segments) def verify_signed_jwt_with_certs(jwt, certs, audience): """Verify a JWT against public certs. See http://self-issued.info/docs/draft-jones-json-web-token.html. Args: jwt: string, A JWT. certs: dict, Dictionary where values of public keys in PEM format. audience: string, The audience, 'aud', that this JWT should contain. If None then the JWT's 'aud' parameter is not verified. Returns: dict, The deserialized JSON payload in the JWT. Raises: AppIdentityError if any checks are failed. """ segments = jwt.split('.') if (len(segments) != 3): raise AppIdentityError( 'Wrong number of segments in token: %s' % jwt) signed = '%s.%s' % (segments[0], segments[1]) signature = _urlsafe_b64decode(segments[2]) # Parse token. json_body = _urlsafe_b64decode(segments[1]) try: parsed = simplejson.loads(json_body) except: raise AppIdentityError('Can\'t parse token: %s' % json_body) # Check signature. verified = False for (keyname, pem) in certs.items(): verifier = Verifier.from_string(pem, True) if (verifier.verify(signed, signature)): verified = True break if not verified: raise AppIdentityError('Invalid token signature: %s' % jwt) # Check creation timestamp. iat = parsed.get('iat') if iat is None: raise AppIdentityError('No iat field in token: %s' % json_body) earliest = iat - CLOCK_SKEW_SECS # Check expiration timestamp. now = long(time.time()) exp = parsed.get('exp') if exp is None: raise AppIdentityError('No exp field in token: %s' % json_body) if exp >= now + MAX_TOKEN_LIFETIME_SECS: raise AppIdentityError( 'exp field too far in future: %s' % json_body) latest = exp + CLOCK_SKEW_SECS if now < earliest: raise AppIdentityError('Token used too early, %d < %d: %s' % (now, earliest, json_body)) if now > latest: raise AppIdentityError('Token used too late, %d > %d: %s' % (now, latest, json_body)) # Check audience. if audience is not None: aud = parsed.get('aud') if aud is None: raise AppIdentityError('No aud field in token: %s' % json_body) if aud != audience: raise AppIdentityError('Wrong recipient, %s != %s: %s' % (aud, audience, json_body)) return parsed
ajibawa-2023/Python-Code-Large/train/row_99075
86
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_99075:Import_L18_C0", "label": "base64 import base64", "type": "import", "loc": [18, 18], "level": 0, "parent": null, "vector": [1, 0, 0.0738, 0.0041, 0, 0.66, 0.0, 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_99075:Import_L19_C0", "label": "hashlib import hashlib", "type": "import", "loc": [19, 19], "level": 0, "parent": null, "vector": [1, 0, 0.0779, 0.0041, 0, 0.66, 0.0625, 154, 0, 1, 0, 0, 154, 0, 0], "semantic": {"name": "hashlib", "arg_names": [], "import_names": ["hashlib"], "rhs_call_name": "", "annotation": ""}, "snippet": "import hashlib"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99075:Import_L20_C0", "label": "logging import logging", "type": "import", "loc": [20, 20], "level": 0, "parent": null, "vector": [1, 0, 0.082, 0.0041, 0, 0.66, 0.125, 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_99075:Import_L21_C0", "label": "time import time", "type": "import", "loc": [21, 21], "level": 0, "parent": null, "vector": [1, 0, 0.0861, 0.0041, 0, 0.66, 0.1875, 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_99075:ImportFrom_L23_C0", "label": "from OpenSSL import crypto", "type": "import", "loc": [23, 23], "level": 0, "parent": null, "vector": [1, 0, 0.0943, 0.0041, 0, 0.66, 0.25, 830, 0, 1, 0, 0, 830, 0, 0], "semantic": {"name": "OpenSSL", "arg_names": [], "import_names": ["crypto"], "rhs_call_name": "", "annotation": ""}, "snippet": "from OpenSSL import crypto"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99075:ImportFrom_L24_C0", "label": "from anyjson import simplejson", "type": "import", "loc": [24, 24], "level": 0, "parent": null, "vector": [1, 0, 0.0984, 0.0041, 0, 0.66, 0.3125, 877, 0, 1, 0, 0, 877, 0, 0], "semantic": {"name": "anyjson", "arg_names": [], "import_names": ["simplejson"], "rhs_call_name": "", "annotation": ""}, "snippet": "from anyjson import simplejson"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99075:Assign_L27_C0", "label": "CLOCK_SKEW_SECS =", "type": "assigned_variable", "loc": [27, 27], "level": 0, "parent": null, "vector": [14, 0, 0.1107, 0.0041, 0, 0.66, 0.375, 647, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "CLOCK_SKEW_SECS", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "CLOCK_SKEW_SECS = 300 # 5 minutes in seconds"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99075:Assign_L28_C0", "label": "AUTH_TOKEN_LIFETIME_SECS =", "type": "assigned_variable", "loc": [28, 28], "level": 0, "parent": null, "vector": [14, 0, 0.1148, 0.0041, 0, 0.66, 0.4375, 840, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "AUTH_TOKEN_LIFETIME_SECS", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "AUTH_TOKEN_LIFETIME_SECS = 300 # 5 minutes in seconds"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99075:Assign_L29_C0", "label": "MAX_TOKEN_LIFETIME_SECS =", "type": "assigned_variable", "loc": [29, 29], "level": 0, "parent": null, "vector": [14, 0, 0.1189, 0.0041, 0, 0.66, 0.5, 88, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "MAX_TOKEN_LIFETIME_SECS", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "MAX_TOKEN_LIFETIME_SECS = 86400 # 1 day in seconds"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99075:ClassDef_L32_C0", "label": "AppIdentityError", "type": "class", "loc": [32, 33], "level": 0, "parent": null, "vector": [3, 0, 0.1332, 0.0082, 0, 0.66, 0.5625, 458, 0, 0, 0, 0, 645, 0, 0], "semantic": {"name": "AppIdentityError", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class AppIdentityError(Exception):\n pass"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99075:ClassDef_L36_C0", "label": "Verifier", "type": "class", "loc": [36, 83], "level": 0, "parent": null, "vector": [3, 0, 0.2439, 0.1967, 0, 0.66, 0.625, 73, 0, 3, 0, 0, 186, 0, 4], "semantic": {"name": "Verifier", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class Verifier(object):\n \"\"\"Verifies the signature on a message.\"\"\"\n\n def __init__(self, pubkey):\n \"\"\"Constructor.\n\n Args:\n pubkey, OpenSSL.crypto.PKey, The public key to verify with."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99075:Expr_L37_C2", "label": "expression", "type": "expression", "loc": [37, 37], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99075:ClassDef_L36_C0", "vector": [8, 1, 0.1516, 0.0041, 1, 0.79, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Verifies the signature on a message.\"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99075:FunctionDef_L39_C2", "label": "__init__", "type": "function", "loc": [39, 45], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99075:ClassDef_L36_C0", "vector": [2, 1, 0.1721, 0.0287, 1, 0.79, 0.3333, 555, 0, 2, 0, 0, 0, 0, 0], "semantic": {"name": "__init__", "arg_names": ["self", "pubkey"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, pubkey):\n \"\"\"Constructor.\n\n Args:\n pubkey, OpenSSL.crypto.PKey, The public key to verify with.\n \"\"\"\n self._pubkey = pubkey"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99075:Expr_L40_C4", "label": "expression", "type": "expression", "loc": [40, 44], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99075:FunctionDef_L39_C2", "vector": [8, 2, 0.1721, 0.0205, 2, 0.24, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Constructor.\n\n Args:\n pubkey, OpenSSL.crypto.PKey, The public key to verify with.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99075:Assign_L45_C4", "label": "self._pubkey =", "type": "assigned_variable", "loc": [45, 45], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99075:FunctionDef_L39_C2", "vector": [14, 2, 0.1844, 0.0041, 2, 0.24, 1.0, 849, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self._pubkey", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self._pubkey = pubkey"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99075:FunctionDef_L47_C2", "label": "verify", "type": "function", "loc": [47, 62], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99075:ClassDef_L36_C0", "vector": [2, 1, 0.2234, 0.0656, 1, 0.79, 0.6667, 422, 0, 3, 1, 0, 0, 0, 1], "semantic": {"name": "verify", "arg_names": ["self", "message", "signature"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def verify(self, message, signature):\n \"\"\"Verifies a message against a signature.\n\n Args:\n message: string, The message to verify.\n signature: string, The signature on the message.\n\n Returns:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99075:Expr_L48_C4", "label": "expression", "type": "expression", "loc": [48, 57], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99075:FunctionDef_L47_C2", "vector": [8, 2, 0.2152, 0.041, 2, 0.45, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Verifies a message against a signature.\n\n Args:\n message: string, The message to verify.\n signature: string, The signature on the message.\n\n Returns:\n True if message was singed by the private key associated with the public"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99075:Try_L58_C4", "label": "try", "type": "try", "loc": [58, 62], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99075:FunctionDef_L47_C2", "vector": [7, 2, 0.2459, 0.0205, 2, 0.45, 1.0, 0, 0, 1, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " try:\n crypto.verify(self._pubkey, signature, message, 'sha256')\n return True\n except:\n return False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99075:Expr_L59_C6", "label": "verify()", "type": "expression", "loc": [59, 59], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99075:Try_L58_C4", "vector": [8, 3, 0.2418, 0.0041, 3, 0.93, 0.0, 422, 3, 4, 0, 0, 0, 0, 1], "semantic": {"name": "verify", "arg_names": [], "import_names": [], "rhs_call_name": "verify", "annotation": ""}, "snippet": " crypto.verify(self._pubkey, signature, message, 'sha256')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99075:Return_L60_C6", "label": "return", "type": "return", "loc": [60, 60], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99075:Try_L58_C4", "vector": [13, 3, 0.2459, 0.0041, 3, 0.93, 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_99075:Return_L62_C6", "label": "return", "type": "return", "loc": [62, 62], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99075:Try_L58_C4", "vector": [13, 3, 0.2541, 0.0041, 3, 0.93, 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_99075:FunctionDef_L65_C2", "label": "from_string", "type": "function", "loc": [65, 83], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99075:ClassDef_L36_C0", "vector": [2, 1, 0.3033, 0.0779, 1, 0.79, 1.0, 423, 0, 2, 1, 0, 0, 0, 3], "semantic": {"name": "from_string", "arg_names": ["key_pem", "is_x509_cert"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def from_string(key_pem, is_x509_cert):\n \"\"\"Construct a Verified instance from a string.\n\n Args:\n key_pem: string, public key in PEM format.\n is_x509_cert: bool, True if key_pem is an X509 cert, otherwise it is\n expected to be an RSA key in PEM format.\n"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99075:Expr_L66_C4", "label": "expression", "type": "expression", "loc": [66, 78], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99075:FunctionDef_L65_C2", "vector": [8, 2, 0.2951, 0.0533, 2, 0.2, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Construct a Verified instance from a string.\n\n Args:\n key_pem: string, public key in PEM format.\n is_x509_cert: bool, True if key_pem is an X509 cert, otherwise it is\n expected to be an RSA key in PEM format.\n\n Returns:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99075:If_L79_C4", "label": "if", "type": "if", "loc": [79, 82], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99075:FunctionDef_L65_C2", "vector": [4, 2, 0.3299, 0.0164, 2, 0.2, 0.5, 0, 2, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if is_x509_cert:\n pubkey = crypto.load_certificate(crypto.FILETYPE_PEM, key_pem)\n else:\n pubkey = crypto.load_privatekey(crypto.FILETYPE_PEM, key_pem)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99075:Assign_L80_C6", "label": "pubkey = load_certificate()", "type": "assigned_variable", "loc": [80, 80], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99075:If_L79_C4", "vector": [14, 3, 0.3279, 0.0041, 3, 0.59, 0.0, 800, 3, 2, 0, 0, 645, 10, 1], "semantic": {"name": "pubkey", "arg_names": [], "import_names": [], "rhs_call_name": "load_certificate", "annotation": ""}, "snippet": " pubkey = crypto.load_certificate(crypto.FILETYPE_PEM, key_pem)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99075:Assign_L82_C6", "label": "pubkey = load_privatekey()", "type": "assigned_variable", "loc": [82, 82], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99075:If_L79_C4", "vector": [14, 3, 0.3361, 0.0041, 3, 0.59, 1.0, 800, 3, 2, 0, 0, 341, 10, 1], "semantic": {"name": "pubkey", "arg_names": [], "import_names": [], "rhs_call_name": "load_privatekey", "annotation": ""}, "snippet": " pubkey = crypto.load_privatekey(crypto.FILETYPE_PEM, key_pem)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99075:Return_L83_C4", "label": "return", "type": "return", "loc": [83, 83], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99075:FunctionDef_L65_C2", "vector": [13, 2, 0.3402, 0.0041, 2, 0.2, 1.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return Verifier(pubkey)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99075:ClassDef_L86_C0", "label": "Signer", "type": "class", "loc": [86, 123], "level": 0, "parent": null, "vector": [3, 0, 0.4283, 0.1557, 0, 0.66, 0.6875, 637, 0, 3, 0, 0, 186, 0, 4], "semantic": {"name": "Signer", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class Signer(object):\n \"\"\"Signs messages with a private key.\"\"\"\n\n def __init__(self, pkey):\n \"\"\"Constructor.\n\n Args:\n pkey, OpenSSL.crypto.PKey, The private key to sign with."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99075:Expr_L87_C2", "label": "expression", "type": "expression", "loc": [87, 87], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99075:ClassDef_L86_C0", "vector": [8, 1, 0.3566, 0.0041, 1, 0.57, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Signs messages with a private key.\"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99075:FunctionDef_L89_C2", "label": "__init__", "type": "function", "loc": [89, 95], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99075:ClassDef_L86_C0", "vector": [2, 1, 0.377, 0.0287, 1, 0.57, 0.3333, 555, 0, 2, 0, 0, 0, 0, 0], "semantic": {"name": "__init__", "arg_names": ["self", "pkey"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, pkey):\n \"\"\"Constructor.\n\n Args:\n pkey, OpenSSL.crypto.PKey, The private key to sign with.\n \"\"\"\n self._key = pkey"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99075:Expr_L90_C4", "label": "expression", "type": "expression", "loc": [90, 94], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99075:FunctionDef_L89_C2", "vector": [8, 2, 0.377, 0.0205, 2, 0.21, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Constructor.\n\n Args:\n pkey, OpenSSL.crypto.PKey, The private key to sign with.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99075:Assign_L95_C4", "label": "self._key =", "type": "assigned_variable", "loc": [95, 95], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99075:FunctionDef_L89_C2", "vector": [14, 2, 0.3893, 0.0041, 2, 0.21, 1.0, 449, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self._key", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self._key = pkey"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99075:FunctionDef_L97_C2", "label": "sign", "type": "function", "loc": [97, 106], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99075:ClassDef_L86_C0", "vector": [2, 1, 0.416, 0.041, 1, 0.57, 0.6667, 448, 0, 2, 1, 0, 0, 0, 1], "semantic": {"name": "sign", "arg_names": ["self", "message"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def sign(self, message):\n \"\"\"Signs a message.\n\n Args:\n message: string, Message to be signed.\n\n Returns:\n string, The signature of the message for the given key."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99075:Expr_L98_C4", "label": "expression", "type": "expression", "loc": [98, 105], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99075:FunctionDef_L97_C2", "vector": [8, 2, 0.416, 0.0328, 2, 0.32, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Signs a message.\n\n Args:\n message: string, Message to be signed.\n\n Returns:\n string, The signature of the message for the given key.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99075:Return_L106_C4", "label": "return", "type": "return", "loc": [106, 106], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99075:FunctionDef_L97_C2", "vector": [13, 2, 0.4344, 0.0041, 2, 0.32, 1.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return crypto.sign(self._key, message, 'sha256')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99075:FunctionDef_L109_C2", "label": "from_string", "type": "function", "loc": [109, 123], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99075:ClassDef_L86_C0", "vector": [2, 1, 0.4754, 0.0615, 1, 0.57, 1.0, 423, 0, 2, 1, 0, 0, 0, 3], "semantic": {"name": "from_string", "arg_names": ["key", "password"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def from_string(key, password='notasecret'):\n \"\"\"Construct a Signer instance from a string.\n\n Args:\n key: string, private key in P12 format.\n password: string, password for the private key file.\n\n Returns:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99075:Expr_L110_C4", "label": "expression", "type": "expression", "loc": [110, 121], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99075:FunctionDef_L109_C2", "vector": [8, 2, 0.4734, 0.0492, 2, 0.93, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Construct a Signer instance from a string.\n\n Args:\n key: string, private key in P12 format.\n password: string, password for the private key file.\n\n Returns:\n Signer instance."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99075:Assign_L122_C4", "label": "pkey = get_privatekey()", "type": "assigned_variable", "loc": [122, 122], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99075:FunctionDef_L109_C2", "vector": [14, 2, 0.5, 0.0041, 2, 0.93, 0.5, 788, 3, 0, 0, 0, 40, 10, 2], "semantic": {"name": "pkey", "arg_names": [], "import_names": [], "rhs_call_name": "get_privatekey", "annotation": ""}, "snippet": " pkey = crypto.load_pkcs12(key, password).get_privatekey()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99075:Return_L123_C4", "label": "return", "type": "return", "loc": [123, 123], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99075:FunctionDef_L109_C2", "vector": [13, 2, 0.5041, 0.0041, 2, 0.93, 1.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return Signer(pkey)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99075:FunctionDef_L126_C0", "label": "_urlsafe_b64encode", "type": "function", "loc": [126, 127], "level": 0, "parent": null, "vector": [2, 0, 0.5184, 0.0082, 0, 0.66, 0.75, 44, 0, 1, 1, 0, 0, 0, 2], "semantic": {"name": "_urlsafe_b64encode", "arg_names": ["raw_bytes"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def _urlsafe_b64encode(raw_bytes):\n return base64.urlsafe_b64encode(raw_bytes).rstrip('=')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99075:Return_L127_C2", "label": "return", "type": "return", "loc": [127, 127], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99075:FunctionDef_L126_C0", "vector": [13, 1, 0.5205, 0.0041, 1, 0.91, 0.0, 0, 3, 0, 0, 0, 0, 10, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return base64.urlsafe_b64encode(raw_bytes).rstrip('=')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99075:FunctionDef_L130_C0", "label": "_urlsafe_b64decode", "type": "function", "loc": [130, 134], "level": 0, "parent": null, "vector": [2, 0, 0.541, 0.0205, 0, 0.66, 0.8125, 388, 0, 1, 1, 0, 0, 0, 3], "semantic": {"name": "_urlsafe_b64decode", "arg_names": ["b64string"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def _urlsafe_b64decode(b64string):\n # Guard against unicode strings, which base64 can't handle.\n b64string = b64string.encode('ascii')\n padded = b64string + '=' * (4 - len(b64string) % 4)\n return base64.urlsafe_b64decode(padded)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99075:Assign_L132_C2", "label": "b64string = encode()", "type": "assigned_variable", "loc": [132, 132], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99075:FunctionDef_L130_C0", "vector": [14, 1, 0.541, 0.0041, 1, 0.95, 0.0, 502, 3, 1, 0, 0, 623, 10, 1], "semantic": {"name": "b64string", "arg_names": [], "import_names": [], "rhs_call_name": "encode", "annotation": ""}, "snippet": " b64string = b64string.encode('ascii')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99075:Assign_L133_C2", "label": "padded =", "type": "assigned_variable", "loc": [133, 133], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99075:FunctionDef_L130_C0", "vector": [14, 1, 0.5451, 0.0041, 1, 0.95, 0.5, 54, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "padded", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " padded = b64string + '=' * (4 - len(b64string) % 4)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99075:Return_L134_C2", "label": "return", "type": "return", "loc": [134, 134], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99075:FunctionDef_L130_C0", "vector": [13, 1, 0.5492, 0.0041, 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 base64.urlsafe_b64decode(padded)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99075:FunctionDef_L137_C0", "label": "_json_encode", "type": "function", "loc": [137, 138], "level": 0, "parent": null, "vector": [2, 0, 0.5635, 0.0082, 0, 0.66, 0.875, 738, 0, 1, 1, 0, 0, 0, 1], "semantic": {"name": "_json_encode", "arg_names": ["data"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def _json_encode(data):\n return simplejson.dumps(data, separators = (',', ':'))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99075:Return_L138_C2", "label": "return", "type": "return", "loc": [138, 138], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99075:FunctionDef_L137_C0", "vector": [13, 1, 0.5656, 0.0041, 1, 0.69, 0.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return simplejson.dumps(data, separators = (',', ':'))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99075:FunctionDef_L141_C0", "label": "make_signed_jwt", "type": "function", "loc": [141, 166], "level": 0, "parent": null, "vector": [2, 0, 0.6291, 0.1066, 0, 0.66, 0.9375, 470, 0, 2, 1, 0, 0, 0, 11], "semantic": {"name": "make_signed_jwt", "arg_names": ["signer", "payload"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def make_signed_jwt(signer, payload):\n \"\"\"Make a signed JWT.\n\n See http://self-issued.info/docs/draft-jones-json-web-token.html.\n\n Args:\n signer: crypt.Signer, Cryptographic signer.\n payload: dict, Dictionary of data to convert to JSON and then sign."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99075:Expr_L142_C2", "label": "expression", "type": "expression", "loc": [142, 152], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99075:FunctionDef_L141_C0", "vector": [8, 1, 0.6025, 0.0451, 1, 0.68, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Make a signed JWT.\n\n See http://self-issued.info/docs/draft-jones-json-web-token.html.\n\n Args:\n signer: crypt.Signer, Cryptographic signer.\n payload: dict, Dictionary of data to convert to JSON and then sign.\n"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99075:Assign_L153_C2", "label": "header =", "type": "assigned_variable", "loc": [153, 153], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99075:FunctionDef_L141_C0", "vector": [14, 1, 0.627, 0.0041, 1, 0.68, 0.1429, 481, 0, 0, 0, 0, 0, 6, 0], "semantic": {"name": "header", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " header = {'typ': 'JWT', 'alg': 'RS256'}"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99075:Assign_L155_C2", "label": "segments =", "type": "assigned_variable", "loc": [155, 158], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99075:FunctionDef_L141_C0", "vector": [14, 1, 0.6414, 0.0164, 1, 0.68, 0.2857, 185, 0, 0, 0, 0, 0, 5, 4], "semantic": {"name": "segments", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " segments = [\n _urlsafe_b64encode(_json_encode(header)),\n _urlsafe_b64encode(_json_encode(payload)),\n ]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99075:Assign_L159_C2", "label": "signing_input = join()", "type": "assigned_variable", "loc": [159, 159], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99075:FunctionDef_L141_C0", "vector": [14, 1, 0.6516, 0.0041, 1, 0.68, 0.4286, 727, 3, 1, 0, 0, 933, 10, 1], "semantic": {"name": "signing_input", "arg_names": [], "import_names": [], "rhs_call_name": "join", "annotation": ""}, "snippet": " signing_input = '.'.join(segments)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99075:Assign_L161_C2", "label": "signature = sign()", "type": "assigned_variable", "loc": [161, 161], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99075:FunctionDef_L141_C0", "vector": [14, 1, 0.6598, 0.0041, 1, 0.68, 0.5714, 932, 3, 1, 0, 0, 448, 10, 1], "semantic": {"name": "signature", "arg_names": [], "import_names": [], "rhs_call_name": "sign", "annotation": ""}, "snippet": " signature = signer.sign(signing_input)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99075:Expr_L162_C2", "label": "append()", "type": "expression", "loc": [162, 162], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99075:FunctionDef_L141_C0", "vector": [8, 1, 0.6639, 0.0041, 1, 0.68, 0.7143, 243, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " segments.append(_urlsafe_b64encode(signature))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99075:Expr_L164_C2", "label": "debug()", "type": "expression", "loc": [164, 164], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99075:FunctionDef_L141_C0", "vector": [8, 1, 0.6721, 0.0041, 1, 0.68, 0.8571, 924, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "debug", "arg_names": [], "import_names": [], "rhs_call_name": "debug", "annotation": ""}, "snippet": " logging.debug(str(segments))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99075:Return_L166_C2", "label": "return", "type": "return", "loc": [166, 166], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99075:FunctionDef_L141_C0", "vector": [13, 1, 0.6803, 0.0041, 1, 0.68, 1.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return '.'.join(segments)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99075:FunctionDef_L169_C0", "label": "verify_signed_jwt_with_certs", "type": "function", "loc": [169, 244], "level": 0, "parent": null, "vector": [2, 0, 0.8463, 0.3115, 0, 0.66, 1.0, 604, 0, 3, 1, 0, 0, 0, 23], "semantic": {"name": "verify_signed_jwt_with_certs", "arg_names": ["jwt", "certs", "audience"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def verify_signed_jwt_with_certs(jwt, certs, audience):\n \"\"\"Verify a JWT against public certs.\n\n See http://self-issued.info/docs/draft-jones-json-web-token.html.\n\n Args:\n jwt: string, A JWT.\n certs: dict, Dictionary where values of public keys in PEM format."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99075:Expr_L170_C2", "label": "expression", "type": "expression", "loc": [170, 185], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99075:FunctionDef_L169_C0", "vector": [8, 1, 0.7275, 0.0656, 1, 0.24, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Verify a JWT against public certs.\n\n See http://self-issued.info/docs/draft-jones-json-web-token.html.\n\n Args:\n jwt: string, A JWT.\n certs: dict, Dictionary where values of public keys in PEM format.\n audience: string, The audience, 'aud', that this JWT should contain. If"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99075:Assign_L186_C2", "label": "segments = split()", "type": "assigned_variable", "loc": [186, 186], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99075:FunctionDef_L169_C0", "vector": [14, 1, 0.7623, 0.0041, 1, 0.24, 0.0476, 185, 3, 1, 0, 0, 908, 10, 1], "semantic": {"name": "segments", "arg_names": [], "import_names": [], "rhs_call_name": "split", "annotation": ""}, "snippet": " segments = jwt.split('.')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99075:If_L188_C2", "label": "if", "type": "if", "loc": [188, 190], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99075:FunctionDef_L169_C0", "vector": [4, 1, 0.7746, 0.0123, 1, 0.24, 0.0952, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if (len(segments) != 3):\n raise AppIdentityError(\n 'Wrong number of segments in token: %s' % jwt)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99075:Assign_L191_C2", "label": "signed =", "type": "assigned_variable", "loc": [191, 191], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99075:FunctionDef_L169_C0", "vector": [14, 1, 0.7828, 0.0041, 1, 0.24, 0.1429, 756, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "signed", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " signed = '%s.%s' % (segments[0], segments[1])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99075:Assign_L193_C2", "label": "signature = _urlsafe_b64decode()", "type": "assigned_variable", "loc": [193, 193], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99075:FunctionDef_L169_C0", "vector": [14, 1, 0.791, 0.0041, 1, 0.24, 0.1905, 932, 3, 1, 0, 0, 388, 10, 1], "semantic": {"name": "signature", "arg_names": [], "import_names": [], "rhs_call_name": "_urlsafe_b64decode", "annotation": ""}, "snippet": " signature = _urlsafe_b64decode(segments[2])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99075:Assign_L196_C2", "label": "json_body = _urlsafe_b64decode()", "type": "assigned_variable", "loc": [196, 196], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99075:FunctionDef_L169_C0", "vector": [14, 1, 0.8033, 0.0041, 1, 0.24, 0.2381, 958, 3, 1, 0, 0, 388, 10, 1], "semantic": {"name": "json_body", "arg_names": [], "import_names": [], "rhs_call_name": "_urlsafe_b64decode", "annotation": ""}, "snippet": " json_body = _urlsafe_b64decode(segments[1])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99075:Try_L197_C2", "label": "try", "type": "try", "loc": [197, 200], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99075:FunctionDef_L169_C0", "vector": [7, 1, 0.8135, 0.0164, 1, 0.24, 0.2857, 0, 0, 1, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " try:\n parsed = simplejson.loads(json_body)\n except:\n raise AppIdentityError('Can\\'t parse token: %s' % json_body)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99075:Assign_L198_C4", "label": "parsed = loads()", "type": "assigned_variable", "loc": [198, 198], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99075:Try_L197_C2", "vector": [14, 2, 0.8115, 0.0041, 2, 0.58, 0.0, 313, 3, 1, 0, 0, 88, 10, 1], "semantic": {"name": "parsed", "arg_names": [], "import_names": [], "rhs_call_name": "loads", "annotation": ""}, "snippet": " parsed = simplejson.loads(json_body)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99075:Assign_L203_C2", "label": "verified =", "type": "assigned_variable", "loc": [203, 203], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99075:FunctionDef_L169_C0", "vector": [14, 1, 0.832, 0.0041, 1, 0.24, 0.3333, 809, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "verified", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " verified = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99075:For_L204_C2", "label": "for keyname, pem", "type": "for", "loc": [204, 208], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99075:FunctionDef_L169_C0", "vector": [6, 1, 0.8443, 0.0205, 1, 0.24, 0.381, 704, 3, 0, 0, 0, 0, 0, 3], "semantic": {"name": "keyname, pem", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for (keyname, pem) in certs.items():\n verifier = Verifier.from_string(pem, True)\n if (verifier.verify(signed, signature)):\n verified = True\n break"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99075:Assign_L205_C4", "label": "verifier = from_string()", "type": "assigned_variable", "loc": [205, 205], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99075:For_L204_C2", "vector": [14, 2, 0.8402, 0.0041, 2, 0.85, 0.0, 629, 3, 2, 0, 0, 423, 10, 1], "semantic": {"name": "verifier", "arg_names": [], "import_names": [], "rhs_call_name": "from_string", "annotation": ""}, "snippet": " verifier = Verifier.from_string(pem, True)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99075:If_L206_C4", "label": "if", "type": "if", "loc": [206, 208], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99075:For_L204_C2", "vector": [4, 2, 0.8484, 0.0123, 2, 0.85, 1.0, 0, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if (verifier.verify(signed, signature)):\n verified = True\n break"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99075:Assign_L207_C6", "label": "verified =", "type": "assigned_variable", "loc": [207, 207], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99075:If_L206_C4", "vector": [14, 3, 0.8484, 0.0041, 3, 0.73, 0.0, 809, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "verified", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " verified = True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99075:If_L209_C2", "label": "if", "type": "if", "loc": [209, 210], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99075:FunctionDef_L169_C0", "vector": [4, 1, 0.8586, 0.0082, 1, 0.24, 0.4286, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not verified:\n raise AppIdentityError('Invalid token signature: %s' % jwt)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99075:Assign_L213_C2", "label": "iat = get()", "type": "assigned_variable", "loc": [213, 213], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99075:FunctionDef_L169_C0", "vector": [14, 1, 0.873, 0.0041, 1, 0.24, 0.4762, 710, 3, 1, 0, 0, 607, 10, 1], "semantic": {"name": "iat", "arg_names": [], "import_names": [], "rhs_call_name": "get", "annotation": ""}, "snippet": " iat = parsed.get('iat')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99075:If_L214_C2", "label": "if", "type": "if", "loc": [214, 215], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99075:FunctionDef_L169_C0", "vector": [4, 1, 0.8791, 0.0082, 1, 0.24, 0.5238, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if iat is None:\n raise AppIdentityError('No iat field in token: %s' % json_body)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99075:Assign_L216_C2", "label": "earliest =", "type": "assigned_variable", "loc": [216, 216], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99075:FunctionDef_L169_C0", "vector": [14, 1, 0.8852, 0.0041, 1, 0.24, 0.5714, 110, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "earliest", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " earliest = iat - CLOCK_SKEW_SECS"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99075:Assign_L219_C2", "label": "now = long()", "type": "assigned_variable", "loc": [219, 219], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99075:FunctionDef_L169_C0", "vector": [14, 1, 0.8975, 0.0041, 1, 0.24, 0.619, 894, 3, 1, 0, 0, 37, 10, 2], "semantic": {"name": "now", "arg_names": [], "import_names": [], "rhs_call_name": "long", "annotation": ""}, "snippet": " now = long(time.time())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99075:Assign_L220_C2", "label": "exp = get()", "type": "assigned_variable", "loc": [220, 220], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99075:FunctionDef_L169_C0", "vector": [14, 1, 0.9016, 0.0041, 1, 0.24, 0.6667, 971, 3, 1, 0, 0, 607, 10, 1], "semantic": {"name": "exp", "arg_names": [], "import_names": [], "rhs_call_name": "get", "annotation": ""}, "snippet": " exp = parsed.get('exp')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99075:If_L221_C2", "label": "if", "type": "if", "loc": [221, 222], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99075:FunctionDef_L169_C0", "vector": [4, 1, 0.9078, 0.0082, 1, 0.24, 0.7143, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if exp is None:\n raise AppIdentityError('No exp field in token: %s' % json_body)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99075:If_L223_C2", "label": "if", "type": "if", "loc": [223, 225], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99075:FunctionDef_L169_C0", "vector": [4, 1, 0.918, 0.0123, 1, 0.24, 0.7619, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if exp >= now + MAX_TOKEN_LIFETIME_SECS:\n raise AppIdentityError(\n 'exp field too far in future: %s' % json_body)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99075:Assign_L226_C2", "label": "latest =", "type": "assigned_variable", "loc": [226, 226], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99075:FunctionDef_L169_C0", "vector": [14, 1, 0.9262, 0.0041, 1, 0.24, 0.8095, 632, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "latest", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " latest = exp + CLOCK_SKEW_SECS"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99075:If_L228_C2", "label": "if", "type": "if", "loc": [228, 230], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99075:FunctionDef_L169_C0", "vector": [4, 1, 0.9385, 0.0123, 1, 0.24, 0.8571, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if now < earliest:\n raise AppIdentityError('Token used too early, %d < %d: %s' %\n (now, earliest, json_body))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99075:If_L231_C2", "label": "if", "type": "if", "loc": [231, 233], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99075:FunctionDef_L169_C0", "vector": [4, 1, 0.9508, 0.0123, 1, 0.24, 0.9048, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if now > latest:\n raise AppIdentityError('Token used too late, %d > %d: %s' %\n (now, latest, json_body))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99075:If_L236_C2", "label": "if", "type": "if", "loc": [236, 242], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99075:FunctionDef_L169_C0", "vector": [4, 1, 0.9795, 0.0287, 1, 0.24, 0.9524, 0, 0, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if audience is not None:\n aud = parsed.get('aud')\n if aud is None:\n raise AppIdentityError('No aud field in token: %s' % json_body)\n if aud != audience:\n raise AppIdentityError('Wrong recipient, %s != %s: %s' %\n (aud, audience, json_body))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99075:Assign_L237_C4", "label": "aud = get()", "type": "assigned_variable", "loc": [237, 237], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99075:If_L236_C2", "vector": [14, 2, 0.9713, 0.0041, 2, 0.27, 0.0, 490, 3, 1, 0, 0, 607, 10, 1], "semantic": {"name": "aud", "arg_names": [], "import_names": [], "rhs_call_name": "get", "annotation": ""}, "snippet": " aud = parsed.get('aud')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99075:If_L238_C4", "label": "if", "type": "if", "loc": [238, 239], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99075:If_L236_C2", "vector": [4, 2, 0.9775, 0.0082, 2, 0.27, 0.5, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if aud is None:\n raise AppIdentityError('No aud field in token: %s' % json_body)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99075:If_L240_C4", "label": "if", "type": "if", "loc": [240, 242], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99075:If_L236_C2", "vector": [4, 2, 0.9877, 0.0123, 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 aud != audience:\n raise AppIdentityError('Wrong recipient, %s != %s: %s' %\n (aud, audience, json_body))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99075:Return_L244_C2", "label": "return", "type": "return", "loc": [244, 244], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99075:FunctionDef_L169_C0", "vector": [13, 1, 1.0, 0.0041, 1, 0.24, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return parsed"}]
[{"f": "ajibawa-2023/Python-Code-Large/train/row_99075:ClassDef_L36_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99075:Expr_L37_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99075:ClassDef_L36_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99075:FunctionDef_L39_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99075:FunctionDef_L39_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99075:Expr_L40_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99075:FunctionDef_L39_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99075:Assign_L45_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99075:ClassDef_L36_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99075:FunctionDef_L47_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99075:FunctionDef_L47_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99075:Expr_L48_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99075:FunctionDef_L47_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99075:Try_L58_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99075:Try_L58_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99075:Expr_L59_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99075:Try_L58_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99075:Return_L60_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99075:Try_L58_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99075:Return_L62_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99075:ClassDef_L36_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99075:FunctionDef_L65_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99075:FunctionDef_L65_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99075:Expr_L66_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99075:FunctionDef_L65_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99075:If_L79_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99075:If_L79_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99075:Assign_L80_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99075:If_L79_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99075:Assign_L82_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99075:FunctionDef_L65_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99075:Return_L83_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99075:ClassDef_L86_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99075:Expr_L87_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99075:ClassDef_L86_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99075:FunctionDef_L89_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99075:FunctionDef_L89_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99075:Expr_L90_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99075:FunctionDef_L89_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99075:Assign_L95_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99075:ClassDef_L86_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99075:FunctionDef_L97_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99075:FunctionDef_L97_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99075:Expr_L98_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99075:FunctionDef_L97_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99075:Return_L106_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99075:ClassDef_L86_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99075:FunctionDef_L109_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99075:FunctionDef_L109_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99075:Expr_L110_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99075:FunctionDef_L109_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99075:Assign_L122_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99075:FunctionDef_L109_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99075:Return_L123_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99075:FunctionDef_L126_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99075:Return_L127_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99075:FunctionDef_L130_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99075:Assign_L132_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99075:FunctionDef_L130_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99075:Assign_L133_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99075:FunctionDef_L130_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99075:Return_L134_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99075:FunctionDef_L137_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99075:Return_L138_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99075:FunctionDef_L141_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99075:Expr_L142_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99075:FunctionDef_L141_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99075:Assign_L153_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99075:FunctionDef_L141_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99075:Assign_L155_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99075:FunctionDef_L141_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99075:Assign_L159_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99075:FunctionDef_L141_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99075:Assign_L161_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99075:FunctionDef_L141_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99075:Expr_L162_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99075:FunctionDef_L141_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99075:Expr_L164_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99075:FunctionDef_L141_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99075:Return_L166_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99075:FunctionDef_L169_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99075:Expr_L170_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99075:FunctionDef_L169_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99075:Assign_L186_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99075:FunctionDef_L169_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99075:If_L188_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99075:FunctionDef_L169_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99075:Assign_L191_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99075:FunctionDef_L169_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99075:Assign_L193_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99075:FunctionDef_L169_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99075:Assign_L196_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99075:FunctionDef_L169_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99075:Try_L197_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99075:Try_L197_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99075:Assign_L198_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99075:FunctionDef_L169_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99075:Assign_L203_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99075:FunctionDef_L169_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99075:For_L204_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99075:For_L204_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99075:Assign_L205_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99075:For_L204_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99075:If_L206_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99075:If_L206_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99075:Assign_L207_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99075:FunctionDef_L169_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99075:If_L209_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99075:FunctionDef_L169_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99075:Assign_L213_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99075:FunctionDef_L169_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99075:If_L214_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99075:FunctionDef_L169_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99075:Assign_L216_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99075:FunctionDef_L169_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99075:Assign_L219_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99075:FunctionDef_L169_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99075:Assign_L220_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99075:FunctionDef_L169_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99075:If_L221_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99075:FunctionDef_L169_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99075:If_L223_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99075:FunctionDef_L169_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99075:Assign_L226_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99075:FunctionDef_L169_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99075:If_L228_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99075:FunctionDef_L169_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99075:If_L231_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99075:FunctionDef_L169_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99075:If_L236_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99075:If_L236_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99075:Assign_L237_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99075:If_L236_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99075:If_L238_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99075:If_L236_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99075:If_L240_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99075:FunctionDef_L169_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99075:Return_L244_C2"}]
# Copyright 2011 Google Inc. All Rights Reserved. """Multi-credential file store with lock support. This module implements a JSON credential store where multiple credentials can be stored in one file. That file supports locking both in a single process and across processes. The credential themselves are keyed off of: * client_id * user_agent * scope The format of the stored data is like so: { 'file_version': 1, 'data': [ { 'key': { 'clientId': '<client id>', 'userAgent': '<user agent>', 'scope': '<scope>' }, 'credential': { # JSON serialized Credentials. } } ] } """ __author__ = 'jbeda@google.com (Joe Beda)' import base64 import errno import logging import os import threading from anyjson import simplejson from client import Storage as BaseStorage from client import Credentials from locked_file import LockedFile logger = logging.getLogger(__name__) # A dict from 'filename'->_MultiStore instances _multistores = {} _multistores_lock = threading.Lock() class Error(Exception): """Base error for this module.""" pass class NewerCredentialStoreError(Error): """The credential store is a newer version that supported.""" pass def get_credential_storage(filename, client_id, user_agent, scope, warn_on_readonly=True): """Get a Storage instance for a credential. Args: filename: The JSON file storing a set of credentials client_id: The client_id for the credential user_agent: The user agent for the credential scope: string or list of strings, Scope(s) being requested warn_on_readonly: if True, log a warning if the store is readonly Returns: An object derived from client.Storage for getting/setting the credential. """ filename = os.path.realpath(os.path.expanduser(filename)) _multistores_lock.acquire() try: multistore = _multistores.setdefault( filename, _MultiStore(filename, warn_on_readonly)) finally: _multistores_lock.release() if type(scope) is list: scope = ' '.join(scope) return multistore._get_storage(client_id, user_agent, scope) class _MultiStore(object): """A file backed store for multiple credentials.""" def __init__(self, filename, warn_on_readonly=True): """Initialize the class. This will create the file if necessary. """ self._file = LockedFile(filename, 'r+b', 'rb') self._thread_lock = threading.Lock() self._read_only = False self._warn_on_readonly = warn_on_readonly self._create_file_if_needed() # Cache of deserialized store. This is only valid after the # _MultiStore is locked or _refresh_data_cache is called. This is # of the form of: # # (client_id, user_agent, scope) -> OAuth2Credential # # If this is None, then the store hasn't been read yet. self._data = None class _Storage(BaseStorage): """A Storage object that knows how to read/write a single credential.""" def __init__(self, multistore, client_id, user_agent, scope): self._multistore = multistore self._client_id = client_id self._user_agent = user_agent self._scope = scope def acquire_lock(self): """Acquires any lock necessary to access this Storage. This lock is not reentrant. """ self._multistore._lock() def release_lock(self): """Release the Storage lock. Trying to release a lock that isn't held will result in a RuntimeError. """ self._multistore._unlock() def locked_get(self): """Retrieve credential. The Storage lock must be held when this is called. Returns: oauth2client.client.Credentials """ credential = self._multistore._get_credential( self._client_id, self._user_agent, self._scope) if credential: credential.set_store(self) return credential def locked_put(self, credentials): """Write a credential. The Storage lock must be held when this is called. Args: credentials: Credentials, the credentials to store. """ self._multistore._update_credential(credentials, self._scope) def locked_delete(self): """Delete a credential. The Storage lock must be held when this is called. Args: credentials: Credentials, the credentials to store. """ self._multistore._delete_credential(self._client_id, self._user_agent, self._scope) def _create_file_if_needed(self): """Create an empty file if necessary. This method will not initialize the file. Instead it implements a simple version of "touch" to ensure the file has been created. """ if not os.path.exists(self._file.filename()): old_umask = os.umask(0177) try: open(self._file.filename(), 'a+b').close() finally: os.umask(old_umask) def _lock(self): """Lock the entire multistore.""" self._thread_lock.acquire() self._file.open_and_lock() if not self._file.is_locked(): self._read_only = True if self._warn_on_readonly: logger.warn('The credentials file (%s) is not writable. Opening in ' 'read-only mode. Any refreshed credentials will only be ' 'valid for this run.' % self._file.filename()) if os.path.getsize(self._file.filename()) == 0: logger.debug('Initializing empty multistore file') # The multistore is empty so write out an empty file. self._data = {} self._write() elif not self._read_only or self._data is None: # Only refresh the data if we are read/write or we haven't # cached the data yet. If we are readonly, we assume is isn't # changing out from under us and that we only have to read it # once. This prevents us from whacking any new access keys that # we have cached in memory but were unable to write out. self._refresh_data_cache() def _unlock(self): """Release the lock on the multistore.""" self._file.unlock_and_close() self._thread_lock.release() def _locked_json_read(self): """Get the raw content of the multistore file. The multistore must be locked when this is called. Returns: The contents of the multistore decoded as JSON. """ assert self._thread_lock.locked() self._file.file_handle().seek(0) return simplejson.load(self._file.file_handle()) def _locked_json_write(self, data): """Write a JSON serializable data structure to the multistore. The multistore must be locked when this is called. Args: data: The data to be serialized and written. """ assert self._thread_lock.locked() if self._read_only: return self._file.file_handle().seek(0) simplejson.dump(data, self._file.file_handle(), sort_keys=True, indent=2) self._file.file_handle().truncate() def _refresh_data_cache(self): """Refresh the contents of the multistore. The multistore must be locked when this is called. Raises: NewerCredentialStoreError: Raised when a newer client has written the store. """ self._data = {} try: raw_data = self._locked_json_read() except Exception: logger.warn('Credential data store could not be loaded. ' 'Will ignore and overwrite.') return version = 0 try: version = raw_data['file_version'] except Exception: logger.warn('Missing version for credential data store. It may be ' 'corrupt or an old version. Overwriting.') if version > 1: raise NewerCredentialStoreError( 'Credential file has file_version of %d. ' 'Only file_version of 1 is supported.' % version) credentials = [] try: credentials = raw_data['data'] except (TypeError, KeyError): pass for cred_entry in credentials: try: (key, credential) = self._decode_credential_from_json(cred_entry) self._data[key] = credential except: # If something goes wrong loading a credential, just ignore it logger.info('Error decoding credential, skipping', exc_info=True) def _decode_credential_from_json(self, cred_entry): """Load a credential from our JSON serialization. Args: cred_entry: A dict entry from the data member of our format Returns: (key, cred) where the key is the key tuple and the cred is the OAuth2Credential object. """ raw_key = cred_entry['key'] client_id = raw_key['clientId'] user_agent = raw_key['userAgent'] scope = raw_key['scope'] key = (client_id, user_agent, scope) credential = None credential = Credentials.new_from_json(simplejson.dumps(cred_entry['credential'])) return (key, credential) def _write(self): """Write the cached data back out. The multistore must be locked. """ raw_data = {'file_version': 1} raw_creds = [] raw_data['data'] = raw_creds for (cred_key, cred) in self._data.items(): raw_key = { 'clientId': cred_key[0], 'userAgent': cred_key[1], 'scope': cred_key[2] } raw_cred = simplejson.loads(cred.to_json()) raw_creds.append({'key': raw_key, 'credential': raw_cred}) self._locked_json_write(raw_data) def _get_credential(self, client_id, user_agent, scope): """Get a credential from the multistore. The multistore must be locked. Args: client_id: The client_id for the credential user_agent: The user agent for the credential scope: A string for the scope(s) being requested Returns: The credential specified or None if not present """ key = (client_id, user_agent, scope) return self._data.get(key, None) def _update_credential(self, cred, scope): """Update a credential and write the multistore. This must be called when the multistore is locked. Args: cred: The OAuth2Credential to update/set scope: The scope(s) that this credential covers """ key = (cred.client_id, cred.user_agent, scope) self._data[key] = cred self._write() def _delete_credential(self, client_id, user_agent, scope): """Delete a credential and write the multistore. This must be called when the multistore is locked. Args: client_id: The client_id for the credential user_agent: The user agent for the credential scope: The scope(s) that this credential covers """ key = (client_id, user_agent, scope) try: del self._data[key] except KeyError: pass self._write() def _get_storage(self, client_id, user_agent, scope): """Get a Storage object to get/set a credential. This Storage is a 'view' into the multistore. Args: client_id: The client_id for the credential user_agent: The user agent for the credential scope: A string for the scope(s) being requested Returns: A Storage object that can be used to get/set this cred """ return self._Storage(self, client_id, user_agent, scope)
ajibawa-2023/Python-Code-Large/train/row_99077
155
378
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_99077:Expr_L3_C0", "label": "expression", "type": "expression", "loc": [3, 30], "level": 0, "parent": null, "vector": [8, 0, 0.0437, 0.0741, 0, 0.66, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\"\"\"Multi-credential file store with lock support.\n\nThis module implements a JSON credential store where multiple\ncredentials can be stored in one file. That file supports locking\nboth in a single process and across processes.\n\nThe credential themselves are keyed off of:\n* client_id"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99077:Assign_L32_C0", "label": "__author__ =", "type": "assigned_variable", "loc": [32, 32], "level": 0, "parent": null, "vector": [14, 0, 0.0847, 0.0026, 0, 0.66, 0.0588, 777, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "__author__", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "__author__ = 'jbeda@google.com (Joe Beda)'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99077:Import_L34_C0", "label": "base64 import base64", "type": "import", "loc": [34, 34], "level": 0, "parent": null, "vector": [1, 0, 0.0899, 0.0026, 0, 0.66, 0.1176, 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_99077:Import_L35_C0", "label": "errno import errno", "type": "import", "loc": [35, 35], "level": 0, "parent": null, "vector": [1, 0, 0.0926, 0.0026, 0, 0.66, 0.1765, 546, 0, 1, 0, 0, 546, 0, 0], "semantic": {"name": "errno", "arg_names": [], "import_names": ["errno"], "rhs_call_name": "", "annotation": ""}, "snippet": "import errno"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99077:Import_L36_C0", "label": "logging import logging", "type": "import", "loc": [36, 36], "level": 0, "parent": null, "vector": [1, 0, 0.0952, 0.0026, 0, 0.66, 0.2353, 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_99077:Import_L37_C0", "label": "os import os", "type": "import", "loc": [37, 37], "level": 0, "parent": null, "vector": [1, 0, 0.0979, 0.0026, 0, 0.66, 0.2941, 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_99077:Import_L38_C0", "label": "threading import threading", "type": "import", "loc": [38, 38], "level": 0, "parent": null, "vector": [1, 0, 0.1005, 0.0026, 0, 0.66, 0.3529, 83, 0, 1, 0, 0, 83, 0, 0], "semantic": {"name": "threading", "arg_names": [], "import_names": ["threading"], "rhs_call_name": "", "annotation": ""}, "snippet": "import threading"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99077:ImportFrom_L40_C0", "label": "from anyjson import simplejson", "type": "import", "loc": [40, 40], "level": 0, "parent": null, "vector": [1, 0, 0.1058, 0.0026, 0, 0.66, 0.4118, 877, 0, 1, 0, 0, 877, 0, 0], "semantic": {"name": "anyjson", "arg_names": [], "import_names": ["simplejson"], "rhs_call_name": "", "annotation": ""}, "snippet": "from anyjson import simplejson"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99077:ImportFrom_L41_C0", "label": "from client import BaseStorage", "type": "import", "loc": [41, 41], "level": 0, "parent": null, "vector": [1, 0, 0.1085, 0.0026, 0, 0.66, 0.4706, 608, 0, 1, 0, 0, 608, 0, 0], "semantic": {"name": "client", "arg_names": [], "import_names": ["BaseStorage"], "rhs_call_name": "", "annotation": ""}, "snippet": "from client import Storage as BaseStorage"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99077:ImportFrom_L42_C0", "label": "from client import Credentials", "type": "import", "loc": [42, 42], "level": 0, "parent": null, "vector": [1, 0, 0.1111, 0.0026, 0, 0.66, 0.5294, 608, 0, 1, 0, 0, 608, 0, 0], "semantic": {"name": "client", "arg_names": [], "import_names": ["Credentials"], "rhs_call_name": "", "annotation": ""}, "snippet": "from client import Credentials"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99077:ImportFrom_L43_C0", "label": "from locked_file import LockedFile", "type": "import", "loc": [43, 43], "level": 0, "parent": null, "vector": [1, 0, 0.1138, 0.0026, 0, 0.66, 0.5882, 176, 0, 1, 0, 0, 176, 0, 0], "semantic": {"name": "locked_file", "arg_names": [], "import_names": ["LockedFile"], "rhs_call_name": "", "annotation": ""}, "snippet": "from locked_file import LockedFile"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99077:Assign_L45_C0", "label": "logger = getLogger()", "type": "assigned_variable", "loc": [45, 45], "level": 0, "parent": null, "vector": [14, 0, 0.119, 0.0026, 0, 0.66, 0.6471, 532, 3, 1, 0, 0, 71, 10, 1], "semantic": {"name": "logger", "arg_names": [], "import_names": [], "rhs_call_name": "getLogger", "annotation": ""}, "snippet": "logger = logging.getLogger(__name__)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99077:Assign_L48_C0", "label": "_multistores =", "type": "assigned_variable", "loc": [48, 48], "level": 0, "parent": null, "vector": [14, 0, 0.127, 0.0026, 0, 0.66, 0.7059, 947, 0, 0, 0, 0, 0, 6, 0], "semantic": {"name": "_multistores", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "_multistores = {}"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99077:Assign_L49_C0", "label": "_multistores_lock = Lock()", "type": "assigned_variable", "loc": [49, 49], "level": 0, "parent": null, "vector": [14, 0, 0.1296, 0.0026, 0, 0.66, 0.7647, 429, 3, 0, 0, 0, 843, 10, 1], "semantic": {"name": "_multistores_lock", "arg_names": [], "import_names": [], "rhs_call_name": "Lock", "annotation": ""}, "snippet": "_multistores_lock = threading.Lock()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99077:ClassDef_L52_C0", "label": "Error", "type": "class", "loc": [52, 54], "level": 0, "parent": null, "vector": [3, 0, 0.1402, 0.0079, 0, 0.66, 0.8235, 529, 0, 0, 0, 0, 645, 0, 0], "semantic": {"name": "Error", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class Error(Exception):\n \"\"\"Base error for this module.\"\"\"\n pass"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99077:Expr_L53_C2", "label": "expression", "type": "expression", "loc": [53, 53], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99077:ClassDef_L52_C0", "vector": [8, 1, 0.1402, 0.0026, 1, 0.13, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Base error for this module.\"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99077:ClassDef_L57_C0", "label": "NewerCredentialStoreError", "type": "class", "loc": [57, 59], "level": 0, "parent": null, "vector": [3, 0, 0.1534, 0.0079, 0, 0.66, 0.8824, 991, 0, 0, 0, 0, 529, 0, 0], "semantic": {"name": "NewerCredentialStoreError", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class NewerCredentialStoreError(Error):\n \"\"\"The credential store is a newer version that supported.\"\"\"\n pass"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99077:Expr_L58_C2", "label": "expression", "type": "expression", "loc": [58, 58], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99077:ClassDef_L57_C0", "vector": [8, 1, 0.1534, 0.0026, 1, 0.48, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"The credential store is a newer version that supported.\"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99077:FunctionDef_L62_C0", "label": "get_credential_storage", "type": "function", "loc": [62, 86], "level": 0, "parent": null, "vector": [2, 0, 0.1958, 0.0661, 0, 0.66, 0.9412, 534, 0, 5, 1, 0, 0, 0, 9], "semantic": {"name": "get_credential_storage", "arg_names": ["filename", "client_id", "user_agent", "scope", "warn_on_readonly"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def get_credential_storage(filename, client_id, user_agent, scope,\n warn_on_readonly=True):\n \"\"\"Get a Storage instance for a credential.\n\n Args:\n filename: The JSON file storing a set of credentials\n client_id: The client_id for the credential\n user_agent: The user agent for the credential"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99077:Expr_L64_C2", "label": "expression", "type": "expression", "loc": [64, 76], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99077:FunctionDef_L62_C0", "vector": [8, 1, 0.1852, 0.0344, 1, 0.98, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Get a Storage instance for a credential.\n\n Args:\n filename: The JSON file storing a set of credentials\n client_id: The client_id for the credential\n user_agent: The user agent for the credential\n scope: string or list of strings, Scope(s) being requested\n warn_on_readonly: if True, log a warning if the store is readonly"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99077:Assign_L77_C2", "label": "filename = realpath()", "type": "assigned_variable", "loc": [77, 77], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99077:FunctionDef_L62_C0", "vector": [14, 1, 0.2037, 0.0026, 1, 0.98, 0.2, 275, 3, 1, 0, 0, 45, 10, 2], "semantic": {"name": "filename", "arg_names": [], "import_names": [], "rhs_call_name": "realpath", "annotation": ""}, "snippet": " filename = os.path.realpath(os.path.expanduser(filename))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99077:Expr_L78_C2", "label": "acquire()", "type": "expression", "loc": [78, 78], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99077:FunctionDef_L62_C0", "vector": [8, 1, 0.2063, 0.0026, 1, 0.98, 0.4, 229, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "acquire", "arg_names": [], "import_names": [], "rhs_call_name": "acquire", "annotation": ""}, "snippet": " _multistores_lock.acquire()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99077:Try_L79_C2", "label": "try", "type": "try", "loc": [79, 83], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99077:FunctionDef_L62_C0", "vector": [7, 1, 0.2143, 0.0132, 1, 0.98, 0.6, 0, 0, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " try:\n multistore = _multistores.setdefault(\n filename, _MultiStore(filename, warn_on_readonly))\n finally:\n _multistores_lock.release()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99077:Assign_L80_C4", "label": "multistore = setdefault()", "type": "assigned_variable", "loc": [80, 81], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99077:Try_L79_C2", "vector": [14, 2, 0.213, 0.0053, 2, 0.71, 0.0, 913, 3, 2, 0, 0, 262, 10, 2], "semantic": {"name": "multistore", "arg_names": [], "import_names": [], "rhs_call_name": "setdefault", "annotation": ""}, "snippet": " multistore = _multistores.setdefault(\n filename, _MultiStore(filename, warn_on_readonly))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99077:Expr_L83_C4", "label": "release()", "type": "expression", "loc": [83, 83], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99077:Try_L79_C2", "vector": [8, 2, 0.2196, 0.0026, 2, 0.71, 1.0, 784, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "release", "arg_names": [], "import_names": [], "rhs_call_name": "release", "annotation": ""}, "snippet": " _multistores_lock.release()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99077:If_L84_C2", "label": "if", "type": "if", "loc": [84, 85], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99077:FunctionDef_L62_C0", "vector": [4, 1, 0.2235, 0.0053, 1, 0.98, 0.8, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if type(scope) is list:\n scope = ' '.join(scope)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99077:Assign_L85_C4", "label": "scope = join()", "type": "assigned_variable", "loc": [85, 85], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99077:If_L84_C2", "vector": [14, 2, 0.2249, 0.0026, 2, 0.34, 0.0, 334, 3, 1, 0, 0, 933, 10, 1], "semantic": {"name": "scope", "arg_names": [], "import_names": [], "rhs_call_name": "join", "annotation": ""}, "snippet": " scope = ' '.join(scope)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99077:Return_L86_C2", "label": "return", "type": "return", "loc": [86, 86], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99077:FunctionDef_L62_C0", "vector": [13, 1, 0.2275, 0.0026, 1, 0.98, 1.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return multistore._get_storage(client_id, user_agent, scope)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99077:ClassDef_L89_C0", "label": "_MultiStore", "type": "class", "loc": [89, 378], "level": 0, "parent": null, "vector": [3, 0, 0.6177, 0.7672, 0, 0.66, 1.0, 727, 0, 19, 0, 0, 186, 0, 56], "semantic": {"name": "_MultiStore", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class _MultiStore(object):\n \"\"\"A file backed store for multiple credentials.\"\"\"\n\n def __init__(self, filename, warn_on_readonly=True):\n \"\"\"Initialize the class.\n\n This will create the file if necessary.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99077:Expr_L90_C2", "label": "expression", "type": "expression", "loc": [90, 90], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99077:ClassDef_L89_C0", "vector": [8, 1, 0.2381, 0.0026, 1, 0.55, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"A file backed store for multiple credentials.\"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99077:FunctionDef_L92_C2", "label": "__init__", "type": "function", "loc": [92, 111], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99077:ClassDef_L89_C0", "vector": [2, 1, 0.2685, 0.0529, 1, 0.55, 0.0714, 555, 0, 3, 0, 0, 0, 0, 3], "semantic": {"name": "__init__", "arg_names": ["self", "filename", "warn_on_readonly"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, filename, warn_on_readonly=True):\n \"\"\"Initialize the class.\n\n This will create the file if necessary.\n \"\"\"\n self._file = LockedFile(filename, 'r+b', 'rb')\n self._thread_lock = threading.Lock()\n self._read_only = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99077:Expr_L93_C4", "label": "expression", "type": "expression", "loc": [93, 96], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99077:FunctionDef_L92_C2", "vector": [8, 2, 0.25, 0.0106, 2, 0.25, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Initialize the class.\n\n This will create the file if necessary.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99077:Assign_L97_C4", "label": "self._file = LockedFile()", "type": "assigned_variable", "loc": [97, 97], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99077:FunctionDef_L92_C2", "vector": [14, 2, 0.2566, 0.0026, 2, 0.25, 0.1667, 852, 3, 3, 0, 0, 1, 10, 1], "semantic": {"name": "self._file", "arg_names": [], "import_names": [], "rhs_call_name": "LockedFile", "annotation": ""}, "snippet": " self._file = LockedFile(filename, 'r+b', 'rb')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99077:Assign_L98_C4", "label": "self._thread_lock = Lock()", "type": "assigned_variable", "loc": [98, 98], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99077:FunctionDef_L92_C2", "vector": [14, 2, 0.2593, 0.0026, 2, 0.25, 0.3333, 407, 3, 0, 0, 0, 843, 10, 1], "semantic": {"name": "self._thread_lock", "arg_names": [], "import_names": [], "rhs_call_name": "Lock", "annotation": ""}, "snippet": " self._thread_lock = threading.Lock()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99077:Assign_L99_C4", "label": "self._read_only =", "type": "assigned_variable", "loc": [99, 99], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99077:FunctionDef_L92_C2", "vector": [14, 2, 0.2619, 0.0026, 2, 0.25, 0.5, 763, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "self._read_only", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self._read_only = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99077:Assign_L100_C4", "label": "self._warn_on_readonly =", "type": "assigned_variable", "loc": [100, 100], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99077:FunctionDef_L92_C2", "vector": [14, 2, 0.2646, 0.0026, 2, 0.25, 0.6667, 231, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self._warn_on_readonly", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self._warn_on_readonly = warn_on_readonly"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99077:Expr_L102_C4", "label": "_create_file_if_needed()", "type": "expression", "loc": [102, 102], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99077:FunctionDef_L92_C2", "vector": [8, 2, 0.2698, 0.0026, 2, 0.25, 0.8333, 654, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "_create_file_if_needed", "arg_names": [], "import_names": [], "rhs_call_name": "_create_file_if_needed", "annotation": ""}, "snippet": " self._create_file_if_needed()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99077:Assign_L111_C4", "label": "self._data =", "type": "assigned_variable", "loc": [111, 111], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99077:FunctionDef_L92_C2", "vector": [14, 2, 0.2937, 0.0026, 2, 0.25, 1.0, 753, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "self._data", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self._data = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99077:ClassDef_L113_C2", "label": "_Storage", "type": "class", "loc": [113, 170], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99077:ClassDef_L89_C0", "vector": [3, 1, 0.3743, 0.1534, 1, 0.55, 0.1429, 373, 0, 6, 0, 0, 775, 0, 6], "semantic": {"name": "_Storage", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " class _Storage(BaseStorage):\n \"\"\"A Storage object that knows how to read/write a single credential.\"\"\"\n\n def __init__(self, multistore, client_id, user_agent, scope):\n self._multistore = multistore\n self._client_id = client_id\n self._user_agent = user_agent\n self._scope = scope"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99077:Expr_L114_C4", "label": "expression", "type": "expression", "loc": [114, 114], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99077:ClassDef_L113_C2", "vector": [8, 2, 0.3016, 0.0026, 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 Storage object that knows how to read/write a single credential.\"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99077:FunctionDef_L116_C4", "label": "__init__", "type": "function", "loc": [116, 120], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99077:ClassDef_L113_C2", "vector": [2, 2, 0.3122, 0.0132, 2, 0.28, 0.1667, 555, 0, 5, 0, 0, 0, 0, 0], "semantic": {"name": "__init__", "arg_names": ["self", "multistore", "client_id", "user_agent", "scope"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, multistore, client_id, user_agent, scope):\n self._multistore = multistore\n self._client_id = client_id\n self._user_agent = user_agent\n self._scope = scope"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99077:Assign_L117_C6", "label": "self._multistore =", "type": "assigned_variable", "loc": [117, 117], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99077:FunctionDef_L116_C4", "vector": [14, 3, 0.3095, 0.0026, 3, 0.68, 0.0, 680, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self._multistore", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self._multistore = multistore"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99077:Assign_L118_C6", "label": "self._client_id =", "type": "assigned_variable", "loc": [118, 118], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99077:FunctionDef_L116_C4", "vector": [14, 3, 0.3122, 0.0026, 3, 0.68, 0.3333, 131, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self._client_id", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self._client_id = client_id"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99077:Assign_L119_C6", "label": "self._user_agent =", "type": "assigned_variable", "loc": [119, 119], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99077:FunctionDef_L116_C4", "vector": [14, 3, 0.3148, 0.0026, 3, 0.68, 0.6667, 996, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self._user_agent", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self._user_agent = user_agent"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99077:Assign_L120_C6", "label": "self._scope =", "type": "assigned_variable", "loc": [120, 120], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99077:FunctionDef_L116_C4", "vector": [14, 3, 0.3175, 0.0026, 3, 0.68, 1.0, 363, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self._scope", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self._scope = scope"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99077:FunctionDef_L122_C4", "label": "acquire_lock", "type": "function", "loc": [122, 127], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99077:ClassDef_L113_C2", "vector": [2, 2, 0.3294, 0.0159, 2, 0.28, 0.3333, 5, 0, 1, 0, 0, 0, 0, 1], "semantic": {"name": "acquire_lock", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def acquire_lock(self):\n \"\"\"Acquires any lock necessary to access this Storage.\n\n This lock is not reentrant.\n \"\"\"\n self._multistore._lock()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99077:Expr_L123_C6", "label": "expression", "type": "expression", "loc": [123, 126], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99077:FunctionDef_L122_C4", "vector": [8, 3, 0.3294, 0.0106, 3, 0.27, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Acquires any lock necessary to access this Storage.\n\n This lock is not reentrant.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99077:Expr_L127_C6", "label": "_lock()", "type": "expression", "loc": [127, 127], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99077:FunctionDef_L122_C4", "vector": [8, 3, 0.336, 0.0026, 3, 0.27, 1.0, 537, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "_lock", "arg_names": [], "import_names": [], "rhs_call_name": "_lock", "annotation": ""}, "snippet": " self._multistore._lock()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99077:FunctionDef_L129_C4", "label": "release_lock", "type": "function", "loc": [129, 135], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99077:ClassDef_L113_C2", "vector": [2, 2, 0.3492, 0.0185, 2, 0.28, 0.5, 821, 0, 1, 0, 0, 0, 0, 1], "semantic": {"name": "release_lock", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def release_lock(self):\n \"\"\"Release the Storage lock.\n\n Trying to release a lock that isn't held will result in a\n RuntimeError.\n \"\"\"\n self._multistore._unlock()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99077:Expr_L130_C6", "label": "expression", "type": "expression", "loc": [130, 134], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99077:FunctionDef_L129_C4", "vector": [8, 3, 0.3492, 0.0132, 3, 0.21, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Release the Storage lock.\n\n Trying to release a lock that isn't held will result in a\n RuntimeError.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99077:Expr_L135_C6", "label": "_unlock()", "type": "expression", "loc": [135, 135], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99077:FunctionDef_L129_C4", "vector": [8, 3, 0.3571, 0.0026, 3, 0.21, 1.0, 287, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "_unlock", "arg_names": [], "import_names": [], "rhs_call_name": "_unlock", "annotation": ""}, "snippet": " self._multistore._unlock()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99077:FunctionDef_L137_C4", "label": "locked_get", "type": "function", "loc": [137, 149], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99077:ClassDef_L113_C2", "vector": [2, 2, 0.3783, 0.0344, 2, 0.28, 0.6667, 579, 0, 1, 1, 0, 0, 0, 2], "semantic": {"name": "locked_get", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def locked_get(self):\n \"\"\"Retrieve credential.\n\n The Storage lock must be held when this is called.\n\n Returns:\n oauth2client.client.Credentials\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99077:Expr_L138_C6", "label": "expression", "type": "expression", "loc": [138, 144], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99077:FunctionDef_L137_C4", "vector": [8, 3, 0.373, 0.0185, 3, 0.26, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Retrieve credential.\n\n The Storage lock must be held when this is called.\n\n Returns:\n oauth2client.client.Credentials\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99077:Assign_L145_C6", "label": "credential = _get_credential()", "type": "assigned_variable", "loc": [145, 146], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99077:FunctionDef_L137_C4", "vector": [14, 3, 0.3849, 0.0053, 3, 0.26, 0.3333, 443, 3, 3, 0, 0, 212, 10, 1], "semantic": {"name": "credential", "arg_names": [], "import_names": [], "rhs_call_name": "_get_credential", "annotation": ""}, "snippet": " credential = self._multistore._get_credential(\n self._client_id, self._user_agent, self._scope)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99077:If_L147_C6", "label": "if", "type": "if", "loc": [147, 148], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99077:FunctionDef_L137_C4", "vector": [4, 3, 0.3902, 0.0053, 3, 0.26, 0.6667, 0, 2, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if credential:\n credential.set_store(self)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99077:Expr_L148_C8", "label": "set_store()", "type": "expression", "loc": [148, 148], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99077:If_L147_C6", "vector": [8, 4, 0.3915, 0.0026, 4, 0.42, 0.0, 939, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "set_store", "arg_names": [], "import_names": [], "rhs_call_name": "set_store", "annotation": ""}, "snippet": " credential.set_store(self)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99077:Return_L149_C6", "label": "return", "type": "return", "loc": [149, 149], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99077:FunctionDef_L137_C4", "vector": [13, 3, 0.3942, 0.0026, 3, 0.26, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return credential"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99077:FunctionDef_L151_C4", "label": "locked_put", "type": "function", "loc": [151, 159], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99077:ClassDef_L113_C2", "vector": [2, 2, 0.4101, 0.0238, 2, 0.28, 0.8333, 154, 0, 2, 0, 0, 0, 0, 1], "semantic": {"name": "locked_put", "arg_names": ["self", "credentials"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def locked_put(self, credentials):\n \"\"\"Write a credential.\n\n The Storage lock must be held when this is called.\n\n Args:\n credentials: Credentials, the credentials to store.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99077:Expr_L152_C6", "label": "expression", "type": "expression", "loc": [152, 158], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99077:FunctionDef_L151_C4", "vector": [8, 3, 0.4101, 0.0185, 3, 0.94, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Write a credential.\n\n The Storage lock must be held when this is called.\n\n Args:\n credentials: Credentials, the credentials to store.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99077:Expr_L159_C6", "label": "_update_credential()", "type": "expression", "loc": [159, 159], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99077:FunctionDef_L151_C4", "vector": [8, 3, 0.4206, 0.0026, 3, 0.94, 1.0, 641, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "_update_credential", "arg_names": [], "import_names": [], "rhs_call_name": "_update_credential", "annotation": ""}, "snippet": " self._multistore._update_credential(credentials, self._scope)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99077:FunctionDef_L161_C4", "label": "locked_delete", "type": "function", "loc": [161, 170], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99077:ClassDef_L113_C2", "vector": [2, 2, 0.4378, 0.0265, 2, 0.28, 1.0, 769, 0, 1, 0, 0, 0, 0, 1], "semantic": {"name": "locked_delete", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def locked_delete(self):\n \"\"\"Delete a credential.\n\n The Storage lock must be held when this is called.\n\n Args:\n credentials: Credentials, the credentials to store.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99077:Expr_L162_C6", "label": "expression", "type": "expression", "loc": [162, 168], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99077:FunctionDef_L161_C4", "vector": [8, 3, 0.4365, 0.0185, 3, 0.74, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Delete a credential.\n\n The Storage lock must be held when this is called.\n\n Args:\n credentials: Credentials, the credentials to store.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99077:Expr_L169_C6", "label": "_delete_credential()", "type": "expression", "loc": [169, 170], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99077:FunctionDef_L161_C4", "vector": [8, 3, 0.4484, 0.0053, 3, 0.74, 1.0, 807, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "_delete_credential", "arg_names": [], "import_names": [], "rhs_call_name": "_delete_credential", "annotation": ""}, "snippet": " self._multistore._delete_credential(self._client_id, self._user_agent,\n self._scope)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99077:FunctionDef_L172_C2", "label": "_create_file_if_needed", "type": "function", "loc": [172, 182], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99077:ClassDef_L89_C0", "vector": [2, 1, 0.4683, 0.0291, 1, 0.55, 0.2143, 654, 0, 1, 0, 0, 0, 0, 6], "semantic": {"name": "_create_file_if_needed", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _create_file_if_needed(self):\n \"\"\"Create an empty file if necessary.\n\n This method will not initialize the file. Instead it implements a\n simple version of \"touch\" to ensure the file has been created.\n \"\"\"\n if not os.path.exists(self._file.filename()):\n try:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99077:Expr_L173_C4", "label": "expression", "type": "expression", "loc": [173, 177], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99077:FunctionDef_L172_C2", "vector": [8, 2, 0.463, 0.0132, 2, 0.89, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Create an empty file if necessary.\n\n This method will not initialize the file. Instead it implements a\n simple version of \"touch\" to ensure the file has been created.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99077:If_L178_C4", "label": "if", "type": "if", "loc": [178, 182], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99077:FunctionDef_L172_C2", "vector": [4, 2, 0.4762, 0.0132, 2, 0.89, 1.0, 0, 0, 0, 0, 0, 0, 0, 6], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not os.path.exists(self._file.filename()):\n try:\n open(self._file.filename(), 'a+b').close()\n finally:\n os.umask(old_umask)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99077:Try_L179_C6", "label": "try", "type": "try", "loc": [179, 182], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99077:If_L178_C4", "vector": [7, 3, 0.4775, 0.0106, 3, 0.16, 0.0, 0, 0, 0, 0, 0, 0, 0, 4], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " try:\n open(self._file.filename(), 'a+b').close()\n finally:\n os.umask(old_umask)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99077:Expr_L180_C8", "label": "close()", "type": "expression", "loc": [180, 180], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99077:Try_L179_C6", "vector": [8, 4, 0.4762, 0.0026, 4, 0.63, 0.0, 77, 3, 0, 0, 0, 0, 0, 3], "semantic": {"name": "close", "arg_names": [], "import_names": [], "rhs_call_name": "close", "annotation": ""}, "snippet": " open(self._file.filename(), 'a+b').close()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99077:Expr_L182_C8", "label": "umask()", "type": "expression", "loc": [182, 182], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99077:Try_L179_C6", "vector": [8, 4, 0.4815, 0.0026, 4, 0.63, 1.0, 505, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "umask", "arg_names": [], "import_names": [], "rhs_call_name": "umask", "annotation": ""}, "snippet": " os.umask(old_umask)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99077:FunctionDef_L184_C2", "label": "_lock", "type": "function", "loc": [184, 205], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99077:ClassDef_L89_C0", "vector": [2, 1, 0.5146, 0.0582, 1, 0.55, 0.2857, 537, 0, 1, 0, 0, 0, 0, 10], "semantic": {"name": "_lock", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _lock(self):\n \"\"\"Lock the entire multistore.\"\"\"\n self._thread_lock.acquire()\n self._file.open_and_lock()\n if not self._file.is_locked():\n self._read_only = True\n if self._warn_on_readonly:\n logger.warn('The credentials file (%s) is not writable. Opening in '"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99077:Expr_L185_C4", "label": "expression", "type": "expression", "loc": [185, 185], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99077:FunctionDef_L184_C2", "vector": [8, 2, 0.4894, 0.0026, 2, 0.62, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Lock the entire multistore.\"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99077:Expr_L186_C4", "label": "acquire()", "type": "expression", "loc": [186, 186], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99077:FunctionDef_L184_C2", "vector": [8, 2, 0.4921, 0.0026, 2, 0.62, 0.25, 229, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "acquire", "arg_names": [], "import_names": [], "rhs_call_name": "acquire", "annotation": ""}, "snippet": " self._thread_lock.acquire()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99077:Expr_L187_C4", "label": "open_and_lock()", "type": "expression", "loc": [187, 187], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99077:FunctionDef_L184_C2", "vector": [8, 2, 0.4947, 0.0026, 2, 0.62, 0.5, 67, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "open_and_lock", "arg_names": [], "import_names": [], "rhs_call_name": "open_and_lock", "annotation": ""}, "snippet": " self._file.open_and_lock()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99077:If_L188_C4", "label": "if", "type": "if", "loc": [188, 193], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99077:FunctionDef_L184_C2", "vector": [4, 2, 0.504, 0.0159, 2, 0.62, 0.75, 0, 0, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not self._file.is_locked():\n self._read_only = True\n if self._warn_on_readonly:\n logger.warn('The credentials file (%s) is not writable. Opening in '\n 'read-only mode. Any refreshed credentials will only be '\n 'valid for this run.' % self._file.filename())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99077:Assign_L189_C6", "label": "self._read_only =", "type": "assigned_variable", "loc": [189, 189], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99077:If_L188_C4", "vector": [14, 3, 0.5, 0.0026, 3, 0.77, 0.0, 763, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "self._read_only", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self._read_only = True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99077:If_L190_C6", "label": "if", "type": "if", "loc": [190, 193], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99077:If_L188_C4", "vector": [4, 3, 0.5066, 0.0106, 3, 0.77, 1.0, 0, 7, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self._warn_on_readonly:\n logger.warn('The credentials file (%s) is not writable. Opening in '\n 'read-only mode. Any refreshed credentials will only be '\n 'valid for this run.' % self._file.filename())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99077:Expr_L191_C8", "label": "warn()", "type": "expression", "loc": [191, 193], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99077:If_L190_C6", "vector": [8, 4, 0.5079, 0.0079, 4, 0.92, 0.0, 960, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "warn", "arg_names": [], "import_names": [], "rhs_call_name": "warn", "annotation": ""}, "snippet": " logger.warn('The credentials file (%s) is not writable. Opening in '\n 'read-only mode. Any refreshed credentials will only be '\n 'valid for this run.' % self._file.filename())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99077:If_L194_C4", "label": "if", "type": "if", "loc": [194, 205], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99077:FunctionDef_L184_C2", "vector": [4, 2, 0.5278, 0.0317, 2, 0.62, 1.0, 0, 0, 0, 0, 0, 0, 0, 5], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if os.path.getsize(self._file.filename()) == 0:\n logger.debug('Initializing empty multistore file')\n # The multistore is empty so write out an empty file.\n self._data = {}\n self._write()\n elif not self._read_only or self._data is None:\n # Only refresh the data if we are read/write or we haven't\n # cached the data yet. If we are readonly, we assume is isn't"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99077:Expr_L195_C6", "label": "debug()", "type": "expression", "loc": [195, 195], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99077:If_L194_C4", "vector": [8, 3, 0.5159, 0.0026, 3, 0.21, 0.0, 924, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "debug", "arg_names": [], "import_names": [], "rhs_call_name": "debug", "annotation": ""}, "snippet": " logger.debug('Initializing empty multistore file')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99077:Assign_L197_C6", "label": "self._data =", "type": "assigned_variable", "loc": [197, 197], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99077:If_L194_C4", "vector": [14, 3, 0.5212, 0.0026, 3, 0.21, 0.3333, 753, 0, 0, 0, 0, 0, 6, 0], "semantic": {"name": "self._data", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self._data = {}"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99077:Expr_L198_C6", "label": "_write()", "type": "expression", "loc": [198, 198], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99077:If_L194_C4", "vector": [8, 3, 0.5238, 0.0026, 3, 0.21, 0.6667, 961, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "_write", "arg_names": [], "import_names": [], "rhs_call_name": "_write", "annotation": ""}, "snippet": " self._write()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99077:If_L199_C4", "label": "if", "type": "if", "loc": [199, 205], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99077:If_L194_C4", "vector": [4, 3, 0.5344, 0.0185, 3, 0.21, 1.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " elif not self._read_only or self._data is None:\n # Only refresh the data if we are read/write or we haven't\n # cached the data yet. If we are readonly, we assume is isn't\n # changing out from under us and that we only have to read it\n # once. This prevents us from whacking any new access keys that\n # we have cached in memory but were unable to write out.\n self._refresh_data_cache()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99077:Expr_L205_C6", "label": "_refresh_data_cache()", "type": "expression", "loc": [205, 205], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99077:If_L199_C4", "vector": [8, 4, 0.5423, 0.0026, 4, 0.39, 0.0, 874, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "_refresh_data_cache", "arg_names": [], "import_names": [], "rhs_call_name": "_refresh_data_cache", "annotation": ""}, "snippet": " self._refresh_data_cache()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99077:FunctionDef_L207_C2", "label": "_unlock", "type": "function", "loc": [207, 210], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99077:ClassDef_L89_C0", "vector": [2, 1, 0.5516, 0.0106, 1, 0.55, 0.3571, 287, 0, 1, 0, 0, 0, 0, 2], "semantic": {"name": "_unlock", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _unlock(self):\n \"\"\"Release the lock on the multistore.\"\"\"\n self._file.unlock_and_close()\n self._thread_lock.release()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99077:Expr_L208_C4", "label": "expression", "type": "expression", "loc": [208, 208], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99077:FunctionDef_L207_C2", "vector": [8, 2, 0.5503, 0.0026, 2, 0.71, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Release the lock on the multistore.\"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99077:Expr_L209_C4", "label": "unlock_and_close()", "type": "expression", "loc": [209, 209], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99077:FunctionDef_L207_C2", "vector": [8, 2, 0.5529, 0.0026, 2, 0.71, 0.5, 518, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "unlock_and_close", "arg_names": [], "import_names": [], "rhs_call_name": "unlock_and_close", "annotation": ""}, "snippet": " self._file.unlock_and_close()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99077:Expr_L210_C4", "label": "release()", "type": "expression", "loc": [210, 210], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99077:FunctionDef_L207_C2", "vector": [8, 2, 0.5556, 0.0026, 2, 0.71, 1.0, 784, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "release", "arg_names": [], "import_names": [], "rhs_call_name": "release", "annotation": ""}, "snippet": " self._thread_lock.release()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99077:FunctionDef_L212_C2", "label": "_locked_json_read", "type": "function", "loc": [212, 222], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99077:ClassDef_L89_C0", "vector": [2, 1, 0.5741, 0.0291, 1, 0.55, 0.4286, 928, 0, 1, 1, 0, 0, 0, 5], "semantic": {"name": "_locked_json_read", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _locked_json_read(self):\n \"\"\"Get the raw content of the multistore file.\n\n The multistore must be locked when this is called.\n\n Returns:\n The contents of the multistore decoded as JSON.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99077:Expr_L213_C4", "label": "expression", "type": "expression", "loc": [213, 219], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99077:FunctionDef_L212_C2", "vector": [8, 2, 0.5714, 0.0185, 2, 0.28, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Get the raw content of the multistore file.\n\n The multistore must be locked when this is called.\n\n Returns:\n The contents of the multistore decoded as JSON.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99077:Expr_L221_C4", "label": "seek()", "type": "expression", "loc": [221, 221], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99077:FunctionDef_L212_C2", "vector": [8, 2, 0.5847, 0.0026, 2, 0.28, 0.5, 66, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "seek", "arg_names": [], "import_names": [], "rhs_call_name": "seek", "annotation": ""}, "snippet": " self._file.file_handle().seek(0)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99077:Return_L222_C4", "label": "return", "type": "return", "loc": [222, 222], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99077:FunctionDef_L212_C2", "vector": [13, 2, 0.5873, 0.0026, 2, 0.28, 1.0, 0, 3, 0, 0, 0, 0, 10, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return simplejson.load(self._file.file_handle())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99077:FunctionDef_L224_C2", "label": "_locked_json_write", "type": "function", "loc": [224, 237], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99077:ClassDef_L89_C0", "vector": [2, 1, 0.6098, 0.037, 1, 0.55, 0.5, 649, 0, 2, 0, 0, 0, 0, 7], "semantic": {"name": "_locked_json_write", "arg_names": ["self", "data"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _locked_json_write(self, data):\n \"\"\"Write a JSON serializable data structure to the multistore.\n\n The multistore must be locked when this is called.\n\n Args:\n data: The data to be serialized and written.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99077:Expr_L225_C4", "label": "expression", "type": "expression", "loc": [225, 231], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99077:FunctionDef_L224_C2", "vector": [8, 2, 0.6032, 0.0185, 2, 0.17, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Write a JSON serializable data structure to the multistore.\n\n The multistore must be locked when this is called.\n\n Args:\n data: The data to be serialized and written.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99077:If_L233_C4", "label": "if", "type": "if", "loc": [233, 234], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99077:FunctionDef_L224_C2", "vector": [4, 2, 0.6177, 0.0053, 2, 0.17, 0.25, 0, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self._read_only:\n return"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99077:Return_L234_C6", "label": "return", "type": "return", "loc": [234, 234], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99077:If_L233_C4", "vector": [13, 3, 0.619, 0.0026, 3, 0.22, 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_99077:Expr_L235_C4", "label": "seek()", "type": "expression", "loc": [235, 235], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99077:FunctionDef_L224_C2", "vector": [8, 2, 0.6217, 0.0026, 2, 0.17, 0.5, 66, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "seek", "arg_names": [], "import_names": [], "rhs_call_name": "seek", "annotation": ""}, "snippet": " self._file.file_handle().seek(0)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99077:Expr_L236_C4", "label": "dump()", "type": "expression", "loc": [236, 236], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99077:FunctionDef_L224_C2", "vector": [8, 2, 0.6243, 0.0026, 2, 0.17, 0.75, 952, 3, 4, 0, 0, 0, 0, 2], "semantic": {"name": "dump", "arg_names": [], "import_names": [], "rhs_call_name": "dump", "annotation": ""}, "snippet": " simplejson.dump(data, self._file.file_handle(), sort_keys=True, indent=2)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99077:Expr_L237_C4", "label": "truncate()", "type": "expression", "loc": [237, 237], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99077:FunctionDef_L224_C2", "vector": [8, 2, 0.627, 0.0026, 2, 0.17, 1.0, 39, 3, 0, 0, 0, 0, 0, 2], "semantic": {"name": "truncate", "arg_names": [], "import_names": [], "rhs_call_name": "truncate", "annotation": ""}, "snippet": " self._file.file_handle().truncate()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99077:FunctionDef_L239_C2", "label": "_refresh_data_cache", "type": "function", "loc": [239, 279], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99077:ClassDef_L89_C0", "vector": [2, 1, 0.6852, 0.1085, 1, 0.55, 0.5714, 874, 0, 1, 0, 0, 0, 0, 6], "semantic": {"name": "_refresh_data_cache", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _refresh_data_cache(self):\n \"\"\"Refresh the contents of the multistore.\n\n The multistore must be locked when this is called.\n\n Raises:\n NewerCredentialStoreError: Raised when a newer client has written the\n store."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99077:Expr_L240_C4", "label": "expression", "type": "expression", "loc": [240, 247], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99077:FunctionDef_L239_C2", "vector": [8, 2, 0.6442, 0.0212, 2, 0.13, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Refresh the contents of the multistore.\n\n The multistore must be locked when this is called.\n\n Raises:\n NewerCredentialStoreError: Raised when a newer client has written the\n store.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99077:Assign_L248_C4", "label": "self._data =", "type": "assigned_variable", "loc": [248, 248], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99077:FunctionDef_L239_C2", "vector": [14, 2, 0.6561, 0.0026, 2, 0.13, 0.125, 753, 0, 0, 0, 0, 0, 6, 0], "semantic": {"name": "self._data", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self._data = {}"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99077:Try_L249_C4", "label": "try", "type": "try", "loc": [249, 254], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99077:FunctionDef_L239_C2", "vector": [7, 2, 0.6653, 0.0159, 2, 0.13, 0.25, 0, 0, 1, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " try:\n raw_data = self._locked_json_read()\n except Exception:\n logger.warn('Credential data store could not be loaded. '\n 'Will ignore and overwrite.')\n return"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99077:Assign_L250_C6", "label": "raw_data = _locked_json_read()", "type": "assigned_variable", "loc": [250, 250], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99077:Try_L249_C4", "vector": [14, 3, 0.6614, 0.0026, 3, 0.48, 0.0, 495, 3, 0, 0, 0, 928, 10, 1], "semantic": {"name": "raw_data", "arg_names": [], "import_names": [], "rhs_call_name": "_locked_json_read", "annotation": ""}, "snippet": " raw_data = self._locked_json_read()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99077:Expr_L252_C6", "label": "warn()", "type": "expression", "loc": [252, 253], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99077:Try_L249_C4", "vector": [8, 3, 0.668, 0.0053, 3, 0.48, 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('Credential data store could not be loaded. '\n 'Will ignore and overwrite.')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99077:Return_L254_C6", "label": "return", "type": "return", "loc": [254, 254], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99077:Try_L249_C4", "vector": [13, 3, 0.672, 0.0026, 3, 0.48, 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_99077:Assign_L256_C4", "label": "version =", "type": "assigned_variable", "loc": [256, 256], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99077:FunctionDef_L239_C2", "vector": [14, 2, 0.6772, 0.0026, 2, 0.13, 0.375, 623, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "version", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " version = 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99077:Try_L257_C4", "label": "try", "type": "try", "loc": [257, 261], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99077:FunctionDef_L239_C2", "vector": [7, 2, 0.6852, 0.0132, 2, 0.13, 0.5, 0, 0, 1, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " try:\n version = raw_data['file_version']\n except Exception:\n logger.warn('Missing version for credential data store. It may be '\n 'corrupt or an old version. Overwriting.')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99077:Assign_L258_C6", "label": "version =", "type": "assigned_variable", "loc": [258, 258], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99077:Try_L257_C4", "vector": [14, 3, 0.6825, 0.0026, 3, 0.81, 0.0, 623, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "version", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " version = raw_data['file_version']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99077:Expr_L260_C6", "label": "warn()", "type": "expression", "loc": [260, 261], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99077:Try_L257_C4", "vector": [8, 3, 0.6892, 0.0053, 3, 0.81, 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('Missing version for credential data store. It may be '\n 'corrupt or an old version. Overwriting.')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99077:If_L262_C4", "label": "if", "type": "if", "loc": [262, 265], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99077:FunctionDef_L239_C2", "vector": [4, 2, 0.6971, 0.0106, 2, 0.13, 0.625, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if version > 1:\n raise NewerCredentialStoreError(\n 'Credential file has file_version of %d. '\n 'Only file_version of 1 is supported.' % version)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99077:Assign_L267_C4", "label": "credentials =", "type": "assigned_variable", "loc": [267, 267], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99077:FunctionDef_L239_C2", "vector": [14, 2, 0.7063, 0.0026, 2, 0.13, 0.75, 198, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "credentials", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " credentials = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99077:Try_L268_C4", "label": "try", "type": "try", "loc": [268, 271], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99077:FunctionDef_L239_C2", "vector": [7, 2, 0.713, 0.0106, 2, 0.13, 0.875, 0, 0, 1, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " try:\n credentials = raw_data['data']\n except (TypeError, KeyError):\n pass"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99077:Assign_L269_C6", "label": "credentials =", "type": "assigned_variable", "loc": [269, 269], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99077:Try_L268_C4", "vector": [14, 3, 0.7116, 0.0026, 3, 0.47, 0.0, 198, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "credentials", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " credentials = raw_data['data']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99077:For_L273_C4", "label": "for cred_entry", "type": "for", "loc": [273, 279], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99077:FunctionDef_L239_C2", "vector": [6, 2, 0.7302, 0.0185, 2, 0.13, 1.0, 31, 2, 0, 0, 0, 0, 0, 2], "semantic": {"name": "cred_entry", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for cred_entry in credentials:\n try:\n (key, credential) = self._decode_credential_from_json(cred_entry)\n self._data[key] = credential\n except:\n # If something goes wrong loading a credential, just ignore it\n logger.info('Error decoding credential, skipping', exc_info=True)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99077:Try_L274_C6", "label": "try", "type": "try", "loc": [274, 279], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99077:For_L273_C4", "vector": [7, 3, 0.7315, 0.0159, 3, 0.86, 0.0, 0, 0, 1, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " try:\n (key, credential) = self._decode_credential_from_json(cred_entry)\n self._data[key] = credential\n except:\n # If something goes wrong loading a credential, just ignore it\n logger.info('Error decoding credential, skipping', exc_info=True)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99077:Assign_L275_C8", "label": "key, credential = _decode_credential_from_json()", "type": "assigned_variable", "loc": [275, 275], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99077:Try_L274_C6", "vector": [14, 4, 0.7275, 0.0026, 4, 0.42, 0.0, 546, 3, 1, 0, 0, 175, 10, 1], "semantic": {"name": "key, credential", "arg_names": [], "import_names": [], "rhs_call_name": "_decode_credential_from_json", "annotation": ""}, "snippet": " (key, credential) = self._decode_credential_from_json(cred_entry)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99077:Assign_L276_C8", "label": "assign", "type": "assigned_variable", "loc": [276, 276], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99077:Try_L274_C6", "vector": [14, 4, 0.7302, 0.0026, 4, 0.42, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self._data[key] = credential"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99077:Expr_L279_C8", "label": "info()", "type": "expression", "loc": [279, 279], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99077:Try_L274_C6", "vector": [8, 4, 0.7381, 0.0026, 4, 0.42, 0.0, 730, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "info", "arg_names": [], "import_names": [], "rhs_call_name": "info", "annotation": ""}, "snippet": " logger.info('Error decoding credential, skipping', exc_info=True)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99077:FunctionDef_L281_C2", "label": "_decode_credential_from_json", "type": "function", "loc": [281, 298], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99077:ClassDef_L89_C0", "vector": [2, 1, 0.7659, 0.0476, 1, 0.55, 0.6429, 175, 0, 2, 1, 0, 0, 0, 2], "semantic": {"name": "_decode_credential_from_json", "arg_names": ["self", "cred_entry"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _decode_credential_from_json(self, cred_entry):\n \"\"\"Load a credential from our JSON serialization.\n\n Args:\n cred_entry: A dict entry from the data member of our format\n\n Returns:\n (key, cred) where the key is the key tuple and the cred is the"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99077:Expr_L282_C4", "label": "expression", "type": "expression", "loc": [282, 290], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99077:FunctionDef_L281_C2", "vector": [8, 2, 0.7566, 0.0238, 2, 0.63, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Load a credential from our JSON serialization.\n\n Args:\n cred_entry: A dict entry from the data member of our format\n\n Returns:\n (key, cred) where the key is the key tuple and the cred is the\n OAuth2Credential object."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99077:Assign_L291_C4", "label": "raw_key =", "type": "assigned_variable", "loc": [291, 291], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99077:FunctionDef_L281_C2", "vector": [14, 2, 0.7698, 0.0026, 2, 0.63, 0.125, 937, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "raw_key", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " raw_key = cred_entry['key']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99077:Assign_L292_C4", "label": "client_id =", "type": "assigned_variable", "loc": [292, 292], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99077:FunctionDef_L281_C2", "vector": [14, 2, 0.7725, 0.0026, 2, 0.63, 0.25, 542, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "client_id", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " client_id = raw_key['clientId']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99077:Assign_L293_C4", "label": "user_agent =", "type": "assigned_variable", "loc": [293, 293], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99077:FunctionDef_L281_C2", "vector": [14, 2, 0.7751, 0.0026, 2, 0.63, 0.375, 731, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "user_agent", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " user_agent = raw_key['userAgent']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99077:Assign_L294_C4", "label": "scope =", "type": "assigned_variable", "loc": [294, 294], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99077:FunctionDef_L281_C2", "vector": [14, 2, 0.7778, 0.0026, 2, 0.63, 0.5, 334, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "scope", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " scope = raw_key['scope']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99077:Assign_L295_C4", "label": "key =", "type": "assigned_variable", "loc": [295, 295], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99077:FunctionDef_L281_C2", "vector": [14, 2, 0.7804, 0.0026, 2, 0.63, 0.625, 230, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "key", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " key = (client_id, user_agent, scope)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99077:Assign_L296_C4", "label": "credential =", "type": "assigned_variable", "loc": [296, 296], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99077:FunctionDef_L281_C2", "vector": [14, 2, 0.7831, 0.0026, 2, 0.63, 0.75, 443, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "credential", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " credential = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99077:Assign_L297_C4", "label": "credential = new_from_json()", "type": "assigned_variable", "loc": [297, 297], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99077:FunctionDef_L281_C2", "vector": [14, 2, 0.7857, 0.0026, 2, 0.63, 0.875, 443, 3, 1, 0, 0, 495, 10, 2], "semantic": {"name": "credential", "arg_names": [], "import_names": [], "rhs_call_name": "new_from_json", "annotation": ""}, "snippet": " credential = Credentials.new_from_json(simplejson.dumps(cred_entry['credential']))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99077:Return_L298_C4", "label": "return", "type": "return", "loc": [298, 298], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99077:FunctionDef_L281_C2", "vector": [13, 2, 0.7884, 0.0026, 2, 0.63, 1.0, 0, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return (key, credential)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99077:FunctionDef_L300_C2", "label": "_write", "type": "function", "loc": [300, 316], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99077:ClassDef_L89_C0", "vector": [2, 1, 0.8148, 0.045, 1, 0.55, 0.7143, 961, 0, 1, 0, 0, 0, 0, 5], "semantic": {"name": "_write", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _write(self):\n \"\"\"Write the cached data back out.\n\n The multistore must be locked.\n \"\"\"\n raw_data = {'file_version': 1}\n raw_creds = []\n raw_data['data'] = raw_creds"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99077:Expr_L301_C4", "label": "expression", "type": "expression", "loc": [301, 304], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99077:FunctionDef_L300_C2", "vector": [8, 2, 0.8003, 0.0106, 2, 0.97, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Write the cached data back out.\n\n The multistore must be locked.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99077:Assign_L305_C4", "label": "raw_data =", "type": "assigned_variable", "loc": [305, 305], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99077:FunctionDef_L300_C2", "vector": [14, 2, 0.8069, 0.0026, 2, 0.97, 0.2, 495, 0, 0, 0, 0, 0, 6, 0], "semantic": {"name": "raw_data", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " raw_data = {'file_version': 1}"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99077:Assign_L306_C4", "label": "raw_creds =", "type": "assigned_variable", "loc": [306, 306], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99077:FunctionDef_L300_C2", "vector": [14, 2, 0.8095, 0.0026, 2, 0.97, 0.4, 685, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "raw_creds", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " raw_creds = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99077:Assign_L307_C4", "label": "assign", "type": "assigned_variable", "loc": [307, 307], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99077:FunctionDef_L300_C2", "vector": [14, 2, 0.8122, 0.0026, 2, 0.97, 0.6, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " raw_data['data'] = raw_creds"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99077:For_L308_C4", "label": "for cred_key, cred", "type": "for", "loc": [308, 315], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99077:FunctionDef_L300_C2", "vector": [6, 2, 0.8241, 0.0212, 2, 0.97, 0.8, 465, 3, 0, 0, 0, 0, 0, 4], "semantic": {"name": "cred_key, cred", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for (cred_key, cred) in self._data.items():\n raw_key = {\n 'clientId': cred_key[0],\n 'userAgent': cred_key[1],\n 'scope': cred_key[2]\n }\n raw_cred = simplejson.loads(cred.to_json())\n raw_creds.append({'key': raw_key, 'credential': raw_cred})"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99077:Assign_L309_C6", "label": "raw_key =", "type": "assigned_variable", "loc": [309, 313], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99077:For_L308_C4", "vector": [14, 3, 0.8228, 0.0132, 3, 0.11, 0.0, 937, 0, 0, 0, 0, 0, 6, 0], "semantic": {"name": "raw_key", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " raw_key = {\n 'clientId': cred_key[0],\n 'userAgent': cred_key[1],\n 'scope': cred_key[2]\n }"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99077:Assign_L314_C6", "label": "raw_cred = loads()", "type": "assigned_variable", "loc": [314, 314], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99077:For_L308_C4", "vector": [14, 3, 0.8307, 0.0026, 3, 0.11, 0.5, 149, 3, 1, 0, 0, 88, 10, 2], "semantic": {"name": "raw_cred", "arg_names": [], "import_names": [], "rhs_call_name": "loads", "annotation": ""}, "snippet": " raw_cred = simplejson.loads(cred.to_json())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99077:Expr_L315_C6", "label": "append()", "type": "expression", "loc": [315, 315], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99077:For_L308_C4", "vector": [8, 3, 0.8333, 0.0026, 3, 0.11, 1.0, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " raw_creds.append({'key': raw_key, 'credential': raw_cred})"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99077:Expr_L316_C4", "label": "_locked_json_write()", "type": "expression", "loc": [316, 316], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99077:FunctionDef_L300_C2", "vector": [8, 2, 0.836, 0.0026, 2, 0.97, 1.0, 649, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "_locked_json_write", "arg_names": [], "import_names": [], "rhs_call_name": "_locked_json_write", "annotation": ""}, "snippet": " self._locked_json_write(raw_data)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99077:FunctionDef_L318_C2", "label": "_get_credential", "type": "function", "loc": [318, 333], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99077:ClassDef_L89_C0", "vector": [2, 1, 0.8611, 0.0423, 1, 0.55, 0.7857, 212, 0, 4, 1, 0, 0, 0, 1], "semantic": {"name": "_get_credential", "arg_names": ["self", "client_id", "user_agent", "scope"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _get_credential(self, client_id, user_agent, scope):\n \"\"\"Get a credential from the multistore.\n\n The multistore must be locked.\n\n Args:\n client_id: The client_id for the credential\n user_agent: The user agent for the credential"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99077:Expr_L319_C4", "label": "expression", "type": "expression", "loc": [319, 330], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99077:FunctionDef_L318_C2", "vector": [8, 2, 0.8585, 0.0317, 2, 0.57, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Get a credential from the multistore.\n\n The multistore must be locked.\n\n Args:\n client_id: The client_id for the credential\n user_agent: The user agent for the credential\n scope: A string for the scope(s) being requested"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99077:Assign_L331_C4", "label": "key =", "type": "assigned_variable", "loc": [331, 331], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99077:FunctionDef_L318_C2", "vector": [14, 2, 0.8757, 0.0026, 2, 0.57, 0.5, 230, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "key", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " key = (client_id, user_agent, scope)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99077:Return_L333_C4", "label": "return", "type": "return", "loc": [333, 333], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99077:FunctionDef_L318_C2", "vector": [13, 2, 0.881, 0.0026, 2, 0.57, 1.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self._data.get(key, None)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99077:FunctionDef_L335_C2", "label": "_update_credential", "type": "function", "loc": [335, 346], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99077:ClassDef_L89_C0", "vector": [2, 1, 0.9008, 0.0317, 1, 0.55, 0.8571, 641, 0, 3, 0, 0, 0, 0, 1], "semantic": {"name": "_update_credential", "arg_names": ["self", "cred", "scope"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _update_credential(self, cred, scope):\n \"\"\"Update a credential and write the multistore.\n\n This must be called when the multistore is locked.\n\n Args:\n cred: The OAuth2Credential to update/set\n scope: The scope(s) that this credential covers"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99077:Expr_L336_C4", "label": "expression", "type": "expression", "loc": [336, 343], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99077:FunctionDef_L335_C2", "vector": [8, 2, 0.8981, 0.0212, 2, 0.56, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Update a credential and write the multistore.\n\n This must be called when the multistore is locked.\n\n Args:\n cred: The OAuth2Credential to update/set\n scope: The scope(s) that this credential covers\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99077:Assign_L344_C4", "label": "key =", "type": "assigned_variable", "loc": [344, 344], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99077:FunctionDef_L335_C2", "vector": [14, 2, 0.9101, 0.0026, 2, 0.56, 0.3333, 230, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "key", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " key = (cred.client_id, cred.user_agent, scope)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99077:Assign_L345_C4", "label": "assign", "type": "assigned_variable", "loc": [345, 345], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99077:FunctionDef_L335_C2", "vector": [14, 2, 0.9127, 0.0026, 2, 0.56, 0.6667, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self._data[key] = cred"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99077:Expr_L346_C4", "label": "_write()", "type": "expression", "loc": [346, 346], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99077:FunctionDef_L335_C2", "vector": [8, 2, 0.9153, 0.0026, 2, 0.56, 1.0, 961, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "_write", "arg_names": [], "import_names": [], "rhs_call_name": "_write", "annotation": ""}, "snippet": " self._write()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99077:FunctionDef_L348_C2", "label": "_delete_credential", "type": "function", "loc": [348, 363], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99077:ClassDef_L89_C0", "vector": [2, 1, 0.9405, 0.0423, 1, 0.55, 0.9286, 807, 0, 4, 0, 0, 0, 0, 1], "semantic": {"name": "_delete_credential", "arg_names": ["self", "client_id", "user_agent", "scope"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _delete_credential(self, client_id, user_agent, scope):\n \"\"\"Delete a credential and write the multistore.\n\n This must be called when the multistore is locked.\n\n Args:\n client_id: The client_id for the credential\n user_agent: The user agent for the credential"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99077:Expr_L349_C4", "label": "expression", "type": "expression", "loc": [349, 357], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99077:FunctionDef_L348_C2", "vector": [8, 2, 0.9339, 0.0238, 2, 0.5, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Delete a credential and write the multistore.\n\n This must be called when the multistore is locked.\n\n Args:\n client_id: The client_id for the credential\n user_agent: The user agent for the credential\n scope: The scope(s) that this credential covers"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99077:Assign_L358_C4", "label": "key =", "type": "assigned_variable", "loc": [358, 358], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99077:FunctionDef_L348_C2", "vector": [14, 2, 0.9471, 0.0026, 2, 0.5, 0.3333, 230, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "key", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " key = (client_id, user_agent, scope)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99077:Try_L359_C4", "label": "try", "type": "try", "loc": [359, 362], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99077:FunctionDef_L348_C2", "vector": [7, 2, 0.9537, 0.0106, 2, 0.5, 0.6667, 0, 0, 1, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " try:\n del self._data[key]\n except KeyError:\n pass"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99077:Expr_L363_C4", "label": "_write()", "type": "expression", "loc": [363, 363], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99077:FunctionDef_L348_C2", "vector": [8, 2, 0.9603, 0.0026, 2, 0.5, 1.0, 961, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "_write", "arg_names": [], "import_names": [], "rhs_call_name": "_write", "annotation": ""}, "snippet": " self._write()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99077:FunctionDef_L365_C2", "label": "_get_storage", "type": "function", "loc": [365, 378], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99077:ClassDef_L89_C0", "vector": [2, 1, 0.9828, 0.037, 1, 0.55, 1.0, 379, 0, 4, 1, 0, 0, 0, 1], "semantic": {"name": "_get_storage", "arg_names": ["self", "client_id", "user_agent", "scope"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _get_storage(self, client_id, user_agent, scope):\n \"\"\"Get a Storage object to get/set a credential.\n\n This Storage is a 'view' into the multistore.\n\n Args:\n client_id: The client_id for the credential\n user_agent: The user agent for the credential"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99077:Expr_L366_C4", "label": "expression", "type": "expression", "loc": [366, 377], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99077:FunctionDef_L365_C2", "vector": [8, 2, 0.9828, 0.0317, 2, 0.65, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Get a Storage object to get/set a credential.\n\n This Storage is a 'view' into the multistore.\n\n Args:\n client_id: The client_id for the credential\n user_agent: The user agent for the credential\n scope: A string for the scope(s) being requested"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99077:Return_L378_C4", "label": "return", "type": "return", "loc": [378, 378], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99077:FunctionDef_L365_C2", "vector": [13, 2, 1.0, 0.0026, 2, 0.65, 1.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self._Storage(self, client_id, user_agent, scope)"}]
[{"f": "ajibawa-2023/Python-Code-Large/train/row_99077:ClassDef_L52_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99077:Expr_L53_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99077:ClassDef_L57_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99077:Expr_L58_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99077:FunctionDef_L62_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99077:Expr_L64_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99077:FunctionDef_L62_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99077:Assign_L77_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99077:FunctionDef_L62_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99077:Expr_L78_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99077:FunctionDef_L62_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99077:Try_L79_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99077:Try_L79_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99077:Assign_L80_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99077:Try_L79_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99077:Expr_L83_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99077:FunctionDef_L62_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99077:If_L84_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99077:If_L84_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99077:Assign_L85_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99077:FunctionDef_L62_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99077:Return_L86_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99077:ClassDef_L89_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99077:Expr_L90_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99077:ClassDef_L89_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99077:FunctionDef_L92_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99077:FunctionDef_L92_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99077:Expr_L93_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99077:FunctionDef_L92_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99077:Assign_L97_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99077:FunctionDef_L92_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99077:Assign_L98_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99077:FunctionDef_L92_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99077:Assign_L99_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99077:FunctionDef_L92_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99077:Assign_L100_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99077:FunctionDef_L92_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99077:Expr_L102_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99077:FunctionDef_L92_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99077:Assign_L111_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99077:ClassDef_L89_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99077:ClassDef_L113_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99077:ClassDef_L113_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99077:Expr_L114_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99077:ClassDef_L113_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99077:FunctionDef_L116_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99077:FunctionDef_L116_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99077:Assign_L117_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99077:FunctionDef_L116_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99077:Assign_L118_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99077:FunctionDef_L116_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99077:Assign_L119_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99077:FunctionDef_L116_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99077:Assign_L120_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99077:ClassDef_L113_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99077:FunctionDef_L122_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99077:FunctionDef_L122_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99077:Expr_L123_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99077:FunctionDef_L122_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99077:Expr_L127_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99077:ClassDef_L113_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99077:FunctionDef_L129_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99077:FunctionDef_L129_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99077:Expr_L130_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99077:FunctionDef_L129_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99077:Expr_L135_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99077:ClassDef_L113_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99077:FunctionDef_L137_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99077:FunctionDef_L137_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99077:Expr_L138_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99077:FunctionDef_L137_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99077:Assign_L145_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99077:FunctionDef_L137_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99077:If_L147_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99077:If_L147_C6", "t": "ajibawa-2023/Python-Code-Large/train/row_99077:Expr_L148_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99077:FunctionDef_L137_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99077:Return_L149_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99077:ClassDef_L113_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99077:FunctionDef_L151_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99077:FunctionDef_L151_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99077:Expr_L152_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99077:FunctionDef_L151_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99077:Expr_L159_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99077:ClassDef_L113_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99077:FunctionDef_L161_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99077:FunctionDef_L161_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99077:Expr_L162_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99077:FunctionDef_L161_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99077:Expr_L169_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99077:ClassDef_L89_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99077:FunctionDef_L172_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99077:FunctionDef_L172_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99077:Expr_L173_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99077:FunctionDef_L172_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99077:If_L178_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99077:If_L178_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99077:Try_L179_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99077:Try_L179_C6", "t": "ajibawa-2023/Python-Code-Large/train/row_99077:Expr_L180_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99077:Try_L179_C6", "t": "ajibawa-2023/Python-Code-Large/train/row_99077:Expr_L182_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99077:ClassDef_L89_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99077:FunctionDef_L184_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99077:FunctionDef_L184_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99077:Expr_L185_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99077:FunctionDef_L184_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99077:Expr_L186_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99077:FunctionDef_L184_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99077:Expr_L187_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99077:FunctionDef_L184_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99077:If_L188_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99077:If_L188_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99077:Assign_L189_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99077:If_L188_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99077:If_L190_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99077:If_L190_C6", "t": "ajibawa-2023/Python-Code-Large/train/row_99077:Expr_L191_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99077:FunctionDef_L184_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99077:If_L194_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99077:If_L194_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99077:Expr_L195_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99077:If_L194_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99077:Assign_L197_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99077:If_L194_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99077:Expr_L198_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99077:If_L194_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99077:If_L199_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99077:If_L199_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99077:Expr_L205_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99077:ClassDef_L89_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99077:FunctionDef_L207_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99077:FunctionDef_L207_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99077:Expr_L208_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99077:FunctionDef_L207_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99077:Expr_L209_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99077:FunctionDef_L207_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99077:Expr_L210_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99077:ClassDef_L89_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99077:FunctionDef_L212_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99077:FunctionDef_L212_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99077:Expr_L213_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99077:FunctionDef_L212_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99077:Expr_L221_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99077:FunctionDef_L212_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99077:Return_L222_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99077:ClassDef_L89_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99077:FunctionDef_L224_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99077:FunctionDef_L224_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99077:Expr_L225_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99077:FunctionDef_L224_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99077:If_L233_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99077:If_L233_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99077:Return_L234_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99077:FunctionDef_L224_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99077:Expr_L235_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99077:FunctionDef_L224_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99077:Expr_L236_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99077:FunctionDef_L224_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99077:Expr_L237_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99077:ClassDef_L89_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99077:FunctionDef_L239_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99077:FunctionDef_L239_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99077:Expr_L240_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99077:FunctionDef_L239_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99077:Assign_L248_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99077:FunctionDef_L239_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99077:Try_L249_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99077:Try_L249_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99077:Assign_L250_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99077:Try_L249_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99077:Expr_L252_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99077:Try_L249_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99077:Return_L254_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99077:FunctionDef_L239_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99077:Assign_L256_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99077:FunctionDef_L239_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99077:Try_L257_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99077:Try_L257_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99077:Assign_L258_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99077:Try_L257_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99077:Expr_L260_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99077:FunctionDef_L239_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99077:If_L262_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99077:FunctionDef_L239_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99077:Assign_L267_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99077:FunctionDef_L239_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99077:Try_L268_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99077:Try_L268_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99077:Assign_L269_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99077:FunctionDef_L239_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99077:For_L273_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99077:For_L273_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99077:Try_L274_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99077:Try_L274_C6", "t": "ajibawa-2023/Python-Code-Large/train/row_99077:Assign_L275_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99077:Try_L274_C6", "t": "ajibawa-2023/Python-Code-Large/train/row_99077:Assign_L276_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99077:Try_L274_C6", "t": "ajibawa-2023/Python-Code-Large/train/row_99077:Expr_L279_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99077:ClassDef_L89_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99077:FunctionDef_L281_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99077:FunctionDef_L281_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99077:Expr_L282_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99077:FunctionDef_L281_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99077:Assign_L291_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99077:FunctionDef_L281_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99077:Assign_L292_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99077:FunctionDef_L281_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99077:Assign_L293_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99077:FunctionDef_L281_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99077:Assign_L294_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99077:FunctionDef_L281_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99077:Assign_L295_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99077:FunctionDef_L281_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99077:Assign_L296_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99077:FunctionDef_L281_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99077:Assign_L297_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99077:FunctionDef_L281_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99077:Return_L298_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99077:ClassDef_L89_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99077:FunctionDef_L300_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99077:FunctionDef_L300_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99077:Expr_L301_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99077:FunctionDef_L300_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99077:Assign_L305_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99077:FunctionDef_L300_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99077:Assign_L306_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99077:FunctionDef_L300_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99077:Assign_L307_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99077:FunctionDef_L300_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99077:For_L308_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99077:For_L308_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99077:Assign_L309_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99077:For_L308_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99077:Assign_L314_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99077:For_L308_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99077:Expr_L315_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99077:FunctionDef_L300_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99077:Expr_L316_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99077:ClassDef_L89_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99077:FunctionDef_L318_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99077:FunctionDef_L318_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99077:Expr_L319_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99077:FunctionDef_L318_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99077:Assign_L331_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99077:FunctionDef_L318_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99077:Return_L333_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99077:ClassDef_L89_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99077:FunctionDef_L335_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99077:FunctionDef_L335_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99077:Expr_L336_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99077:FunctionDef_L335_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99077:Assign_L344_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99077:FunctionDef_L335_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99077:Assign_L345_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99077:FunctionDef_L335_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99077:Expr_L346_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99077:ClassDef_L89_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99077:FunctionDef_L348_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99077:FunctionDef_L348_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99077:Expr_L349_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99077:FunctionDef_L348_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99077:Assign_L358_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99077:FunctionDef_L348_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99077:Try_L359_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99077:FunctionDef_L348_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99077:Expr_L363_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99077:ClassDef_L89_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99077:FunctionDef_L365_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99077:FunctionDef_L365_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99077:Expr_L366_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99077:FunctionDef_L365_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99077:Return_L378_C4"}]
# Copyright (C) 2010 Google Inc. # # 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. """Utility module to import a JSON module Hides all the messy details of exactly where we get a simplejson module from. """ __author__ = 'jcgregorio@google.com (Joe Gregorio)' try: # pragma: no cover # Should work for Python2.6 and higher. import json as simplejson except ImportError: # pragma: no cover try: import simplejson except ImportError: # Try to import from django, should work on App Engine from django.utils import simplejson
ajibawa-2023/Python-Code-Large/train/row_99078
7
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_99078:Expr_L15_C0", "label": "expression", "type": "expression", "loc": [15, 19], "level": 0, "parent": null, "vector": [8, 0, 0.5312, 0.1562, 0, 0.66, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\"\"\"Utility module to import a JSON module\n\nHides all the messy details of exactly where\nwe get a simplejson module from.\n\"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99078:Assign_L21_C0", "label": "__author__ =", "type": "assigned_variable", "loc": [21, 21], "level": 0, "parent": null, "vector": [14, 0, 0.6562, 0.0312, 0, 0.66, 0.5, 777, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "__author__", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "__author__ = 'jcgregorio@google.com (Joe Gregorio)'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99078:Try_L24_C0", "label": "try", "type": "try", "loc": [24, 32], "level": 0, "parent": null, "vector": [7, 0, 0.875, 0.2812, 0, 0.66, 1.0, 0, 0, 1, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "try: # pragma: no cover\n # Should work for Python2.6 and higher.\n import json as simplejson\nexcept ImportError: # pragma: no cover\n try:\n import simplejson\n except ImportError:\n # Try to import from django, should work on App Engine"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99078:Import_L26_C2", "label": "json import simplejson", "type": "import", "loc": [26, 26], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99078:Try_L24_C0", "vector": [1, 1, 0.8125, 0.0312, 1, 0.93, 0.0, 463, 0, 1, 0, 0, 463, 0, 0], "semantic": {"name": "json", "arg_names": [], "import_names": ["simplejson"], "rhs_call_name": "", "annotation": ""}, "snippet": " import json as simplejson"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99078:Try_L28_C2", "label": "try", "type": "try", "loc": [28, 32], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99078:Try_L24_C0", "vector": [7, 1, 0.9375, 0.1562, 1, 0.93, 0.0, 0, 0, 1, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " try:\n import simplejson\n except ImportError:\n # Try to import from django, should work on App Engine\n from django.utils import simplejson"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99078:Import_L29_C4", "label": "simplejson import simplejson", "type": "import", "loc": [29, 29], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99078:Try_L28_C2", "vector": [1, 2, 0.9062, 0.0312, 2, 0.82, 0.0, 386, 0, 1, 0, 0, 386, 0, 0], "semantic": {"name": "simplejson", "arg_names": [], "import_names": ["simplejson"], "rhs_call_name": "", "annotation": ""}, "snippet": " import simplejson"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99078:ImportFrom_L32_C4", "label": "from django.utils import simplejson", "type": "import", "loc": [32, 32], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99078:Try_L28_C2", "vector": [1, 2, 1.0, 0.0312, 2, 0.82, 0.0, 944, 0, 1, 0, 0, 944, 0, 0], "semantic": {"name": "django.utils", "arg_names": [], "import_names": ["simplejson"], "rhs_call_name": "", "annotation": ""}, "snippet": " from django.utils import simplejson"}]
[{"f": "ajibawa-2023/Python-Code-Large/train/row_99078:Try_L24_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99078:Import_L26_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99078:Try_L24_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99078:Try_L28_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99078:Try_L28_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99078:Import_L29_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99078:Try_L28_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99078:ImportFrom_L32_C4"}]
# Copyright (C) 2010 Google Inc. # # 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. """An OAuth 2.0 client. Tools for interacting with OAuth 2.0 protected resources. """ __author__ = 'jcgregorio@google.com (Joe Gregorio)' import base64 import clientsecrets import copy import datetime import httplib2 import logging import os import sys import time import urllib import urlparse from anyjson import simplejson HAS_OPENSSL = False try: from oauth2client.crypt import Signer from oauth2client.crypt import make_signed_jwt from oauth2client.crypt import verify_signed_jwt_with_certs HAS_OPENSSL = True except ImportError: pass try: from urlparse import parse_qsl except ImportError: from cgi import parse_qsl logger = logging.getLogger(__name__) # Expiry is stored in RFC3339 UTC format EXPIRY_FORMAT = '%Y-%m-%dT%H:%M:%SZ' # Which certs to use to validate id_tokens received. ID_TOKEN_VERIFICATON_CERTS = 'https://www.googleapis.com/oauth2/v1/certs' # Constant to use for the out of band OAuth 2.0 flow. OOB_CALLBACK_URN = 'urn:ietf:wg:oauth:2.0:oob' class Error(Exception): """Base error for this module.""" pass class FlowExchangeError(Error): """Error trying to exchange an authorization grant for an access token.""" pass class AccessTokenRefreshError(Error): """Error trying to refresh an expired access token.""" pass class UnknownClientSecretsFlowError(Error): """The client secrets file called for an unknown type of OAuth 2.0 flow. """ pass class AccessTokenCredentialsError(Error): """Having only the access_token means no refresh is possible.""" pass class VerifyJwtTokenError(Error): """Could on retrieve certificates for validation.""" pass def _abstract(): raise NotImplementedError('You need to override this function') class MemoryCache(object): """httplib2 Cache implementation which only caches locally.""" def __init__(self): self.cache = {} def get(self, key): return self.cache.get(key) def set(self, key, value): self.cache[key] = value def delete(self, key): self.cache.pop(key, None) class Credentials(object): """Base class for all Credentials objects. Subclasses must define an authorize() method that applies the credentials to an HTTP transport. Subclasses must also specify a classmethod named 'from_json' that takes a JSON string as input and returns an instaniated Credentials object. """ NON_SERIALIZED_MEMBERS = ['store'] def authorize(self, http): """Take an httplib2.Http instance (or equivalent) and authorizes it for the set of credentials, usually by replacing http.request() with a method that adds in the appropriate headers and then delegates to the original Http.request() method. """ _abstract() def refresh(self, http): """Forces a refresh of the access_token. Args: http: httplib2.Http, an http object to be used to make the refresh request. """ _abstract() def apply(self, headers): """Add the authorization to the headers. Args: headers: dict, the headers to add the Authorization header to. """ _abstract() def _to_json(self, strip): """Utility function for creating a JSON representation of an instance of Credentials. Args: strip: array, An array of names of members to not include in the JSON. Returns: string, a JSON representation of this instance, suitable to pass to from_json(). """ t = type(self) d = copy.copy(self.__dict__) for member in strip: if member in d: del d[member] if 'token_expiry' in d and isinstance(d['token_expiry'], datetime.datetime): d['token_expiry'] = d['token_expiry'].strftime(EXPIRY_FORMAT) # Add in information we will need later to reconsistitue this instance. d['_class'] = t.__name__ d['_module'] = t.__module__ return simplejson.dumps(d) def to_json(self): """Creating a JSON representation of an instance of Credentials. Returns: string, a JSON representation of this instance, suitable to pass to from_json(). """ return self._to_json(Credentials.NON_SERIALIZED_MEMBERS) @classmethod def new_from_json(cls, s): """Utility class method to instantiate a Credentials subclass from a JSON representation produced by to_json(). Args: s: string, JSON from to_json(). Returns: An instance of the subclass of Credentials that was serialized with to_json(). """ data = simplejson.loads(s) # Find and call the right classmethod from_json() to restore the object. module = data['_module'] try: m = __import__(module) except ImportError: # In case there's an object from the old package structure, update it module = module.replace('.apiclient', '') m = __import__(module) m = __import__(module, fromlist=module.split('.')[:-1]) kls = getattr(m, data['_class']) from_json = getattr(kls, 'from_json') return from_json(s) @classmethod def from_json(cls, s): """Instantiate a Credentials object from a JSON description of it. The JSON should have been produced by calling .to_json() on the object. Args: data: dict, A deserialized JSON object. Returns: An instance of a Credentials subclass. """ return Credentials() class Flow(object): """Base class for all Flow objects.""" pass class Storage(object): """Base class for all Storage objects. Store and retrieve a single credential. This class supports locking such that multiple processes and threads can operate on a single store. """ def acquire_lock(self): """Acquires any lock necessary to access this Storage. This lock is not reentrant. """ pass def release_lock(self): """Release the Storage lock. Trying to release a lock that isn't held will result in a RuntimeError. """ pass def locked_get(self): """Retrieve credential. The Storage lock must be held when this is called. Returns: oauth2client.client.Credentials """ _abstract() def locked_put(self, credentials): """Write a credential. The Storage lock must be held when this is called. Args: credentials: Credentials, the credentials to store. """ _abstract() def locked_delete(self): """Delete a credential. The Storage lock must be held when this is called. """ _abstract() def get(self): """Retrieve credential. The Storage lock must *not* be held when this is called. Returns: oauth2client.client.Credentials """ self.acquire_lock() try: return self.locked_get() finally: self.release_lock() def put(self, credentials): """Write a credential. The Storage lock must be held when this is called. Args: credentials: Credentials, the credentials to store. """ self.acquire_lock() try: self.locked_put(credentials) finally: self.release_lock() def delete(self): """Delete credential. Frees any resources associated with storing the credential. The Storage lock must *not* be held when this is called. Returns: None """ self.acquire_lock() try: return self.locked_delete() finally: self.release_lock() class OAuth2Credentials(Credentials): """Credentials object for OAuth 2.0. Credentials can be applied to an httplib2.Http object using the authorize() method, which then adds the OAuth 2.0 access token to each request. OAuth2Credentials objects may be safely pickled and unpickled. """ def __init__(self, access_token, client_id, client_secret, refresh_token, token_expiry, token_uri, user_agent, id_token=None): """Create an instance of OAuth2Credentials. This constructor is not usually called by the user, instead OAuth2Credentials objects are instantiated by the OAuth2WebServerFlow. Args: access_token: string, access token. client_id: string, client identifier. client_secret: string, client secret. refresh_token: string, refresh token. token_expiry: datetime, when the access_token expires. token_uri: string, URI of token endpoint. user_agent: string, The HTTP User-Agent to provide for this application. id_token: object, The identity of the resource owner. Notes: store: callable, A callable that when passed a Credential will store the credential back to where it came from. This is needed to store the latest access_token if it has expired and been refreshed. """ self.access_token = access_token self.client_id = client_id self.client_secret = client_secret self.refresh_token = refresh_token self.store = None self.token_expiry = token_expiry self.token_uri = token_uri self.user_agent = user_agent self.id_token = id_token # True if the credentials have been revoked or expired and can't be # refreshed. self.invalid = False def authorize(self, http): """Authorize an httplib2.Http instance with these credentials. The modified http.request method will add authentication headers to each request and will refresh access_tokens when a 401 is received on a request. In addition the http.request method has a credentials property, http.request.credentials, which is the Credentials object that authorized it. Args: http: An instance of httplib2.Http or something that acts like it. Returns: A modified instance of http that was passed in. Example: h = httplib2.Http() h = credentials.authorize(h) You can't create a new OAuth subclass of httplib2.Authenication because it never gets passed the absolute URI, which is needed for signing. So instead we have to overload 'request' with a closure that adds in the Authorization header and then calls the original version of 'request()'. """ request_orig = http.request # The closure that will replace 'httplib2.Http.request'. def new_request(uri, method='GET', body=None, headers=None, redirections=httplib2.DEFAULT_MAX_REDIRECTS, connection_type=None): if not self.access_token: logger.info('Attempting refresh to obtain initial access_token') self._refresh(request_orig) # Modify the request headers to add the appropriate # Authorization header. if headers is None: headers = {} self.apply(headers) if self.user_agent is not None: if 'user-agent' in headers: headers['user-agent'] = self.user_agent + ' ' + headers['user-agent'] else: headers['user-agent'] = self.user_agent resp, content = request_orig(uri, method, body, headers, redirections, connection_type) if resp.status == 401: logger.info('Refreshing due to a 401') self._refresh(request_orig) self.apply(headers) return request_orig(uri, method, body, headers, redirections, connection_type) else: return (resp, content) # Replace the request method with our own closure. http.request = new_request # Set credentials as a property of the request method. setattr(http.request, 'credentials', self) return http def refresh(self, http): """Forces a refresh of the access_token. Args: http: httplib2.Http, an http object to be used to make the refresh request. """ self._refresh(http.request) def apply(self, headers): """Add the authorization to the headers. Args: headers: dict, the headers to add the Authorization header to. """ headers['Authorization'] = 'Bearer ' + self.access_token def to_json(self): return self._to_json(Credentials.NON_SERIALIZED_MEMBERS) @classmethod def from_json(cls, s): """Instantiate a Credentials object from a JSON description of it. The JSON should have been produced by calling .to_json() on the object. Args: data: dict, A deserialized JSON object. Returns: An instance of a Credentials subclass. """ data = simplejson.loads(s) if 'token_expiry' in data and not isinstance(data['token_expiry'], datetime.datetime): try: data['token_expiry'] = datetime.datetime.strptime( data['token_expiry'], EXPIRY_FORMAT) except: data['token_expiry'] = None retval = OAuth2Credentials( data['access_token'], data['client_id'], data['client_secret'], data['refresh_token'], data['token_expiry'], data['token_uri'], data['user_agent'], data.get('id_token', None)) retval.invalid = data['invalid'] return retval @property def access_token_expired(self): """True if the credential is expired or invalid. If the token_expiry isn't set, we assume the token doesn't expire. """ if self.invalid: return True if not self.token_expiry: return False now = datetime.datetime.utcnow() if now >= self.token_expiry: logger.info('access_token is expired. Now: %s, token_expiry: %s', now, self.token_expiry) return True return False def set_store(self, store): """Set the Storage for the credential. Args: store: Storage, an implementation of Stroage object. This is needed to store the latest access_token if it has expired and been refreshed. This implementation uses locking to check for updates before updating the access_token. """ self.store = store def _updateFromCredential(self, other): """Update this Credential from another instance.""" self.__dict__.update(other.__getstate__()) def __getstate__(self): """Trim the state down to something that can be pickled.""" d = copy.copy(self.__dict__) del d['store'] return d def __setstate__(self, state): """Reconstitute the state of the object from being pickled.""" self.__dict__.update(state) self.store = None def _generate_refresh_request_body(self): """Generate the body that will be used in the refresh request.""" body = urllib.urlencode({ 'grant_type': 'refresh_token', 'client_id': self.client_id, 'client_secret': self.client_secret, 'refresh_token': self.refresh_token, }) return body def _generate_refresh_request_headers(self): """Generate the headers that will be used in the refresh request.""" headers = { 'content-type': 'application/x-www-form-urlencoded', } if self.user_agent is not None: headers['user-agent'] = self.user_agent return headers def _refresh(self, http_request): """Refreshes the access_token. This method first checks by reading the Storage object if available. If a refresh is still needed, it holds the Storage lock until the refresh is completed. Args: http_request: callable, a callable that matches the method signature of httplib2.Http.request, used to make the refresh request. Raises: AccessTokenRefreshError: When the refresh fails. """ if not self.store: self._do_refresh_request(http_request) else: self.store.acquire_lock() try: new_cred = self.store.locked_get() if (new_cred and not new_cred.invalid and new_cred.access_token != self.access_token): logger.info('Updated access_token read from Storage') self._updateFromCredential(new_cred) else: self._do_refresh_request(http_request) finally: self.store.release_lock() def _do_refresh_request(self, http_request): """Refresh the access_token using the refresh_token. Args: http_request: callable, a callable that matches the method signature of httplib2.Http.request, used to make the refresh request. Raises: AccessTokenRefreshError: When the refresh fails. """ body = self._generate_refresh_request_body() headers = self._generate_refresh_request_headers() logger.info('Refreshing access_token') resp, content = http_request( self.token_uri, method='POST', body=body, headers=headers) if resp.status == 200: # TODO(jcgregorio) Raise an error if loads fails? d = simplejson.loads(content) self.access_token = d['access_token'] self.refresh_token = d.get('refresh_token', self.refresh_token) if 'expires_in' in d: self.token_expiry = datetime.timedelta( seconds=int(d['expires_in'])) + datetime.datetime.utcnow() else: self.token_expiry = None if self.store: self.store.locked_put(self) else: # An {'error':...} response body means the token is expired or revoked, # so we flag the credentials as such. logger.info('Failed to retrieve access token: %s' % content) error_msg = 'Invalid response %s.' % resp['status'] try: d = simplejson.loads(content) if 'error' in d: error_msg = d['error'] self.invalid = True if self.store: self.store.locked_put(self) except: pass raise AccessTokenRefreshError(error_msg) class AccessTokenCredentials(OAuth2Credentials): """Credentials object for OAuth 2.0. Credentials can be applied to an httplib2.Http object using the authorize() method, which then signs each request from that object with the OAuth 2.0 access token. This set of credentials is for the use case where you have acquired an OAuth 2.0 access_token from another place such as a JavaScript client or another web application, and wish to use it from Python. Because only the access_token is present it can not be refreshed and will in time expire. AccessTokenCredentials objects may be safely pickled and unpickled. Usage: credentials = AccessTokenCredentials('<an access token>', 'my-user-agent/1.0') http = httplib2.Http() http = credentials.authorize(http) Exceptions: AccessTokenCredentialsExpired: raised when the access_token expires or is revoked. """ def __init__(self, access_token, user_agent): """Create an instance of OAuth2Credentials This is one of the few types if Credentials that you should contrust, Credentials objects are usually instantiated by a Flow. Args: access_token: string, access token. user_agent: string, The HTTP User-Agent to provide for this application. Notes: store: callable, a callable that when passed a Credential will store the credential back to where it came from. """ super(AccessTokenCredentials, self).__init__( access_token, None, None, None, None, None, user_agent) @classmethod def from_json(cls, s): data = simplejson.loads(s) retval = AccessTokenCredentials( data['access_token'], data['user_agent']) return retval def _refresh(self, http_request): raise AccessTokenCredentialsError( "The access_token is expired or invalid and can't be refreshed.") class AssertionCredentials(OAuth2Credentials): """Abstract Credentials object used for OAuth 2.0 assertion grants. This credential does not require a flow to instantiate because it represents a two legged flow, and therefore has all of the required information to generate and refresh its own access tokens. It must be subclassed to generate the appropriate assertion string. AssertionCredentials objects may be safely pickled and unpickled. """ def __init__(self, assertion_type, user_agent, token_uri='https://accounts.google.com/o/oauth2/token', **unused_kwargs): """Constructor for AssertionFlowCredentials. Args: assertion_type: string, assertion type that will be declared to the auth server user_agent: string, The HTTP User-Agent to provide for this application. token_uri: string, URI for token endpoint. For convenience defaults to Google's endpoints but any OAuth 2.0 provider can be used. """ super(AssertionCredentials, self).__init__( None, None, None, None, None, token_uri, user_agent) self.assertion_type = assertion_type def _generate_refresh_request_body(self): assertion = self._generate_assertion() body = urllib.urlencode({ 'assertion_type': self.assertion_type, 'assertion': assertion, 'grant_type': 'assertion', }) return body def _generate_assertion(self): """Generate the assertion string that will be used in the access token request. """ _abstract() if HAS_OPENSSL: # PyOpenSSL is not a prerequisite for oauth2client, so if it is missing then # don't create the SignedJwtAssertionCredentials or the verify_id_token() # method. class SignedJwtAssertionCredentials(AssertionCredentials): """Credentials object used for OAuth 2.0 Signed JWT assertion grants. This credential does not require a flow to instantiate because it represents a two legged flow, and therefore has all of the required information to generate and refresh its own access tokens. """ MAX_TOKEN_LIFETIME_SECS = 3600 # 1 hour in seconds def __init__(self, service_account_name, private_key, scope, private_key_password='notasecret', user_agent=None, token_uri='https://accounts.google.com/o/oauth2/token', **kwargs): """Constructor for SignedJwtAssertionCredentials. Args: service_account_name: string, id for account, usually an email address. private_key: string, private key in P12 format. scope: string or list of strings, scope(s) of the credentials being requested. private_key_password: string, password for private_key. user_agent: string, HTTP User-Agent to provide for this application. token_uri: string, URI for token endpoint. For convenience defaults to Google's endpoints but any OAuth 2.0 provider can be used. kwargs: kwargs, Additional parameters to add to the JWT token, for example prn=joe@xample.org.""" super(SignedJwtAssertionCredentials, self).__init__( 'http://oauth.net/grant_type/jwt/1.0/bearer', user_agent, token_uri=token_uri, ) if type(scope) is list: scope = ' '.join(scope) self.scope = scope self.private_key = private_key self.private_key_password = private_key_password self.service_account_name = service_account_name self.kwargs = kwargs @classmethod def from_json(cls, s): data = simplejson.loads(s) retval = SignedJwtAssertionCredentials( data['service_account_name'], data['private_key'], data['private_key_password'], data['scope'], data['user_agent'], data['token_uri'], data['kwargs'] ) retval.invalid = data['invalid'] return retval def _generate_assertion(self): """Generate the assertion that will be used in the request.""" now = long(time.time()) payload = { 'aud': self.token_uri, 'scope': self.scope, 'iat': now, 'exp': now + SignedJwtAssertionCredentials.MAX_TOKEN_LIFETIME_SECS, 'iss': self.service_account_name } payload.update(self.kwargs) logger.debug(str(payload)) return make_signed_jwt( Signer.from_string(self.private_key, self.private_key_password), payload) # Only used in verify_id_token(), which is always calling to the same URI # for the certs. _cached_http = httplib2.Http(MemoryCache()) def verify_id_token(id_token, audience, http=None, cert_uri=ID_TOKEN_VERIFICATON_CERTS): """Verifies a signed JWT id_token. Args: id_token: string, A Signed JWT. audience: string, The audience 'aud' that the token should be for. http: httplib2.Http, instance to use to make the HTTP request. Callers should supply an instance that has caching enabled. cert_uri: string, URI of the certificates in JSON format to verify the JWT against. Returns: The deserialized JSON in the JWT. Raises: oauth2client.crypt.AppIdentityError if the JWT fails to verify. """ if http is None: http = _cached_http resp, content = http.request(cert_uri) if resp.status == 200: certs = simplejson.loads(content) return verify_signed_jwt_with_certs(id_token, certs, audience) else: raise VerifyJwtTokenError('Status code: %d' % resp.status) def _urlsafe_b64decode(b64string): # Guard against unicode strings, which base64 can't handle. b64string = b64string.encode('ascii') padded = b64string + '=' * (4 - len(b64string) % 4) return base64.urlsafe_b64decode(padded) def _extract_id_token(id_token): """Extract the JSON payload from a JWT. Does the extraction w/o checking the signature. Args: id_token: string, OAuth 2.0 id_token. Returns: object, The deserialized JSON payload. """ segments = id_token.split('.') if (len(segments) != 3): raise VerifyJwtTokenError( 'Wrong number of segments in token: %s' % id_token) return simplejson.loads(_urlsafe_b64decode(segments[1])) def credentials_from_code(client_id, client_secret, scope, code, redirect_uri = 'postmessage', http=None, user_agent=None, token_uri='https://accounts.google.com/o/oauth2/token'): """Exchanges an authorization code for an OAuth2Credentials object. Args: client_id: string, client identifier. client_secret: string, client secret. scope: string or list of strings, scope(s) to request. code: string, An authroization code, most likely passed down from the client redirect_uri: string, this is generally set to 'postmessage' to match the redirect_uri that the client specified http: httplib2.Http, optional http instance to use to do the fetch token_uri: string, URI for token endpoint. For convenience defaults to Google's endpoints but any OAuth 2.0 provider can be used. Returns: An OAuth2Credentials object. Raises: FlowExchangeError if the authorization code cannot be exchanged for an access token """ flow = OAuth2WebServerFlow(client_id, client_secret, scope, user_agent, 'https://accounts.google.com/o/oauth2/auth', token_uri) # We primarily make this call to set up the redirect_uri in the flow object uriThatWeDontReallyUse = flow.step1_get_authorize_url(redirect_uri) credentials = flow.step2_exchange(code, http) return credentials def credentials_from_clientsecrets_and_code(filename, scope, code, message = None, redirect_uri = 'postmessage', http=None): """Returns OAuth2Credentials from a clientsecrets file and an auth code. Will create the right kind of Flow based on the contents of the clientsecrets file or will raise InvalidClientSecretsError for unknown types of Flows. Args: filename: string, File name of clientsecrets. scope: string or list of strings, scope(s) to request. code: string, An authroization code, most likely passed down from the client message: string, A friendly string to display to the user if the clientsecrets file is missing or invalid. If message is provided then sys.exit will be called in the case of an error. If message in not provided then clientsecrets.InvalidClientSecretsError will be raised. redirect_uri: string, this is generally set to 'postmessage' to match the redirect_uri that the client specified http: httplib2.Http, optional http instance to use to do the fetch Returns: An OAuth2Credentials object. Raises: FlowExchangeError if the authorization code cannot be exchanged for an access token UnknownClientSecretsFlowError if the file describes an unknown kind of Flow. clientsecrets.InvalidClientSecretsError if the clientsecrets file is invalid. """ flow = flow_from_clientsecrets(filename, scope, message) # We primarily make this call to set up the redirect_uri in the flow object uriThatWeDontReallyUse = flow.step1_get_authorize_url(redirect_uri) credentials = flow.step2_exchange(code, http) return credentials class OAuth2WebServerFlow(Flow): """Does the Web Server Flow for OAuth 2.0. OAuth2Credentials objects may be safely pickled and unpickled. """ def __init__(self, client_id, client_secret, scope, user_agent=None, auth_uri='https://accounts.google.com/o/oauth2/auth', token_uri='https://accounts.google.com/o/oauth2/token', **kwargs): """Constructor for OAuth2WebServerFlow. Args: client_id: string, client identifier. client_secret: string client secret. scope: string or list of strings, scope(s) of the credentials being requested. user_agent: string, HTTP User-Agent to provide for this application. auth_uri: string, URI for authorization endpoint. For convenience defaults to Google's endpoints but any OAuth 2.0 provider can be used. token_uri: string, URI for token endpoint. For convenience defaults to Google's endpoints but any OAuth 2.0 provider can be used. **kwargs: dict, The keyword arguments are all optional and required parameters for the OAuth calls. """ self.client_id = client_id self.client_secret = client_secret if type(scope) is list: scope = ' '.join(scope) self.scope = scope self.user_agent = user_agent self.auth_uri = auth_uri self.token_uri = token_uri self.params = { 'access_type': 'offline', } self.params.update(kwargs) self.redirect_uri = None def step1_get_authorize_url(self, redirect_uri=OOB_CALLBACK_URN): """Returns a URI to redirect to the provider. Args: redirect_uri: string, Either the string 'urn:ietf:wg:oauth:2.0:oob' for a non-web-based application, or a URI that handles the callback from the authorization server. If redirect_uri is 'urn:ietf:wg:oauth:2.0:oob' then pass in the generated verification code to step2_exchange, otherwise pass in the query parameters received at the callback uri to step2_exchange. """ self.redirect_uri = redirect_uri query = { 'response_type': 'code', 'client_id': self.client_id, 'redirect_uri': redirect_uri, 'scope': self.scope, } query.update(self.params) parts = list(urlparse.urlparse(self.auth_uri)) query.update(dict(parse_qsl(parts[4]))) # 4 is the index of the query part parts[4] = urllib.urlencode(query) return urlparse.urlunparse(parts) def step2_exchange(self, code, http=None): """Exhanges a code for OAuth2Credentials. Args: code: string or dict, either the code as a string, or a dictionary of the query parameters to the redirect_uri, which contains the code. http: httplib2.Http, optional http instance to use to do the fetch Returns: An OAuth2Credentials object that can be used to authorize requests. Raises: FlowExchangeError if a problem occured exchanging the code for a refresh_token. """ if not (isinstance(code, str) or isinstance(code, unicode)): if 'code' not in code: if 'error' in code: error_msg = code['error'] else: error_msg = 'No code was supplied in the query parameters.' raise FlowExchangeError(error_msg) else: code = code['code'] body = urllib.urlencode({ 'grant_type': 'authorization_code', 'client_id': self.client_id, 'client_secret': self.client_secret, 'code': code, 'redirect_uri': self.redirect_uri, 'scope': self.scope, }) headers = { 'content-type': 'application/x-www-form-urlencoded', } if self.user_agent is not None: headers['user-agent'] = self.user_agent if http is None: http = httplib2.Http() resp, content = http.request(self.token_uri, method='POST', body=body, headers=headers) if resp.status == 200: # TODO(jcgregorio) Raise an error if simplejson.loads fails? d = simplejson.loads(content) access_token = d['access_token'] refresh_token = d.get('refresh_token', None) token_expiry = None if 'expires_in' in d: token_expiry = datetime.datetime.utcnow() + datetime.timedelta( seconds=int(d['expires_in'])) if 'id_token' in d: d['id_token'] = _extract_id_token(d['id_token']) logger.info('Successfully retrieved access token: %s' % content) return OAuth2Credentials(access_token, self.client_id, self.client_secret, refresh_token, token_expiry, self.token_uri, self.user_agent, id_token=d.get('id_token', None)) else: logger.info('Failed to retrieve access token: %s' % content) error_msg = 'Invalid response %s.' % resp['status'] try: d = simplejson.loads(content) if 'error' in d: error_msg = d['error'] except: pass raise FlowExchangeError(error_msg) def flow_from_clientsecrets(filename, scope, message=None): """Create a Flow from a clientsecrets file. Will create the right kind of Flow based on the contents of the clientsecrets file or will raise InvalidClientSecretsError for unknown types of Flows. Args: filename: string, File name of client secrets. scope: string or list of strings, scope(s) to request. message: string, A friendly string to display to the user if the clientsecrets file is missing or invalid. If message is provided then sys.exit will be called in the case of an error. If message in not provided then clientsecrets.InvalidClientSecretsError will be raised. Returns: A Flow object. Raises: UnknownClientSecretsFlowError if the file describes an unknown kind of Flow. clientsecrets.InvalidClientSecretsError if the clientsecrets file is invalid. """ try: client_type, client_info = clientsecrets.loadfile(filename) if client_type in [clientsecrets.TYPE_WEB, clientsecrets.TYPE_INSTALLED]: return OAuth2WebServerFlow( client_info['client_id'], client_info['client_secret'], scope, None, # user_agent client_info['auth_uri'], client_info['token_uri']) except clientsecrets.InvalidClientSecretsError: if message: sys.exit(message) else: raise else: raise UnknownClientSecretsFlowError( 'This OAuth 2.0 flow is unsupported: "%s"' * client_type)
ajibawa-2023/Python-Code-Large/train/row_99080
396
1,139
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_99080:Expr_L15_C0", "label": "expression", "type": "expression", "loc": [15, 18], "level": 0, "parent": null, "vector": [8, 0, 0.0145, 0.0035, 0, 0.66, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\"\"\"An OAuth 2.0 client.\n\nTools for interacting with OAuth 2.0 protected resources.\n\"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99080:Assign_L20_C0", "label": "__author__ =", "type": "assigned_variable", "loc": [20, 20], "level": 0, "parent": null, "vector": [14, 0, 0.0176, 0.0009, 0, 0.66, 0.0244, 777, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "__author__", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "__author__ = 'jcgregorio@google.com (Joe Gregorio)'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99080:Import_L22_C0", "label": "base64 import base64", "type": "import", "loc": [22, 22], "level": 0, "parent": null, "vector": [1, 0, 0.0193, 0.0009, 0, 0.66, 0.0488, 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_99080:Import_L23_C0", "label": "clientsecrets import clientsecrets", "type": "import", "loc": [23, 23], "level": 0, "parent": null, "vector": [1, 0, 0.0202, 0.0009, 0, 0.66, 0.0732, 609, 0, 1, 0, 0, 609, 0, 0], "semantic": {"name": "clientsecrets", "arg_names": [], "import_names": ["clientsecrets"], "rhs_call_name": "", "annotation": ""}, "snippet": "import clientsecrets"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99080:Import_L24_C0", "label": "copy import copy", "type": "import", "loc": [24, 24], "level": 0, "parent": null, "vector": [1, 0, 0.0211, 0.0009, 0, 0.66, 0.0976, 739, 0, 1, 0, 0, 739, 0, 0], "semantic": {"name": "copy", "arg_names": [], "import_names": ["copy"], "rhs_call_name": "", "annotation": ""}, "snippet": "import copy"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99080:Import_L25_C0", "label": "datetime import datetime", "type": "import", "loc": [25, 25], "level": 0, "parent": null, "vector": [1, 0, 0.0219, 0.0009, 0, 0.66, 0.122, 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_99080:Import_L26_C0", "label": "httplib2 import httplib2", "type": "import", "loc": [26, 26], "level": 0, "parent": null, "vector": [1, 0, 0.0228, 0.0009, 0, 0.66, 0.1463, 273, 0, 1, 0, 0, 273, 0, 0], "semantic": {"name": "httplib2", "arg_names": [], "import_names": ["httplib2"], "rhs_call_name": "", "annotation": ""}, "snippet": "import httplib2"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99080:Import_L27_C0", "label": "logging import logging", "type": "import", "loc": [27, 27], "level": 0, "parent": null, "vector": [1, 0, 0.0237, 0.0009, 0, 0.66, 0.1707, 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_99080:Import_L28_C0", "label": "os import os", "type": "import", "loc": [28, 28], "level": 0, "parent": null, "vector": [1, 0, 0.0246, 0.0009, 0, 0.66, 0.1951, 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_99080:Import_L29_C0", "label": "sys import sys", "type": "import", "loc": [29, 29], "level": 0, "parent": null, "vector": [1, 0, 0.0255, 0.0009, 0, 0.66, 0.2195, 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_99080:Import_L30_C0", "label": "time import time", "type": "import", "loc": [30, 30], "level": 0, "parent": null, "vector": [1, 0, 0.0263, 0.0009, 0, 0.66, 0.2439, 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_99080:Import_L31_C0", "label": "urllib import urllib", "type": "import", "loc": [31, 31], "level": 0, "parent": null, "vector": [1, 0, 0.0272, 0.0009, 0, 0.66, 0.2683, 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_99080:Import_L32_C0", "label": "urlparse import urlparse", "type": "import", "loc": [32, 32], "level": 0, "parent": null, "vector": [1, 0, 0.0281, 0.0009, 0, 0.66, 0.2927, 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_99080:ImportFrom_L34_C0", "label": "from anyjson import simplejson", "type": "import", "loc": [34, 34], "level": 0, "parent": null, "vector": [1, 0, 0.0299, 0.0009, 0, 0.66, 0.3171, 877, 0, 1, 0, 0, 877, 0, 0], "semantic": {"name": "anyjson", "arg_names": [], "import_names": ["simplejson"], "rhs_call_name": "", "annotation": ""}, "snippet": "from anyjson import simplejson"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99080:Assign_L36_C0", "label": "HAS_OPENSSL =", "type": "assigned_variable", "loc": [36, 36], "level": 0, "parent": null, "vector": [14, 0, 0.0316, 0.0009, 0, 0.66, 0.3415, 62, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "HAS_OPENSSL", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "HAS_OPENSSL = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99080:Try_L37_C0", "label": "try", "type": "try", "loc": [37, 43], "level": 0, "parent": null, "vector": [7, 0, 0.0351, 0.0061, 0, 0.66, 0.3659, 0, 0, 1, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "try:\n from oauth2client.crypt import Signer\n from oauth2client.crypt import make_signed_jwt\n from oauth2client.crypt import verify_signed_jwt_with_certs\n HAS_OPENSSL = True\nexcept ImportError:\n pass"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99080:ImportFrom_L38_C2", "label": "from oauth2client.crypt import Signer", "type": "import", "loc": [38, 38], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99080:Try_L37_C0", "vector": [1, 1, 0.0334, 0.0009, 1, 0.99, 0.0, 792, 0, 1, 0, 0, 792, 0, 0], "semantic": {"name": "oauth2client.crypt", "arg_names": [], "import_names": ["Signer"], "rhs_call_name": "", "annotation": ""}, "snippet": " from oauth2client.crypt import Signer"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99080:ImportFrom_L39_C2", "label": "from oauth2client.crypt import make_signed_jwt", "type": "import", "loc": [39, 39], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99080:Try_L37_C0", "vector": [1, 1, 0.0342, 0.0009, 1, 0.99, 0.3333, 792, 0, 1, 0, 0, 792, 0, 0], "semantic": {"name": "oauth2client.crypt", "arg_names": [], "import_names": ["make_signed_jwt"], "rhs_call_name": "", "annotation": ""}, "snippet": " from oauth2client.crypt import make_signed_jwt"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99080:ImportFrom_L40_C2", "label": "from oauth2client.crypt import verify_signed_jwt_with_certs", "type": "import", "loc": [40, 40], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99080:Try_L37_C0", "vector": [1, 1, 0.0351, 0.0009, 1, 0.99, 0.6667, 792, 0, 1, 0, 0, 792, 0, 0], "semantic": {"name": "oauth2client.crypt", "arg_names": [], "import_names": ["verify_signed_jwt_with_certs"], "rhs_call_name": "", "annotation": ""}, "snippet": " from oauth2client.crypt import verify_signed_jwt_with_certs"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99080:Assign_L41_C2", "label": "HAS_OPENSSL =", "type": "assigned_variable", "loc": [41, 41], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99080:Try_L37_C0", "vector": [14, 1, 0.036, 0.0009, 1, 0.99, 1.0, 62, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "HAS_OPENSSL", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " HAS_OPENSSL = True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99080:Try_L45_C0", "label": "try", "type": "try", "loc": [45, 48], "level": 0, "parent": null, "vector": [7, 0, 0.0408, 0.0035, 0, 0.66, 0.3902, 0, 0, 1, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "try:\n from urlparse import parse_qsl\nexcept ImportError:\n from cgi import parse_qsl"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99080:ImportFrom_L46_C2", "label": "from urlparse import parse_qsl", "type": "import", "loc": [46, 46], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99080:Try_L45_C0", "vector": [1, 1, 0.0404, 0.0009, 1, 0.04, 0.0, 857, 0, 1, 0, 0, 857, 0, 0], "semantic": {"name": "urlparse", "arg_names": [], "import_names": ["parse_qsl"], "rhs_call_name": "", "annotation": ""}, "snippet": " from urlparse import parse_qsl"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99080:ImportFrom_L48_C2", "label": "from cgi import parse_qsl", "type": "import", "loc": [48, 48], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99080:Try_L45_C0", "vector": [1, 1, 0.0421, 0.0009, 1, 0.04, 0.0, 934, 0, 1, 0, 0, 934, 0, 0], "semantic": {"name": "cgi", "arg_names": [], "import_names": ["parse_qsl"], "rhs_call_name": "", "annotation": ""}, "snippet": " from cgi import parse_qsl"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99080:Assign_L50_C0", "label": "logger = getLogger()", "type": "assigned_variable", "loc": [50, 50], "level": 0, "parent": null, "vector": [14, 0, 0.0439, 0.0009, 0, 0.66, 0.4146, 532, 3, 1, 0, 0, 71, 10, 1], "semantic": {"name": "logger", "arg_names": [], "import_names": [], "rhs_call_name": "getLogger", "annotation": ""}, "snippet": "logger = logging.getLogger(__name__)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99080:Assign_L53_C0", "label": "EXPIRY_FORMAT =", "type": "assigned_variable", "loc": [53, 53], "level": 0, "parent": null, "vector": [14, 0, 0.0465, 0.0009, 0, 0.66, 0.439, 87, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "EXPIRY_FORMAT", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "EXPIRY_FORMAT = '%Y-%m-%dT%H:%M:%SZ'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99080:Assign_L56_C0", "label": "ID_TOKEN_VERIFICATON_CERTS =", "type": "assigned_variable", "loc": [56, 56], "level": 0, "parent": null, "vector": [14, 0, 0.0492, 0.0009, 0, 0.66, 0.4634, 345, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "ID_TOKEN_VERIFICATON_CERTS", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "ID_TOKEN_VERIFICATON_CERTS = 'https://www.googleapis.com/oauth2/v1/certs'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99080:Assign_L59_C0", "label": "OOB_CALLBACK_URN =", "type": "assigned_variable", "loc": [59, 59], "level": 0, "parent": null, "vector": [14, 0, 0.0518, 0.0009, 0, 0.66, 0.4878, 667, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "OOB_CALLBACK_URN", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "OOB_CALLBACK_URN = 'urn:ietf:wg:oauth:2.0:oob'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99080:ClassDef_L62_C0", "label": "Error", "type": "class", "loc": [62, 64], "level": 0, "parent": null, "vector": [3, 0, 0.0553, 0.0026, 0, 0.66, 0.5122, 529, 0, 0, 0, 0, 645, 0, 0], "semantic": {"name": "Error", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class Error(Exception):\n \"\"\"Base error for this module.\"\"\"\n pass"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99080:Expr_L63_C2", "label": "expression", "type": "expression", "loc": [63, 63], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99080:ClassDef_L62_C0", "vector": [8, 1, 0.0553, 0.0009, 1, 0.25, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Base error for this module.\"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99080:ClassDef_L67_C0", "label": "FlowExchangeError", "type": "class", "loc": [67, 69], "level": 0, "parent": null, "vector": [3, 0, 0.0597, 0.0026, 0, 0.66, 0.5366, 369, 0, 0, 0, 0, 529, 0, 0], "semantic": {"name": "FlowExchangeError", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class FlowExchangeError(Error):\n \"\"\"Error trying to exchange an authorization grant for an access token.\"\"\"\n pass"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99080:Expr_L68_C2", "label": "expression", "type": "expression", "loc": [68, 68], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99080:ClassDef_L67_C0", "vector": [8, 1, 0.0597, 0.0009, 1, 0.01, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Error trying to exchange an authorization grant for an access token.\"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99080:ClassDef_L72_C0", "label": "AccessTokenRefreshError", "type": "class", "loc": [72, 74], "level": 0, "parent": null, "vector": [3, 0, 0.0641, 0.0026, 0, 0.66, 0.561, 773, 0, 0, 0, 0, 529, 0, 0], "semantic": {"name": "AccessTokenRefreshError", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class AccessTokenRefreshError(Error):\n \"\"\"Error trying to refresh an expired access token.\"\"\"\n pass"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99080:Expr_L73_C2", "label": "expression", "type": "expression", "loc": [73, 73], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99080:ClassDef_L72_C0", "vector": [8, 1, 0.0641, 0.0009, 1, 0.02, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Error trying to refresh an expired access token.\"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99080:ClassDef_L76_C0", "label": "UnknownClientSecretsFlowError", "type": "class", "loc": [76, 78], "level": 0, "parent": null, "vector": [3, 0, 0.0676, 0.0026, 0, 0.66, 0.5854, 728, 0, 0, 0, 0, 529, 0, 0], "semantic": {"name": "UnknownClientSecretsFlowError", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class UnknownClientSecretsFlowError(Error):\n \"\"\"The client secrets file called for an unknown type of OAuth 2.0 flow. \"\"\"\n pass"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99080:Expr_L77_C2", "label": "expression", "type": "expression", "loc": [77, 77], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99080:ClassDef_L76_C0", "vector": [8, 1, 0.0676, 0.0009, 1, 0.34, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"The client secrets file called for an unknown type of OAuth 2.0 flow. \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99080:ClassDef_L81_C0", "label": "AccessTokenCredentialsError", "type": "class", "loc": [81, 83], "level": 0, "parent": null, "vector": [3, 0, 0.072, 0.0026, 0, 0.66, 0.6098, 450, 0, 0, 0, 0, 529, 0, 0], "semantic": {"name": "AccessTokenCredentialsError", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class AccessTokenCredentialsError(Error):\n \"\"\"Having only the access_token means no refresh is possible.\"\"\"\n pass"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99080:Expr_L82_C2", "label": "expression", "type": "expression", "loc": [82, 82], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99080:ClassDef_L81_C0", "vector": [8, 1, 0.072, 0.0009, 1, 0.69, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Having only the access_token means no refresh is possible.\"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99080:ClassDef_L86_C0", "label": "VerifyJwtTokenError", "type": "class", "loc": [86, 88], "level": 0, "parent": null, "vector": [3, 0, 0.0764, 0.0026, 0, 0.66, 0.6341, 43, 0, 0, 0, 0, 529, 0, 0], "semantic": {"name": "VerifyJwtTokenError", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class VerifyJwtTokenError(Error):\n \"\"\"Could on retrieve certificates for validation.\"\"\"\n pass"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99080:Expr_L87_C2", "label": "expression", "type": "expression", "loc": [87, 87], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99080:ClassDef_L86_C0", "vector": [8, 1, 0.0764, 0.0009, 1, 0.94, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Could on retrieve certificates for validation.\"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L91_C0", "label": "_abstract", "type": "function", "loc": [91, 92], "level": 0, "parent": null, "vector": [2, 0, 0.0803, 0.0018, 0, 0.66, 0.6585, 629, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "_abstract", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def _abstract():\n raise NotImplementedError('You need to override this function')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99080:ClassDef_L95_C0", "label": "MemoryCache", "type": "class", "loc": [95, 108], "level": 0, "parent": null, "vector": [3, 0, 0.0891, 0.0123, 0, 0.66, 0.6829, 322, 0, 4, 0, 0, 186, 0, 2], "semantic": {"name": "MemoryCache", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class MemoryCache(object):\n \"\"\"httplib2 Cache implementation which only caches locally.\"\"\"\n\n def __init__(self):\n self.cache = {}\n\n def get(self, key):\n return self.cache.get(key)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99080:Expr_L96_C2", "label": "expression", "type": "expression", "loc": [96, 96], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99080:ClassDef_L95_C0", "vector": [8, 1, 0.0843, 0.0009, 1, 0.39, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"httplib2 Cache implementation which only caches locally.\"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L98_C2", "label": "__init__", "type": "function", "loc": [98, 99], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99080:ClassDef_L95_C0", "vector": [2, 1, 0.0865, 0.0018, 1, 0.39, 0.25, 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.cache = {}"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99080:Assign_L99_C4", "label": "self.cache =", "type": "assigned_variable", "loc": [99, 99], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L98_C2", "vector": [14, 2, 0.0869, 0.0009, 2, 0.92, 0.0, 55, 0, 0, 0, 0, 0, 6, 0], "semantic": {"name": "self.cache", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.cache = {}"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L101_C2", "label": "get", "type": "function", "loc": [101, 102], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99080:ClassDef_L95_C0", "vector": [2, 1, 0.0891, 0.0018, 1, 0.39, 0.5, 607, 0, 2, 1, 0, 0, 0, 1], "semantic": {"name": "get", "arg_names": ["self", "key"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def get(self, key):\n return self.cache.get(key)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99080:Return_L102_C4", "label": "return", "type": "return", "loc": [102, 102], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L101_C2", "vector": [13, 2, 0.0896, 0.0009, 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 self.cache.get(key)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L104_C2", "label": "set", "type": "function", "loc": [104, 105], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99080:ClassDef_L95_C0", "vector": [2, 1, 0.0917, 0.0018, 1, 0.39, 0.75, 21, 0, 3, 0, 0, 0, 0, 0], "semantic": {"name": "set", "arg_names": ["self", "key", "value"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def set(self, key, value):\n self.cache[key] = value"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99080:Assign_L105_C4", "label": "assign", "type": "assigned_variable", "loc": [105, 105], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L104_C2", "vector": [14, 2, 0.0922, 0.0009, 2, 0.66, 0.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.cache[key] = value"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L107_C2", "label": "delete", "type": "function", "loc": [107, 108], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99080:ClassDef_L95_C0", "vector": [2, 1, 0.0944, 0.0018, 1, 0.39, 1.0, 266, 0, 2, 0, 0, 0, 0, 1], "semantic": {"name": "delete", "arg_names": ["self", "key"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def delete(self, key):\n self.cache.pop(key, None)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99080:Expr_L108_C4", "label": "pop()", "type": "expression", "loc": [108, 108], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L107_C2", "vector": [8, 2, 0.0948, 0.0009, 2, 0.11, 0.0, 969, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "pop", "arg_names": [], "import_names": [], "rhs_call_name": "pop", "annotation": ""}, "snippet": " self.cache.pop(key, None)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99080:ClassDef_L111_C0", "label": "Credentials", "type": "class", "loc": [111, 219], "level": 0, "parent": null, "vector": [3, 0, 0.1449, 0.0957, 0, 0.66, 0.7073, 309, 0, 7, 0, 0, 186, 0, 19], "semantic": {"name": "Credentials", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class Credentials(object):\n \"\"\"Base class for all Credentials objects.\n\n Subclasses must define an authorize() method that applies the credentials to\n an HTTP transport.\n\n Subclasses must also specify a classmethod named 'from_json' that takes a JSON\n string as input and returns an instaniated Credentials object."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99080:Expr_L112_C2", "label": "expression", "type": "expression", "loc": [112, 119], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99080:ClassDef_L111_C0", "vector": [8, 1, 0.1014, 0.007, 1, 0.76, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Base class for all Credentials objects.\n\n Subclasses must define an authorize() method that applies the credentials to\n an HTTP transport.\n\n Subclasses must also specify a classmethod named 'from_json' that takes a JSON\n string as input and returns an instaniated Credentials object.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99080:Assign_L121_C2", "label": "NON_SERIALIZED_MEMBERS =", "type": "assigned_variable", "loc": [121, 121], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99080:ClassDef_L111_C0", "vector": [14, 1, 0.1062, 0.0009, 1, 0.76, 0.125, 192, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "NON_SERIALIZED_MEMBERS", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " NON_SERIALIZED_MEMBERS = ['store']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L123_C2", "label": "authorize", "type": "function", "loc": [123, 130], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99080:ClassDef_L111_C0", "vector": [2, 1, 0.1111, 0.007, 1, 0.76, 0.25, 880, 0, 2, 0, 0, 0, 0, 1], "semantic": {"name": "authorize", "arg_names": ["self", "http"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def authorize(self, http):\n \"\"\"Take an httplib2.Http instance (or equivalent) and\n authorizes it for the set of credentials, usually by\n replacing http.request() with a method that adds in\n the appropriate headers and then delegates to the original\n Http.request() method.\n \"\"\"\n _abstract()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99080:Expr_L124_C4", "label": "expression", "type": "expression", "loc": [124, 129], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L123_C2", "vector": [8, 2, 0.1111, 0.0053, 2, 0.7, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Take an httplib2.Http instance (or equivalent) and\n authorizes it for the set of credentials, usually by\n replacing http.request() with a method that adds in\n the appropriate headers and then delegates to the original\n Http.request() method.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99080:Expr_L130_C4", "label": "_abstract()", "type": "expression", "loc": [130, 130], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L123_C2", "vector": [8, 2, 0.1141, 0.0009, 2, 0.7, 1.0, 629, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "_abstract", "arg_names": [], "import_names": [], "rhs_call_name": "_abstract", "annotation": ""}, "snippet": " _abstract()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L132_C2", "label": "refresh", "type": "function", "loc": [132, 139], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99080:ClassDef_L111_C0", "vector": [2, 1, 0.119, 0.007, 1, 0.76, 0.375, 804, 0, 2, 0, 0, 0, 0, 1], "semantic": {"name": "refresh", "arg_names": ["self", "http"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def refresh(self, http):\n \"\"\"Forces a refresh of the access_token.\n\n Args:\n http: httplib2.Http, an http object to be used to make the refresh\n request.\n \"\"\"\n _abstract()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99080:Expr_L133_C4", "label": "expression", "type": "expression", "loc": [133, 138], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L132_C2", "vector": [8, 2, 0.119, 0.0053, 2, 0.86, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Forces a refresh of the access_token.\n\n Args:\n http: httplib2.Http, an http object to be used to make the refresh\n request.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99080:Expr_L139_C4", "label": "_abstract()", "type": "expression", "loc": [139, 139], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L132_C2", "vector": [8, 2, 0.122, 0.0009, 2, 0.86, 1.0, 629, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "_abstract", "arg_names": [], "import_names": [], "rhs_call_name": "_abstract", "annotation": ""}, "snippet": " _abstract()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L141_C2", "label": "apply", "type": "function", "loc": [141, 147], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99080:ClassDef_L111_C0", "vector": [2, 1, 0.1264, 0.0061, 1, 0.76, 0.5, 524, 0, 2, 0, 0, 0, 0, 1], "semantic": {"name": "apply", "arg_names": ["self", "headers"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def apply(self, headers):\n \"\"\"Add the authorization to the headers.\n\n Args:\n headers: dict, the headers to add the Authorization header to.\n \"\"\"\n _abstract()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99080:Expr_L142_C4", "label": "expression", "type": "expression", "loc": [142, 146], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L141_C2", "vector": [8, 2, 0.1264, 0.0044, 2, 0.4, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Add the authorization to the headers.\n\n Args:\n headers: dict, the headers to add the Authorization header to.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99080:Expr_L147_C4", "label": "_abstract()", "type": "expression", "loc": [147, 147], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L141_C2", "vector": [8, 2, 0.1291, 0.0009, 2, 0.4, 1.0, 629, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "_abstract", "arg_names": [], "import_names": [], "rhs_call_name": "_abstract", "annotation": ""}, "snippet": " _abstract()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L149_C2", "label": "_to_json", "type": "function", "loc": [149, 169], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99080:ClassDef_L111_C0", "vector": [2, 1, 0.1396, 0.0184, 1, 0.76, 0.625, 879, 0, 2, 1, 0, 0, 0, 5], "semantic": {"name": "_to_json", "arg_names": ["self", "strip"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _to_json(self, strip):\n \"\"\"Utility function for creating a JSON representation of an instance of Credentials.\n\n Args:\n strip: array, An array of names of members to not include in the JSON.\n\n Returns:\n string, a JSON representation of this instance, suitable to pass to"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99080:Expr_L150_C4", "label": "expression", "type": "expression", "loc": [150, 158], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L149_C2", "vector": [8, 2, 0.1352, 0.0079, 2, 0.08, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Utility function for creating a JSON representation of an instance of Credentials.\n\n Args:\n strip: array, An array of names of members to not include in the JSON.\n\n Returns:\n string, a JSON representation of this instance, suitable to pass to\n from_json()."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99080:Assign_L159_C4", "label": "t = type()", "type": "assigned_variable", "loc": [159, 159], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L149_C2", "vector": [14, 2, 0.1396, 0.0009, 2, 0.08, 0.1429, 15, 3, 1, 0, 0, 801, 10, 1], "semantic": {"name": "t", "arg_names": [], "import_names": [], "rhs_call_name": "type", "annotation": ""}, "snippet": " t = type(self)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99080:Assign_L160_C4", "label": "d = copy()", "type": "assigned_variable", "loc": [160, 160], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L149_C2", "vector": [14, 2, 0.1405, 0.0009, 2, 0.08, 0.2857, 355, 3, 1, 0, 0, 739, 10, 1], "semantic": {"name": "d", "arg_names": [], "import_names": [], "rhs_call_name": "copy", "annotation": ""}, "snippet": " d = copy.copy(self.__dict__)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99080:For_L161_C4", "label": "for member", "type": "for", "loc": [161, 163], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L149_C2", "vector": [6, 2, 0.1422, 0.0026, 2, 0.08, 0.4286, 150, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "member", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for member in strip:\n if member in d:\n del d[member]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99080:If_L162_C6", "label": "if", "type": "if", "loc": [162, 163], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99080:For_L161_C4", "vector": [4, 3, 0.1427, 0.0018, 3, 0.62, 0.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if member in d:\n del d[member]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99080:If_L164_C4", "label": "if", "type": "if", "loc": [164, 165], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L149_C2", "vector": [4, 2, 0.1444, 0.0018, 2, 0.08, 0.5714, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if 'token_expiry' in d and isinstance(d['token_expiry'], datetime.datetime):\n d['token_expiry'] = d['token_expiry'].strftime(EXPIRY_FORMAT)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99080:Assign_L165_C6", "label": " = strftime()", "type": "assigned_variable", "loc": [165, 165], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99080:If_L164_C4", "vector": [14, 3, 0.1449, 0.0009, 3, 0.23, 0.0, 0, 3, 1, 0, 0, 668, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "strftime", "annotation": ""}, "snippet": " d['token_expiry'] = d['token_expiry'].strftime(EXPIRY_FORMAT)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99080:Assign_L167_C4", "label": "assign", "type": "assigned_variable", "loc": [167, 167], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L149_C2", "vector": [14, 2, 0.1466, 0.0009, 2, 0.08, 0.7143, 0, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " d['_class'] = t.__name__"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99080:Assign_L168_C4", "label": "assign", "type": "assigned_variable", "loc": [168, 168], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L149_C2", "vector": [14, 2, 0.1475, 0.0009, 2, 0.08, 0.8571, 0, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " d['_module'] = t.__module__"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99080:Return_L169_C4", "label": "return", "type": "return", "loc": [169, 169], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L149_C2", "vector": [13, 2, 0.1484, 0.0009, 2, 0.08, 1.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return simplejson.dumps(d)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L171_C2", "label": "to_json", "type": "function", "loc": [171, 178], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99080:ClassDef_L111_C0", "vector": [2, 1, 0.1532, 0.007, 1, 0.76, 0.75, 287, 0, 1, 1, 0, 0, 0, 1], "semantic": {"name": "to_json", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def to_json(self):\n \"\"\"Creating a JSON representation of an instance of Credentials.\n\n Returns:\n string, a JSON representation of this instance, suitable to pass to\n from_json().\n \"\"\"\n return self._to_json(Credentials.NON_SERIALIZED_MEMBERS)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99080:Expr_L172_C4", "label": "expression", "type": "expression", "loc": [172, 177], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L171_C2", "vector": [8, 2, 0.1532, 0.0053, 2, 0.77, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Creating a JSON representation of an instance of Credentials.\n\n Returns:\n string, a JSON representation of this instance, suitable to pass to\n from_json().\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99080:Return_L178_C4", "label": "return", "type": "return", "loc": [178, 178], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L171_C2", "vector": [13, 2, 0.1563, 0.0009, 2, 0.77, 1.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self._to_json(Credentials.NON_SERIALIZED_MEMBERS)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L181_C2", "label": "new_from_json", "type": "function", "loc": [181, 205], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99080:ClassDef_L111_C0", "vector": [2, 1, 0.1694, 0.0219, 1, 0.76, 0.875, 495, 0, 2, 1, 0, 0, 0, 9], "semantic": {"name": "new_from_json", "arg_names": ["cls", "s"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def new_from_json(cls, s):\n \"\"\"Utility class method to instantiate a Credentials subclass from a JSON\n representation produced by to_json().\n\n Args:\n s: string, JSON from to_json().\n\n Returns:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99080:Expr_L182_C4", "label": "expression", "type": "expression", "loc": [182, 191], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L181_C2", "vector": [8, 2, 0.1637, 0.0088, 2, 0.81, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Utility class method to instantiate a Credentials subclass from a JSON\n representation produced by to_json().\n\n Args:\n s: string, JSON from to_json().\n\n Returns:\n An instance of the subclass of Credentials that was serialized with"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99080:Assign_L192_C4", "label": "data = loads()", "type": "assigned_variable", "loc": [192, 192], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L181_C2", "vector": [14, 2, 0.1686, 0.0009, 2, 0.81, 0.1429, 929, 3, 1, 0, 0, 88, 10, 1], "semantic": {"name": "data", "arg_names": [], "import_names": [], "rhs_call_name": "loads", "annotation": ""}, "snippet": " data = simplejson.loads(s)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99080:Assign_L194_C4", "label": "module =", "type": "assigned_variable", "loc": [194, 194], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L181_C2", "vector": [14, 2, 0.1703, 0.0009, 2, 0.81, 0.2857, 98, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "module", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " module = data['_module']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99080:Try_L195_C4", "label": "try", "type": "try", "loc": [195, 200], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L181_C2", "vector": [7, 2, 0.1734, 0.0053, 2, 0.81, 0.4286, 0, 0, 1, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " try:\n m = __import__(module)\n except ImportError:\n # In case there's an object from the old package structure, update it\n module = module.replace('.apiclient', '')\n m = __import__(module)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99080:Assign_L196_C6", "label": "m = __import__()", "type": "assigned_variable", "loc": [196, 196], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99080:Try_L195_C4", "vector": [14, 3, 0.1721, 0.0009, 3, 0.23, 0.0, 711, 3, 1, 0, 0, 744, 10, 1], "semantic": {"name": "m", "arg_names": [], "import_names": [], "rhs_call_name": "__import__", "annotation": ""}, "snippet": " m = __import__(module)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99080:Assign_L199_C6", "label": "module = replace()", "type": "assigned_variable", "loc": [199, 199], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99080:Try_L195_C4", "vector": [14, 3, 0.1747, 0.0009, 3, 0.23, 0.0, 98, 3, 2, 0, 0, 293, 10, 1], "semantic": {"name": "module", "arg_names": [], "import_names": [], "rhs_call_name": "replace", "annotation": ""}, "snippet": " module = module.replace('.apiclient', '')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99080:Assign_L200_C6", "label": "m = __import__()", "type": "assigned_variable", "loc": [200, 200], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99080:Try_L195_C4", "vector": [14, 3, 0.1756, 0.0009, 3, 0.23, 1.0, 711, 3, 1, 0, 0, 744, 10, 1], "semantic": {"name": "m", "arg_names": [], "import_names": [], "rhs_call_name": "__import__", "annotation": ""}, "snippet": " m = __import__(module)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99080:Assign_L202_C4", "label": "m = __import__()", "type": "assigned_variable", "loc": [202, 202], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L181_C2", "vector": [14, 2, 0.1773, 0.0009, 2, 0.81, 0.5714, 711, 3, 2, 0, 0, 744, 10, 2], "semantic": {"name": "m", "arg_names": [], "import_names": [], "rhs_call_name": "__import__", "annotation": ""}, "snippet": " m = __import__(module, fromlist=module.split('.')[:-1])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99080:Assign_L203_C4", "label": "kls = getattr()", "type": "assigned_variable", "loc": [203, 203], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L181_C2", "vector": [14, 2, 0.1782, 0.0009, 2, 0.81, 0.7143, 947, 3, 2, 0, 0, 121, 10, 1], "semantic": {"name": "kls", "arg_names": [], "import_names": [], "rhs_call_name": "getattr", "annotation": ""}, "snippet": " kls = getattr(m, data['_class'])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99080:Assign_L204_C4", "label": "from_json = getattr()", "type": "assigned_variable", "loc": [204, 204], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L181_C2", "vector": [14, 2, 0.1791, 0.0009, 2, 0.81, 0.8571, 975, 3, 2, 0, 0, 121, 10, 1], "semantic": {"name": "from_json", "arg_names": [], "import_names": [], "rhs_call_name": "getattr", "annotation": ""}, "snippet": " from_json = getattr(kls, 'from_json')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99080:Return_L205_C4", "label": "return", "type": "return", "loc": [205, 205], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L181_C2", "vector": [13, 2, 0.18, 0.0009, 2, 0.81, 1.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return from_json(s)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L208_C2", "label": "from_json", "type": "function", "loc": [208, 219], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99080:ClassDef_L111_C0", "vector": [2, 1, 0.1874, 0.0105, 1, 0.76, 1.0, 975, 0, 2, 1, 0, 0, 0, 1], "semantic": {"name": "from_json", "arg_names": ["cls", "s"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def from_json(cls, s):\n \"\"\"Instantiate a Credentials object from a JSON description of it.\n\n The JSON should have been produced by calling .to_json() on the object.\n\n Args:\n data: dict, A deserialized JSON object.\n"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99080:Expr_L209_C4", "label": "expression", "type": "expression", "loc": [209, 218], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L208_C2", "vector": [8, 2, 0.1874, 0.0088, 2, 0.78, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Instantiate a Credentials object from a JSON description of it.\n\n The JSON should have been produced by calling .to_json() on the object.\n\n Args:\n data: dict, A deserialized JSON object.\n\n Returns:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99080:Return_L219_C4", "label": "return", "type": "return", "loc": [219, 219], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L208_C2", "vector": [13, 2, 0.1923, 0.0009, 2, 0.78, 1.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return Credentials()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99080:ClassDef_L222_C0", "label": "Flow", "type": "class", "loc": [222, 224], "level": 0, "parent": null, "vector": [3, 0, 0.1958, 0.0026, 0, 0.66, 0.7317, 746, 0, 0, 0, 0, 186, 0, 0], "semantic": {"name": "Flow", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class Flow(object):\n \"\"\"Base class for all Flow objects.\"\"\"\n pass"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99080:Expr_L223_C2", "label": "expression", "type": "expression", "loc": [223, 223], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99080:ClassDef_L222_C0", "vector": [8, 1, 0.1958, 0.0009, 1, 0.76, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Base class for all Flow objects.\"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99080:ClassDef_L227_C0", "label": "Storage", "type": "class", "loc": [227, 318], "level": 0, "parent": null, "vector": [3, 0, 0.2392, 0.0808, 0, 0.66, 0.7561, 850, 0, 8, 0, 0, 186, 0, 12], "semantic": {"name": "Storage", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class Storage(object):\n \"\"\"Base class for all Storage objects.\n\n Store and retrieve a single credential. This class supports locking\n such that multiple processes and threads can operate on a single\n store.\n \"\"\"\n"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99080:Expr_L228_C2", "label": "expression", "type": "expression", "loc": [228, 233], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99080:ClassDef_L227_C0", "vector": [8, 1, 0.2024, 0.0053, 1, 0.38, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Base class for all Storage objects.\n\n Store and retrieve a single credential. This class supports locking\n such that multiple processes and threads can operate on a single\n store.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L235_C2", "label": "acquire_lock", "type": "function", "loc": [235, 240], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99080:ClassDef_L227_C0", "vector": [2, 1, 0.2085, 0.0053, 1, 0.38, 0.125, 5, 0, 1, 0, 0, 0, 0, 0], "semantic": {"name": "acquire_lock", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def acquire_lock(self):\n \"\"\"Acquires any lock necessary to access this Storage.\n\n This lock is not reentrant.\n \"\"\"\n pass"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99080:Expr_L236_C4", "label": "expression", "type": "expression", "loc": [236, 239], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L235_C2", "vector": [8, 2, 0.2085, 0.0035, 2, 0.3, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Acquires any lock necessary to access this Storage.\n\n This lock is not reentrant.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L242_C2", "label": "release_lock", "type": "function", "loc": [242, 248], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99080:ClassDef_L227_C0", "vector": [2, 1, 0.2151, 0.0061, 1, 0.38, 0.25, 821, 0, 1, 0, 0, 0, 0, 0], "semantic": {"name": "release_lock", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def release_lock(self):\n \"\"\"Release the Storage lock.\n\n Trying to release a lock that isn't held will result in a\n RuntimeError.\n \"\"\"\n pass"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99080:Expr_L243_C4", "label": "expression", "type": "expression", "loc": [243, 247], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L242_C2", "vector": [8, 2, 0.2151, 0.0044, 2, 0.5, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Release the Storage lock.\n\n Trying to release a lock that isn't held will result in a\n RuntimeError.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L250_C2", "label": "locked_get", "type": "function", "loc": [250, 258], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99080:ClassDef_L227_C0", "vector": [2, 1, 0.223, 0.0079, 1, 0.38, 0.375, 579, 0, 1, 0, 0, 0, 0, 1], "semantic": {"name": "locked_get", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def locked_get(self):\n \"\"\"Retrieve credential.\n\n The Storage lock must be held when this is called.\n\n Returns:\n oauth2client.client.Credentials\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99080:Expr_L251_C4", "label": "expression", "type": "expression", "loc": [251, 257], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L250_C2", "vector": [8, 2, 0.223, 0.0061, 2, 0.91, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Retrieve credential.\n\n The Storage lock must be held when this is called.\n\n Returns:\n oauth2client.client.Credentials\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99080:Expr_L258_C4", "label": "_abstract()", "type": "expression", "loc": [258, 258], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L250_C2", "vector": [8, 2, 0.2265, 0.0009, 2, 0.91, 1.0, 629, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "_abstract", "arg_names": [], "import_names": [], "rhs_call_name": "_abstract", "annotation": ""}, "snippet": " _abstract()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L260_C2", "label": "locked_put", "type": "function", "loc": [260, 268], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99080:ClassDef_L227_C0", "vector": [2, 1, 0.2318, 0.0079, 1, 0.38, 0.5, 154, 0, 2, 0, 0, 0, 0, 1], "semantic": {"name": "locked_put", "arg_names": ["self", "credentials"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def locked_put(self, credentials):\n \"\"\"Write a credential.\n\n The Storage lock must be held when this is called.\n\n Args:\n credentials: Credentials, the credentials to store.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99080:Expr_L261_C4", "label": "expression", "type": "expression", "loc": [261, 267], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L260_C2", "vector": [8, 2, 0.2318, 0.0061, 2, 0.43, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Write a credential.\n\n The Storage lock must be held when this is called.\n\n Args:\n credentials: Credentials, the credentials to store.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99080:Expr_L268_C4", "label": "_abstract()", "type": "expression", "loc": [268, 268], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L260_C2", "vector": [8, 2, 0.2353, 0.0009, 2, 0.43, 1.0, 629, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "_abstract", "arg_names": [], "import_names": [], "rhs_call_name": "_abstract", "annotation": ""}, "snippet": " _abstract()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L270_C2", "label": "locked_delete", "type": "function", "loc": [270, 275], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99080:ClassDef_L227_C0", "vector": [2, 1, 0.2392, 0.0053, 1, 0.38, 0.625, 769, 0, 1, 0, 0, 0, 0, 1], "semantic": {"name": "locked_delete", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def locked_delete(self):\n \"\"\"Delete a credential.\n\n The Storage lock must be held when this is called.\n \"\"\"\n _abstract()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99080:Expr_L271_C4", "label": "expression", "type": "expression", "loc": [271, 274], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L270_C2", "vector": [8, 2, 0.2392, 0.0035, 2, 0.84, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Delete a credential.\n\n The Storage lock must be held when this is called.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99080:Expr_L275_C4", "label": "_abstract()", "type": "expression", "loc": [275, 275], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L270_C2", "vector": [8, 2, 0.2414, 0.0009, 2, 0.84, 1.0, 629, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "_abstract", "arg_names": [], "import_names": [], "rhs_call_name": "_abstract", "annotation": ""}, "snippet": " _abstract()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L277_C2", "label": "get", "type": "function", "loc": [277, 289], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99080:ClassDef_L227_C0", "vector": [2, 1, 0.2485, 0.0114, 1, 0.38, 0.75, 607, 0, 1, 1, 0, 0, 0, 3], "semantic": {"name": "get", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def get(self):\n \"\"\"Retrieve credential.\n\n The Storage lock must *not* be held when this is called.\n\n Returns:\n oauth2client.client.Credentials\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99080:Expr_L278_C4", "label": "expression", "type": "expression", "loc": [278, 284], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L277_C2", "vector": [8, 2, 0.2467, 0.0061, 2, 0.11, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Retrieve credential.\n\n The Storage lock must *not* be held when this is called.\n\n Returns:\n oauth2client.client.Credentials\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99080:Expr_L285_C4", "label": "acquire_lock()", "type": "expression", "loc": [285, 285], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L277_C2", "vector": [8, 2, 0.2502, 0.0009, 2, 0.11, 0.5, 5, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "acquire_lock", "arg_names": [], "import_names": [], "rhs_call_name": "acquire_lock", "annotation": ""}, "snippet": " self.acquire_lock()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99080:Try_L286_C4", "label": "try", "type": "try", "loc": [286, 289], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L277_C2", "vector": [7, 2, 0.2524, 0.0035, 2, 0.11, 1.0, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " try:\n return self.locked_get()\n finally:\n self.release_lock()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99080:Return_L287_C6", "label": "return", "type": "return", "loc": [287, 287], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99080:Try_L286_C4", "vector": [13, 3, 0.252, 0.0009, 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 self.locked_get()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99080:Expr_L289_C6", "label": "release_lock()", "type": "expression", "loc": [289, 289], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99080:Try_L286_C4", "vector": [8, 3, 0.2537, 0.0009, 3, 0.72, 1.0, 821, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "release_lock", "arg_names": [], "import_names": [], "rhs_call_name": "release_lock", "annotation": ""}, "snippet": " self.release_lock()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L291_C2", "label": "put", "type": "function", "loc": [291, 303], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99080:ClassDef_L227_C0", "vector": [2, 1, 0.2608, 0.0114, 1, 0.38, 0.875, 636, 0, 2, 0, 0, 0, 0, 3], "semantic": {"name": "put", "arg_names": ["self", "credentials"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def put(self, credentials):\n \"\"\"Write a credential.\n\n The Storage lock must be held when this is called.\n\n Args:\n credentials: Credentials, the credentials to store.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99080:Expr_L292_C4", "label": "expression", "type": "expression", "loc": [292, 298], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L291_C2", "vector": [8, 2, 0.259, 0.0061, 2, 0.12, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Write a credential.\n\n The Storage lock must be held when this is called.\n\n Args:\n credentials: Credentials, the credentials to store.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99080:Expr_L299_C4", "label": "acquire_lock()", "type": "expression", "loc": [299, 299], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L291_C2", "vector": [8, 2, 0.2625, 0.0009, 2, 0.12, 0.5, 5, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "acquire_lock", "arg_names": [], "import_names": [], "rhs_call_name": "acquire_lock", "annotation": ""}, "snippet": " self.acquire_lock()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99080:Try_L300_C4", "label": "try", "type": "try", "loc": [300, 303], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L291_C2", "vector": [7, 2, 0.2647, 0.0035, 2, 0.12, 1.0, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " try:\n self.locked_put(credentials)\n finally:\n self.release_lock()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99080:Expr_L301_C6", "label": "locked_put()", "type": "expression", "loc": [301, 301], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99080:Try_L300_C4", "vector": [8, 3, 0.2643, 0.0009, 3, 0.06, 0.0, 154, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "locked_put", "arg_names": [], "import_names": [], "rhs_call_name": "locked_put", "annotation": ""}, "snippet": " self.locked_put(credentials)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99080:Expr_L303_C6", "label": "release_lock()", "type": "expression", "loc": [303, 303], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99080:Try_L300_C4", "vector": [8, 3, 0.266, 0.0009, 3, 0.06, 1.0, 821, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "release_lock", "arg_names": [], "import_names": [], "rhs_call_name": "release_lock", "annotation": ""}, "snippet": " self.release_lock()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L305_C2", "label": "delete", "type": "function", "loc": [305, 318], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99080:ClassDef_L227_C0", "vector": [2, 1, 0.2735, 0.0123, 1, 0.38, 1.0, 266, 0, 1, 1, 0, 0, 0, 3], "semantic": {"name": "delete", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def delete(self):\n \"\"\"Delete credential.\n\n Frees any resources associated with storing the credential.\n The Storage lock must *not* be held when this is called.\n\n Returns:\n None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99080:Expr_L306_C4", "label": "expression", "type": "expression", "loc": [306, 313], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L305_C2", "vector": [8, 2, 0.2717, 0.007, 2, 0.41, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Delete credential.\n\n Frees any resources associated with storing the credential.\n The Storage lock must *not* be held when this is called.\n\n Returns:\n None\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99080:Expr_L314_C4", "label": "acquire_lock()", "type": "expression", "loc": [314, 314], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L305_C2", "vector": [8, 2, 0.2757, 0.0009, 2, 0.41, 0.5, 5, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "acquire_lock", "arg_names": [], "import_names": [], "rhs_call_name": "acquire_lock", "annotation": ""}, "snippet": " self.acquire_lock()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99080:Try_L315_C4", "label": "try", "type": "try", "loc": [315, 318], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L305_C2", "vector": [7, 2, 0.2779, 0.0035, 2, 0.41, 1.0, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " try:\n return self.locked_delete()\n finally:\n self.release_lock()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99080:Return_L316_C6", "label": "return", "type": "return", "loc": [316, 316], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99080:Try_L315_C4", "vector": [13, 3, 0.2774, 0.0009, 3, 0.66, 0.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self.locked_delete()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99080:Expr_L318_C6", "label": "release_lock()", "type": "expression", "loc": [318, 318], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99080:Try_L315_C4", "vector": [8, 3, 0.2792, 0.0009, 3, 0.66, 1.0, 821, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "release_lock", "arg_names": [], "import_names": [], "rhs_call_name": "release_lock", "annotation": ""}, "snippet": " self.release_lock()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99080:ClassDef_L321_C0", "label": "OAuth2Credentials", "type": "class", "loc": [321, 625], "level": 0, "parent": null, "vector": [3, 0, 0.4153, 0.2678, 0, 0.66, 0.7805, 494, 0, 16, 0, 0, 309, 0, 44], "semantic": {"name": "OAuth2Credentials", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class OAuth2Credentials(Credentials):\n \"\"\"Credentials object for OAuth 2.0.\n\n Credentials can be applied to an httplib2.Http object using the authorize()\n method, which then adds the OAuth 2.0 access token to each request.\n\n OAuth2Credentials objects may be safely pickled and unpickled.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99080:Expr_L322_C2", "label": "expression", "type": "expression", "loc": [322, 328], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99080:ClassDef_L321_C0", "vector": [8, 1, 0.2853, 0.0061, 1, 0.72, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Credentials object for OAuth 2.0.\n\n Credentials can be applied to an httplib2.Http object using the authorize()\n method, which then adds the OAuth 2.0 access token to each request.\n\n OAuth2Credentials objects may be safely pickled and unpickled.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L330_C2", "label": "__init__", "type": "function", "loc": [330, 365], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99080:ClassDef_L321_C0", "vector": [2, 1, 0.3051, 0.0316, 1, 0.72, 0.0667, 555, 0, 9, 0, 0, 0, 0, 0], "semantic": {"name": "__init__", "arg_names": ["self", "access_token", "client_id", "client_secret", "refresh_token", "token_expiry", "token_uri", "user_agent", "id_token"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, access_token, client_id, client_secret, refresh_token,\n token_expiry, token_uri, user_agent, id_token=None):\n \"\"\"Create an instance of OAuth2Credentials.\n\n This constructor is not usually called by the user, instead\n OAuth2Credentials objects are instantiated by the OAuth2WebServerFlow.\n\n Args:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99080:Expr_L332_C4", "label": "expression", "type": "expression", "loc": [332, 352], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L330_C2", "vector": [8, 2, 0.3003, 0.0184, 2, 0.84, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Create an instance of OAuth2Credentials.\n\n This constructor is not usually called by the user, instead\n OAuth2Credentials objects are instantiated by the OAuth2WebServerFlow.\n\n Args:\n access_token: string, access token.\n client_id: string, client identifier."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99080:Assign_L353_C4", "label": "self.access_token =", "type": "assigned_variable", "loc": [353, 353], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L330_C2", "vector": [14, 2, 0.3099, 0.0009, 2, 0.84, 0.1, 909, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.access_token", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.access_token = access_token"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99080:Assign_L354_C4", "label": "self.client_id =", "type": "assigned_variable", "loc": [354, 354], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L330_C2", "vector": [14, 2, 0.3108, 0.0009, 2, 0.84, 0.2, 144, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.client_id", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.client_id = client_id"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99080:Assign_L355_C4", "label": "self.client_secret =", "type": "assigned_variable", "loc": [355, 355], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L330_C2", "vector": [14, 2, 0.3117, 0.0009, 2, 0.84, 0.3, 451, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.client_secret", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.client_secret = client_secret"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99080:Assign_L356_C4", "label": "self.refresh_token =", "type": "assigned_variable", "loc": [356, 356], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L330_C2", "vector": [14, 2, 0.3126, 0.0009, 2, 0.84, 0.4, 920, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.refresh_token", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.refresh_token = refresh_token"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99080:Assign_L357_C4", "label": "self.store =", "type": "assigned_variable", "loc": [357, 357], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L330_C2", "vector": [14, 2, 0.3134, 0.0009, 2, 0.84, 0.5, 375, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "self.store", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.store = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99080:Assign_L358_C4", "label": "self.token_expiry =", "type": "assigned_variable", "loc": [358, 358], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L330_C2", "vector": [14, 2, 0.3143, 0.0009, 2, 0.84, 0.6, 327, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.token_expiry", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.token_expiry = token_expiry"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99080:Assign_L359_C4", "label": "self.token_uri =", "type": "assigned_variable", "loc": [359, 359], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L330_C2", "vector": [14, 2, 0.3152, 0.0009, 2, 0.84, 0.7, 941, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.token_uri", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.token_uri = token_uri"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99080:Assign_L360_C4", "label": "self.user_agent =", "type": "assigned_variable", "loc": [360, 360], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L330_C2", "vector": [14, 2, 0.3161, 0.0009, 2, 0.84, 0.8, 723, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.user_agent", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.user_agent = user_agent"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99080:Assign_L361_C4", "label": "self.id_token =", "type": "assigned_variable", "loc": [361, 361], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L330_C2", "vector": [14, 2, 0.3169, 0.0009, 2, 0.84, 0.9, 326, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.id_token", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.id_token = id_token"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99080:Assign_L365_C4", "label": "self.invalid =", "type": "assigned_variable", "loc": [365, 365], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L330_C2", "vector": [14, 2, 0.3205, 0.0009, 2, 0.84, 1.0, 540, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "self.invalid", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.invalid = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L367_C2", "label": "authorize", "type": "function", "loc": [367, 434], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99080:ClassDef_L321_C0", "vector": [2, 1, 0.3516, 0.0597, 1, 0.72, 0.1333, 880, 0, 2, 1, 0, 0, 0, 9], "semantic": {"name": "authorize", "arg_names": ["self", "http"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def authorize(self, http):\n \"\"\"Authorize an httplib2.Http instance with these credentials.\n\n The modified http.request method will add authentication headers to each\n request and will refresh access_tokens when a 401 is received on a\n request. In addition the http.request method has a credentials property,\n http.request.credentials, which is the Credentials object that authorized\n it."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99080:Expr_L368_C4", "label": "expression", "type": "expression", "loc": [368, 393], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L367_C2", "vector": [8, 2, 0.3341, 0.0228, 2, 0.16, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Authorize an httplib2.Http instance with these credentials.\n\n The modified http.request method will add authentication headers to each\n request and will refresh access_tokens when a 401 is received on a\n request. In addition the http.request method has a credentials property,\n http.request.credentials, which is the Credentials object that authorized\n it.\n"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99080:Assign_L394_C4", "label": "request_orig =", "type": "assigned_variable", "loc": [394, 394], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L367_C2", "vector": [14, 2, 0.3459, 0.0009, 2, 0.16, 0.2, 112, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "request_orig", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " request_orig = http.request"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L397_C4", "label": "new_request", "type": "function", "loc": [397, 426], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L367_C2", "vector": [2, 2, 0.3613, 0.0263, 2, 0.16, 0.4, 23, 0, 6, 1, 0, 0, 0, 8], "semantic": {"name": "new_request", "arg_names": ["uri", "method", "body", "headers", "redirections", "connection_type"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def new_request(uri, method='GET', body=None, headers=None,\n redirections=httplib2.DEFAULT_MAX_REDIRECTS,\n connection_type=None):\n if not self.access_token:\n logger.info('Attempting refresh to obtain initial access_token')\n self._refresh(request_orig)\n\n # Modify the request headers to add the appropriate"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99080:If_L400_C6", "label": "if", "type": "if", "loc": [400, 402], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L397_C4", "vector": [4, 3, 0.3521, 0.0026, 3, 0.09, 0.0, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not self.access_token:\n logger.info('Attempting refresh to obtain initial access_token')\n self._refresh(request_orig)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99080:Expr_L401_C8", "label": "info()", "type": "expression", "loc": [401, 401], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99080:If_L400_C6", "vector": [8, 4, 0.3521, 0.0009, 4, 0.03, 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('Attempting refresh to obtain initial access_token')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99080:Expr_L402_C8", "label": "_refresh()", "type": "expression", "loc": [402, 402], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99080:If_L400_C6", "vector": [8, 4, 0.3529, 0.0009, 4, 0.03, 1.0, 770, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "_refresh", "arg_names": [], "import_names": [], "rhs_call_name": "_refresh", "annotation": ""}, "snippet": " self._refresh(request_orig)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99080:If_L406_C6", "label": "if", "type": "if", "loc": [406, 407], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L397_C4", "vector": [4, 3, 0.3569, 0.0018, 3, 0.09, 0.2, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if headers is None:\n headers = {}"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99080:Assign_L407_C8", "label": "headers =", "type": "assigned_variable", "loc": [407, 407], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99080:If_L406_C6", "vector": [14, 4, 0.3573, 0.0009, 4, 0.47, 0.0, 950, 0, 0, 0, 0, 0, 6, 0], "semantic": {"name": "headers", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " headers = {}"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99080:Expr_L408_C6", "label": "apply()", "type": "expression", "loc": [408, 408], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L397_C4", "vector": [8, 3, 0.3582, 0.0009, 3, 0.09, 0.4, 524, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "apply", "arg_names": [], "import_names": [], "rhs_call_name": "apply", "annotation": ""}, "snippet": " self.apply(headers)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99080:If_L410_C6", "label": "if", "type": "if", "loc": [410, 414], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L397_C4", "vector": [4, 3, 0.3617, 0.0044, 3, 0.09, 0.6, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self.user_agent is not None:\n if 'user-agent' in headers:\n headers['user-agent'] = self.user_agent + ' ' + headers['user-agent']\n else:\n headers['user-agent'] = self.user_agent"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99080:If_L411_C8", "label": "if", "type": "if", "loc": [411, 414], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99080:If_L410_C6", "vector": [4, 4, 0.3622, 0.0035, 4, 0.19, 0.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if 'user-agent' in headers:\n headers['user-agent'] = self.user_agent + ' ' + headers['user-agent']\n else:\n headers['user-agent'] = self.user_agent"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99080:Assign_L412_C10", "label": "assign", "type": "assigned_variable", "loc": [412, 412], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99080:If_L411_C8", "vector": [14, 5, 0.3617, 0.0009, 5, 0.53, 0.0, 0, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " headers['user-agent'] = self.user_agent + ' ' + headers['user-agent']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99080:Assign_L414_C10", "label": "assign", "type": "assigned_variable", "loc": [414, 414], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99080:If_L411_C8", "vector": [14, 5, 0.3635, 0.0009, 5, 0.53, 1.0, 0, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " headers['user-agent'] = self.user_agent"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99080:Assign_L416_C6", "label": "resp, content = request_orig()", "type": "assigned_variable", "loc": [416, 417], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L397_C4", "vector": [14, 3, 0.3657, 0.0018, 3, 0.09, 0.8, 339, 3, 6, 0, 0, 112, 10, 1], "semantic": {"name": "resp, content", "arg_names": [], "import_names": [], "rhs_call_name": "request_orig", "annotation": ""}, "snippet": " resp, content = request_orig(uri, method, body, headers,\n redirections, connection_type)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99080:If_L419_C6", "label": "if", "type": "if", "loc": [419, 426], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L397_C4", "vector": [4, 3, 0.3709, 0.007, 3, 0.09, 1.0, 0, 0, 0, 0, 0, 0, 0, 4], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if resp.status == 401:\n logger.info('Refreshing due to a 401')\n self._refresh(request_orig)\n self.apply(headers)\n return request_orig(uri, method, body, headers,\n redirections, connection_type)\n else:\n return (resp, content)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99080:Expr_L420_C8", "label": "info()", "type": "expression", "loc": [420, 420], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99080:If_L419_C6", "vector": [8, 4, 0.3687, 0.0009, 4, 0.37, 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('Refreshing due to a 401')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99080:Expr_L421_C8", "label": "_refresh()", "type": "expression", "loc": [421, 421], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99080:If_L419_C6", "vector": [8, 4, 0.3696, 0.0009, 4, 0.37, 0.25, 770, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "_refresh", "arg_names": [], "import_names": [], "rhs_call_name": "_refresh", "annotation": ""}, "snippet": " self._refresh(request_orig)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99080:Expr_L422_C8", "label": "apply()", "type": "expression", "loc": [422, 422], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99080:If_L419_C6", "vector": [8, 4, 0.3705, 0.0009, 4, 0.37, 0.5, 524, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "apply", "arg_names": [], "import_names": [], "rhs_call_name": "apply", "annotation": ""}, "snippet": " self.apply(headers)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99080:Return_L423_C8", "label": "return", "type": "return", "loc": [423, 424], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99080:If_L419_C6", "vector": [13, 4, 0.3718, 0.0018, 4, 0.37, 0.75, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return request_orig(uri, method, body, headers,\n redirections, connection_type)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99080:Return_L426_C8", "label": "return", "type": "return", "loc": [426, 426], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99080:If_L419_C6", "vector": [13, 4, 0.374, 0.0009, 4, 0.37, 1.0, 0, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return (resp, content)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99080:Assign_L429_C4", "label": "http.request =", "type": "assigned_variable", "loc": [429, 429], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L367_C2", "vector": [14, 2, 0.3766, 0.0009, 2, 0.16, 0.6, 47, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "http.request", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " http.request = new_request"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99080:Expr_L432_C4", "label": "setattr()", "type": "expression", "loc": [432, 432], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L367_C2", "vector": [8, 2, 0.3793, 0.0009, 2, 0.16, 0.8, 501, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "setattr", "arg_names": [], "import_names": [], "rhs_call_name": "setattr", "annotation": ""}, "snippet": " setattr(http.request, 'credentials', self)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99080:Return_L434_C4", "label": "return", "type": "return", "loc": [434, 434], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L367_C2", "vector": [13, 2, 0.381, 0.0009, 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 http"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L436_C2", "label": "refresh", "type": "function", "loc": [436, 443], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99080:ClassDef_L321_C0", "vector": [2, 1, 0.3859, 0.007, 1, 0.72, 0.2, 804, 0, 2, 0, 0, 0, 0, 1], "semantic": {"name": "refresh", "arg_names": ["self", "http"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def refresh(self, http):\n \"\"\"Forces a refresh of the access_token.\n\n Args:\n http: httplib2.Http, an http object to be used to make the refresh\n request.\n \"\"\"\n self._refresh(http.request)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99080:Expr_L437_C4", "label": "expression", "type": "expression", "loc": [437, 442], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L436_C2", "vector": [8, 2, 0.3859, 0.0053, 2, 0.98, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Forces a refresh of the access_token.\n\n Args:\n http: httplib2.Http, an http object to be used to make the refresh\n request.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99080:Expr_L443_C4", "label": "_refresh()", "type": "expression", "loc": [443, 443], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L436_C2", "vector": [8, 2, 0.3889, 0.0009, 2, 0.98, 1.0, 770, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "_refresh", "arg_names": [], "import_names": [], "rhs_call_name": "_refresh", "annotation": ""}, "snippet": " self._refresh(http.request)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L445_C2", "label": "apply", "type": "function", "loc": [445, 451], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99080:ClassDef_L321_C0", "vector": [2, 1, 0.3933, 0.0061, 1, 0.72, 0.2667, 524, 0, 2, 0, 0, 0, 0, 0], "semantic": {"name": "apply", "arg_names": ["self", "headers"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def apply(self, headers):\n \"\"\"Add the authorization to the headers.\n\n Args:\n headers: dict, the headers to add the Authorization header to.\n \"\"\"\n headers['Authorization'] = 'Bearer ' + self.access_token"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99080:Expr_L446_C4", "label": "expression", "type": "expression", "loc": [446, 450], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L445_C2", "vector": [8, 2, 0.3933, 0.0044, 2, 0.12, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Add the authorization to the headers.\n\n Args:\n headers: dict, the headers to add the Authorization header to.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99080:Assign_L451_C4", "label": "assign", "type": "assigned_variable", "loc": [451, 451], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L445_C2", "vector": [14, 2, 0.396, 0.0009, 2, 0.12, 1.0, 0, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " headers['Authorization'] = 'Bearer ' + self.access_token"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L453_C2", "label": "to_json", "type": "function", "loc": [453, 454], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99080:ClassDef_L321_C0", "vector": [2, 1, 0.3982, 0.0018, 1, 0.72, 0.3333, 287, 0, 1, 1, 0, 0, 0, 1], "semantic": {"name": "to_json", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def to_json(self):\n return self._to_json(Credentials.NON_SERIALIZED_MEMBERS)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99080:Return_L454_C4", "label": "return", "type": "return", "loc": [454, 454], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L453_C2", "vector": [13, 2, 0.3986, 0.0009, 2, 0.74, 0.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self._to_json(Credentials.NON_SERIALIZED_MEMBERS)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L457_C2", "label": "from_json", "type": "function", "loc": [457, 485], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99080:ClassDef_L321_C0", "vector": [2, 1, 0.4135, 0.0255, 1, 0.72, 0.4, 975, 0, 2, 1, 0, 0, 0, 5], "semantic": {"name": "from_json", "arg_names": ["cls", "s"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def from_json(cls, s):\n \"\"\"Instantiate a Credentials object from a JSON description of it. The JSON\n should have been produced by calling .to_json() on the object.\n\n Args:\n data: dict, A deserialized JSON object.\n\n Returns:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99080:Expr_L458_C4", "label": "expression", "type": "expression", "loc": [458, 466], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L457_C2", "vector": [8, 2, 0.4056, 0.0079, 2, 0.05, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Instantiate a Credentials object from a JSON description of it. The JSON\n should have been produced by calling .to_json() on the object.\n\n Args:\n data: dict, A deserialized JSON object.\n\n Returns:\n An instance of a Credentials subclass."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99080:Assign_L467_C4", "label": "data = loads()", "type": "assigned_variable", "loc": [467, 467], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L457_C2", "vector": [14, 2, 0.41, 0.0009, 2, 0.05, 0.2, 929, 3, 1, 0, 0, 88, 10, 1], "semantic": {"name": "data", "arg_names": [], "import_names": [], "rhs_call_name": "loads", "annotation": ""}, "snippet": " data = simplejson.loads(s)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99080:If_L468_C4", "label": "if", "type": "if", "loc": [468, 474], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L457_C2", "vector": [4, 2, 0.4135, 0.0061, 2, 0.05, 0.4, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if 'token_expiry' in data and not isinstance(data['token_expiry'],\n datetime.datetime):\n try:\n data['token_expiry'] = datetime.datetime.strptime(\n data['token_expiry'], EXPIRY_FORMAT)\n except:\n data['token_expiry'] = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99080:Try_L470_C6", "label": "try", "type": "try", "loc": [470, 474], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99080:If_L468_C4", "vector": [7, 3, 0.4144, 0.0044, 3, 0.93, 0.0, 0, 0, 1, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " try:\n data['token_expiry'] = datetime.datetime.strptime(\n data['token_expiry'], EXPIRY_FORMAT)\n except:\n data['token_expiry'] = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99080:Assign_L471_C8", "label": " = strptime()", "type": "assigned_variable", "loc": [471, 472], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99080:Try_L470_C6", "vector": [14, 4, 0.414, 0.0018, 4, 0.35, 0.0, 0, 3, 2, 0, 0, 839, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "strptime", "annotation": ""}, "snippet": " data['token_expiry'] = datetime.datetime.strptime(\n data['token_expiry'], EXPIRY_FORMAT)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99080:Assign_L474_C8", "label": "assign", "type": "assigned_variable", "loc": [474, 474], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99080:Try_L470_C6", "vector": [14, 4, 0.4162, 0.0009, 4, 0.35, 0.0, 0, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " data['token_expiry'] = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99080:Assign_L475_C4", "label": "retval = OAuth2Credentials()", "type": "assigned_variable", "loc": [475, 483], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L457_C2", "vector": [14, 2, 0.4205, 0.0079, 2, 0.05, 0.6, 991, 3, 8, 0, 0, 494, 10, 2], "semantic": {"name": "retval", "arg_names": [], "import_names": [], "rhs_call_name": "OAuth2Credentials", "annotation": ""}, "snippet": " retval = OAuth2Credentials(\n data['access_token'],\n data['client_id'],\n data['client_secret'],\n data['refresh_token'],\n data['token_expiry'],\n data['token_uri'],\n data['user_agent'],"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99080:Assign_L484_C4", "label": "retval.invalid =", "type": "assigned_variable", "loc": [484, 484], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L457_C2", "vector": [14, 2, 0.4249, 0.0009, 2, 0.05, 0.8, 900, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "retval.invalid", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " retval.invalid = data['invalid']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99080:Return_L485_C4", "label": "return", "type": "return", "loc": [485, 485], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L457_C2", "vector": [13, 2, 0.4258, 0.0009, 2, 0.05, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return retval"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L488_C2", "label": "access_token_expired", "type": "function", "loc": [488, 504], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99080:ClassDef_L321_C0", "vector": [2, 1, 0.4355, 0.0149, 1, 0.72, 0.4667, 722, 0, 1, 1, 0, 0, 0, 2], "semantic": {"name": "access_token_expired", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def access_token_expired(self):\n \"\"\"True if the credential is expired or invalid.\n\n If the token_expiry isn't set, we assume the token doesn't expire.\n \"\"\"\n if self.invalid:\n return True\n"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99080:Expr_L489_C4", "label": "expression", "type": "expression", "loc": [489, 492], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L488_C2", "vector": [8, 2, 0.4306, 0.0035, 2, 0.09, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"True if the credential is expired or invalid.\n\n If the token_expiry isn't set, we assume the token doesn't expire.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99080:If_L493_C4", "label": "if", "type": "if", "loc": [493, 494], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L488_C2", "vector": [4, 2, 0.4333, 0.0018, 2, 0.09, 0.2, 0, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self.invalid:\n return True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99080:Return_L494_C6", "label": "return", "type": "return", "loc": [494, 494], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99080:If_L493_C4", "vector": [13, 3, 0.4337, 0.0009, 3, 0.97, 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_99080:If_L496_C4", "label": "if", "type": "if", "loc": [496, 497], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L488_C2", "vector": [4, 2, 0.4359, 0.0018, 2, 0.09, 0.4, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not self.token_expiry:\n return False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99080:Return_L497_C6", "label": "return", "type": "return", "loc": [497, 497], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99080:If_L496_C4", "vector": [13, 3, 0.4363, 0.0009, 3, 0.2, 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_99080:Assign_L499_C4", "label": "now = utcnow()", "type": "assigned_variable", "loc": [499, 499], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L488_C2", "vector": [14, 2, 0.4381, 0.0009, 2, 0.09, 0.6, 894, 3, 0, 0, 0, 394, 10, 1], "semantic": {"name": "now", "arg_names": [], "import_names": [], "rhs_call_name": "utcnow", "annotation": ""}, "snippet": " now = datetime.datetime.utcnow()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99080:If_L500_C4", "label": "if", "type": "if", "loc": [500, 503], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L488_C2", "vector": [4, 2, 0.4403, 0.0035, 2, 0.09, 0.8, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if now >= self.token_expiry:\n logger.info('access_token is expired. Now: %s, token_expiry: %s',\n now, self.token_expiry)\n return True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99080:Expr_L501_C6", "label": "info()", "type": "expression", "loc": [501, 502], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99080:If_L500_C4", "vector": [8, 3, 0.4403, 0.0018, 3, 0.97, 0.0, 730, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "info", "arg_names": [], "import_names": [], "rhs_call_name": "info", "annotation": ""}, "snippet": " logger.info('access_token is expired. Now: %s, token_expiry: %s',\n now, self.token_expiry)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99080:Return_L503_C6", "label": "return", "type": "return", "loc": [503, 503], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99080:If_L500_C4", "vector": [13, 3, 0.4416, 0.0009, 3, 0.97, 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_99080:Return_L504_C4", "label": "return", "type": "return", "loc": [504, 504], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L488_C2", "vector": [13, 2, 0.4425, 0.0009, 2, 0.09, 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_99080:FunctionDef_L506_C2", "label": "set_store", "type": "function", "loc": [506, 516], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99080:ClassDef_L321_C0", "vector": [2, 1, 0.4486, 0.0097, 1, 0.72, 0.5333, 939, 0, 2, 0, 0, 0, 0, 0], "semantic": {"name": "set_store", "arg_names": ["self", "store"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def set_store(self, store):\n \"\"\"Set the Storage for the credential.\n\n Args:\n store: Storage, an implementation of Stroage object.\n This is needed to store the latest access_token if it\n has expired and been refreshed. This implementation uses\n locking to check for updates before updating the"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99080:Expr_L507_C4", "label": "expression", "type": "expression", "loc": [507, 515], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L506_C2", "vector": [8, 2, 0.4486, 0.0079, 2, 0.29, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Set the Storage for the credential.\n\n Args:\n store: Storage, an implementation of Stroage object.\n This is needed to store the latest access_token if it\n has expired and been refreshed. This implementation uses\n locking to check for updates before updating the\n access_token."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99080:Assign_L516_C4", "label": "self.store =", "type": "assigned_variable", "loc": [516, 516], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L506_C2", "vector": [14, 2, 0.453, 0.0009, 2, 0.29, 1.0, 375, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.store", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.store = store"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L518_C2", "label": "_updateFromCredential", "type": "function", "loc": [518, 520], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99080:ClassDef_L321_C0", "vector": [2, 1, 0.4557, 0.0026, 1, 0.72, 0.6, 49, 0, 2, 0, 0, 0, 0, 2], "semantic": {"name": "_updateFromCredential", "arg_names": ["self", "other"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _updateFromCredential(self, other):\n \"\"\"Update this Credential from another instance.\"\"\"\n self.__dict__.update(other.__getstate__())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99080:Expr_L519_C4", "label": "expression", "type": "expression", "loc": [519, 519], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L518_C2", "vector": [8, 2, 0.4557, 0.0009, 2, 0.72, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Update this Credential from another instance.\"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99080:Expr_L520_C4", "label": "update()", "type": "expression", "loc": [520, 520], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L518_C2", "vector": [8, 2, 0.4565, 0.0009, 2, 0.72, 1.0, 637, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "update", "arg_names": [], "import_names": [], "rhs_call_name": "update", "annotation": ""}, "snippet": " self.__dict__.update(other.__getstate__())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L522_C2", "label": "__getstate__", "type": "function", "loc": [522, 526], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99080:ClassDef_L321_C0", "vector": [2, 1, 0.4601, 0.0044, 1, 0.72, 0.6667, 250, 0, 1, 1, 0, 0, 0, 1], "semantic": {"name": "__getstate__", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __getstate__(self):\n \"\"\"Trim the state down to something that can be pickled.\"\"\"\n d = copy.copy(self.__dict__)\n del d['store']\n return d"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99080:Expr_L523_C4", "label": "expression", "type": "expression", "loc": [523, 523], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L522_C2", "vector": [8, 2, 0.4592, 0.0009, 2, 0.92, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Trim the state down to something that can be pickled.\"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99080:Assign_L524_C4", "label": "d = copy()", "type": "assigned_variable", "loc": [524, 524], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L522_C2", "vector": [14, 2, 0.4601, 0.0009, 2, 0.92, 0.5, 355, 3, 1, 0, 0, 739, 10, 1], "semantic": {"name": "d", "arg_names": [], "import_names": [], "rhs_call_name": "copy", "annotation": ""}, "snippet": " d = copy.copy(self.__dict__)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99080:Return_L526_C4", "label": "return", "type": "return", "loc": [526, 526], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L522_C2", "vector": [13, 2, 0.4618, 0.0009, 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 d"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L528_C2", "label": "__setstate__", "type": "function", "loc": [528, 531], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99080:ClassDef_L321_C0", "vector": [2, 1, 0.4649, 0.0035, 1, 0.72, 0.7333, 698, 0, 2, 0, 0, 0, 0, 1], "semantic": {"name": "__setstate__", "arg_names": ["self", "state"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __setstate__(self, state):\n \"\"\"Reconstitute the state of the object from being pickled.\"\"\"\n self.__dict__.update(state)\n self.store = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99080:Expr_L529_C4", "label": "expression", "type": "expression", "loc": [529, 529], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L528_C2", "vector": [8, 2, 0.4644, 0.0009, 2, 0.2, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Reconstitute the state of the object from being pickled.\"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99080:Expr_L530_C4", "label": "update()", "type": "expression", "loc": [530, 530], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L528_C2", "vector": [8, 2, 0.4653, 0.0009, 2, 0.2, 0.5, 637, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "update", "arg_names": [], "import_names": [], "rhs_call_name": "update", "annotation": ""}, "snippet": " self.__dict__.update(state)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99080:Assign_L531_C4", "label": "self.store =", "type": "assigned_variable", "loc": [531, 531], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L528_C2", "vector": [14, 2, 0.4662, 0.0009, 2, 0.2, 1.0, 375, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "self.store", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.store = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L533_C2", "label": "_generate_refresh_request_body", "type": "function", "loc": [533, 541], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99080:ClassDef_L321_C0", "vector": [2, 1, 0.4715, 0.0079, 1, 0.72, 0.8, 776, 0, 1, 1, 0, 0, 0, 1], "semantic": {"name": "_generate_refresh_request_body", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _generate_refresh_request_body(self):\n \"\"\"Generate the body that will be used in the refresh request.\"\"\"\n body = urllib.urlencode({\n 'grant_type': 'refresh_token',\n 'client_id': self.client_id,\n 'client_secret': self.client_secret,\n 'refresh_token': self.refresh_token,\n })"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99080:Expr_L534_C4", "label": "expression", "type": "expression", "loc": [534, 534], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L533_C2", "vector": [8, 2, 0.4688, 0.0009, 2, 0.34, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Generate the body that will be used in the refresh request.\"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99080:Assign_L535_C4", "label": "body = urlencode()", "type": "assigned_variable", "loc": [535, 540], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L533_C2", "vector": [14, 2, 0.4719, 0.0053, 2, 0.34, 0.5, 477, 3, 1, 0, 0, 414, 10, 1], "semantic": {"name": "body", "arg_names": [], "import_names": [], "rhs_call_name": "urlencode", "annotation": ""}, "snippet": " body = urllib.urlencode({\n 'grant_type': 'refresh_token',\n 'client_id': self.client_id,\n 'client_secret': self.client_secret,\n 'refresh_token': self.refresh_token,\n })"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99080:Return_L541_C4", "label": "return", "type": "return", "loc": [541, 541], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L533_C2", "vector": [13, 2, 0.475, 0.0009, 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 body"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L543_C2", "label": "_generate_refresh_request_headers", "type": "function", "loc": [543, 552], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99080:ClassDef_L321_C0", "vector": [2, 1, 0.4807, 0.0088, 1, 0.72, 0.8667, 498, 0, 1, 1, 0, 0, 0, 0], "semantic": {"name": "_generate_refresh_request_headers", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _generate_refresh_request_headers(self):\n \"\"\"Generate the headers that will be used in the refresh request.\"\"\"\n headers = {\n 'content-type': 'application/x-www-form-urlencoded',\n }\n\n if self.user_agent is not None:\n headers['user-agent'] = self.user_agent"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99080:Expr_L544_C4", "label": "expression", "type": "expression", "loc": [544, 544], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L543_C2", "vector": [8, 2, 0.4776, 0.0009, 2, 0.4, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Generate the headers that will be used in the refresh request.\"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99080:Assign_L545_C4", "label": "headers =", "type": "assigned_variable", "loc": [545, 547], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L543_C2", "vector": [14, 2, 0.4794, 0.0026, 2, 0.4, 0.3333, 950, 0, 0, 0, 0, 0, 6, 0], "semantic": {"name": "headers", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " headers = {\n 'content-type': 'application/x-www-form-urlencoded',\n }"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99080:If_L549_C4", "label": "if", "type": "if", "loc": [549, 550], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L543_C2", "vector": [4, 2, 0.4824, 0.0018, 2, 0.4, 0.6667, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self.user_agent is not None:\n headers['user-agent'] = self.user_agent"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99080:Assign_L550_C6", "label": "assign", "type": "assigned_variable", "loc": [550, 550], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99080:If_L549_C4", "vector": [14, 3, 0.4829, 0.0009, 3, 0.15, 0.0, 0, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " headers['user-agent'] = self.user_agent"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99080:Return_L552_C4", "label": "return", "type": "return", "loc": [552, 552], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L543_C2", "vector": [13, 2, 0.4846, 0.0009, 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 headers"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L554_C2", "label": "_refresh", "type": "function", "loc": [554, 581], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99080:ClassDef_L321_C0", "vector": [2, 1, 0.4982, 0.0246, 1, 0.72, 0.9333, 770, 0, 2, 0, 0, 0, 0, 7], "semantic": {"name": "_refresh", "arg_names": ["self", "http_request"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _refresh(self, http_request):\n \"\"\"Refreshes the access_token.\n\n This method first checks by reading the Storage object if available.\n If a refresh is still needed, it holds the Storage lock until the\n refresh is completed.\n\n Args:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99080:Expr_L555_C4", "label": "expression", "type": "expression", "loc": [555, 567], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L554_C2", "vector": [8, 2, 0.4925, 0.0114, 2, 0.28, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Refreshes the access_token.\n\n This method first checks by reading the Storage object if available.\n If a refresh is still needed, it holds the Storage lock until the\n refresh is completed.\n\n Args:\n http_request: callable, a callable that matches the method signature of"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99080:If_L568_C4", "label": "if", "type": "if", "loc": [568, 581], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L554_C2", "vector": [4, 2, 0.5044, 0.0123, 2, 0.28, 1.0, 0, 0, 0, 0, 0, 0, 0, 7], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not self.store:\n self._do_refresh_request(http_request)\n else:\n self.store.acquire_lock()\n try:\n new_cred = self.store.locked_get()\n if (new_cred and not new_cred.invalid and\n new_cred.access_token != self.access_token):"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99080:Expr_L569_C6", "label": "_do_refresh_request()", "type": "expression", "loc": [569, 569], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99080:If_L568_C4", "vector": [8, 3, 0.4996, 0.0009, 3, 0.99, 0.0, 85, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "_do_refresh_request", "arg_names": [], "import_names": [], "rhs_call_name": "_do_refresh_request", "annotation": ""}, "snippet": " self._do_refresh_request(http_request)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99080:Expr_L571_C6", "label": "acquire_lock()", "type": "expression", "loc": [571, 571], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99080:If_L568_C4", "vector": [8, 3, 0.5013, 0.0009, 3, 0.99, 0.5, 5, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "acquire_lock", "arg_names": [], "import_names": [], "rhs_call_name": "acquire_lock", "annotation": ""}, "snippet": " self.store.acquire_lock()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99080:Try_L572_C6", "label": "try", "type": "try", "loc": [572, 581], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99080:If_L568_C4", "vector": [7, 3, 0.5061, 0.0088, 3, 0.99, 1.0, 0, 0, 0, 0, 0, 0, 0, 5], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " try:\n new_cred = self.store.locked_get()\n if (new_cred and not new_cred.invalid and\n new_cred.access_token != self.access_token):\n logger.info('Updated access_token read from Storage')\n self._updateFromCredential(new_cred)\n else:\n self._do_refresh_request(http_request)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99080:Assign_L573_C8", "label": "new_cred = locked_get()", "type": "assigned_variable", "loc": [573, 573], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99080:Try_L572_C6", "vector": [14, 4, 0.5031, 0.0009, 4, 0.75, 0.0, 572, 3, 0, 0, 0, 579, 10, 1], "semantic": {"name": "new_cred", "arg_names": [], "import_names": [], "rhs_call_name": "locked_get", "annotation": ""}, "snippet": " new_cred = self.store.locked_get()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99080:If_L574_C8", "label": "if", "type": "if", "loc": [574, 579], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99080:Try_L572_C6", "vector": [4, 4, 0.5061, 0.0053, 4, 0.75, 0.5, 0, 0, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if (new_cred and not new_cred.invalid and\n new_cred.access_token != self.access_token):\n logger.info('Updated access_token read from Storage')\n self._updateFromCredential(new_cred)\n else:\n self._do_refresh_request(http_request)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99080:Expr_L576_C10", "label": "info()", "type": "expression", "loc": [576, 576], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99080:If_L574_C8", "vector": [8, 5, 0.5057, 0.0009, 5, 0.17, 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('Updated access_token read from Storage')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99080:Expr_L577_C10", "label": "_updateFromCredential()", "type": "expression", "loc": [577, 577], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99080:If_L574_C8", "vector": [8, 5, 0.5066, 0.0009, 5, 0.17, 0.5, 49, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "_updateFromCredential", "arg_names": [], "import_names": [], "rhs_call_name": "_updateFromCredential", "annotation": ""}, "snippet": " self._updateFromCredential(new_cred)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99080:Expr_L579_C10", "label": "_do_refresh_request()", "type": "expression", "loc": [579, 579], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99080:If_L574_C8", "vector": [8, 5, 0.5083, 0.0009, 5, 0.17, 1.0, 85, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "_do_refresh_request", "arg_names": [], "import_names": [], "rhs_call_name": "_do_refresh_request", "annotation": ""}, "snippet": " self._do_refresh_request(http_request)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99080:Expr_L581_C8", "label": "release_lock()", "type": "expression", "loc": [581, 581], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99080:Try_L572_C6", "vector": [8, 4, 0.5101, 0.0009, 4, 0.75, 1.0, 821, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "release_lock", "arg_names": [], "import_names": [], "rhs_call_name": "release_lock", "annotation": ""}, "snippet": " self.store.release_lock()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L583_C2", "label": "_do_refresh_request", "type": "function", "loc": [583, 625], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99080:ClassDef_L321_C0", "vector": [2, 1, 0.5303, 0.0378, 1, 0.72, 1.0, 85, 0, 2, 0, 0, 0, 0, 14], "semantic": {"name": "_do_refresh_request", "arg_names": ["self", "http_request"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _do_refresh_request(self, http_request):\n \"\"\"Refresh the access_token using the refresh_token.\n\n Args:\n http_request: callable, a callable that matches the method signature of\n httplib2.Http.request, used to make the refresh request.\n\n Raises:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99080:Expr_L584_C4", "label": "expression", "type": "expression", "loc": [584, 592], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L583_C2", "vector": [8, 2, 0.5162, 0.0079, 2, 0.96, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Refresh the access_token using the refresh_token.\n\n Args:\n http_request: callable, a callable that matches the method signature of\n httplib2.Http.request, used to make the refresh request.\n\n Raises:\n AccessTokenRefreshError: When the refresh fails."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99080:Assign_L593_C4", "label": "body = _generate_refresh_request_body()", "type": "assigned_variable", "loc": [593, 593], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L583_C2", "vector": [14, 2, 0.5206, 0.0009, 2, 0.96, 0.2, 477, 3, 0, 0, 0, 776, 10, 1], "semantic": {"name": "body", "arg_names": [], "import_names": [], "rhs_call_name": "_generate_refresh_request_body", "annotation": ""}, "snippet": " body = self._generate_refresh_request_body()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99080:Assign_L594_C4", "label": "headers = _generate_refresh_request_headers()", "type": "assigned_variable", "loc": [594, 594], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L583_C2", "vector": [14, 2, 0.5215, 0.0009, 2, 0.96, 0.4, 950, 3, 0, 0, 0, 498, 10, 1], "semantic": {"name": "headers", "arg_names": [], "import_names": [], "rhs_call_name": "_generate_refresh_request_headers", "annotation": ""}, "snippet": " headers = self._generate_refresh_request_headers()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99080:Expr_L596_C4", "label": "info()", "type": "expression", "loc": [596, 596], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L583_C2", "vector": [8, 2, 0.5233, 0.0009, 2, 0.96, 0.6, 730, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "info", "arg_names": [], "import_names": [], "rhs_call_name": "info", "annotation": ""}, "snippet": " logger.info('Refreshing access_token')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99080:Assign_L597_C4", "label": "resp, content = http_request()", "type": "assigned_variable", "loc": [597, 598], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L583_C2", "vector": [14, 2, 0.5246, 0.0018, 2, 0.96, 0.8, 339, 3, 4, 0, 0, 29, 10, 1], "semantic": {"name": "resp, content", "arg_names": [], "import_names": [], "rhs_call_name": "http_request", "annotation": ""}, "snippet": " resp, content = http_request(\n self.token_uri, method='POST', body=body, headers=headers)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99080:If_L599_C4", "label": "if", "type": "if", "loc": [599, 625], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L583_C2", "vector": [4, 2, 0.5373, 0.0237, 2, 0.96, 1.0, 0, 0, 0, 0, 0, 0, 0, 10], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if resp.status == 200:\n # TODO(jcgregorio) Raise an error if loads fails?\n d = simplejson.loads(content)\n self.access_token = d['access_token']\n self.refresh_token = d.get('refresh_token', self.refresh_token)\n if 'expires_in' in d:\n self.token_expiry = datetime.timedelta(\n seconds=int(d['expires_in'])) + datetime.datetime.utcnow()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99080:Assign_L601_C6", "label": "d = loads()", "type": "assigned_variable", "loc": [601, 601], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99080:If_L599_C4", "vector": [14, 3, 0.5277, 0.0009, 3, 0.86, 0.0, 355, 3, 1, 0, 0, 88, 10, 1], "semantic": {"name": "d", "arg_names": [], "import_names": [], "rhs_call_name": "loads", "annotation": ""}, "snippet": " d = simplejson.loads(content)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99080:Assign_L602_C6", "label": "self.access_token =", "type": "assigned_variable", "loc": [602, 602], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99080:If_L599_C4", "vector": [14, 3, 0.5285, 0.0009, 3, 0.86, 0.1429, 909, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.access_token", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.access_token = d['access_token']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99080:Assign_L603_C6", "label": "self.refresh_token = get()", "type": "assigned_variable", "loc": [603, 603], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99080:If_L599_C4", "vector": [14, 3, 0.5294, 0.0009, 3, 0.86, 0.2857, 920, 3, 2, 0, 0, 607, 10, 1], "semantic": {"name": "self.refresh_token", "arg_names": [], "import_names": [], "rhs_call_name": "get", "annotation": ""}, "snippet": " self.refresh_token = d.get('refresh_token', self.refresh_token)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99080:If_L604_C6", "label": "if", "type": "if", "loc": [604, 608], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99080:If_L599_C4", "vector": [4, 3, 0.532, 0.0044, 3, 0.86, 0.4286, 0, 0, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if 'expires_in' in d:\n self.token_expiry = datetime.timedelta(\n seconds=int(d['expires_in'])) + datetime.datetime.utcnow()\n else:\n self.token_expiry = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99080:Assign_L605_C8", "label": "self.token_expiry =", "type": "assigned_variable", "loc": [605, 606], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99080:If_L604_C6", "vector": [14, 4, 0.5316, 0.0018, 4, 0.06, 0.0, 327, 4, 0, 0, 0, 0, 0, 3], "semantic": {"name": "self.token_expiry", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.token_expiry = datetime.timedelta(\n seconds=int(d['expires_in'])) + datetime.datetime.utcnow()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99080:Assign_L608_C8", "label": "self.token_expiry =", "type": "assigned_variable", "loc": [608, 608], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99080:If_L604_C6", "vector": [14, 4, 0.5338, 0.0009, 4, 0.06, 1.0, 327, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "self.token_expiry", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.token_expiry = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99080:If_L609_C6", "label": "if", "type": "if", "loc": [609, 610], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99080:If_L599_C4", "vector": [4, 3, 0.5351, 0.0018, 3, 0.86, 0.5714, 0, 7, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self.store:\n self.store.locked_put(self)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99080:Expr_L610_C8", "label": "locked_put()", "type": "expression", "loc": [610, 610], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99080:If_L609_C6", "vector": [8, 4, 0.5356, 0.0009, 4, 0.29, 0.0, 154, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "locked_put", "arg_names": [], "import_names": [], "rhs_call_name": "locked_put", "annotation": ""}, "snippet": " self.store.locked_put(self)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99080:Expr_L614_C6", "label": "info()", "type": "expression", "loc": [614, 614], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99080:If_L599_C4", "vector": [8, 3, 0.5391, 0.0009, 3, 0.86, 0.7143, 730, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "info", "arg_names": [], "import_names": [], "rhs_call_name": "info", "annotation": ""}, "snippet": " logger.info('Failed to retrieve access token: %s' % content)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99080:Assign_L615_C6", "label": "error_msg =", "type": "assigned_variable", "loc": [615, 615], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99080:If_L599_C4", "vector": [14, 3, 0.5399, 0.0009, 3, 0.86, 0.8571, 503, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "error_msg", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " error_msg = 'Invalid response %s.' % resp['status']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99080:Try_L616_C6", "label": "try", "type": "try", "loc": [616, 624], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99080:If_L599_C4", "vector": [7, 3, 0.5443, 0.0079, 3, 0.86, 1.0, 0, 0, 1, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " try:\n d = simplejson.loads(content)\n if 'error' in d:\n error_msg = d['error']\n self.invalid = True\n if self.store:\n self.store.locked_put(self)\n except:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99080:Assign_L617_C8", "label": "d = loads()", "type": "assigned_variable", "loc": [617, 617], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99080:Try_L616_C6", "vector": [14, 4, 0.5417, 0.0009, 4, 0.22, 0.0, 355, 3, 1, 0, 0, 88, 10, 1], "semantic": {"name": "d", "arg_names": [], "import_names": [], "rhs_call_name": "loads", "annotation": ""}, "snippet": " d = simplejson.loads(content)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99080:If_L618_C8", "label": "if", "type": "if", "loc": [618, 622], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99080:Try_L616_C6", "vector": [4, 4, 0.5443, 0.0044, 4, 0.22, 1.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if 'error' in d:\n error_msg = d['error']\n self.invalid = True\n if self.store:\n self.store.locked_put(self)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99080:Assign_L619_C10", "label": "error_msg =", "type": "assigned_variable", "loc": [619, 619], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99080:If_L618_C8", "vector": [14, 5, 0.5435, 0.0009, 5, 0.26, 0.0, 503, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "error_msg", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " error_msg = d['error']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99080:Assign_L620_C10", "label": "self.invalid =", "type": "assigned_variable", "loc": [620, 620], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99080:If_L618_C8", "vector": [14, 5, 0.5443, 0.0009, 5, 0.26, 0.5, 540, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "self.invalid", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.invalid = True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99080:If_L621_C10", "label": "if", "type": "if", "loc": [621, 622], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99080:If_L618_C8", "vector": [4, 5, 0.5457, 0.0018, 5, 0.26, 1.0, 0, 7, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self.store:\n self.store.locked_put(self)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99080:Expr_L622_C12", "label": "locked_put()", "type": "expression", "loc": [622, 622], "level": 6, "parent": "ajibawa-2023/Python-Code-Large/train/row_99080:If_L621_C10", "vector": [8, 6, 0.5461, 0.0009, 6, 0.31, 0.0, 154, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "locked_put", "arg_names": [], "import_names": [], "rhs_call_name": "locked_put", "annotation": ""}, "snippet": " self.store.locked_put(self)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99080:ClassDef_L628_C0", "label": "AccessTokenCredentials", "type": "class", "loc": [628, 687], "level": 0, "parent": null, "vector": [3, 0, 0.5773, 0.0527, 0, 0.66, 0.8049, 260, 0, 3, 0, 0, 494, 0, 5], "semantic": {"name": "AccessTokenCredentials", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class AccessTokenCredentials(OAuth2Credentials):\n \"\"\"Credentials object for OAuth 2.0.\n\n Credentials can be applied to an httplib2.Http object using the\n authorize() method, which then signs each request from that object\n with the OAuth 2.0 access token. This set of credentials is for the\n use case where you have acquired an OAuth 2.0 access_token from\n another place such as a JavaScript client or another web"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99080:Expr_L629_C2", "label": "expression", "type": "expression", "loc": [629, 651], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99080:ClassDef_L628_C0", "vector": [8, 1, 0.5619, 0.0202, 1, 0.9, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Credentials object for OAuth 2.0.\n\n Credentials can be applied to an httplib2.Http object using the\n authorize() method, which then signs each request from that object\n with the OAuth 2.0 access token. This set of credentials is for the\n use case where you have acquired an OAuth 2.0 access_token from\n another place such as a JavaScript client or another web\n application, and wish to use it from Python. Because only the"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L653_C2", "label": "__init__", "type": "function", "loc": [653, 674], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99080:ClassDef_L628_C0", "vector": [2, 1, 0.5825, 0.0193, 1, 0.9, 0.3333, 555, 0, 3, 0, 0, 0, 0, 2], "semantic": {"name": "__init__", "arg_names": ["self", "access_token", "user_agent"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, access_token, user_agent):\n \"\"\"Create an instance of OAuth2Credentials\n\n This is one of the few types if Credentials that you should contrust,\n Credentials objects are usually instantiated by a Flow.\n\n Args:\n access_token: string, access token."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99080:Expr_L654_C4", "label": "expression", "type": "expression", "loc": [654, 666], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L653_C2", "vector": [8, 2, 0.5795, 0.0114, 2, 0.92, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Create an instance of OAuth2Credentials\n\n This is one of the few types if Credentials that you should contrust,\n Credentials objects are usually instantiated by a Flow.\n\n Args:\n access_token: string, access token.\n user_agent: string, The HTTP User-Agent to provide for this application."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99080:Expr_L667_C4", "label": "__init__()", "type": "expression", "loc": [667, 674], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L653_C2", "vector": [8, 2, 0.5887, 0.007, 2, 0.92, 1.0, 555, 3, 7, 0, 0, 0, 0, 2], "semantic": {"name": "__init__", "arg_names": [], "import_names": [], "rhs_call_name": "__init__", "annotation": ""}, "snippet": " super(AccessTokenCredentials, self).__init__(\n access_token,\n None,\n None,\n None,\n None,\n None,\n user_agent)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L678_C2", "label": "from_json", "type": "function", "loc": [678, 683], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99080:ClassDef_L628_C0", "vector": [2, 1, 0.5975, 0.0053, 1, 0.9, 0.6667, 975, 0, 2, 1, 0, 0, 0, 2], "semantic": {"name": "from_json", "arg_names": ["cls", "s"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def from_json(cls, s):\n data = simplejson.loads(s)\n retval = AccessTokenCredentials(\n data['access_token'],\n data['user_agent'])\n return retval"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99080:Assign_L679_C4", "label": "data = loads()", "type": "assigned_variable", "loc": [679, 679], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L678_C2", "vector": [14, 2, 0.5961, 0.0009, 2, 0.34, 0.0, 929, 3, 1, 0, 0, 88, 10, 1], "semantic": {"name": "data", "arg_names": [], "import_names": [], "rhs_call_name": "loads", "annotation": ""}, "snippet": " data = simplejson.loads(s)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99080:Assign_L680_C4", "label": "retval = AccessTokenCredentials()", "type": "assigned_variable", "loc": [680, 682], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L678_C2", "vector": [14, 2, 0.5979, 0.0026, 2, 0.34, 0.5, 991, 3, 2, 0, 0, 260, 10, 1], "semantic": {"name": "retval", "arg_names": [], "import_names": [], "rhs_call_name": "AccessTokenCredentials", "annotation": ""}, "snippet": " retval = AccessTokenCredentials(\n data['access_token'],\n data['user_agent'])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99080:Return_L683_C4", "label": "return", "type": "return", "loc": [683, 683], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L678_C2", "vector": [13, 2, 0.5996, 0.0009, 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 retval"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L685_C2", "label": "_refresh", "type": "function", "loc": [685, 687], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99080:ClassDef_L628_C0", "vector": [2, 1, 0.6023, 0.0026, 1, 0.9, 1.0, 770, 0, 2, 0, 0, 0, 0, 1], "semantic": {"name": "_refresh", "arg_names": ["self", "http_request"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _refresh(self, http_request):\n raise AccessTokenCredentialsError(\n \"The access_token is expired or invalid and can't be refreshed.\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99080:ClassDef_L690_C0", "label": "AssertionCredentials", "type": "class", "loc": [690, 738], "level": 0, "parent": null, "vector": [3, 0, 0.6269, 0.043, 0, 0.66, 0.8293, 563, 0, 3, 0, 0, 494, 0, 5], "semantic": {"name": "AssertionCredentials", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class AssertionCredentials(OAuth2Credentials):\n \"\"\"Abstract Credentials object used for OAuth 2.0 assertion grants.\n\n This credential does not require a flow to instantiate because it\n represents a two legged flow, and therefore has all of the required\n information to generate and refresh its own access tokens. It must\n be subclassed to generate the appropriate assertion string.\n"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99080:Expr_L691_C2", "label": "expression", "type": "expression", "loc": [691, 699], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99080:ClassDef_L690_C0", "vector": [8, 1, 0.6102, 0.0079, 1, 0.95, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Abstract Credentials object used for OAuth 2.0 assertion grants.\n\n This credential does not require a flow to instantiate because it\n represents a two legged flow, and therefore has all of the required\n information to generate and refresh its own access tokens. It must\n be subclassed to generate the appropriate assertion string.\n\n AssertionCredentials objects may be safely pickled and unpickled."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L701_C2", "label": "__init__", "type": "function", "loc": [701, 721], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99080:ClassDef_L690_C0", "vector": [2, 1, 0.6242, 0.0184, 1, 0.95, 0.3333, 555, 0, 5, 0, 0, 0, 0, 2], "semantic": {"name": "__init__", "arg_names": ["self", "assertion_type", "user_agent", "token_uri", "unused_kwargs"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, assertion_type, user_agent,\n token_uri='https://accounts.google.com/o/oauth2/token',\n **unused_kwargs):\n \"\"\"Constructor for AssertionFlowCredentials.\n\n Args:\n assertion_type: string, assertion type that will be declared to the auth\n server"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99080:Expr_L704_C4", "label": "expression", "type": "expression", "loc": [704, 712], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L701_C2", "vector": [8, 2, 0.6216, 0.0079, 2, 0.78, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Constructor for AssertionFlowCredentials.\n\n Args:\n assertion_type: string, assertion type that will be declared to the auth\n server\n user_agent: string, The HTTP User-Agent to provide for this application.\n token_uri: string, URI for token endpoint. For convenience\n defaults to Google's endpoints but any OAuth 2.0 provider can be used."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99080:Expr_L713_C4", "label": "__init__()", "type": "expression", "loc": [713, 720], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L701_C2", "vector": [8, 2, 0.6291, 0.007, 2, 0.78, 0.5, 555, 3, 7, 0, 0, 0, 0, 2], "semantic": {"name": "__init__", "arg_names": [], "import_names": [], "rhs_call_name": "__init__", "annotation": ""}, "snippet": " super(AssertionCredentials, self).__init__(\n None,\n None,\n None,\n None,\n None,\n token_uri,\n user_agent)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99080:Assign_L721_C4", "label": "self.assertion_type =", "type": "assigned_variable", "loc": [721, 721], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L701_C2", "vector": [14, 2, 0.633, 0.0009, 2, 0.78, 1.0, 298, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.assertion_type", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.assertion_type = assertion_type"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L723_C2", "label": "_generate_refresh_request_body", "type": "function", "loc": [723, 732], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99080:ClassDef_L690_C0", "vector": [2, 1, 0.6387, 0.0088, 1, 0.95, 0.6667, 776, 0, 1, 1, 0, 0, 0, 2], "semantic": {"name": "_generate_refresh_request_body", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _generate_refresh_request_body(self):\n assertion = self._generate_assertion()\n\n body = urllib.urlencode({\n 'assertion_type': self.assertion_type,\n 'assertion': assertion,\n 'grant_type': 'assertion',\n })"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99080:Assign_L724_C4", "label": "assertion = _generate_assertion()", "type": "assigned_variable", "loc": [724, 724], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L723_C2", "vector": [14, 2, 0.6356, 0.0009, 2, 0.76, 0.0, 238, 3, 0, 0, 0, 768, 10, 1], "semantic": {"name": "assertion", "arg_names": [], "import_names": [], "rhs_call_name": "_generate_assertion", "annotation": ""}, "snippet": " assertion = self._generate_assertion()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99080:Assign_L726_C4", "label": "body = urlencode()", "type": "assigned_variable", "loc": [726, 730], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L723_C2", "vector": [14, 2, 0.6392, 0.0044, 2, 0.76, 0.5, 477, 3, 1, 0, 0, 414, 10, 1], "semantic": {"name": "body", "arg_names": [], "import_names": [], "rhs_call_name": "urlencode", "annotation": ""}, "snippet": " body = urllib.urlencode({\n 'assertion_type': self.assertion_type,\n 'assertion': assertion,\n 'grant_type': 'assertion',\n })"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99080:Return_L732_C4", "label": "return", "type": "return", "loc": [732, 732], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L723_C2", "vector": [13, 2, 0.6427, 0.0009, 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 body"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L734_C2", "label": "_generate_assertion", "type": "function", "loc": [734, 738], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99080:ClassDef_L690_C0", "vector": [2, 1, 0.6462, 0.0044, 1, 0.95, 1.0, 768, 0, 1, 0, 0, 0, 0, 1], "semantic": {"name": "_generate_assertion", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _generate_assertion(self):\n \"\"\"Generate the assertion string that will be used in the access token\n request.\n \"\"\"\n _abstract()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99080:Expr_L735_C4", "label": "expression", "type": "expression", "loc": [735, 737], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L734_C2", "vector": [8, 2, 0.6462, 0.0026, 2, 0.56, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Generate the assertion string that will be used in the access token\n request.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99080:Expr_L738_C4", "label": "_abstract()", "type": "expression", "loc": [738, 738], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L734_C2", "vector": [8, 2, 0.6479, 0.0009, 2, 0.56, 1.0, 629, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "_abstract", "arg_names": [], "import_names": [], "rhs_call_name": "_abstract", "annotation": ""}, "snippet": " _abstract()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99080:If_L740_C0", "label": "if", "type": "if", "loc": [740, 855], "level": 0, "parent": null, "vector": [4, 0, 0.7002, 0.1018, 0, 0.66, 0.8537, 0, 2, 0, 0, 0, 0, 0, 19], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "if HAS_OPENSSL:\n # PyOpenSSL is not a prerequisite for oauth2client, so if it is missing then\n # don't create the SignedJwtAssertionCredentials or the verify_id_token()\n # method.\n\n class SignedJwtAssertionCredentials(AssertionCredentials):\n \"\"\"Credentials object used for OAuth 2.0 Signed JWT assertion grants.\n"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99080:ClassDef_L745_C2", "label": "SignedJwtAssertionCredentials", "type": "class", "loc": [745, 822], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99080:If_L740_C0", "vector": [3, 1, 0.6879, 0.0685, 1, 0.21, 0.0, 41, 0, 3, 0, 0, 563, 0, 13], "semantic": {"name": "SignedJwtAssertionCredentials", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " class SignedJwtAssertionCredentials(AssertionCredentials):\n \"\"\"Credentials object used for OAuth 2.0 Signed JWT assertion grants.\n\n This credential does not require a flow to instantiate because it\n represents a two legged flow, and therefore has all of the required\n information to generate and refresh its own access tokens.\n \"\"\"\n"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99080:Expr_L746_C4", "label": "expression", "type": "expression", "loc": [746, 751], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99080:ClassDef_L745_C2", "vector": [8, 2, 0.6572, 0.0053, 2, 0.52, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Credentials object used for OAuth 2.0 Signed JWT assertion grants.\n\n This credential does not require a flow to instantiate because it\n represents a two legged flow, and therefore has all of the required\n information to generate and refresh its own access tokens.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99080:Assign_L753_C4", "label": "MAX_TOKEN_LIFETIME_SECS =", "type": "assigned_variable", "loc": [753, 753], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99080:ClassDef_L745_C2", "vector": [14, 2, 0.6611, 0.0009, 2, 0.52, 0.25, 88, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "MAX_TOKEN_LIFETIME_SECS", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " MAX_TOKEN_LIFETIME_SECS = 3600 # 1 hour in seconds"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L755_C4", "label": "__init__", "type": "function", "loc": [755, 790], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99080:ClassDef_L745_C2", "vector": [2, 2, 0.6782, 0.0316, 2, 0.52, 0.5, 555, 0, 8, 0, 0, 0, 0, 4], "semantic": {"name": "__init__", "arg_names": ["self", "service_account_name", "private_key", "scope", "private_key_password", "user_agent", "token_uri", "kwargs"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self,\n service_account_name,\n private_key,\n scope,\n private_key_password='notasecret',\n user_agent=None,\n token_uri='https://accounts.google.com/o/oauth2/token',\n **kwargs):"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99080:Expr_L763_C6", "label": "expression", "type": "expression", "loc": [763, 775], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L755_C4", "vector": [8, 3, 0.6752, 0.0114, 3, 0.05, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Constructor for SignedJwtAssertionCredentials.\n\n Args:\n service_account_name: string, id for account, usually an email address.\n private_key: string, private key in P12 format.\n scope: string or list of strings, scope(s) of the credentials being\n requested.\n private_key_password: string, password for private_key."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99080:Expr_L777_C6", "label": "__init__()", "type": "expression", "loc": [777, 781], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L755_C4", "vector": [8, 3, 0.6839, 0.0044, 3, 0.05, 0.1429, 555, 3, 3, 0, 0, 0, 0, 2], "semantic": {"name": "__init__", "arg_names": [], "import_names": [], "rhs_call_name": "__init__", "annotation": ""}, "snippet": " super(SignedJwtAssertionCredentials, self).__init__(\n 'http://oauth.net/grant_type/jwt/1.0/bearer',\n user_agent,\n token_uri=token_uri,\n )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99080:If_L783_C6", "label": "if", "type": "if", "loc": [783, 784], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L755_C4", "vector": [4, 3, 0.6879, 0.0018, 3, 0.05, 0.2857, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if type(scope) is list:\n scope = ' '.join(scope)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99080:Assign_L784_C8", "label": "scope = join()", "type": "assigned_variable", "loc": [784, 784], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99080:If_L783_C6", "vector": [14, 4, 0.6883, 0.0009, 4, 0.59, 0.0, 334, 3, 1, 0, 0, 933, 10, 1], "semantic": {"name": "scope", "arg_names": [], "import_names": [], "rhs_call_name": "join", "annotation": ""}, "snippet": " scope = ' '.join(scope)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99080:Assign_L785_C6", "label": "self.scope =", "type": "assigned_variable", "loc": [785, 785], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L755_C4", "vector": [14, 3, 0.6892, 0.0009, 3, 0.05, 0.4286, 550, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.scope", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.scope = scope"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99080:Assign_L787_C6", "label": "self.private_key =", "type": "assigned_variable", "loc": [787, 787], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L755_C4", "vector": [14, 3, 0.691, 0.0009, 3, 0.05, 0.5714, 91, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.private_key", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.private_key = private_key"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99080:Assign_L788_C6", "label": "self.private_key_password =", "type": "assigned_variable", "loc": [788, 788], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L755_C4", "vector": [14, 3, 0.6918, 0.0009, 3, 0.05, 0.7143, 751, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.private_key_password", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.private_key_password = private_key_password"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99080:Assign_L789_C6", "label": "self.service_account_name =", "type": "assigned_variable", "loc": [789, 789], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L755_C4", "vector": [14, 3, 0.6927, 0.0009, 3, 0.05, 0.8571, 976, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.service_account_name", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.service_account_name = service_account_name"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99080:Assign_L790_C6", "label": "self.kwargs =", "type": "assigned_variable", "loc": [790, 790], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L755_C4", "vector": [14, 3, 0.6936, 0.0009, 3, 0.05, 1.0, 790, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.kwargs", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.kwargs = kwargs"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L793_C4", "label": "from_json", "type": "function", "loc": [793, 805], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99080:ClassDef_L745_C2", "vector": [2, 2, 0.7015, 0.0114, 2, 0.52, 0.75, 975, 0, 2, 1, 0, 0, 0, 2], "semantic": {"name": "from_json", "arg_names": ["cls", "s"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def from_json(cls, s):\n data = simplejson.loads(s)\n retval = SignedJwtAssertionCredentials(\n data['service_account_name'],\n data['private_key'],\n data['private_key_password'],\n data['scope'],\n data['user_agent'],"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99080:Assign_L794_C6", "label": "data = loads()", "type": "assigned_variable", "loc": [794, 794], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L793_C4", "vector": [14, 3, 0.6971, 0.0009, 3, 0.9, 0.0, 929, 3, 1, 0, 0, 88, 10, 1], "semantic": {"name": "data", "arg_names": [], "import_names": [], "rhs_call_name": "loads", "annotation": ""}, "snippet": " data = simplejson.loads(s)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99080:Assign_L795_C6", "label": "retval = SignedJwtAssertionCredentials()", "type": "assigned_variable", "loc": [795, 803], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L793_C4", "vector": [14, 3, 0.7015, 0.0079, 3, 0.9, 0.3333, 991, 3, 7, 0, 0, 41, 10, 1], "semantic": {"name": "retval", "arg_names": [], "import_names": [], "rhs_call_name": "SignedJwtAssertionCredentials", "annotation": ""}, "snippet": " retval = SignedJwtAssertionCredentials(\n data['service_account_name'],\n data['private_key'],\n data['private_key_password'],\n data['scope'],\n data['user_agent'],\n data['token_uri'],\n data['kwargs']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99080:Assign_L804_C6", "label": "retval.invalid =", "type": "assigned_variable", "loc": [804, 804], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L793_C4", "vector": [14, 3, 0.7059, 0.0009, 3, 0.9, 0.6667, 900, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "retval.invalid", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " retval.invalid = data['invalid']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99080:Return_L805_C6", "label": "return", "type": "return", "loc": [805, 805], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L793_C4", "vector": [13, 3, 0.7068, 0.0009, 3, 0.9, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return retval"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L807_C4", "label": "_generate_assertion", "type": "function", "loc": [807, 822], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99080:ClassDef_L745_C2", "vector": [2, 2, 0.7151, 0.014, 2, 0.52, 1.0, 768, 0, 1, 1, 0, 0, 0, 7], "semantic": {"name": "_generate_assertion", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _generate_assertion(self):\n \"\"\"Generate the assertion that will be used in the request.\"\"\"\n now = long(time.time())\n payload = {\n 'aud': self.token_uri,\n 'scope': self.scope,\n 'iat': now,\n 'exp': now + SignedJwtAssertionCredentials.MAX_TOKEN_LIFETIME_SECS,"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99080:Expr_L808_C6", "label": "expression", "type": "expression", "loc": [808, 808], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L807_C4", "vector": [8, 3, 0.7094, 0.0009, 3, 0.19, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Generate the assertion that will be used in the request.\"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99080:Assign_L809_C6", "label": "now = long()", "type": "assigned_variable", "loc": [809, 809], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L807_C4", "vector": [14, 3, 0.7103, 0.0009, 3, 0.19, 0.2, 894, 3, 1, 0, 0, 37, 10, 2], "semantic": {"name": "now", "arg_names": [], "import_names": [], "rhs_call_name": "long", "annotation": ""}, "snippet": " now = long(time.time())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99080:Assign_L810_C6", "label": "payload =", "type": "assigned_variable", "loc": [810, 816], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L807_C4", "vector": [14, 3, 0.7138, 0.0061, 3, 0.19, 0.4, 271, 0, 0, 0, 0, 0, 6, 0], "semantic": {"name": "payload", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " payload = {\n 'aud': self.token_uri,\n 'scope': self.scope,\n 'iat': now,\n 'exp': now + SignedJwtAssertionCredentials.MAX_TOKEN_LIFETIME_SECS,\n 'iss': self.service_account_name\n }"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99080:Expr_L817_C6", "label": "update()", "type": "expression", "loc": [817, 817], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L807_C4", "vector": [8, 3, 0.7173, 0.0009, 3, 0.19, 0.6, 637, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "update", "arg_names": [], "import_names": [], "rhs_call_name": "update", "annotation": ""}, "snippet": " payload.update(self.kwargs)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99080:Expr_L818_C6", "label": "debug()", "type": "expression", "loc": [818, 818], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L807_C4", "vector": [8, 3, 0.7182, 0.0009, 3, 0.19, 0.8, 924, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "debug", "arg_names": [], "import_names": [], "rhs_call_name": "debug", "annotation": ""}, "snippet": " logger.debug(str(payload))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99080:Return_L820_C6", "label": "return", "type": "return", "loc": [820, 822], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L807_C4", "vector": [13, 3, 0.7208, 0.0026, 3, 0.19, 1.0, 0, 3, 0, 0, 0, 0, 10, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return make_signed_jwt(\n Signer.from_string(self.private_key, self.private_key_password),\n payload)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99080:Assign_L826_C2", "label": "_cached_http = Http()", "type": "assigned_variable", "loc": [826, 826], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99080:If_L740_C0", "vector": [14, 1, 0.7252, 0.0009, 1, 0.21, 0.5, 258, 3, 1, 0, 0, 967, 10, 2], "semantic": {"name": "_cached_http", "arg_names": [], "import_names": [], "rhs_call_name": "Http", "annotation": ""}, "snippet": " _cached_http = httplib2.Http(MemoryCache())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L828_C2", "label": "verify_id_token", "type": "function", "loc": [828, 855], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99080:If_L740_C0", "vector": [2, 1, 0.7388, 0.0246, 1, 0.21, 1.0, 749, 0, 4, 1, 0, 0, 0, 4], "semantic": {"name": "verify_id_token", "arg_names": ["id_token", "audience", "http", "cert_uri"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def verify_id_token(id_token, audience, http=None,\n cert_uri=ID_TOKEN_VERIFICATON_CERTS):\n \"\"\"Verifies a signed JWT id_token.\n\n Args:\n id_token: string, A Signed JWT.\n audience: string, The audience 'aud' that the token should be for.\n http: httplib2.Http, instance to use to make the HTTP request. Callers"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99080:Expr_L830_C4", "label": "expression", "type": "expression", "loc": [830, 845], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L828_C2", "vector": [8, 2, 0.7353, 0.014, 2, 0.54, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Verifies a signed JWT id_token.\n\n Args:\n id_token: string, A Signed JWT.\n audience: string, The audience 'aud' that the token should be for.\n http: httplib2.Http, instance to use to make the HTTP request. Callers\n should supply an instance that has caching enabled.\n cert_uri: string, URI of the certificates in JSON format to"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99080:If_L846_C4", "label": "if", "type": "if", "loc": [846, 847], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L828_C2", "vector": [4, 2, 0.7432, 0.0018, 2, 0.54, 0.3333, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if http is None:\n http = _cached_http"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99080:Assign_L847_C6", "label": "http =", "type": "assigned_variable", "loc": [847, 847], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99080:If_L846_C4", "vector": [14, 3, 0.7436, 0.0009, 3, 0.98, 0.0, 415, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "http", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " http = _cached_http"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99080:Assign_L849_C4", "label": "resp, content = request()", "type": "assigned_variable", "loc": [849, 849], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L828_C2", "vector": [14, 2, 0.7454, 0.0009, 2, 0.54, 0.6667, 339, 3, 1, 0, 0, 50, 10, 1], "semantic": {"name": "resp, content", "arg_names": [], "import_names": [], "rhs_call_name": "request", "annotation": ""}, "snippet": " resp, content = http.request(cert_uri)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99080:If_L851_C4", "label": "if", "type": "if", "loc": [851, 855], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L828_C2", "vector": [4, 2, 0.7489, 0.0044, 2, 0.54, 1.0, 0, 0, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if resp.status == 200:\n certs = simplejson.loads(content)\n return verify_signed_jwt_with_certs(id_token, certs, audience)\n else:\n raise VerifyJwtTokenError('Status code: %d' % resp.status)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99080:Assign_L852_C6", "label": "certs = loads()", "type": "assigned_variable", "loc": [852, 852], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99080:If_L851_C4", "vector": [14, 3, 0.748, 0.0009, 3, 0.75, 0.0, 10, 3, 1, 0, 0, 88, 10, 1], "semantic": {"name": "certs", "arg_names": [], "import_names": [], "rhs_call_name": "loads", "annotation": ""}, "snippet": " certs = simplejson.loads(content)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99080:Return_L853_C6", "label": "return", "type": "return", "loc": [853, 853], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99080:If_L851_C4", "vector": [13, 3, 0.7489, 0.0009, 3, 0.75, 1.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return verify_signed_jwt_with_certs(id_token, certs, audience)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L858_C0", "label": "_urlsafe_b64decode", "type": "function", "loc": [858, 862], "level": 0, "parent": null, "vector": [2, 0, 0.755, 0.0044, 0, 0.66, 0.878, 388, 0, 1, 1, 0, 0, 0, 3], "semantic": {"name": "_urlsafe_b64decode", "arg_names": ["b64string"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def _urlsafe_b64decode(b64string):\n # Guard against unicode strings, which base64 can't handle.\n b64string = b64string.encode('ascii')\n padded = b64string + '=' * (4 - len(b64string) % 4)\n return base64.urlsafe_b64decode(padded)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99080:Assign_L860_C2", "label": "b64string = encode()", "type": "assigned_variable", "loc": [860, 860], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L858_C0", "vector": [14, 1, 0.755, 0.0009, 1, 0.81, 0.0, 502, 3, 1, 0, 0, 623, 10, 1], "semantic": {"name": "b64string", "arg_names": [], "import_names": [], "rhs_call_name": "encode", "annotation": ""}, "snippet": " b64string = b64string.encode('ascii')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99080:Assign_L861_C2", "label": "padded =", "type": "assigned_variable", "loc": [861, 861], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L858_C0", "vector": [14, 1, 0.7559, 0.0009, 1, 0.81, 0.5, 54, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "padded", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " padded = b64string + '=' * (4 - len(b64string) % 4)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99080:Return_L862_C2", "label": "return", "type": "return", "loc": [862, 862], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L858_C0", "vector": [13, 1, 0.7568, 0.0009, 1, 0.81, 1.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return base64.urlsafe_b64decode(padded)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L865_C0", "label": "_extract_id_token", "type": "function", "loc": [865, 882], "level": 0, "parent": null, "vector": [2, 0, 0.7669, 0.0158, 0, 0.66, 0.9024, 179, 0, 1, 1, 0, 0, 0, 5], "semantic": {"name": "_extract_id_token", "arg_names": ["id_token"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def _extract_id_token(id_token):\n \"\"\"Extract the JSON payload from a JWT.\n\n Does the extraction w/o checking the signature.\n\n Args:\n id_token: string, OAuth 2.0 id_token.\n"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99080:Expr_L866_C2", "label": "expression", "type": "expression", "loc": [866, 875], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L865_C0", "vector": [8, 1, 0.7643, 0.0088, 1, 0.59, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Extract the JSON payload from a JWT.\n\n Does the extraction w/o checking the signature.\n\n Args:\n id_token: string, OAuth 2.0 id_token.\n\n Returns:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99080:Assign_L876_C2", "label": "segments = split()", "type": "assigned_variable", "loc": [876, 876], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L865_C0", "vector": [14, 1, 0.7691, 0.0009, 1, 0.59, 0.3333, 185, 3, 1, 0, 0, 908, 10, 1], "semantic": {"name": "segments", "arg_names": [], "import_names": [], "rhs_call_name": "split", "annotation": ""}, "snippet": " segments = id_token.split('.')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99080:If_L878_C2", "label": "if", "type": "if", "loc": [878, 880], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L865_C0", "vector": [4, 1, 0.7717, 0.0026, 1, 0.59, 0.6667, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if (len(segments) != 3):\n raise VerifyJwtTokenError(\n 'Wrong number of segments in token: %s' % id_token)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99080:Return_L882_C2", "label": "return", "type": "return", "loc": [882, 882], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L865_C0", "vector": [13, 1, 0.7744, 0.0009, 1, 0.59, 1.0, 0, 3, 0, 0, 0, 0, 10, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return simplejson.loads(_urlsafe_b64decode(segments[1]))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L884_C0", "label": "credentials_from_code", "type": "function", "loc": [884, 915], "level": 0, "parent": null, "vector": [2, 0, 0.7897, 0.0281, 0, 0.66, 0.9268, 622, 0, 8, 1, 0, 0, 0, 3], "semantic": {"name": "credentials_from_code", "arg_names": ["client_id", "client_secret", "scope", "code", "redirect_uri", "http", "user_agent", "token_uri"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def credentials_from_code(client_id, client_secret, scope, code,\n redirect_uri = 'postmessage',\n http=None, user_agent=None,\n token_uri='https://accounts.google.com/o/oauth2/token'):\n \"\"\"Exchanges an authorization code for an OAuth2Credentials object.\n\n Args:\n client_id: string, client identifier."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99080:Expr_L888_C2", "label": "expression", "type": "expression", "loc": [888, 907], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L884_C0", "vector": [8, 1, 0.788, 0.0176, 1, 0.38, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Exchanges an authorization code for an OAuth2Credentials object.\n\n Args:\n client_id: string, client identifier.\n client_secret: string, client secret.\n scope: string or list of strings, scope(s) to request.\n code: string, An authroization code, most likely passed down from\n the client"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99080:Assign_L908_C2", "label": "flow = OAuth2WebServerFlow()", "type": "assigned_variable", "loc": [908, 910], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L884_C0", "vector": [14, 1, 0.7981, 0.0026, 1, 0.38, 0.25, 258, 3, 6, 0, 0, 875, 10, 1], "semantic": {"name": "flow", "arg_names": [], "import_names": [], "rhs_call_name": "OAuth2WebServerFlow", "annotation": ""}, "snippet": " flow = OAuth2WebServerFlow(client_id, client_secret, scope, user_agent,\n 'https://accounts.google.com/o/oauth2/auth',\n token_uri)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99080:Assign_L913_C2", "label": "uriThatWeDontReallyUse = step1_get_authorize_url()", "type": "assigned_variable", "loc": [913, 913], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L884_C0", "vector": [14, 1, 0.8016, 0.0009, 1, 0.38, 0.5, 774, 3, 1, 0, 0, 752, 10, 1], "semantic": {"name": "uriThatWeDontReallyUse", "arg_names": [], "import_names": [], "rhs_call_name": "step1_get_authorize_url", "annotation": ""}, "snippet": " uriThatWeDontReallyUse = flow.step1_get_authorize_url(redirect_uri)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99080:Assign_L914_C2", "label": "credentials = step2_exchange()", "type": "assigned_variable", "loc": [914, 914], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L884_C0", "vector": [14, 1, 0.8025, 0.0009, 1, 0.38, 0.75, 198, 3, 2, 0, 0, 471, 10, 1], "semantic": {"name": "credentials", "arg_names": [], "import_names": [], "rhs_call_name": "step2_exchange", "annotation": ""}, "snippet": " credentials = flow.step2_exchange(code, http)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99080:Return_L915_C2", "label": "return", "type": "return", "loc": [915, 915], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L884_C0", "vector": [13, 1, 0.8033, 0.0009, 1, 0.38, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return credentials"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L918_C0", "label": "credentials_from_clientsecrets_and_code", "type": "function", "loc": [918, 954], "level": 0, "parent": null, "vector": [2, 0, 0.8218, 0.0325, 0, 0.66, 0.9512, 790, 0, 6, 1, 0, 0, 0, 3], "semantic": {"name": "credentials_from_clientsecrets_and_code", "arg_names": ["filename", "scope", "code", "message", "redirect_uri", "http"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def credentials_from_clientsecrets_and_code(filename, scope, code,\n message = None,\n redirect_uri = 'postmessage',\n http=None):\n \"\"\"Returns OAuth2Credentials from a clientsecrets file and an auth code.\n\n Will create the right kind of Flow based on the contents of the clientsecrets\n file or will raise InvalidClientSecretsError for unknown types of Flows."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99080:Expr_L922_C2", "label": "expression", "type": "expression", "loc": [922, 949], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L918_C0", "vector": [8, 1, 0.8213, 0.0246, 1, 0.54, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Returns OAuth2Credentials from a clientsecrets file and an auth code.\n\n Will create the right kind of Flow based on the contents of the clientsecrets\n file or will raise InvalidClientSecretsError for unknown types of Flows.\n\n Args:\n filename: string, File name of clientsecrets.\n scope: string or list of strings, scope(s) to request."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99080:Assign_L950_C2", "label": "flow = flow_from_clientsecrets()", "type": "assigned_variable", "loc": [950, 950], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L918_C0", "vector": [14, 1, 0.8341, 0.0009, 1, 0.54, 0.25, 258, 3, 3, 0, 0, 355, 10, 1], "semantic": {"name": "flow", "arg_names": [], "import_names": [], "rhs_call_name": "flow_from_clientsecrets", "annotation": ""}, "snippet": " flow = flow_from_clientsecrets(filename, scope, message)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99080:Assign_L952_C2", "label": "uriThatWeDontReallyUse = step1_get_authorize_url()", "type": "assigned_variable", "loc": [952, 952], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L918_C0", "vector": [14, 1, 0.8358, 0.0009, 1, 0.54, 0.5, 774, 3, 1, 0, 0, 752, 10, 1], "semantic": {"name": "uriThatWeDontReallyUse", "arg_names": [], "import_names": [], "rhs_call_name": "step1_get_authorize_url", "annotation": ""}, "snippet": " uriThatWeDontReallyUse = flow.step1_get_authorize_url(redirect_uri)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99080:Assign_L953_C2", "label": "credentials = step2_exchange()", "type": "assigned_variable", "loc": [953, 953], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L918_C0", "vector": [14, 1, 0.8367, 0.0009, 1, 0.54, 0.75, 198, 3, 2, 0, 0, 471, 10, 1], "semantic": {"name": "credentials", "arg_names": [], "import_names": [], "rhs_call_name": "step2_exchange", "annotation": ""}, "snippet": " credentials = flow.step2_exchange(code, http)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99080:Return_L954_C2", "label": "return", "type": "return", "loc": [954, 954], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L918_C0", "vector": [13, 1, 0.8376, 0.0009, 1, 0.54, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return credentials"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99080:ClassDef_L957_C0", "label": "OAuth2WebServerFlow", "type": "class", "loc": [957, 1098], "level": 0, "parent": null, "vector": [3, 0, 0.9021, 0.1247, 0, 0.66, 0.9756, 875, 0, 3, 0, 0, 746, 0, 29], "semantic": {"name": "OAuth2WebServerFlow", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class OAuth2WebServerFlow(Flow):\n \"\"\"Does the Web Server Flow for OAuth 2.0.\n\n OAuth2Credentials objects may be safely pickled and unpickled.\n \"\"\"\n\n def __init__(self, client_id, client_secret, scope, user_agent=None,\n auth_uri='https://accounts.google.com/o/oauth2/auth',"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99080:Expr_L958_C2", "label": "expression", "type": "expression", "loc": [958, 961], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99080:ClassDef_L957_C0", "vector": [8, 1, 0.8424, 0.0035, 1, 0.72, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Does the Web Server Flow for OAuth 2.0.\n\n OAuth2Credentials objects may be safely pickled and unpickled.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L963_C2", "label": "__init__", "type": "function", "loc": [963, 994], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99080:ClassDef_L957_C0", "vector": [2, 1, 0.8591, 0.0281, 1, 0.72, 0.3333, 555, 0, 8, 0, 0, 0, 0, 3], "semantic": {"name": "__init__", "arg_names": ["self", "client_id", "client_secret", "scope", "user_agent", "auth_uri", "token_uri", "kwargs"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, client_id, client_secret, scope, user_agent=None,\n auth_uri='https://accounts.google.com/o/oauth2/auth',\n token_uri='https://accounts.google.com/o/oauth2/token',\n **kwargs):\n \"\"\"Constructor for OAuth2WebServerFlow.\n\n Args:\n client_id: string, client identifier."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99080:Expr_L967_C4", "label": "expression", "type": "expression", "loc": [967, 981], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L963_C2", "vector": [8, 2, 0.8551, 0.0132, 2, 0.93, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Constructor for OAuth2WebServerFlow.\n\n Args:\n client_id: string, client identifier.\n client_secret: string client secret.\n scope: string or list of strings, scope(s) of the credentials being\n requested.\n user_agent: string, HTTP User-Agent to provide for this application."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99080:Assign_L982_C4", "label": "self.client_id =", "type": "assigned_variable", "loc": [982, 982], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L963_C2", "vector": [14, 2, 0.8622, 0.0009, 2, 0.93, 0.1, 144, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.client_id", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.client_id = client_id"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99080:Assign_L983_C4", "label": "self.client_secret =", "type": "assigned_variable", "loc": [983, 983], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L963_C2", "vector": [14, 2, 0.863, 0.0009, 2, 0.93, 0.2, 451, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.client_secret", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.client_secret = client_secret"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99080:If_L984_C4", "label": "if", "type": "if", "loc": [984, 985], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L963_C2", "vector": [4, 2, 0.8644, 0.0018, 2, 0.93, 0.3, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if type(scope) is list:\n scope = ' '.join(scope)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99080:Assign_L985_C6", "label": "scope = join()", "type": "assigned_variable", "loc": [985, 985], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99080:If_L984_C4", "vector": [14, 3, 0.8648, 0.0009, 3, 0.21, 0.0, 334, 3, 1, 0, 0, 933, 10, 1], "semantic": {"name": "scope", "arg_names": [], "import_names": [], "rhs_call_name": "join", "annotation": ""}, "snippet": " scope = ' '.join(scope)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99080:Assign_L986_C4", "label": "self.scope =", "type": "assigned_variable", "loc": [986, 986], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L963_C2", "vector": [14, 2, 0.8657, 0.0009, 2, 0.93, 0.4, 550, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.scope", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.scope = scope"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99080:Assign_L987_C4", "label": "self.user_agent =", "type": "assigned_variable", "loc": [987, 987], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L963_C2", "vector": [14, 2, 0.8665, 0.0009, 2, 0.93, 0.5, 723, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.user_agent", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.user_agent = user_agent"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99080:Assign_L988_C4", "label": "self.auth_uri =", "type": "assigned_variable", "loc": [988, 988], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L963_C2", "vector": [14, 2, 0.8674, 0.0009, 2, 0.93, 0.6, 981, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.auth_uri", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.auth_uri = auth_uri"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99080:Assign_L989_C4", "label": "self.token_uri =", "type": "assigned_variable", "loc": [989, 989], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L963_C2", "vector": [14, 2, 0.8683, 0.0009, 2, 0.93, 0.7, 941, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.token_uri", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.token_uri = token_uri"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99080:Assign_L990_C4", "label": "self.params =", "type": "assigned_variable", "loc": [990, 992], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L963_C2", "vector": [14, 2, 0.8701, 0.0026, 2, 0.93, 0.8, 402, 0, 0, 0, 0, 0, 6, 0], "semantic": {"name": "self.params", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.params = {\n 'access_type': 'offline',\n }"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99080:Expr_L993_C4", "label": "update()", "type": "expression", "loc": [993, 993], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L963_C2", "vector": [8, 2, 0.8718, 0.0009, 2, 0.93, 0.9, 637, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "update", "arg_names": [], "import_names": [], "rhs_call_name": "update", "annotation": ""}, "snippet": " self.params.update(kwargs)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99080:Assign_L994_C4", "label": "self.redirect_uri =", "type": "assigned_variable", "loc": [994, 994], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L963_C2", "vector": [14, 2, 0.8727, 0.0009, 2, 0.93, 1.0, 937, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "self.redirect_uri", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.redirect_uri = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L996_C2", "label": "step1_get_authorize_url", "type": "function", "loc": [996, 1021], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99080:ClassDef_L957_C0", "vector": [2, 1, 0.8854, 0.0228, 1, 0.72, 0.6667, 752, 0, 2, 1, 0, 0, 0, 8], "semantic": {"name": "step1_get_authorize_url", "arg_names": ["self", "redirect_uri"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def step1_get_authorize_url(self, redirect_uri=OOB_CALLBACK_URN):\n \"\"\"Returns a URI to redirect to the provider.\n\n Args:\n redirect_uri: string, Either the string 'urn:ietf:wg:oauth:2.0:oob' for\n a non-web-based application, or a URI that handles the callback from\n the authorization server.\n"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99080:Expr_L997_C4", "label": "expression", "type": "expression", "loc": [997, 1008], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L996_C2", "vector": [8, 2, 0.8802, 0.0105, 2, 0.11, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Returns a URI to redirect to the provider.\n\n Args:\n redirect_uri: string, Either the string 'urn:ietf:wg:oauth:2.0:oob' for\n a non-web-based application, or a URI that handles the callback from\n the authorization server.\n\n If redirect_uri is 'urn:ietf:wg:oauth:2.0:oob' then pass in the"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99080:Assign_L1010_C4", "label": "self.redirect_uri =", "type": "assigned_variable", "loc": [1010, 1010], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L996_C2", "vector": [14, 2, 0.8867, 0.0009, 2, 0.11, 0.1429, 937, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.redirect_uri", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.redirect_uri = redirect_uri"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99080:Assign_L1011_C4", "label": "query =", "type": "assigned_variable", "loc": [1011, 1016], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L996_C2", "vector": [14, 2, 0.8898, 0.0053, 2, 0.11, 0.2857, 546, 0, 0, 0, 0, 0, 6, 0], "semantic": {"name": "query", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " query = {\n 'response_type': 'code',\n 'client_id': self.client_id,\n 'redirect_uri': redirect_uri,\n 'scope': self.scope,\n }"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99080:Expr_L1017_C4", "label": "update()", "type": "expression", "loc": [1017, 1017], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L996_C2", "vector": [8, 2, 0.8929, 0.0009, 2, 0.11, 0.4286, 637, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "update", "arg_names": [], "import_names": [], "rhs_call_name": "update", "annotation": ""}, "snippet": " query.update(self.params)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99080:Assign_L1018_C4", "label": "parts = list()", "type": "assigned_variable", "loc": [1018, 1018], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L996_C2", "vector": [14, 2, 0.8938, 0.0009, 2, 0.11, 0.5714, 13, 3, 1, 0, 0, 430, 10, 2], "semantic": {"name": "parts", "arg_names": [], "import_names": [], "rhs_call_name": "list", "annotation": ""}, "snippet": " parts = list(urlparse.urlparse(self.auth_uri))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99080:Expr_L1019_C4", "label": "update()", "type": "expression", "loc": [1019, 1019], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L996_C2", "vector": [8, 2, 0.8946, 0.0009, 2, 0.11, 0.7143, 637, 3, 1, 0, 0, 0, 0, 3], "semantic": {"name": "update", "arg_names": [], "import_names": [], "rhs_call_name": "update", "annotation": ""}, "snippet": " query.update(dict(parse_qsl(parts[4]))) # 4 is the index of the query part"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99080:Assign_L1020_C4", "label": " = urlencode()", "type": "assigned_variable", "loc": [1020, 1020], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L996_C2", "vector": [14, 2, 0.8955, 0.0009, 2, 0.11, 0.8571, 0, 3, 1, 0, 0, 414, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "urlencode", "annotation": ""}, "snippet": " parts[4] = urllib.urlencode(query)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99080:Return_L1021_C4", "label": "return", "type": "return", "loc": [1021, 1021], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L996_C2", "vector": [13, 2, 0.8964, 0.0009, 2, 0.11, 1.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return urlparse.urlunparse(parts)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L1023_C2", "label": "step2_exchange", "type": "function", "loc": [1023, 1098], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99080:ClassDef_L957_C0", "vector": [2, 1, 0.9311, 0.0667, 1, 0.72, 1.0, 471, 0, 3, 1, 0, 0, 0, 18], "semantic": {"name": "step2_exchange", "arg_names": ["self", "code", "http"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def step2_exchange(self, code, http=None):\n \"\"\"Exhanges a code for OAuth2Credentials.\n\n Args:\n code: string or dict, either the code as a string, or a dictionary\n of the query parameters to the redirect_uri, which contains\n the code.\n http: httplib2.Http, optional http instance to use to do the fetch"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99080:Expr_L1024_C4", "label": "expression", "type": "expression", "loc": [1024, 1038], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L1023_C2", "vector": [8, 2, 0.9052, 0.0132, 2, 0.84, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Exhanges a code for OAuth2Credentials.\n\n Args:\n code: string or dict, either the code as a string, or a dictionary\n of the query parameters to the redirect_uri, which contains\n the code.\n http: httplib2.Http, optional http instance to use to do the fetch\n"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99080:If_L1040_C4", "label": "if", "type": "if", "loc": [1040, 1048], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L1023_C2", "vector": [4, 2, 0.9166, 0.0079, 2, 0.84, 0.1429, 0, 0, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not (isinstance(code, str) or isinstance(code, unicode)):\n if 'code' not in code:\n if 'error' in code:\n error_msg = code['error']\n else:\n error_msg = 'No code was supplied in the query parameters.'\n raise FlowExchangeError(error_msg)\n else:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99080:If_L1041_C6", "label": "if", "type": "if", "loc": [1041, 1048], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99080:If_L1040_C4", "vector": [4, 3, 0.917, 0.007, 3, 0.3, 0.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if 'code' not in code:\n if 'error' in code:\n error_msg = code['error']\n else:\n error_msg = 'No code was supplied in the query parameters.'\n raise FlowExchangeError(error_msg)\n else:\n code = code['code']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99080:If_L1042_C8", "label": "if", "type": "if", "loc": [1042, 1045], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99080:If_L1041_C6", "vector": [4, 4, 0.9162, 0.0035, 4, 0.81, 0.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if 'error' in code:\n error_msg = code['error']\n else:\n error_msg = 'No code was supplied in the query parameters.'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99080:Assign_L1043_C10", "label": "error_msg =", "type": "assigned_variable", "loc": [1043, 1043], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99080:If_L1042_C8", "vector": [14, 5, 0.9157, 0.0009, 5, 0.61, 0.0, 503, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "error_msg", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " error_msg = code['error']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99080:Assign_L1045_C10", "label": "error_msg =", "type": "assigned_variable", "loc": [1045, 1045], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99080:If_L1042_C8", "vector": [14, 5, 0.9175, 0.0009, 5, 0.61, 1.0, 503, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "error_msg", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " error_msg = 'No code was supplied in the query parameters.'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99080:Assign_L1048_C8", "label": "code =", "type": "assigned_variable", "loc": [1048, 1048], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99080:If_L1041_C6", "vector": [14, 4, 0.9201, 0.0009, 4, 0.81, 1.0, 44, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "code", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " code = code['code']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99080:Assign_L1050_C4", "label": "body = urlencode()", "type": "assigned_variable", "loc": [1050, 1057], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L1023_C2", "vector": [14, 2, 0.9249, 0.007, 2, 0.84, 0.2857, 477, 3, 1, 0, 0, 414, 10, 1], "semantic": {"name": "body", "arg_names": [], "import_names": [], "rhs_call_name": "urlencode", "annotation": ""}, "snippet": " body = urllib.urlencode({\n 'grant_type': 'authorization_code',\n 'client_id': self.client_id,\n 'client_secret': self.client_secret,\n 'code': code,\n 'redirect_uri': self.redirect_uri,\n 'scope': self.scope,\n })"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99080:Assign_L1058_C4", "label": "headers =", "type": "assigned_variable", "loc": [1058, 1060], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L1023_C2", "vector": [14, 2, 0.9298, 0.0026, 2, 0.84, 0.4286, 950, 0, 0, 0, 0, 0, 6, 0], "semantic": {"name": "headers", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " headers = {\n 'content-type': 'application/x-www-form-urlencoded',\n }"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99080:If_L1062_C4", "label": "if", "type": "if", "loc": [1062, 1063], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L1023_C2", "vector": [4, 2, 0.9328, 0.0018, 2, 0.84, 0.5714, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self.user_agent is not None:\n headers['user-agent'] = self.user_agent"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99080:Assign_L1063_C6", "label": "assign", "type": "assigned_variable", "loc": [1063, 1063], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99080:If_L1062_C4", "vector": [14, 3, 0.9333, 0.0009, 3, 0.95, 0.0, 0, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " headers['user-agent'] = self.user_agent"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99080:If_L1065_C4", "label": "if", "type": "if", "loc": [1065, 1066], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L1023_C2", "vector": [4, 2, 0.9355, 0.0018, 2, 0.84, 0.7143, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if http is None:\n http = httplib2.Http()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99080:Assign_L1066_C6", "label": "http = Http()", "type": "assigned_variable", "loc": [1066, 1066], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99080:If_L1065_C4", "vector": [14, 3, 0.9359, 0.0009, 3, 0.05, 0.0, 415, 3, 0, 0, 0, 967, 10, 1], "semantic": {"name": "http", "arg_names": [], "import_names": [], "rhs_call_name": "Http", "annotation": ""}, "snippet": " http = httplib2.Http()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99080:Assign_L1068_C4", "label": "resp, content = request()", "type": "assigned_variable", "loc": [1068, 1069], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L1023_C2", "vector": [14, 2, 0.9381, 0.0018, 2, 0.84, 0.8571, 339, 3, 4, 0, 0, 50, 10, 1], "semantic": {"name": "resp, content", "arg_names": [], "import_names": [], "rhs_call_name": "request", "annotation": ""}, "snippet": " resp, content = http.request(self.token_uri, method='POST', body=body,\n headers=headers)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99080:If_L1070_C4", "label": "if", "type": "if", "loc": [1070, 1098], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L1023_C2", "vector": [4, 2, 0.9517, 0.0255, 2, 0.84, 1.0, 0, 0, 0, 0, 0, 0, 0, 12], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if resp.status == 200:\n # TODO(jcgregorio) Raise an error if simplejson.loads fails?\n d = simplejson.loads(content)\n access_token = d['access_token']\n refresh_token = d.get('refresh_token', None)\n token_expiry = None\n if 'expires_in' in d:\n token_expiry = datetime.datetime.utcnow() + datetime.timedelta("}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99080:Assign_L1072_C6", "label": "d = loads()", "type": "assigned_variable", "loc": [1072, 1072], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99080:If_L1070_C4", "vector": [14, 3, 0.9412, 0.0009, 3, 0.09, 0.0, 355, 3, 1, 0, 0, 88, 10, 1], "semantic": {"name": "d", "arg_names": [], "import_names": [], "rhs_call_name": "loads", "annotation": ""}, "snippet": " d = simplejson.loads(content)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99080:Assign_L1073_C6", "label": "access_token =", "type": "assigned_variable", "loc": [1073, 1073], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99080:If_L1070_C4", "vector": [14, 3, 0.9421, 0.0009, 3, 0.09, 0.1, 797, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "access_token", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " access_token = d['access_token']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99080:Assign_L1074_C6", "label": "refresh_token = get()", "type": "assigned_variable", "loc": [1074, 1074], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99080:If_L1070_C4", "vector": [14, 3, 0.9429, 0.0009, 3, 0.09, 0.2, 192, 3, 2, 0, 0, 607, 10, 1], "semantic": {"name": "refresh_token", "arg_names": [], "import_names": [], "rhs_call_name": "get", "annotation": ""}, "snippet": " refresh_token = d.get('refresh_token', None)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99080:Assign_L1075_C6", "label": "token_expiry =", "type": "assigned_variable", "loc": [1075, 1075], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99080:If_L1070_C4", "vector": [14, 3, 0.9438, 0.0009, 3, 0.09, 0.3, 457, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "token_expiry", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " token_expiry = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99080:If_L1076_C6", "label": "if", "type": "if", "loc": [1076, 1078], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99080:If_L1070_C4", "vector": [4, 3, 0.9456, 0.0026, 3, 0.09, 0.4, 0, 0, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if 'expires_in' in d:\n token_expiry = datetime.datetime.utcnow() + datetime.timedelta(\n seconds=int(d['expires_in']))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99080:Assign_L1077_C8", "label": "token_expiry =", "type": "assigned_variable", "loc": [1077, 1078], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99080:If_L1076_C6", "vector": [14, 4, 0.946, 0.0018, 4, 0.84, 0.0, 457, 4, 0, 0, 0, 0, 0, 3], "semantic": {"name": "token_expiry", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " token_expiry = datetime.datetime.utcnow() + datetime.timedelta(\n seconds=int(d['expires_in']))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99080:If_L1080_C6", "label": "if", "type": "if", "loc": [1080, 1081], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99080:If_L1070_C4", "vector": [4, 3, 0.9486, 0.0018, 3, 0.09, 0.5, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if 'id_token' in d:\n d['id_token'] = _extract_id_token(d['id_token'])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99080:Assign_L1081_C8", "label": " = _extract_id_token()", "type": "assigned_variable", "loc": [1081, 1081], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99080:If_L1080_C6", "vector": [14, 4, 0.9491, 0.0009, 4, 0.05, 0.0, 0, 3, 1, 0, 0, 179, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "_extract_id_token", "annotation": ""}, "snippet": " d['id_token'] = _extract_id_token(d['id_token'])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99080:Expr_L1083_C6", "label": "info()", "type": "expression", "loc": [1083, 1083], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99080:If_L1070_C4", "vector": [8, 3, 0.9508, 0.0009, 3, 0.09, 0.6, 730, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "info", "arg_names": [], "import_names": [], "rhs_call_name": "info", "annotation": ""}, "snippet": " logger.info('Successfully retrieved access token: %s' % content)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99080:Return_L1084_C6", "label": "return", "type": "return", "loc": [1084, 1087], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99080:If_L1070_C4", "vector": [13, 3, 0.953, 0.0035, 3, 0.09, 0.7, 0, 3, 0, 0, 0, 0, 10, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return OAuth2Credentials(access_token, self.client_id,\n self.client_secret, refresh_token, token_expiry,\n self.token_uri, self.user_agent,\n id_token=d.get('id_token', None))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99080:Expr_L1089_C6", "label": "info()", "type": "expression", "loc": [1089, 1089], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99080:If_L1070_C4", "vector": [8, 3, 0.9561, 0.0009, 3, 0.09, 0.8, 730, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "info", "arg_names": [], "import_names": [], "rhs_call_name": "info", "annotation": ""}, "snippet": " logger.info('Failed to retrieve access token: %s' % content)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99080:Assign_L1090_C6", "label": "error_msg =", "type": "assigned_variable", "loc": [1090, 1090], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99080:If_L1070_C4", "vector": [14, 3, 0.957, 0.0009, 3, 0.09, 0.9, 503, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "error_msg", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " error_msg = 'Invalid response %s.' % resp['status']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99080:Try_L1091_C6", "label": "try", "type": "try", "loc": [1091, 1096], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99080:If_L1070_C4", "vector": [7, 3, 0.9601, 0.0053, 3, 0.09, 1.0, 0, 0, 1, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " try:\n d = simplejson.loads(content)\n if 'error' in d:\n error_msg = d['error']\n except:\n pass"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99080:Assign_L1092_C8", "label": "d = loads()", "type": "assigned_variable", "loc": [1092, 1092], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99080:Try_L1091_C6", "vector": [14, 4, 0.9587, 0.0009, 4, 0.9, 0.0, 355, 3, 1, 0, 0, 88, 10, 1], "semantic": {"name": "d", "arg_names": [], "import_names": [], "rhs_call_name": "loads", "annotation": ""}, "snippet": " d = simplejson.loads(content)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99080:If_L1093_C8", "label": "if", "type": "if", "loc": [1093, 1094], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99080:Try_L1091_C6", "vector": [4, 4, 0.9601, 0.0018, 4, 0.9, 1.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if 'error' in d:\n error_msg = d['error']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99080:Assign_L1094_C10", "label": "error_msg =", "type": "assigned_variable", "loc": [1094, 1094], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99080:If_L1093_C8", "vector": [14, 5, 0.9605, 0.0009, 5, 0.84, 0.0, 503, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "error_msg", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " error_msg = d['error']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L1100_C0", "label": "flow_from_clientsecrets", "type": "function", "loc": [1100, 1139], "level": 0, "parent": null, "vector": [2, 0, 0.9829, 0.0351, 0, 0.66, 1.0, 355, 0, 3, 1, 0, 0, 0, 4], "semantic": {"name": "flow_from_clientsecrets", "arg_names": ["filename", "scope", "message"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def flow_from_clientsecrets(filename, scope, message=None):\n \"\"\"Create a Flow from a clientsecrets file.\n\n Will create the right kind of Flow based on the contents of the clientsecrets\n file or will raise InvalidClientSecretsError for unknown types of Flows.\n\n Args:\n filename: string, File name of client secrets."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99080:Expr_L1101_C2", "label": "expression", "type": "expression", "loc": [1101, 1121], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L1100_C0", "vector": [8, 1, 0.9754, 0.0184, 1, 0.71, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Create a Flow from a clientsecrets file.\n\n Will create the right kind of Flow based on the contents of the clientsecrets\n file or will raise InvalidClientSecretsError for unknown types of Flows.\n\n Args:\n filename: string, File name of client secrets.\n scope: string or list of strings, scope(s) to request."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99080:Try_L1122_C2", "label": "try", "type": "try", "loc": [1122, 1139], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L1100_C0", "vector": [7, 1, 0.9925, 0.0158, 1, 0.71, 1.0, 0, 0, 1, 0, 0, 0, 0, 4], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " try:\n client_type, client_info = clientsecrets.loadfile(filename)\n if client_type in [clientsecrets.TYPE_WEB, clientsecrets.TYPE_INSTALLED]:\n return OAuth2WebServerFlow(\n client_info['client_id'],\n client_info['client_secret'],\n scope,\n None, # user_agent"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99080:Assign_L1123_C4", "label": "client_type, client_info = loadfile()", "type": "assigned_variable", "loc": [1123, 1123], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99080:Try_L1122_C2", "vector": [14, 2, 0.986, 0.0009, 2, 0.29, 0.0, 849, 3, 1, 0, 0, 752, 10, 1], "semantic": {"name": "client_type, client_info", "arg_names": [], "import_names": [], "rhs_call_name": "loadfile", "annotation": ""}, "snippet": " client_type, client_info = clientsecrets.loadfile(filename)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99080:If_L1124_C4", "label": "if", "type": "if", "loc": [1124, 1131], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99080:Try_L1122_C2", "vector": [4, 2, 0.9899, 0.007, 2, 0.29, 1.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if client_type in [clientsecrets.TYPE_WEB, clientsecrets.TYPE_INSTALLED]:\n return OAuth2WebServerFlow(\n client_info['client_id'],\n client_info['client_secret'],\n scope,\n None, # user_agent\n client_info['auth_uri'],\n client_info['token_uri'])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99080:Return_L1125_C8", "label": "return", "type": "return", "loc": [1125, 1131], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99080:If_L1124_C4", "vector": [13, 3, 0.9903, 0.0061, 3, 0.38, 0.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return OAuth2WebServerFlow(\n client_info['client_id'],\n client_info['client_secret'],\n scope,\n None, # user_agent\n client_info['auth_uri'],\n client_info['token_uri'])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99080:If_L1133_C4", "label": "if", "type": "if", "loc": [1133, 1136], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99080:Try_L1122_C2", "vector": [4, 2, 0.996, 0.0035, 2, 0.29, 0.0, 0, 2, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if message:\n sys.exit(message)\n else:\n raise"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99080:Expr_L1134_C6", "label": "exit()", "type": "expression", "loc": [1134, 1134], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99080:If_L1133_C4", "vector": [8, 3, 0.9956, 0.0009, 3, 0.94, 0.0, 436, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "exit", "arg_names": [], "import_names": [], "rhs_call_name": "exit", "annotation": ""}, "snippet": " sys.exit(message)"}]
[{"f": "ajibawa-2023/Python-Code-Large/train/row_99080:Try_L37_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99080:ImportFrom_L38_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99080:Try_L37_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99080:ImportFrom_L39_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99080:Try_L37_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99080:ImportFrom_L40_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99080:Try_L37_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99080:Assign_L41_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99080:Try_L45_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99080:ImportFrom_L46_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99080:Try_L45_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99080:ImportFrom_L48_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99080:ClassDef_L62_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99080:Expr_L63_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99080:ClassDef_L67_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99080:Expr_L68_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99080:ClassDef_L72_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99080:Expr_L73_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99080:ClassDef_L76_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99080:Expr_L77_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99080:ClassDef_L81_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99080:Expr_L82_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99080:ClassDef_L86_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99080:Expr_L87_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99080:ClassDef_L95_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99080:Expr_L96_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99080:ClassDef_L95_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L98_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L98_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99080:Assign_L99_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99080:ClassDef_L95_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L101_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L101_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99080:Return_L102_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99080:ClassDef_L95_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L104_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L104_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99080:Assign_L105_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99080:ClassDef_L95_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L107_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L107_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99080:Expr_L108_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99080:ClassDef_L111_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99080:Expr_L112_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99080:ClassDef_L111_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99080:Assign_L121_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99080:ClassDef_L111_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L123_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L123_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99080:Expr_L124_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L123_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99080:Expr_L130_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99080:ClassDef_L111_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L132_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L132_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99080:Expr_L133_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L132_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99080:Expr_L139_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99080:ClassDef_L111_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L141_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L141_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99080:Expr_L142_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L141_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99080:Expr_L147_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99080:ClassDef_L111_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L149_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L149_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99080:Expr_L150_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L149_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99080:Assign_L159_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L149_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99080:Assign_L160_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L149_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99080:For_L161_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99080:For_L161_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99080:If_L162_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L149_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99080:If_L164_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99080:If_L164_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99080:Assign_L165_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L149_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99080:Assign_L167_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L149_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99080:Assign_L168_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L149_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99080:Return_L169_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99080:ClassDef_L111_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L171_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L171_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99080:Expr_L172_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L171_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99080:Return_L178_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99080:ClassDef_L111_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L181_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L181_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99080:Expr_L182_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L181_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99080:Assign_L192_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L181_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99080:Assign_L194_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L181_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99080:Try_L195_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99080:Try_L195_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99080:Assign_L196_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99080:Try_L195_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99080:Assign_L199_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99080:Try_L195_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99080:Assign_L200_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L181_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99080:Assign_L202_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L181_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99080:Assign_L203_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L181_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99080:Assign_L204_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L181_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99080:Return_L205_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99080:ClassDef_L111_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L208_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L208_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99080:Expr_L209_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L208_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99080:Return_L219_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99080:ClassDef_L222_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99080:Expr_L223_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99080:ClassDef_L227_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99080:Expr_L228_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99080:ClassDef_L227_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L235_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L235_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99080:Expr_L236_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99080:ClassDef_L227_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L242_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L242_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99080:Expr_L243_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99080:ClassDef_L227_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L250_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L250_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99080:Expr_L251_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L250_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99080:Expr_L258_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99080:ClassDef_L227_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L260_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L260_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99080:Expr_L261_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L260_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99080:Expr_L268_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99080:ClassDef_L227_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L270_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L270_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99080:Expr_L271_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L270_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99080:Expr_L275_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99080:ClassDef_L227_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L277_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L277_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99080:Expr_L278_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L277_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99080:Expr_L285_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L277_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99080:Try_L286_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99080:Try_L286_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99080:Return_L287_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99080:Try_L286_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99080:Expr_L289_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99080:ClassDef_L227_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L291_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L291_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99080:Expr_L292_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L291_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99080:Expr_L299_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L291_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99080:Try_L300_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99080:Try_L300_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99080:Expr_L301_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99080:Try_L300_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99080:Expr_L303_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99080:ClassDef_L227_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L305_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L305_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99080:Expr_L306_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L305_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99080:Expr_L314_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L305_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99080:Try_L315_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99080:Try_L315_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99080:Return_L316_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99080:Try_L315_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99080:Expr_L318_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99080:ClassDef_L321_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99080:Expr_L322_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99080:ClassDef_L321_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L330_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L330_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99080:Expr_L332_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L330_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99080:Assign_L353_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L330_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99080:Assign_L354_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L330_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99080:Assign_L355_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L330_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99080:Assign_L356_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L330_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99080:Assign_L357_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L330_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99080:Assign_L358_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L330_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99080:Assign_L359_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L330_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99080:Assign_L360_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L330_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99080:Assign_L361_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L330_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99080:Assign_L365_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99080:ClassDef_L321_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L367_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L367_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99080:Expr_L368_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L367_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99080:Assign_L394_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L367_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L397_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L397_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99080:If_L400_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99080:If_L400_C6", "t": "ajibawa-2023/Python-Code-Large/train/row_99080:Expr_L401_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99080:If_L400_C6", "t": "ajibawa-2023/Python-Code-Large/train/row_99080:Expr_L402_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L397_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99080:If_L406_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99080:If_L406_C6", "t": "ajibawa-2023/Python-Code-Large/train/row_99080:Assign_L407_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L397_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99080:Expr_L408_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L397_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99080:If_L410_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99080:If_L410_C6", "t": "ajibawa-2023/Python-Code-Large/train/row_99080:If_L411_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99080:If_L411_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99080:Assign_L412_C10"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99080:If_L411_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99080:Assign_L414_C10"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L397_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99080:Assign_L416_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L397_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99080:If_L419_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99080:If_L419_C6", "t": "ajibawa-2023/Python-Code-Large/train/row_99080:Expr_L420_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99080:If_L419_C6", "t": "ajibawa-2023/Python-Code-Large/train/row_99080:Expr_L421_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99080:If_L419_C6", "t": "ajibawa-2023/Python-Code-Large/train/row_99080:Expr_L422_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99080:If_L419_C6", "t": "ajibawa-2023/Python-Code-Large/train/row_99080:Return_L423_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99080:If_L419_C6", "t": "ajibawa-2023/Python-Code-Large/train/row_99080:Return_L426_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L367_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99080:Assign_L429_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L367_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99080:Expr_L432_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L367_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99080:Return_L434_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99080:ClassDef_L321_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L436_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L436_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99080:Expr_L437_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L436_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99080:Expr_L443_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99080:ClassDef_L321_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L445_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L445_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99080:Expr_L446_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L445_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99080:Assign_L451_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99080:ClassDef_L321_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L453_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L453_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99080:Return_L454_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99080:ClassDef_L321_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L457_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L457_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99080:Expr_L458_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L457_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99080:Assign_L467_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L457_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99080:If_L468_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99080:If_L468_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99080:Try_L470_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99080:Try_L470_C6", "t": "ajibawa-2023/Python-Code-Large/train/row_99080:Assign_L471_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99080:Try_L470_C6", "t": "ajibawa-2023/Python-Code-Large/train/row_99080:Assign_L474_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L457_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99080:Assign_L475_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L457_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99080:Assign_L484_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L457_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99080:Return_L485_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99080:ClassDef_L321_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L488_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L488_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99080:Expr_L489_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L488_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99080:If_L493_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99080:If_L493_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99080:Return_L494_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L488_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99080:If_L496_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99080:If_L496_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99080:Return_L497_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L488_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99080:Assign_L499_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L488_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99080:If_L500_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99080:If_L500_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99080:Expr_L501_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99080:If_L500_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99080:Return_L503_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L488_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99080:Return_L504_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99080:ClassDef_L321_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L506_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L506_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99080:Expr_L507_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L506_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99080:Assign_L516_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99080:ClassDef_L321_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L518_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L518_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99080:Expr_L519_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L518_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99080:Expr_L520_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99080:ClassDef_L321_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L522_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L522_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99080:Expr_L523_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L522_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99080:Assign_L524_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L522_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99080:Return_L526_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99080:ClassDef_L321_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L528_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L528_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99080:Expr_L529_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L528_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99080:Expr_L530_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L528_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99080:Assign_L531_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99080:ClassDef_L321_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L533_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L533_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99080:Expr_L534_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L533_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99080:Assign_L535_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L533_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99080:Return_L541_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99080:ClassDef_L321_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L543_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L543_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99080:Expr_L544_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L543_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99080:Assign_L545_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L543_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99080:If_L549_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99080:If_L549_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99080:Assign_L550_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L543_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99080:Return_L552_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99080:ClassDef_L321_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L554_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L554_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99080:Expr_L555_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L554_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99080:If_L568_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99080:If_L568_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99080:Expr_L569_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99080:If_L568_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99080:Expr_L571_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99080:If_L568_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99080:Try_L572_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99080:Try_L572_C6", "t": "ajibawa-2023/Python-Code-Large/train/row_99080:Assign_L573_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99080:Try_L572_C6", "t": "ajibawa-2023/Python-Code-Large/train/row_99080:If_L574_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99080:If_L574_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99080:Expr_L576_C10"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99080:If_L574_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99080:Expr_L577_C10"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99080:If_L574_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99080:Expr_L579_C10"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99080:Try_L572_C6", "t": "ajibawa-2023/Python-Code-Large/train/row_99080:Expr_L581_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99080:ClassDef_L321_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L583_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L583_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99080:Expr_L584_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L583_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99080:Assign_L593_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L583_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99080:Assign_L594_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L583_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99080:Expr_L596_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L583_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99080:Assign_L597_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L583_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99080:If_L599_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99080:If_L599_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99080:Assign_L601_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99080:If_L599_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99080:Assign_L602_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99080:If_L599_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99080:Assign_L603_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99080:If_L599_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99080:If_L604_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99080:If_L604_C6", "t": "ajibawa-2023/Python-Code-Large/train/row_99080:Assign_L605_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99080:If_L604_C6", "t": "ajibawa-2023/Python-Code-Large/train/row_99080:Assign_L608_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99080:If_L599_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99080:If_L609_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99080:If_L609_C6", "t": "ajibawa-2023/Python-Code-Large/train/row_99080:Expr_L610_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99080:If_L599_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99080:Expr_L614_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99080:If_L599_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99080:Assign_L615_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99080:If_L599_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99080:Try_L616_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99080:Try_L616_C6", "t": "ajibawa-2023/Python-Code-Large/train/row_99080:Assign_L617_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99080:Try_L616_C6", "t": "ajibawa-2023/Python-Code-Large/train/row_99080:If_L618_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99080:If_L618_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99080:Assign_L619_C10"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99080:If_L618_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99080:Assign_L620_C10"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99080:If_L618_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99080:If_L621_C10"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99080:If_L621_C10", "t": "ajibawa-2023/Python-Code-Large/train/row_99080:Expr_L622_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99080:ClassDef_L628_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99080:Expr_L629_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99080:ClassDef_L628_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L653_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L653_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99080:Expr_L654_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L653_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99080:Expr_L667_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99080:ClassDef_L628_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L678_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L678_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99080:Assign_L679_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L678_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99080:Assign_L680_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L678_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99080:Return_L683_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99080:ClassDef_L628_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L685_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99080:ClassDef_L690_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99080:Expr_L691_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99080:ClassDef_L690_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L701_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L701_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99080:Expr_L704_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L701_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99080:Expr_L713_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L701_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99080:Assign_L721_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99080:ClassDef_L690_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L723_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L723_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99080:Assign_L724_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L723_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99080:Assign_L726_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L723_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99080:Return_L732_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99080:ClassDef_L690_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L734_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L734_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99080:Expr_L735_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L734_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99080:Expr_L738_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99080:If_L740_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99080:ClassDef_L745_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99080:ClassDef_L745_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99080:Expr_L746_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99080:ClassDef_L745_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99080:Assign_L753_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99080:ClassDef_L745_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L755_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L755_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99080:Expr_L763_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L755_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99080:Expr_L777_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L755_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99080:If_L783_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99080:If_L783_C6", "t": "ajibawa-2023/Python-Code-Large/train/row_99080:Assign_L784_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L755_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99080:Assign_L785_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L755_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99080:Assign_L787_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L755_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99080:Assign_L788_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L755_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99080:Assign_L789_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L755_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99080:Assign_L790_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99080:ClassDef_L745_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L793_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L793_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99080:Assign_L794_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L793_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99080:Assign_L795_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L793_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99080:Assign_L804_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L793_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99080:Return_L805_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99080:ClassDef_L745_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L807_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L807_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99080:Expr_L808_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L807_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99080:Assign_L809_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L807_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99080:Assign_L810_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L807_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99080:Expr_L817_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L807_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99080:Expr_L818_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L807_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99080:Return_L820_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99080:If_L740_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99080:Assign_L826_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99080:If_L740_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L828_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L828_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99080:Expr_L830_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L828_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99080:If_L846_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99080:If_L846_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99080:Assign_L847_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L828_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99080:Assign_L849_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L828_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99080:If_L851_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99080:If_L851_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99080:Assign_L852_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99080:If_L851_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99080:Return_L853_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L858_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99080:Assign_L860_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L858_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99080:Assign_L861_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L858_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99080:Return_L862_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L865_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99080:Expr_L866_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L865_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99080:Assign_L876_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L865_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99080:If_L878_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L865_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99080:Return_L882_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L884_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99080:Expr_L888_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L884_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99080:Assign_L908_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L884_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99080:Assign_L913_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L884_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99080:Assign_L914_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L884_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99080:Return_L915_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L918_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99080:Expr_L922_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L918_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99080:Assign_L950_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L918_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99080:Assign_L952_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L918_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99080:Assign_L953_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L918_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99080:Return_L954_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99080:ClassDef_L957_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99080:Expr_L958_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99080:ClassDef_L957_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L963_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L963_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99080:Expr_L967_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L963_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99080:Assign_L982_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L963_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99080:Assign_L983_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L963_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99080:If_L984_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99080:If_L984_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99080:Assign_L985_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L963_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99080:Assign_L986_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L963_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99080:Assign_L987_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L963_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99080:Assign_L988_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L963_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99080:Assign_L989_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L963_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99080:Assign_L990_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L963_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99080:Expr_L993_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L963_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99080:Assign_L994_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99080:ClassDef_L957_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L996_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L996_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99080:Expr_L997_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L996_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99080:Assign_L1010_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L996_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99080:Assign_L1011_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L996_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99080:Expr_L1017_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L996_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99080:Assign_L1018_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L996_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99080:Expr_L1019_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L996_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99080:Assign_L1020_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L996_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99080:Return_L1021_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99080:ClassDef_L957_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L1023_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L1023_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99080:Expr_L1024_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L1023_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99080:If_L1040_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99080:If_L1040_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99080:If_L1041_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99080:If_L1041_C6", "t": "ajibawa-2023/Python-Code-Large/train/row_99080:If_L1042_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99080:If_L1042_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99080:Assign_L1043_C10"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99080:If_L1042_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99080:Assign_L1045_C10"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99080:If_L1041_C6", "t": "ajibawa-2023/Python-Code-Large/train/row_99080:Assign_L1048_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L1023_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99080:Assign_L1050_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L1023_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99080:Assign_L1058_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L1023_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99080:If_L1062_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99080:If_L1062_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99080:Assign_L1063_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L1023_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99080:If_L1065_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99080:If_L1065_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99080:Assign_L1066_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L1023_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99080:Assign_L1068_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L1023_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99080:If_L1070_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99080:If_L1070_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99080:Assign_L1072_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99080:If_L1070_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99080:Assign_L1073_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99080:If_L1070_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99080:Assign_L1074_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99080:If_L1070_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99080:Assign_L1075_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99080:If_L1070_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99080:If_L1076_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99080:If_L1076_C6", "t": "ajibawa-2023/Python-Code-Large/train/row_99080:Assign_L1077_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99080:If_L1070_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99080:If_L1080_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99080:If_L1080_C6", "t": "ajibawa-2023/Python-Code-Large/train/row_99080:Assign_L1081_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99080:If_L1070_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99080:Expr_L1083_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99080:If_L1070_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99080:Return_L1084_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99080:If_L1070_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99080:Expr_L1089_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99080:If_L1070_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99080:Assign_L1090_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99080:If_L1070_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99080:Try_L1091_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99080:Try_L1091_C6", "t": "ajibawa-2023/Python-Code-Large/train/row_99080:Assign_L1092_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99080:Try_L1091_C6", "t": "ajibawa-2023/Python-Code-Large/train/row_99080:If_L1093_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99080:If_L1093_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99080:Assign_L1094_C10"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L1100_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99080:Expr_L1101_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99080:FunctionDef_L1100_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99080:Try_L1122_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99080:Try_L1122_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99080:Assign_L1123_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99080:Try_L1122_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99080:If_L1124_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99080:If_L1124_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99080:Return_L1125_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99080:Try_L1122_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99080:If_L1133_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99080:If_L1133_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99080:Expr_L1134_C6"}]
# Copyright (C) 2011 Google Inc. # # 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. """Utilities for reading OAuth 2.0 client secret files. A client_secrets.json file contains all the information needed to interact with an OAuth 2.0 protected service. """ __author__ = 'jcgregorio@google.com (Joe Gregorio)' from anyjson import simplejson # Properties that make a client_secrets.json file valid. TYPE_WEB = 'web' TYPE_INSTALLED = 'installed' VALID_CLIENT = { TYPE_WEB: { 'required': [ 'client_id', 'client_secret', 'redirect_uris', 'auth_uri', 'token_uri'], 'string': [ 'client_id', 'client_secret' ] }, TYPE_INSTALLED: { 'required': [ 'client_id', 'client_secret', 'redirect_uris', 'auth_uri', 'token_uri'], 'string': [ 'client_id', 'client_secret' ] } } class Error(Exception): """Base error for this module.""" pass class InvalidClientSecretsError(Error): """Format of ClientSecrets file is invalid.""" pass def _validate_clientsecrets(obj): if obj is None or len(obj) != 1: raise InvalidClientSecretsError('Invalid file format.') client_type = obj.keys()[0] if client_type not in VALID_CLIENT.keys(): raise InvalidClientSecretsError('Unknown client type: %s.' % client_type) client_info = obj[client_type] for prop_name in VALID_CLIENT[client_type]['required']: if prop_name not in client_info: raise InvalidClientSecretsError( 'Missing property "%s" in a client type of "%s".' % (prop_name, client_type)) for prop_name in VALID_CLIENT[client_type]['string']: if client_info[prop_name].startswith('[['): raise InvalidClientSecretsError( 'Property "%s" is not configured.' % prop_name) return client_type, client_info def load(fp): obj = simplejson.load(fp) return _validate_clientsecrets(obj) def loads(s): obj = simplejson.loads(s) return _validate_clientsecrets(obj) def loadfile(filename): try: fp = file(filename, 'r') try: obj = simplejson.load(fp) finally: fp.close() except IOError: raise InvalidClientSecretsError('File not found: "%s"' % filename) return _validate_clientsecrets(obj)
ajibawa-2023/Python-Code-Large/train/row_99081
33
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_99081:Expr_L15_C0", "label": "expression", "type": "expression", "loc": [15, 19], "level": 0, "parent": null, "vector": [8, 0, 0.1619, 0.0476, 0, 0.66, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\"\"\"Utilities for reading OAuth 2.0 client secret files.\n\nA client_secrets.json file contains all the information needed to interact with\nan OAuth 2.0 protected service.\n\"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99081:Assign_L21_C0", "label": "__author__ =", "type": "assigned_variable", "loc": [21, 21], "level": 0, "parent": null, "vector": [14, 0, 0.2, 0.0095, 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__ = 'jcgregorio@google.com (Joe Gregorio)'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99081:ImportFrom_L24_C0", "label": "from anyjson import simplejson", "type": "import", "loc": [24, 24], "level": 0, "parent": null, "vector": [1, 0, 0.2286, 0.0095, 0, 0.66, 0.1818, 877, 0, 1, 0, 0, 877, 0, 0], "semantic": {"name": "anyjson", "arg_names": [], "import_names": ["simplejson"], "rhs_call_name": "", "annotation": ""}, "snippet": "from anyjson import simplejson"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99081:Assign_L27_C0", "label": "TYPE_WEB =", "type": "assigned_variable", "loc": [27, 27], "level": 0, "parent": null, "vector": [14, 0, 0.2571, 0.0095, 0, 0.66, 0.2727, 350, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "TYPE_WEB", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "TYPE_WEB = 'web'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99081:Assign_L28_C0", "label": "TYPE_INSTALLED =", "type": "assigned_variable", "loc": [28, 28], "level": 0, "parent": null, "vector": [14, 0, 0.2667, 0.0095, 0, 0.66, 0.3636, 412, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "TYPE_INSTALLED", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "TYPE_INSTALLED = 'installed'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99081:Assign_L30_C0", "label": "VALID_CLIENT =", "type": "assigned_variable", "loc": [30, 55], "level": 0, "parent": null, "vector": [14, 0, 0.4048, 0.2476, 0, 0.66, 0.4545, 361, 0, 0, 0, 0, 0, 6, 0], "semantic": {"name": "VALID_CLIENT", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "VALID_CLIENT = {\n TYPE_WEB: {\n 'required': [\n 'client_id',\n 'client_secret',\n 'redirect_uris',\n 'auth_uri',\n 'token_uri'],"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99081:ClassDef_L57_C0", "label": "Error", "type": "class", "loc": [57, 59], "level": 0, "parent": null, "vector": [3, 0, 0.5524, 0.0286, 0, 0.66, 0.5455, 529, 0, 0, 0, 0, 645, 0, 0], "semantic": {"name": "Error", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class Error(Exception):\n \"\"\"Base error for this module.\"\"\"\n pass"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99081:Expr_L58_C2", "label": "expression", "type": "expression", "loc": [58, 58], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99081:ClassDef_L57_C0", "vector": [8, 1, 0.5524, 0.0095, 1, 0.79, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Base error for this module.\"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99081:ClassDef_L62_C0", "label": "InvalidClientSecretsError", "type": "class", "loc": [62, 64], "level": 0, "parent": null, "vector": [3, 0, 0.6, 0.0286, 0, 0.66, 0.6364, 481, 0, 0, 0, 0, 529, 0, 0], "semantic": {"name": "InvalidClientSecretsError", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class InvalidClientSecretsError(Error):\n \"\"\"Format of ClientSecrets file is invalid.\"\"\"\n pass"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99081:Expr_L63_C2", "label": "expression", "type": "expression", "loc": [63, 63], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99081:ClassDef_L62_C0", "vector": [8, 1, 0.6, 0.0095, 1, 0.83, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Format of ClientSecrets file is invalid.\"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99081:FunctionDef_L67_C0", "label": "_validate_clientsecrets", "type": "function", "loc": [67, 83], "level": 0, "parent": null, "vector": [2, 0, 0.7143, 0.1619, 0, 0.66, 0.7273, 852, 0, 1, 1, 0, 0, 0, 8], "semantic": {"name": "_validate_clientsecrets", "arg_names": ["obj"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def _validate_clientsecrets(obj):\n if obj is None or len(obj) != 1:\n raise InvalidClientSecretsError('Invalid file format.')\n client_type = obj.keys()[0]\n if client_type not in VALID_CLIENT.keys():\n raise InvalidClientSecretsError('Unknown client type: %s.' % client_type)\n client_info = obj[client_type]\n for prop_name in VALID_CLIENT[client_type]['required']:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99081:If_L68_C2", "label": "if", "type": "if", "loc": [68, 69], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99081:FunctionDef_L67_C0", "vector": [4, 1, 0.6524, 0.019, 1, 0.93, 0.0, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if obj is None or len(obj) != 1:\n raise InvalidClientSecretsError('Invalid file format.')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99081:Assign_L70_C2", "label": "client_type =", "type": "assigned_variable", "loc": [70, 70], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99081:FunctionDef_L67_C0", "vector": [14, 1, 0.6667, 0.0095, 1, 0.93, 0.1667, 130, 6, 0, 0, 0, 0, 0, 1], "semantic": {"name": "client_type", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " client_type = obj.keys()[0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99081:If_L71_C2", "label": "if", "type": "if", "loc": [71, 72], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99081:FunctionDef_L67_C0", "vector": [4, 1, 0.681, 0.019, 1, 0.93, 0.3333, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if client_type not in VALID_CLIENT.keys():\n raise InvalidClientSecretsError('Unknown client type: %s.' % client_type)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99081:Assign_L73_C2", "label": "client_info =", "type": "assigned_variable", "loc": [73, 73], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99081:FunctionDef_L67_C0", "vector": [14, 1, 0.6952, 0.0095, 1, 0.93, 0.5, 923, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "client_info", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " client_info = obj[client_type]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99081:For_L74_C2", "label": "for prop_name", "type": "for", "loc": [74, 78], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99081:FunctionDef_L67_C0", "vector": [6, 1, 0.7238, 0.0476, 1, 0.93, 0.6667, 117, 6, 0, 0, 0, 0, 0, 1], "semantic": {"name": "prop_name", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for prop_name in VALID_CLIENT[client_type]['required']:\n if prop_name not in client_info:\n raise InvalidClientSecretsError(\n 'Missing property \"%s\" in a client type of \"%s\".' % (prop_name,\n client_type))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99081:If_L75_C4", "label": "if", "type": "if", "loc": [75, 78], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99081:For_L74_C2", "vector": [4, 2, 0.7286, 0.0381, 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 prop_name not in client_info:\n raise InvalidClientSecretsError(\n 'Missing property \"%s\" in a client type of \"%s\".' % (prop_name,\n client_type))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99081:For_L79_C2", "label": "for prop_name", "type": "for", "loc": [79, 82], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99081:FunctionDef_L67_C0", "vector": [6, 1, 0.7667, 0.0381, 1, 0.93, 0.8333, 117, 6, 0, 0, 0, 0, 0, 2], "semantic": {"name": "prop_name", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for prop_name in VALID_CLIENT[client_type]['string']:\n if client_info[prop_name].startswith('[['):\n raise InvalidClientSecretsError(\n 'Property \"%s\" is not configured.' % prop_name)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99081:If_L80_C4", "label": "if", "type": "if", "loc": [80, 82], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99081:For_L79_C2", "vector": [4, 2, 0.7714, 0.0286, 2, 0.8, 0.0, 0, 3, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if client_info[prop_name].startswith('[['):\n raise InvalidClientSecretsError(\n 'Property \"%s\" is not configured.' % prop_name)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99081:Return_L83_C2", "label": "return", "type": "return", "loc": [83, 83], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99081:FunctionDef_L67_C0", "vector": [13, 1, 0.7905, 0.0095, 1, 0.93, 1.0, 0, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return client_type, client_info"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99081:FunctionDef_L86_C0", "label": "load", "type": "function", "loc": [86, 88], "level": 0, "parent": null, "vector": [2, 0, 0.8286, 0.0286, 0, 0.66, 0.8182, 37, 0, 1, 1, 0, 0, 0, 2], "semantic": {"name": "load", "arg_names": ["fp"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def load(fp):\n obj = simplejson.load(fp)\n return _validate_clientsecrets(obj)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99081:Assign_L87_C2", "label": "obj = load()", "type": "assigned_variable", "loc": [87, 87], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99081:FunctionDef_L86_C0", "vector": [14, 1, 0.8286, 0.0095, 1, 0.77, 0.0, 505, 3, 1, 0, 0, 37, 10, 1], "semantic": {"name": "obj", "arg_names": [], "import_names": [], "rhs_call_name": "load", "annotation": ""}, "snippet": " obj = simplejson.load(fp)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99081:Return_L88_C2", "label": "return", "type": "return", "loc": [88, 88], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99081:FunctionDef_L86_C0", "vector": [13, 1, 0.8381, 0.0095, 1, 0.77, 1.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return _validate_clientsecrets(obj)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99081:FunctionDef_L91_C0", "label": "loads", "type": "function", "loc": [91, 93], "level": 0, "parent": null, "vector": [2, 0, 0.8762, 0.0286, 0, 0.66, 0.9091, 88, 0, 1, 1, 0, 0, 0, 2], "semantic": {"name": "loads", "arg_names": ["s"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def loads(s):\n obj = simplejson.loads(s)\n return _validate_clientsecrets(obj)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99081:Assign_L92_C2", "label": "obj = loads()", "type": "assigned_variable", "loc": [92, 92], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99081:FunctionDef_L91_C0", "vector": [14, 1, 0.8762, 0.0095, 1, 0.5, 0.0, 505, 3, 1, 0, 0, 88, 10, 1], "semantic": {"name": "obj", "arg_names": [], "import_names": [], "rhs_call_name": "loads", "annotation": ""}, "snippet": " obj = simplejson.loads(s)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99081:Return_L93_C2", "label": "return", "type": "return", "loc": [93, 93], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99081:FunctionDef_L91_C0", "vector": [13, 1, 0.8857, 0.0095, 1, 0.5, 1.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return _validate_clientsecrets(obj)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99081:FunctionDef_L96_C0", "label": "loadfile", "type": "function", "loc": [96, 105], "level": 0, "parent": null, "vector": [2, 0, 0.9571, 0.0952, 0, 0.66, 1.0, 752, 0, 1, 1, 0, 0, 0, 5], "semantic": {"name": "loadfile", "arg_names": ["filename"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def loadfile(filename):\n try:\n fp = file(filename, 'r')\n try:\n obj = simplejson.load(fp)\n finally:\n fp.close()\n except IOError:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99081:Try_L97_C2", "label": "try", "type": "try", "loc": [97, 104], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99081:FunctionDef_L96_C0", "vector": [7, 1, 0.9571, 0.0762, 1, 0.46, 0.0, 0, 0, 1, 0, 0, 0, 0, 4], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " try:\n fp = file(filename, 'r')\n try:\n obj = simplejson.load(fp)\n finally:\n fp.close()\n except IOError:\n raise InvalidClientSecretsError('File not found: \"%s\"' % filename)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99081:Assign_L98_C4", "label": "fp = file()", "type": "assigned_variable", "loc": [98, 98], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99081:Try_L97_C2", "vector": [14, 2, 0.9333, 0.0095, 2, 0.04, 0.0, 392, 3, 2, 0, 0, 107, 10, 1], "semantic": {"name": "fp", "arg_names": [], "import_names": [], "rhs_call_name": "file", "annotation": ""}, "snippet": " fp = file(filename, 'r')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99081:Try_L99_C4", "label": "try", "type": "try", "loc": [99, 102], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99081:Try_L97_C2", "vector": [7, 2, 0.9571, 0.0381, 2, 0.04, 1.0, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " try:\n obj = simplejson.load(fp)\n finally:\n fp.close()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99081:Assign_L100_C6", "label": "obj = load()", "type": "assigned_variable", "loc": [100, 100], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99081:Try_L99_C4", "vector": [14, 3, 0.9524, 0.0095, 3, 0.56, 0.0, 505, 3, 1, 0, 0, 37, 10, 1], "semantic": {"name": "obj", "arg_names": [], "import_names": [], "rhs_call_name": "load", "annotation": ""}, "snippet": " obj = simplejson.load(fp)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99081:Expr_L102_C6", "label": "close()", "type": "expression", "loc": [102, 102], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99081:Try_L99_C4", "vector": [8, 3, 0.9714, 0.0095, 3, 0.56, 1.0, 77, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "close", "arg_names": [], "import_names": [], "rhs_call_name": "close", "annotation": ""}, "snippet": " fp.close()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99081:Return_L105_C2", "label": "return", "type": "return", "loc": [105, 105], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99081:FunctionDef_L96_C0", "vector": [13, 1, 1.0, 0.0095, 1, 0.46, 1.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return _validate_clientsecrets(obj)"}]
[{"f": "ajibawa-2023/Python-Code-Large/train/row_99081:ClassDef_L57_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99081:Expr_L58_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99081:ClassDef_L62_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99081:Expr_L63_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99081:FunctionDef_L67_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99081:If_L68_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99081:FunctionDef_L67_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99081:Assign_L70_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99081:FunctionDef_L67_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99081:If_L71_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99081:FunctionDef_L67_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99081:Assign_L73_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99081:FunctionDef_L67_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99081:For_L74_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99081:For_L74_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99081:If_L75_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99081:FunctionDef_L67_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99081:For_L79_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99081:For_L79_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99081:If_L80_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99081:FunctionDef_L67_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99081:Return_L83_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99081:FunctionDef_L86_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99081:Assign_L87_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99081:FunctionDef_L86_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99081:Return_L88_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99081:FunctionDef_L91_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99081:Assign_L92_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99081:FunctionDef_L91_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99081:Return_L93_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99081:FunctionDef_L96_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99081:Try_L97_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99081:Try_L97_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99081:Assign_L98_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99081:Try_L97_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99081:Try_L99_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99081:Try_L99_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99081:Assign_L100_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99081:Try_L99_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99081:Expr_L102_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99081:FunctionDef_L96_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99081:Return_L105_C2"}]
# Copyright (C) 2010 Google Inc. # # 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. """Utilities for OAuth. Utilities for making it easier to work with OAuth 2.0 credentials. """ __author__ = 'jcgregorio@google.com (Joe Gregorio)' import os import stat import threading from anyjson import simplejson from client import Storage as BaseStorage from client import Credentials class Storage(BaseStorage): """Store and retrieve a single credential to and from a file.""" def __init__(self, filename): self._filename = filename self._lock = threading.Lock() def acquire_lock(self): """Acquires any lock necessary to access this Storage. This lock is not reentrant.""" self._lock.acquire() def release_lock(self): """Release the Storage lock. Trying to release a lock that isn't held will result in a RuntimeError. """ self._lock.release() def locked_get(self): """Retrieve Credential from file. Returns: oauth2client.client.Credentials """ credentials = None try: f = open(self._filename, 'rb') content = f.read() f.close() except IOError: return credentials try: credentials = Credentials.new_from_json(content) credentials.set_store(self) except ValueError: pass return credentials def _create_file_if_needed(self): """Create an empty file if necessary. This method will not initialize the file. Instead it implements a simple version of "touch" to ensure the file has been created. """ if not os.path.exists(self._filename): old_umask = os.umask(0177) try: open(self._filename, 'a+b').close() finally: os.umask(old_umask) def locked_put(self, credentials): """Write Credentials to file. Args: credentials: Credentials, the credentials to store. """ self._create_file_if_needed() f = open(self._filename, 'wb') f.write(credentials.to_json()) f.close() def locked_delete(self): """Delete Credentials file. Args: credentials: Credentials, the credentials to store. """ os.unlink(self._filename)
ajibawa-2023/Python-Code-Large/train/row_99082
46
106
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_99082:Expr_L15_C0", "label": "expression", "type": "expression", "loc": [15, 19], "level": 0, "parent": null, "vector": [8, 0, 0.1604, 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": "\"\"\"Utilities for OAuth.\n\nUtilities for making it easier to work with OAuth 2.0\ncredentials.\n\"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99082:Assign_L21_C0", "label": "__author__ =", "type": "assigned_variable", "loc": [21, 21], "level": 0, "parent": null, "vector": [14, 0, 0.1981, 0.0094, 0, 0.66, 0.125, 777, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "__author__", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "__author__ = 'jcgregorio@google.com (Joe Gregorio)'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99082:Import_L23_C0", "label": "os import os", "type": "import", "loc": [23, 23], "level": 0, "parent": null, "vector": [1, 0, 0.217, 0.0094, 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_99082:Import_L24_C0", "label": "stat import stat", "type": "import", "loc": [24, 24], "level": 0, "parent": null, "vector": [1, 0, 0.2264, 0.0094, 0, 0.66, 0.375, 48, 0, 1, 0, 0, 48, 0, 0], "semantic": {"name": "stat", "arg_names": [], "import_names": ["stat"], "rhs_call_name": "", "annotation": ""}, "snippet": "import stat"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99082:Import_L25_C0", "label": "threading import threading", "type": "import", "loc": [25, 25], "level": 0, "parent": null, "vector": [1, 0, 0.2358, 0.0094, 0, 0.66, 0.5, 83, 0, 1, 0, 0, 83, 0, 0], "semantic": {"name": "threading", "arg_names": [], "import_names": ["threading"], "rhs_call_name": "", "annotation": ""}, "snippet": "import threading"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99082:ImportFrom_L27_C0", "label": "from anyjson import simplejson", "type": "import", "loc": [27, 27], "level": 0, "parent": null, "vector": [1, 0, 0.2547, 0.0094, 0, 0.66, 0.625, 877, 0, 1, 0, 0, 877, 0, 0], "semantic": {"name": "anyjson", "arg_names": [], "import_names": ["simplejson"], "rhs_call_name": "", "annotation": ""}, "snippet": "from anyjson import simplejson"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99082:ImportFrom_L28_C0", "label": "from client import BaseStorage", "type": "import", "loc": [28, 28], "level": 0, "parent": null, "vector": [1, 0, 0.2642, 0.0094, 0, 0.66, 0.75, 608, 0, 1, 0, 0, 608, 0, 0], "semantic": {"name": "client", "arg_names": [], "import_names": ["BaseStorage"], "rhs_call_name": "", "annotation": ""}, "snippet": "from client import Storage as BaseStorage"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99082:ImportFrom_L29_C0", "label": "from client import Credentials", "type": "import", "loc": [29, 29], "level": 0, "parent": null, "vector": [1, 0, 0.2736, 0.0094, 0, 0.66, 0.875, 608, 0, 1, 0, 0, 608, 0, 0], "semantic": {"name": "client", "arg_names": [], "import_names": ["Credentials"], "rhs_call_name": "", "annotation": ""}, "snippet": "from client import Credentials"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99082:ClassDef_L32_C0", "label": "Storage", "type": "class", "loc": [32, 106], "level": 0, "parent": null, "vector": [3, 0, 0.6509, 0.7075, 0, 0.66, 1.0, 850, 0, 7, 0, 0, 775, 0, 18], "semantic": {"name": "Storage", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class Storage(BaseStorage):\n \"\"\"Store and retrieve a single credential to and from a file.\"\"\"\n\n def __init__(self, filename):\n self._filename = filename\n self._lock = threading.Lock()\n\n def acquire_lock(self):"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99082:Expr_L33_C2", "label": "expression", "type": "expression", "loc": [33, 33], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99082:ClassDef_L32_C0", "vector": [8, 1, 0.3113, 0.0094, 1, 0.69, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Store and retrieve a single credential to and from a file.\"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99082:FunctionDef_L35_C2", "label": "__init__", "type": "function", "loc": [35, 37], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99082:ClassDef_L32_C0", "vector": [2, 1, 0.3396, 0.0283, 1, 0.69, 0.1429, 555, 0, 2, 0, 0, 0, 0, 1], "semantic": {"name": "__init__", "arg_names": ["self", "filename"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, filename):\n self._filename = filename\n self._lock = threading.Lock()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99082:Assign_L36_C4", "label": "self._filename =", "type": "assigned_variable", "loc": [36, 36], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99082:FunctionDef_L35_C2", "vector": [14, 2, 0.3396, 0.0094, 2, 0.32, 0.0, 146, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self._filename", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self._filename = filename"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99082:Assign_L37_C4", "label": "self._lock = Lock()", "type": "assigned_variable", "loc": [37, 37], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99082:FunctionDef_L35_C2", "vector": [14, 2, 0.3491, 0.0094, 2, 0.32, 1.0, 143, 3, 0, 0, 0, 843, 10, 1], "semantic": {"name": "self._lock", "arg_names": [], "import_names": [], "rhs_call_name": "Lock", "annotation": ""}, "snippet": " self._lock = threading.Lock()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99082:FunctionDef_L39_C2", "label": "acquire_lock", "type": "function", "loc": [39, 43], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99082:ClassDef_L32_C0", "vector": [2, 1, 0.3868, 0.0472, 1, 0.69, 0.2857, 5, 0, 1, 0, 0, 0, 0, 1], "semantic": {"name": "acquire_lock", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def acquire_lock(self):\n \"\"\"Acquires any lock necessary to access this Storage.\n\n This lock is not reentrant.\"\"\"\n self._lock.acquire()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99082:Expr_L40_C4", "label": "expression", "type": "expression", "loc": [40, 42], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99082:FunctionDef_L39_C2", "vector": [8, 2, 0.3868, 0.0283, 2, 0.53, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Acquires any lock necessary to access this Storage.\n\n This lock is not reentrant.\"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99082:Expr_L43_C4", "label": "acquire()", "type": "expression", "loc": [43, 43], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99082:FunctionDef_L39_C2", "vector": [8, 2, 0.4057, 0.0094, 2, 0.53, 1.0, 229, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "acquire", "arg_names": [], "import_names": [], "rhs_call_name": "acquire", "annotation": ""}, "snippet": " self._lock.acquire()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99082:FunctionDef_L45_C2", "label": "release_lock", "type": "function", "loc": [45, 51], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99082:ClassDef_L32_C0", "vector": [2, 1, 0.4528, 0.066, 1, 0.69, 0.4286, 821, 0, 1, 0, 0, 0, 0, 1], "semantic": {"name": "release_lock", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def release_lock(self):\n \"\"\"Release the Storage lock.\n\n Trying to release a lock that isn't held will result in a\n RuntimeError.\n \"\"\"\n self._lock.release()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99082:Expr_L46_C4", "label": "expression", "type": "expression", "loc": [46, 50], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99082:FunctionDef_L45_C2", "vector": [8, 2, 0.4528, 0.0472, 2, 0.18, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Release the Storage lock.\n\n Trying to release a lock that isn't held will result in a\n RuntimeError.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99082:Expr_L51_C4", "label": "release()", "type": "expression", "loc": [51, 51], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99082:FunctionDef_L45_C2", "vector": [8, 2, 0.4811, 0.0094, 2, 0.18, 1.0, 784, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "release", "arg_names": [], "import_names": [], "rhs_call_name": "release", "annotation": ""}, "snippet": " self._lock.release()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99082:FunctionDef_L53_C2", "label": "locked_get", "type": "function", "loc": [53, 73], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99082:ClassDef_L32_C0", "vector": [2, 1, 0.5943, 0.1981, 1, 0.69, 0.5714, 579, 0, 1, 1, 0, 0, 0, 5], "semantic": {"name": "locked_get", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def locked_get(self):\n \"\"\"Retrieve Credential from file.\n\n Returns:\n oauth2client.client.Credentials\n \"\"\"\n credentials = None\n try:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99082:Expr_L54_C4", "label": "expression", "type": "expression", "loc": [54, 58], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99082:FunctionDef_L53_C2", "vector": [8, 2, 0.5283, 0.0472, 2, 0.97, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Retrieve Credential from file.\n\n Returns:\n oauth2client.client.Credentials\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99082:Assign_L59_C4", "label": "credentials =", "type": "assigned_variable", "loc": [59, 59], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99082:FunctionDef_L53_C2", "vector": [14, 2, 0.5566, 0.0094, 2, 0.97, 0.25, 198, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "credentials", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " credentials = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99082:Try_L60_C4", "label": "try", "type": "try", "loc": [60, 65], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99082:FunctionDef_L53_C2", "vector": [7, 2, 0.5896, 0.0566, 2, 0.97, 0.5, 0, 0, 1, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " try:\n f = open(self._filename, 'rb')\n content = f.read()\n f.close()\n except IOError:\n return credentials"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99082:Assign_L61_C6", "label": "f = open()", "type": "assigned_variable", "loc": [61, 61], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99082:Try_L60_C4", "vector": [14, 3, 0.5755, 0.0094, 3, 0.63, 0.0, 899, 3, 2, 0, 0, 693, 10, 1], "semantic": {"name": "f", "arg_names": [], "import_names": [], "rhs_call_name": "open", "annotation": ""}, "snippet": " f = open(self._filename, 'rb')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99082:Assign_L62_C6", "label": "content = read()", "type": "assigned_variable", "loc": [62, 62], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99082:Try_L60_C4", "vector": [14, 3, 0.5849, 0.0094, 3, 0.63, 0.5, 273, 3, 0, 0, 0, 453, 10, 1], "semantic": {"name": "content", "arg_names": [], "import_names": [], "rhs_call_name": "read", "annotation": ""}, "snippet": " content = f.read()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99082:Expr_L63_C6", "label": "close()", "type": "expression", "loc": [63, 63], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99082:Try_L60_C4", "vector": [8, 3, 0.5943, 0.0094, 3, 0.63, 1.0, 77, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "close", "arg_names": [], "import_names": [], "rhs_call_name": "close", "annotation": ""}, "snippet": " f.close()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99082:Return_L65_C6", "label": "return", "type": "return", "loc": [65, 65], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99082:Try_L60_C4", "vector": [13, 3, 0.6132, 0.0094, 3, 0.63, 0.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return credentials"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99082:Try_L67_C4", "label": "try", "type": "try", "loc": [67, 71], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99082:FunctionDef_L53_C2", "vector": [7, 2, 0.6509, 0.0472, 2, 0.97, 0.75, 0, 0, 1, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " try:\n credentials = Credentials.new_from_json(content)\n credentials.set_store(self)\n except ValueError:\n pass"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99082:Assign_L68_C6", "label": "credentials = new_from_json()", "type": "assigned_variable", "loc": [68, 68], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99082:Try_L67_C4", "vector": [14, 3, 0.6415, 0.0094, 3, 0.7, 0.0, 198, 3, 1, 0, 0, 495, 10, 1], "semantic": {"name": "credentials", "arg_names": [], "import_names": [], "rhs_call_name": "new_from_json", "annotation": ""}, "snippet": " credentials = Credentials.new_from_json(content)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99082:Expr_L69_C6", "label": "set_store()", "type": "expression", "loc": [69, 69], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99082:Try_L67_C4", "vector": [8, 3, 0.6509, 0.0094, 3, 0.7, 1.0, 939, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "set_store", "arg_names": [], "import_names": [], "rhs_call_name": "set_store", "annotation": ""}, "snippet": " credentials.set_store(self)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99082:Return_L73_C4", "label": "return", "type": "return", "loc": [73, 73], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99082:FunctionDef_L53_C2", "vector": [13, 2, 0.6887, 0.0094, 2, 0.97, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return credentials"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99082:FunctionDef_L75_C2", "label": "_create_file_if_needed", "type": "function", "loc": [75, 85], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99082:ClassDef_L32_C0", "vector": [2, 1, 0.7547, 0.1038, 1, 0.69, 0.7143, 654, 0, 1, 0, 0, 0, 0, 4], "semantic": {"name": "_create_file_if_needed", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _create_file_if_needed(self):\n \"\"\"Create an empty file if necessary.\n\n This method will not initialize the file. Instead it implements a\n simple version of \"touch\" to ensure the file has been created.\n \"\"\"\n if not os.path.exists(self._filename):\n try:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99082:Expr_L76_C4", "label": "expression", "type": "expression", "loc": [76, 80], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99082:FunctionDef_L75_C2", "vector": [8, 2, 0.7358, 0.0472, 2, 0.25, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Create an empty file if necessary.\n\n This method will not initialize the file. Instead it implements a\n simple version of \"touch\" to ensure the file has been created.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99082:If_L81_C4", "label": "if", "type": "if", "loc": [81, 85], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99082:FunctionDef_L75_C2", "vector": [4, 2, 0.783, 0.0472, 2, 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 os.path.exists(self._filename):\n try:\n open(self._filename, 'a+b').close()\n finally:\n os.umask(old_umask)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99082:Try_L82_C6", "label": "try", "type": "try", "loc": [82, 85], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99082:If_L81_C4", "vector": [7, 3, 0.7877, 0.0377, 3, 0.08, 0.0, 0, 0, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " try:\n open(self._filename, 'a+b').close()\n finally:\n os.umask(old_umask)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99082:Expr_L83_C8", "label": "close()", "type": "expression", "loc": [83, 83], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99082:Try_L82_C6", "vector": [8, 4, 0.783, 0.0094, 4, 0.02, 0.0, 77, 3, 0, 0, 0, 0, 0, 2], "semantic": {"name": "close", "arg_names": [], "import_names": [], "rhs_call_name": "close", "annotation": ""}, "snippet": " open(self._filename, 'a+b').close()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99082:Expr_L85_C8", "label": "umask()", "type": "expression", "loc": [85, 85], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99082:Try_L82_C6", "vector": [8, 4, 0.8019, 0.0094, 4, 0.02, 1.0, 505, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "umask", "arg_names": [], "import_names": [], "rhs_call_name": "umask", "annotation": ""}, "snippet": " os.umask(old_umask)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99082:FunctionDef_L87_C2", "label": "locked_put", "type": "function", "loc": [87, 97], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99082:ClassDef_L32_C0", "vector": [2, 1, 0.8679, 0.1038, 1, 0.69, 0.8571, 154, 0, 2, 0, 0, 0, 0, 5], "semantic": {"name": "locked_put", "arg_names": ["self", "credentials"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def locked_put(self, credentials):\n \"\"\"Write Credentials to file.\n\n Args:\n credentials: Credentials, the credentials to store.\n \"\"\"\n\n self._create_file_if_needed()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99082:Expr_L88_C4", "label": "expression", "type": "expression", "loc": [88, 92], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99082:FunctionDef_L87_C2", "vector": [8, 2, 0.8491, 0.0472, 2, 0.89, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Write Credentials to file.\n\n Args:\n credentials: Credentials, the credentials to store.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99082:Expr_L94_C4", "label": "_create_file_if_needed()", "type": "expression", "loc": [94, 94], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99082:FunctionDef_L87_C2", "vector": [8, 2, 0.8868, 0.0094, 2, 0.89, 0.25, 654, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "_create_file_if_needed", "arg_names": [], "import_names": [], "rhs_call_name": "_create_file_if_needed", "annotation": ""}, "snippet": " self._create_file_if_needed()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99082:Assign_L95_C4", "label": "f = open()", "type": "assigned_variable", "loc": [95, 95], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99082:FunctionDef_L87_C2", "vector": [14, 2, 0.8962, 0.0094, 2, 0.89, 0.5, 899, 3, 2, 0, 0, 693, 10, 1], "semantic": {"name": "f", "arg_names": [], "import_names": [], "rhs_call_name": "open", "annotation": ""}, "snippet": " f = open(self._filename, 'wb')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99082:Expr_L96_C4", "label": "write()", "type": "expression", "loc": [96, 96], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99082:FunctionDef_L87_C2", "vector": [8, 2, 0.9057, 0.0094, 2, 0.89, 0.75, 837, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "write", "arg_names": [], "import_names": [], "rhs_call_name": "write", "annotation": ""}, "snippet": " f.write(credentials.to_json())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99082:Expr_L97_C4", "label": "close()", "type": "expression", "loc": [97, 97], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99082:FunctionDef_L87_C2", "vector": [8, 2, 0.9151, 0.0094, 2, 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": " f.close()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99082:FunctionDef_L99_C2", "label": "locked_delete", "type": "function", "loc": [99, 106], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99082:ClassDef_L32_C0", "vector": [2, 1, 0.967, 0.0755, 1, 0.69, 1.0, 769, 0, 1, 0, 0, 0, 0, 1], "semantic": {"name": "locked_delete", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def locked_delete(self):\n \"\"\"Delete Credentials file.\n\n Args:\n credentials: Credentials, the credentials to store.\n \"\"\"\n\n os.unlink(self._filename)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99082:Expr_L100_C4", "label": "expression", "type": "expression", "loc": [100, 104], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99082:FunctionDef_L99_C2", "vector": [8, 2, 0.9623, 0.0472, 2, 0.59, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Delete Credentials file.\n\n Args:\n credentials: Credentials, the credentials to store.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99082:Expr_L106_C4", "label": "unlink()", "type": "expression", "loc": [106, 106], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99082:FunctionDef_L99_C2", "vector": [8, 2, 1.0, 0.0094, 2, 0.59, 1.0, 701, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "unlink", "arg_names": [], "import_names": [], "rhs_call_name": "unlink", "annotation": ""}, "snippet": " os.unlink(self._filename)"}]
[{"f": "ajibawa-2023/Python-Code-Large/train/row_99082:ClassDef_L32_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99082:Expr_L33_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99082:ClassDef_L32_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99082:FunctionDef_L35_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99082:FunctionDef_L35_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99082:Assign_L36_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99082:FunctionDef_L35_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99082:Assign_L37_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99082:ClassDef_L32_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99082:FunctionDef_L39_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99082:FunctionDef_L39_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99082:Expr_L40_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99082:FunctionDef_L39_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99082:Expr_L43_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99082:ClassDef_L32_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99082:FunctionDef_L45_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99082:FunctionDef_L45_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99082:Expr_L46_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99082:FunctionDef_L45_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99082:Expr_L51_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99082:ClassDef_L32_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99082:FunctionDef_L53_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99082:FunctionDef_L53_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99082:Expr_L54_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99082:FunctionDef_L53_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99082:Assign_L59_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99082:FunctionDef_L53_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99082:Try_L60_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99082:Try_L60_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99082:Assign_L61_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99082:Try_L60_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99082:Assign_L62_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99082:Try_L60_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99082:Expr_L63_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99082:Try_L60_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99082:Return_L65_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99082:FunctionDef_L53_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99082:Try_L67_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99082:Try_L67_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99082:Assign_L68_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99082:Try_L67_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99082:Expr_L69_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99082:FunctionDef_L53_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99082:Return_L73_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99082:ClassDef_L32_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99082:FunctionDef_L75_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99082:FunctionDef_L75_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99082:Expr_L76_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99082:FunctionDef_L75_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99082:If_L81_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99082:If_L81_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99082:Try_L82_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99082:Try_L82_C6", "t": "ajibawa-2023/Python-Code-Large/train/row_99082:Expr_L83_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99082:Try_L82_C6", "t": "ajibawa-2023/Python-Code-Large/train/row_99082:Expr_L85_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99082:ClassDef_L32_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99082:FunctionDef_L87_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99082:FunctionDef_L87_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99082:Expr_L88_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99082:FunctionDef_L87_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99082:Expr_L94_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99082:FunctionDef_L87_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99082:Assign_L95_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99082:FunctionDef_L87_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99082:Expr_L96_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99082:FunctionDef_L87_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99082:Expr_L97_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99082:ClassDef_L32_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99082:FunctionDef_L99_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99082:FunctionDef_L99_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99082:Expr_L100_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99082:FunctionDef_L99_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99082:Expr_L106_C4"}]
__version__ = "1.0c2"
ajibawa-2023/Python-Code-Large/train/row_99083
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_99083:Assign_L1_C0", "label": "__version__ =", "type": "assigned_variable", "loc": [1, 1], "level": 0, "parent": null, "vector": [14, 0, 1.0, 1.0, 0, 0.66, 0.0, 162, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "__version__", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "__version__ = \"1.0c2\""}]
[]
# Copyright (C) 2010 Google Inc. # # 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. """OAuth 2.0 utilities for Django. Utilities for using OAuth 2.0 in conjunction with the Django datastore. """ __author__ = 'jcgregorio@google.com (Joe Gregorio)' import oauth2client import base64 import pickle from django.db import models from oauth2client.client import Storage as BaseStorage class CredentialsField(models.Field): __metaclass__ = models.SubfieldBase def get_internal_type(self): return "TextField" def to_python(self, value): if value is None: return None if isinstance(value, oauth2client.client.Credentials): return value return pickle.loads(base64.b64decode(value)) def get_db_prep_value(self, value, connection, prepared=False): if value is None: return None return base64.b64encode(pickle.dumps(value)) class FlowField(models.Field): __metaclass__ = models.SubfieldBase def get_internal_type(self): return "TextField" def to_python(self, value): if value is None: return None if isinstance(value, oauth2client.client.Flow): return value return pickle.loads(base64.b64decode(value)) def get_db_prep_value(self, value, connection, prepared=False): if value is None: return None return base64.b64encode(pickle.dumps(value)) class Storage(BaseStorage): """Store and retrieve a single credential to and from the datastore. This Storage helper presumes the Credentials have been stored as a CredenialsField on a db model class. """ def __init__(self, model_class, key_name, key_value, property_name): """Constructor for Storage. Args: model: db.Model, model class key_name: string, key name for the entity that has the credentials key_value: string, key value for the entity that has the credentials property_name: string, name of the property that is an CredentialsProperty """ self.model_class = model_class self.key_name = key_name self.key_value = key_value self.property_name = property_name def locked_get(self): """Retrieve Credential from datastore. Returns: oauth2client.Credentials """ credential = None query = {self.key_name: self.key_value} entities = self.model_class.objects.filter(**query) if len(entities) > 0: credential = getattr(entities[0], self.property_name) if credential and hasattr(credential, 'set_store'): credential.set_store(self) return credential def locked_put(self, credentials): """Write a Credentials to the datastore. Args: credentials: Credentials, the credentials to store. """ args = {self.key_name: self.key_value} entity = self.model_class(**args) setattr(entity, self.property_name, credentials) entity.save() def locked_delete(self): """Delete Credentials from the datastore.""" query = {self.key_name: self.key_value} entities = self.model_class.objects.filter(**query).delete()
ajibawa-2023/Python-Code-Large/train/row_99084
63
124
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_99084:Expr_L15_C0", "label": "expression", "type": "expression", "loc": [15, 19], "level": 0, "parent": null, "vector": [8, 0, 0.1371, 0.0403, 0, 0.66, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\"\"\"OAuth 2.0 utilities for Django.\n\nUtilities for using OAuth 2.0 in conjunction with\nthe Django datastore.\n\"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99084:Assign_L21_C0", "label": "__author__ =", "type": "assigned_variable", "loc": [21, 21], "level": 0, "parent": null, "vector": [14, 0, 0.1694, 0.0081, 0, 0.66, 0.1111, 777, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "__author__", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "__author__ = 'jcgregorio@google.com (Joe Gregorio)'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99084:Import_L23_C0", "label": "oauth2client import oauth2client", "type": "import", "loc": [23, 23], "level": 0, "parent": null, "vector": [1, 0, 0.1855, 0.0081, 0, 0.66, 0.2222, 90, 0, 1, 0, 0, 90, 0, 0], "semantic": {"name": "oauth2client", "arg_names": [], "import_names": ["oauth2client"], "rhs_call_name": "", "annotation": ""}, "snippet": "import oauth2client"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99084:Import_L24_C0", "label": "base64 import base64", "type": "import", "loc": [24, 24], "level": 0, "parent": null, "vector": [1, 0, 0.1935, 0.0081, 0, 0.66, 0.3333, 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_99084:Import_L25_C0", "label": "pickle import pickle", "type": "import", "loc": [25, 25], "level": 0, "parent": null, "vector": [1, 0, 0.2016, 0.0081, 0, 0.66, 0.4444, 848, 0, 1, 0, 0, 848, 0, 0], "semantic": {"name": "pickle", "arg_names": [], "import_names": ["pickle"], "rhs_call_name": "", "annotation": ""}, "snippet": "import pickle"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99084:ImportFrom_L27_C0", "label": "from django.db import models", "type": "import", "loc": [27, 27], "level": 0, "parent": null, "vector": [1, 0, 0.2177, 0.0081, 0, 0.66, 0.5556, 40, 0, 1, 0, 0, 40, 0, 0], "semantic": {"name": "django.db", "arg_names": [], "import_names": ["models"], "rhs_call_name": "", "annotation": ""}, "snippet": "from django.db import models"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99084:ImportFrom_L28_C0", "label": "from oauth2client.client import BaseStorage", "type": "import", "loc": [28, 28], "level": 0, "parent": null, "vector": [1, 0, 0.2258, 0.0081, 0, 0.66, 0.6667, 340, 0, 1, 0, 0, 340, 0, 0], "semantic": {"name": "oauth2client.client", "arg_names": [], "import_names": ["BaseStorage"], "rhs_call_name": "", "annotation": ""}, "snippet": "from oauth2client.client import Storage as BaseStorage"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99084:ClassDef_L30_C0", "label": "CredentialsField", "type": "class", "loc": [30, 47], "level": 0, "parent": null, "vector": [3, 0, 0.3105, 0.1452, 0, 0.66, 0.7778, 776, 0, 3, 0, 0, 922, 0, 5], "semantic": {"name": "CredentialsField", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class CredentialsField(models.Field):\n\n __metaclass__ = models.SubfieldBase\n\n def get_internal_type(self):\n return \"TextField\"\n\n def to_python(self, value):"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99084:Assign_L32_C2", "label": "__metaclass__ =", "type": "assigned_variable", "loc": [32, 32], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99084:ClassDef_L30_C0", "vector": [14, 1, 0.2581, 0.0081, 1, 0.24, 0.0, 203, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "__metaclass__", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " __metaclass__ = models.SubfieldBase"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99084:FunctionDef_L34_C2", "label": "get_internal_type", "type": "function", "loc": [34, 35], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99084:ClassDef_L30_C0", "vector": [2, 1, 0.2782, 0.0161, 1, 0.24, 0.3333, 291, 0, 1, 1, 0, 0, 0, 0], "semantic": {"name": "get_internal_type", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def get_internal_type(self):\n return \"TextField\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99084:Return_L35_C4", "label": "return", "type": "return", "loc": [35, 35], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99084:FunctionDef_L34_C2", "vector": [13, 2, 0.2823, 0.0081, 2, 0.75, 0.0, 0, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return \"TextField\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99084:FunctionDef_L37_C2", "label": "to_python", "type": "function", "loc": [37, 42], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99084:ClassDef_L30_C0", "vector": [2, 1, 0.3185, 0.0484, 1, 0.24, 0.6667, 800, 0, 2, 1, 0, 0, 0, 3], "semantic": {"name": "to_python", "arg_names": ["self", "value"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def to_python(self, value):\n if value is None:\n return None\n if isinstance(value, oauth2client.client.Credentials):\n return value\n return pickle.loads(base64.b64decode(value))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99084:If_L38_C4", "label": "if", "type": "if", "loc": [38, 39], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99084:FunctionDef_L37_C2", "vector": [4, 2, 0.3105, 0.0161, 2, 0.1, 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_99084:Return_L39_C6", "label": "return", "type": "return", "loc": [39, 39], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99084:If_L38_C4", "vector": [13, 3, 0.3145, 0.0081, 3, 0.76, 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_99084:If_L40_C4", "label": "if", "type": "if", "loc": [40, 41], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99084:FunctionDef_L37_C2", "vector": [4, 2, 0.3266, 0.0161, 2, 0.1, 0.5, 0, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if isinstance(value, oauth2client.client.Credentials):\n return value"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99084:Return_L41_C6", "label": "return", "type": "return", "loc": [41, 41], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99084:If_L40_C4", "vector": [13, 3, 0.3306, 0.0081, 3, 0.3, 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_99084:Return_L42_C4", "label": "return", "type": "return", "loc": [42, 42], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99084:FunctionDef_L37_C2", "vector": [13, 2, 0.3387, 0.0081, 2, 0.1, 1.0, 0, 3, 0, 0, 0, 0, 10, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return pickle.loads(base64.b64decode(value))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99084:FunctionDef_L44_C2", "label": "get_db_prep_value", "type": "function", "loc": [44, 47], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99084:ClassDef_L30_C0", "vector": [2, 1, 0.3669, 0.0323, 1, 0.24, 1.0, 728, 0, 4, 1, 0, 0, 0, 2], "semantic": {"name": "get_db_prep_value", "arg_names": ["self", "value", "connection", "prepared"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def get_db_prep_value(self, value, connection, prepared=False):\n if value is None:\n return None\n return base64.b64encode(pickle.dumps(value))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99084:If_L45_C4", "label": "if", "type": "if", "loc": [45, 46], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99084:FunctionDef_L44_C2", "vector": [4, 2, 0.3669, 0.0161, 2, 0.34, 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_99084:Return_L46_C6", "label": "return", "type": "return", "loc": [46, 46], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99084:If_L45_C4", "vector": [13, 3, 0.371, 0.0081, 3, 0.89, 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_99084:Return_L47_C4", "label": "return", "type": "return", "loc": [47, 47], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99084:FunctionDef_L44_C2", "vector": [13, 2, 0.379, 0.0081, 2, 0.34, 1.0, 0, 3, 0, 0, 0, 0, 10, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return base64.b64encode(pickle.dumps(value))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99084:ClassDef_L50_C0", "label": "FlowField", "type": "class", "loc": [50, 67], "level": 0, "parent": null, "vector": [3, 0, 0.4718, 0.1452, 0, 0.66, 0.8889, 843, 0, 3, 0, 0, 922, 0, 5], "semantic": {"name": "FlowField", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class FlowField(models.Field):\n\n __metaclass__ = models.SubfieldBase\n\n def get_internal_type(self):\n return \"TextField\"\n\n def to_python(self, value):"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99084:Assign_L52_C2", "label": "__metaclass__ =", "type": "assigned_variable", "loc": [52, 52], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99084:ClassDef_L50_C0", "vector": [14, 1, 0.4194, 0.0081, 1, 0.15, 0.0, 203, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "__metaclass__", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " __metaclass__ = models.SubfieldBase"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99084:FunctionDef_L54_C2", "label": "get_internal_type", "type": "function", "loc": [54, 55], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99084:ClassDef_L50_C0", "vector": [2, 1, 0.4395, 0.0161, 1, 0.15, 0.3333, 291, 0, 1, 1, 0, 0, 0, 0], "semantic": {"name": "get_internal_type", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def get_internal_type(self):\n return \"TextField\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99084:Return_L55_C4", "label": "return", "type": "return", "loc": [55, 55], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99084:FunctionDef_L54_C2", "vector": [13, 2, 0.4435, 0.0081, 2, 0.94, 0.0, 0, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return \"TextField\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99084:FunctionDef_L57_C2", "label": "to_python", "type": "function", "loc": [57, 62], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99084:ClassDef_L50_C0", "vector": [2, 1, 0.4798, 0.0484, 1, 0.15, 0.6667, 800, 0, 2, 1, 0, 0, 0, 3], "semantic": {"name": "to_python", "arg_names": ["self", "value"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def to_python(self, value):\n if value is None:\n return None\n if isinstance(value, oauth2client.client.Flow):\n return value\n return pickle.loads(base64.b64decode(value))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99084:If_L58_C4", "label": "if", "type": "if", "loc": [58, 59], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99084:FunctionDef_L57_C2", "vector": [4, 2, 0.4718, 0.0161, 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 value is None:\n return None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99084:Return_L59_C6", "label": "return", "type": "return", "loc": [59, 59], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99084:If_L58_C4", "vector": [13, 3, 0.4758, 0.0081, 3, 0.62, 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_99084:If_L60_C4", "label": "if", "type": "if", "loc": [60, 61], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99084:FunctionDef_L57_C2", "vector": [4, 2, 0.4879, 0.0161, 2, 0.5, 0.5, 0, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if isinstance(value, oauth2client.client.Flow):\n return value"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99084:Return_L61_C6", "label": "return", "type": "return", "loc": [61, 61], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99084:If_L60_C4", "vector": [13, 3, 0.4919, 0.0081, 3, 0.74, 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_99084:Return_L62_C4", "label": "return", "type": "return", "loc": [62, 62], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99084:FunctionDef_L57_C2", "vector": [13, 2, 0.5, 0.0081, 2, 0.5, 1.0, 0, 3, 0, 0, 0, 0, 10, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return pickle.loads(base64.b64decode(value))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99084:FunctionDef_L64_C2", "label": "get_db_prep_value", "type": "function", "loc": [64, 67], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99084:ClassDef_L50_C0", "vector": [2, 1, 0.5282, 0.0323, 1, 0.15, 1.0, 728, 0, 4, 1, 0, 0, 0, 2], "semantic": {"name": "get_db_prep_value", "arg_names": ["self", "value", "connection", "prepared"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def get_db_prep_value(self, value, connection, prepared=False):\n if value is None:\n return None\n return base64.b64encode(pickle.dumps(value))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99084:If_L65_C4", "label": "if", "type": "if", "loc": [65, 66], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99084:FunctionDef_L64_C2", "vector": [4, 2, 0.5282, 0.0161, 2, 0.83, 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_99084:Return_L66_C6", "label": "return", "type": "return", "loc": [66, 66], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99084:If_L65_C4", "vector": [13, 3, 0.5323, 0.0081, 3, 0.97, 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_99084:Return_L67_C4", "label": "return", "type": "return", "loc": [67, 67], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99084:FunctionDef_L64_C2", "vector": [13, 2, 0.5403, 0.0081, 2, 0.83, 1.0, 0, 3, 0, 0, 0, 0, 10, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return base64.b64encode(pickle.dumps(value))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99084:ClassDef_L70_C0", "label": "Storage", "type": "class", "loc": [70, 124], "level": 0, "parent": null, "vector": [3, 0, 0.7823, 0.4435, 0, 0.66, 1.0, 850, 0, 4, 0, 0, 775, 0, 10], "semantic": {"name": "Storage", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class Storage(BaseStorage):\n \"\"\"Store and retrieve a single credential to and from\n the datastore.\n\n This Storage helper presumes the Credentials\n have been stored as a CredenialsField\n on a db model class.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99084:Expr_L71_C2", "label": "expression", "type": "expression", "loc": [71, 77], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99084:ClassDef_L70_C0", "vector": [8, 1, 0.5968, 0.0565, 1, 0.72, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Store and retrieve a single credential to and from\n the datastore.\n\n This Storage helper presumes the Credentials\n have been stored as a CredenialsField\n on a db model class.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99084:FunctionDef_L79_C2", "label": "__init__", "type": "function", "loc": [79, 91], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99084:ClassDef_L70_C0", "vector": [2, 1, 0.6855, 0.1048, 1, 0.72, 0.25, 555, 0, 5, 0, 0, 0, 0, 0], "semantic": {"name": "__init__", "arg_names": ["self", "model_class", "key_name", "key_value", "property_name"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, model_class, key_name, key_value, property_name):\n \"\"\"Constructor for Storage.\n\n Args:\n model: db.Model, model class\n key_name: string, key name for the entity that has the credentials\n key_value: string, key value for the entity that has the credentials\n property_name: string, name of the property that is an CredentialsProperty"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99084:Expr_L80_C4", "label": "expression", "type": "expression", "loc": [80, 87], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99084:FunctionDef_L79_C2", "vector": [8, 2, 0.6734, 0.0645, 2, 0.06, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Constructor for Storage.\n\n Args:\n model: db.Model, model class\n key_name: string, key name for the entity that has the credentials\n key_value: string, key value for the entity that has the credentials\n property_name: string, name of the property that is an CredentialsProperty\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99084:Assign_L88_C4", "label": "self.model_class =", "type": "assigned_variable", "loc": [88, 88], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99084:FunctionDef_L79_C2", "vector": [14, 2, 0.7097, 0.0081, 2, 0.06, 0.25, 687, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.model_class", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.model_class = model_class"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99084:Assign_L89_C4", "label": "self.key_name =", "type": "assigned_variable", "loc": [89, 89], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99084:FunctionDef_L79_C2", "vector": [14, 2, 0.7177, 0.0081, 2, 0.06, 0.5, 40, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.key_name", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.key_name = key_name"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99084:Assign_L90_C4", "label": "self.key_value =", "type": "assigned_variable", "loc": [90, 90], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99084:FunctionDef_L79_C2", "vector": [14, 2, 0.7258, 0.0081, 2, 0.06, 0.75, 655, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.key_value", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.key_value = key_value"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99084:Assign_L91_C4", "label": "self.property_name =", "type": "assigned_variable", "loc": [91, 91], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99084:FunctionDef_L79_C2", "vector": [14, 2, 0.7339, 0.0081, 2, 0.06, 1.0, 742, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.property_name", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.property_name = property_name"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99084:FunctionDef_L93_C2", "label": "locked_get", "type": "function", "loc": [93, 107], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99084:ClassDef_L70_C0", "vector": [2, 1, 0.8065, 0.121, 1, 0.72, 0.5, 579, 0, 1, 1, 0, 0, 0, 5], "semantic": {"name": "locked_get", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def locked_get(self):\n \"\"\"Retrieve Credential from datastore.\n\n Returns:\n oauth2client.Credentials\n \"\"\"\n credential = None\n"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99084:Expr_L94_C4", "label": "expression", "type": "expression", "loc": [94, 98], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99084:FunctionDef_L93_C2", "vector": [8, 2, 0.7742, 0.0403, 2, 0.34, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Retrieve Credential from datastore.\n\n Returns:\n oauth2client.Credentials\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99084:Assign_L99_C4", "label": "credential =", "type": "assigned_variable", "loc": [99, 99], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99084:FunctionDef_L93_C2", "vector": [14, 2, 0.7984, 0.0081, 2, 0.34, 0.2, 443, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "credential", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " credential = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99084:Assign_L101_C4", "label": "query =", "type": "assigned_variable", "loc": [101, 101], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99084:FunctionDef_L93_C2", "vector": [14, 2, 0.8145, 0.0081, 2, 0.34, 0.4, 546, 0, 0, 0, 0, 0, 6, 0], "semantic": {"name": "query", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " query = {self.key_name: self.key_value}"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99084:Assign_L102_C4", "label": "entities = filter()", "type": "assigned_variable", "loc": [102, 102], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99084:FunctionDef_L93_C2", "vector": [14, 2, 0.8226, 0.0081, 2, 0.34, 0.6, 744, 3, 1, 0, 0, 526, 10, 1], "semantic": {"name": "entities", "arg_names": [], "import_names": [], "rhs_call_name": "filter", "annotation": ""}, "snippet": " entities = self.model_class.objects.filter(**query)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99084:If_L103_C4", "label": "if", "type": "if", "loc": [103, 106], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99084:FunctionDef_L93_C2", "vector": [4, 2, 0.8427, 0.0323, 2, 0.34, 0.8, 0, 0, 0, 0, 0, 0, 0, 4], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if len(entities) > 0:\n credential = getattr(entities[0], self.property_name)\n if credential and hasattr(credential, 'set_store'):\n credential.set_store(self)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99084:Assign_L104_C6", "label": "credential = getattr()", "type": "assigned_variable", "loc": [104, 104], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99084:If_L103_C4", "vector": [14, 3, 0.8387, 0.0081, 3, 0.36, 0.0, 443, 3, 2, 0, 0, 121, 10, 1], "semantic": {"name": "credential", "arg_names": [], "import_names": [], "rhs_call_name": "getattr", "annotation": ""}, "snippet": " credential = getattr(entities[0], self.property_name)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99084:If_L105_C6", "label": "if", "type": "if", "loc": [105, 106], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99084:If_L103_C4", "vector": [4, 3, 0.8508, 0.0161, 3, 0.36, 1.0, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if credential and hasattr(credential, 'set_store'):\n credential.set_store(self)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99084:Expr_L106_C8", "label": "set_store()", "type": "expression", "loc": [106, 106], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99084:If_L105_C6", "vector": [8, 4, 0.8548, 0.0081, 4, 0.5, 0.0, 939, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "set_store", "arg_names": [], "import_names": [], "rhs_call_name": "set_store", "annotation": ""}, "snippet": " credential.set_store(self)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99084:Return_L107_C4", "label": "return", "type": "return", "loc": [107, 107], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99084:FunctionDef_L93_C2", "vector": [13, 2, 0.8629, 0.0081, 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 credential"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99084:FunctionDef_L109_C2", "label": "locked_put", "type": "function", "loc": [109, 118], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99084:ClassDef_L70_C0", "vector": [2, 1, 0.9153, 0.0806, 1, 0.72, 0.75, 154, 0, 2, 0, 0, 0, 0, 3], "semantic": {"name": "locked_put", "arg_names": ["self", "credentials"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def locked_put(self, credentials):\n \"\"\"Write a Credentials to the datastore.\n\n Args:\n credentials: Credentials, the credentials to store.\n \"\"\"\n args = {self.key_name: self.key_value}\n entity = self.model_class(**args)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99084:Expr_L110_C4", "label": "expression", "type": "expression", "loc": [110, 114], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99084:FunctionDef_L109_C2", "vector": [8, 2, 0.9032, 0.0403, 2, 0.86, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Write a Credentials to the datastore.\n\n Args:\n credentials: Credentials, the credentials to store.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99084:Assign_L115_C4", "label": "args =", "type": "assigned_variable", "loc": [115, 115], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99084:FunctionDef_L109_C2", "vector": [14, 2, 0.9274, 0.0081, 2, 0.86, 0.25, 805, 0, 0, 0, 0, 0, 6, 0], "semantic": {"name": "args", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " args = {self.key_name: self.key_value}"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99084:Assign_L116_C4", "label": "entity = model_class()", "type": "assigned_variable", "loc": [116, 116], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99084:FunctionDef_L109_C2", "vector": [14, 2, 0.9355, 0.0081, 2, 0.86, 0.5, 214, 3, 1, 0, 0, 826, 10, 1], "semantic": {"name": "entity", "arg_names": [], "import_names": [], "rhs_call_name": "model_class", "annotation": ""}, "snippet": " entity = self.model_class(**args)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99084:Expr_L117_C4", "label": "setattr()", "type": "expression", "loc": [117, 117], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99084:FunctionDef_L109_C2", "vector": [8, 2, 0.9435, 0.0081, 2, 0.86, 0.75, 501, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "setattr", "arg_names": [], "import_names": [], "rhs_call_name": "setattr", "annotation": ""}, "snippet": " setattr(entity, self.property_name, credentials)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99084:Expr_L118_C4", "label": "save()", "type": "expression", "loc": [118, 118], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99084:FunctionDef_L109_C2", "vector": [8, 2, 0.9516, 0.0081, 2, 0.86, 1.0, 928, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "save", "arg_names": [], "import_names": [], "rhs_call_name": "save", "annotation": ""}, "snippet": " entity.save()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99084:FunctionDef_L120_C2", "label": "locked_delete", "type": "function", "loc": [120, 124], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99084:ClassDef_L70_C0", "vector": [2, 1, 0.9839, 0.0403, 1, 0.72, 1.0, 769, 0, 1, 0, 0, 0, 0, 2], "semantic": {"name": "locked_delete", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def locked_delete(self):\n \"\"\"Delete Credentials from the datastore.\"\"\"\n\n query = {self.key_name: self.key_value}\n entities = self.model_class.objects.filter(**query).delete()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99084:Expr_L121_C4", "label": "expression", "type": "expression", "loc": [121, 121], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99084:FunctionDef_L120_C2", "vector": [8, 2, 0.9758, 0.0081, 2, 0.41, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Delete Credentials from the datastore.\"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99084:Assign_L123_C4", "label": "query =", "type": "assigned_variable", "loc": [123, 123], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99084:FunctionDef_L120_C2", "vector": [14, 2, 0.9919, 0.0081, 2, 0.41, 0.5, 546, 0, 0, 0, 0, 0, 6, 0], "semantic": {"name": "query", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " query = {self.key_name: self.key_value}"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99084:Assign_L124_C4", "label": "entities = delete()", "type": "assigned_variable", "loc": [124, 124], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99084:FunctionDef_L120_C2", "vector": [14, 2, 1.0, 0.0081, 2, 0.41, 1.0, 744, 3, 0, 0, 0, 266, 10, 2], "semantic": {"name": "entities", "arg_names": [], "import_names": [], "rhs_call_name": "delete", "annotation": ""}, "snippet": " entities = self.model_class.objects.filter(**query).delete()"}]
[{"f": "ajibawa-2023/Python-Code-Large/train/row_99084:ClassDef_L30_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99084:Assign_L32_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99084:ClassDef_L30_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99084:FunctionDef_L34_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99084:FunctionDef_L34_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99084:Return_L35_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99084:ClassDef_L30_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99084:FunctionDef_L37_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99084:FunctionDef_L37_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99084:If_L38_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99084:If_L38_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99084:Return_L39_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99084:FunctionDef_L37_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99084:If_L40_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99084:If_L40_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99084:Return_L41_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99084:FunctionDef_L37_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99084:Return_L42_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99084:ClassDef_L30_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99084:FunctionDef_L44_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99084:FunctionDef_L44_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99084:If_L45_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99084:If_L45_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99084:Return_L46_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99084:FunctionDef_L44_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99084:Return_L47_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99084:ClassDef_L50_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99084:Assign_L52_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99084:ClassDef_L50_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99084:FunctionDef_L54_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99084:FunctionDef_L54_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99084:Return_L55_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99084:ClassDef_L50_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99084:FunctionDef_L57_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99084:FunctionDef_L57_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99084:If_L58_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99084:If_L58_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99084:Return_L59_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99084:FunctionDef_L57_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99084:If_L60_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99084:If_L60_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99084:Return_L61_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99084:FunctionDef_L57_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99084:Return_L62_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99084:ClassDef_L50_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99084:FunctionDef_L64_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99084:FunctionDef_L64_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99084:If_L65_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99084:If_L65_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99084:Return_L66_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99084:FunctionDef_L64_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99084:Return_L67_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99084:ClassDef_L70_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99084:Expr_L71_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99084:ClassDef_L70_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99084:FunctionDef_L79_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99084:FunctionDef_L79_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99084:Expr_L80_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99084:FunctionDef_L79_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99084:Assign_L88_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99084:FunctionDef_L79_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99084:Assign_L89_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99084:FunctionDef_L79_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99084:Assign_L90_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99084:FunctionDef_L79_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99084:Assign_L91_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99084:ClassDef_L70_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99084:FunctionDef_L93_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99084:FunctionDef_L93_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99084:Expr_L94_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99084:FunctionDef_L93_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99084:Assign_L99_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99084:FunctionDef_L93_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99084:Assign_L101_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99084:FunctionDef_L93_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99084:Assign_L102_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99084:FunctionDef_L93_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99084:If_L103_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99084:If_L103_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99084:Assign_L104_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99084:If_L103_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99084:If_L105_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99084:If_L105_C6", "t": "ajibawa-2023/Python-Code-Large/train/row_99084:Expr_L106_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99084:FunctionDef_L93_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99084:Return_L107_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99084:ClassDef_L70_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99084:FunctionDef_L109_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99084:FunctionDef_L109_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99084:Expr_L110_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99084:FunctionDef_L109_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99084:Assign_L115_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99084:FunctionDef_L109_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99084:Assign_L116_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99084:FunctionDef_L109_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99084:Expr_L117_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99084:FunctionDef_L109_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99084:Expr_L118_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99084:ClassDef_L70_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99084:FunctionDef_L120_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99084:FunctionDef_L120_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99084:Expr_L121_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99084:FunctionDef_L120_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99084:Assign_L123_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99084:FunctionDef_L120_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99084:Assign_L124_C4"}]
# Copyright (C) 2007 Joe Gregorio # # Licensed under the MIT License """MIME-Type Parser This module provides basic functions for handling mime-types. It can handle matching mime-types against a list of media-ranges. See section 14.1 of the HTTP specification [RFC 2616] for a complete explanation. http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.1 Contents: - parse_mime_type(): Parses a mime-type into its component parts. - parse_media_range(): Media-ranges are mime-types with wild-cards and a 'q' quality parameter. - quality(): Determines the quality ('q') of a mime-type when compared against a list of media-ranges. - quality_parsed(): Just like quality() except the second parameter must be pre-parsed. - best_match(): Choose the mime-type with the highest quality ('q') from a list of candidates. """ __version__ = '0.1.3' __author__ = 'Joe Gregorio' __email__ = 'joe@bitworking.org' __license__ = 'MIT License' __credits__ = '' def parse_mime_type(mime_type): """Parses a mime-type into its component parts. Carves up a mime-type and returns a tuple of the (type, subtype, params) where 'params' is a dictionary of all the parameters for the media range. For example, the media range 'application/xhtml;q=0.5' would get parsed into: ('application', 'xhtml', {'q', '0.5'}) """ parts = mime_type.split(';') params = dict([tuple([s.strip() for s in param.split('=', 1)])\ for param in parts[1:] ]) full_type = parts[0].strip() # Java URLConnection class sends an Accept header that includes a # single '*'. Turn it into a legal wildcard. if full_type == '*': full_type = '*/*' (type, subtype) = full_type.split('/') return (type.strip(), subtype.strip(), params) def parse_media_range(range): """Parse a media-range into its component parts. Carves up a media range and returns a tuple of the (type, subtype, params) where 'params' is a dictionary of all the parameters for the media range. For example, the media range 'application/*;q=0.5' would get parsed into: ('application', '*', {'q', '0.5'}) In addition this function also guarantees that there is a value for 'q' in the params dictionary, filling it in with a proper default if necessary. """ (type, subtype, params) = parse_mime_type(range) if not params.has_key('q') or not params['q'] or \ not float(params['q']) or float(params['q']) > 1\ or float(params['q']) < 0: params['q'] = '1' return (type, subtype, params) def fitness_and_quality_parsed(mime_type, parsed_ranges): """Find the best match for a mime-type amongst parsed media-ranges. Find the best match for a given mime-type against a list of media_ranges that have already been parsed by parse_media_range(). Returns a tuple of the fitness value and the value of the 'q' quality parameter of the best match, or (-1, 0) if no match was found. Just as for quality_parsed(), 'parsed_ranges' must be a list of parsed media ranges. """ best_fitness = -1 best_fit_q = 0 (target_type, target_subtype, target_params) =\ parse_media_range(mime_type) for (type, subtype, params) in parsed_ranges: type_match = (type == target_type or\ type == '*' or\ target_type == '*') subtype_match = (subtype == target_subtype or\ subtype == '*' or\ target_subtype == '*') if type_match and subtype_match: param_matches = reduce(lambda x, y: x + y, [1 for (key, value) in \ target_params.iteritems() if key != 'q' and \ params.has_key(key) and value == params[key]], 0) fitness = (type == target_type) and 100 or 0 fitness += (subtype == target_subtype) and 10 or 0 fitness += param_matches if fitness > best_fitness: best_fitness = fitness best_fit_q = params['q'] return best_fitness, float(best_fit_q) def quality_parsed(mime_type, parsed_ranges): """Find the best match for a mime-type amongst parsed media-ranges. Find the best match for a given mime-type against a list of media_ranges that have already been parsed by parse_media_range(). Returns the 'q' quality parameter of the best match, 0 if no match was found. This function bahaves the same as quality() except that 'parsed_ranges' must be a list of parsed media ranges. """ return fitness_and_quality_parsed(mime_type, parsed_ranges)[1] def quality(mime_type, ranges): """Return the quality ('q') of a mime-type against a list of media-ranges. Returns the quality 'q' of a mime-type when compared against the media-ranges in ranges. For example: >>> quality('text/html','text/*;q=0.3, text/html;q=0.7, text/html;level=1, text/html;level=2;q=0.4, */*;q=0.5') 0.7 """ parsed_ranges = [parse_media_range(r) for r in ranges.split(',')] return quality_parsed(mime_type, parsed_ranges) def best_match(supported, header): """Return mime-type with the highest quality ('q') from list of candidates. Takes a list of supported mime-types and finds the best match for all the media-ranges listed in header. The value of header must be a string that conforms to the format of the HTTP Accept: header. The value of 'supported' is a list of mime-types. The list of supported mime-types should be sorted in order of increasing desirability, in case of a situation where there is a tie. >>> best_match(['application/xbel+xml', 'text/xml'], 'text/*;q=0.5,*/*; q=0.1') 'text/xml' """ split_header = _filter_blank(header.split(',')) parsed_header = [parse_media_range(r) for r in split_header] weighted_matches = [] pos = 0 for mime_type in supported: weighted_matches.append((fitness_and_quality_parsed(mime_type, parsed_header), pos, mime_type)) pos += 1 weighted_matches.sort() return weighted_matches[-1][0][1] and weighted_matches[-1][2] or '' def _filter_blank(i): for s in i: if s.strip(): yield s
ajibawa-2023/Python-Code-Large/train/row_99086
57
172
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_99086:Expr_L5_C0", "label": "expression", "type": "expression", "loc": [5, 23], "level": 0, "parent": null, "vector": [8, 0, 0.0814, 0.1105, 0, 0.66, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\"\"\"MIME-Type Parser\n\nThis module provides basic functions for handling mime-types. It can handle\nmatching mime-types against a list of media-ranges. See section 14.1 of the\nHTTP specification [RFC 2616] for a complete explanation.\n\n http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.1\n"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99086:Assign_L25_C0", "label": "__version__ =", "type": "assigned_variable", "loc": [25, 25], "level": 0, "parent": null, "vector": [14, 0, 0.1453, 0.0058, 0, 0.66, 0.0833, 162, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "__version__", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "__version__ = '0.1.3'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99086:Assign_L26_C0", "label": "__author__ =", "type": "assigned_variable", "loc": [26, 26], "level": 0, "parent": null, "vector": [14, 0, 0.1512, 0.0058, 0, 0.66, 0.1667, 777, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "__author__", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "__author__ = 'Joe Gregorio'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99086:Assign_L27_C0", "label": "__email__ =", "type": "assigned_variable", "loc": [27, 27], "level": 0, "parent": null, "vector": [14, 0, 0.157, 0.0058, 0, 0.66, 0.25, 424, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "__email__", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "__email__ = 'joe@bitworking.org'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99086:Assign_L28_C0", "label": "__license__ =", "type": "assigned_variable", "loc": [28, 28], "level": 0, "parent": null, "vector": [14, 0, 0.1628, 0.0058, 0, 0.66, 0.3333, 11, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "__license__", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "__license__ = 'MIT License'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99086:Assign_L29_C0", "label": "__credits__ =", "type": "assigned_variable", "loc": [29, 29], "level": 0, "parent": null, "vector": [14, 0, 0.1686, 0.0058, 0, 0.66, 0.4167, 451, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "__credits__", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "__credits__ = ''"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99086:FunctionDef_L32_C0", "label": "parse_mime_type", "type": "function", "loc": [32, 53], "level": 0, "parent": null, "vector": [2, 0, 0.2471, 0.1279, 0, 0.66, 0.5, 191, 0, 1, 1, 0, 0, 0, 9], "semantic": {"name": "parse_mime_type", "arg_names": ["mime_type"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def parse_mime_type(mime_type):\n \"\"\"Parses a mime-type into its component parts.\n\n Carves up a mime-type and returns a tuple of the (type, subtype, params)\n where 'params' is a dictionary of all the parameters for the media range.\n For example, the media range 'application/xhtml;q=0.5' would get parsed\n into:\n"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99086:Expr_L33_C4", "label": "expression", "type": "expression", "loc": [33, 41], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99086:FunctionDef_L32_C0", "vector": [8, 1, 0.2151, 0.0523, 1, 0.96, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Parses a mime-type into its component parts.\n\n Carves up a mime-type and returns a tuple of the (type, subtype, params)\n where 'params' is a dictionary of all the parameters for the media range.\n For example, the media range 'application/xhtml;q=0.5' would get parsed\n into:\n\n ('application', 'xhtml', {'q', '0.5'})"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99086:Assign_L42_C4", "label": "parts = split()", "type": "assigned_variable", "loc": [42, 42], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99086:FunctionDef_L32_C0", "vector": [14, 1, 0.2442, 0.0058, 1, 0.96, 0.1667, 13, 3, 1, 0, 0, 908, 10, 1], "semantic": {"name": "parts", "arg_names": [], "import_names": [], "rhs_call_name": "split", "annotation": ""}, "snippet": " parts = mime_type.split(';')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99086:Assign_L43_C4", "label": "params = dict()", "type": "assigned_variable", "loc": [43, 45], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99086:FunctionDef_L32_C0", "vector": [14, 1, 0.2558, 0.0174, 1, 0.96, 0.3333, 206, 3, 1, 0, 0, 827, 10, 4], "semantic": {"name": "params", "arg_names": [], "import_names": [], "rhs_call_name": "dict", "annotation": ""}, "snippet": " params = dict([tuple([s.strip() for s in param.split('=', 1)])\\\n for param in parts[1:]\n ])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99086:Assign_L46_C4", "label": "full_type = strip()", "type": "assigned_variable", "loc": [46, 46], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99086:FunctionDef_L32_C0", "vector": [14, 1, 0.2674, 0.0058, 1, 0.96, 0.5, 972, 3, 0, 0, 0, 973, 10, 1], "semantic": {"name": "full_type", "arg_names": [], "import_names": [], "rhs_call_name": "strip", "annotation": ""}, "snippet": " full_type = parts[0].strip()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99086:If_L49_C4", "label": "if", "type": "if", "loc": [49, 50], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99086:FunctionDef_L32_C0", "vector": [4, 1, 0.2878, 0.0116, 1, 0.96, 0.6667, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if full_type == '*':\n full_type = '*/*'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99086:Assign_L50_C8", "label": "full_type =", "type": "assigned_variable", "loc": [50, 50], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99086:If_L49_C4", "vector": [14, 2, 0.2907, 0.0058, 2, 0.61, 0.0, 972, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "full_type", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " full_type = '*/*'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99086:Assign_L51_C4", "label": "type, subtype = split()", "type": "assigned_variable", "loc": [51, 51], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99086:FunctionDef_L32_C0", "vector": [14, 1, 0.2965, 0.0058, 1, 0.96, 0.8333, 140, 3, 1, 0, 0, 908, 10, 1], "semantic": {"name": "type, subtype", "arg_names": [], "import_names": [], "rhs_call_name": "split", "annotation": ""}, "snippet": " (type, subtype) = full_type.split('/')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99086:Return_L53_C4", "label": "return", "type": "return", "loc": [53, 53], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99086:FunctionDef_L32_C0", "vector": [13, 1, 0.3081, 0.0058, 1, 0.96, 1.0, 0, 0, 0, 0, 0, 0, 8, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return (type.strip(), subtype.strip(), params)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99086:FunctionDef_L56_C0", "label": "parse_media_range", "type": "function", "loc": [56, 76], "level": 0, "parent": null, "vector": [2, 0, 0.3837, 0.1221, 0, 0.66, 0.5833, 68, 0, 1, 1, 0, 0, 0, 5], "semantic": {"name": "parse_media_range", "arg_names": ["range"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def parse_media_range(range):\n \"\"\"Parse a media-range into its component parts.\n\n Carves up a media range and returns a tuple of the (type, subtype,\n params) where 'params' is a dictionary of all the parameters for the media\n range. For example, the media range 'application/*;q=0.5' would get parsed\n into:\n"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99086:Expr_L57_C4", "label": "expression", "type": "expression", "loc": [57, 69], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99086:FunctionDef_L56_C0", "vector": [8, 1, 0.3663, 0.0756, 1, 0.34, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Parse a media-range into its component parts.\n\n Carves up a media range and returns a tuple of the (type, subtype,\n params) where 'params' is a dictionary of all the parameters for the media\n range. For example, the media range 'application/*;q=0.5' would get parsed\n into:\n\n ('application', '*', {'q', '0.5'})"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99086:Assign_L70_C4", "label": "type, subtype, params = parse_mime_type()", "type": "assigned_variable", "loc": [70, 70], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99086:FunctionDef_L56_C0", "vector": [14, 1, 0.407, 0.0058, 1, 0.34, 0.3333, 104, 3, 1, 0, 0, 191, 10, 1], "semantic": {"name": "type, subtype, params", "arg_names": [], "import_names": [], "rhs_call_name": "parse_mime_type", "annotation": ""}, "snippet": " (type, subtype, params) = parse_mime_type(range)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99086:If_L71_C4", "label": "if", "type": "if", "loc": [71, 74], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99086:FunctionDef_L56_C0", "vector": [4, 1, 0.4215, 0.0233, 1, 0.34, 0.6667, 0, 0, 0, 0, 0, 0, 0, 4], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not params.has_key('q') or not params['q'] or \\\n not float(params['q']) or float(params['q']) > 1\\\n or float(params['q']) < 0:\n params['q'] = '1'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99086:Assign_L74_C8", "label": "assign", "type": "assigned_variable", "loc": [74, 74], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99086:If_L71_C4", "vector": [14, 2, 0.4302, 0.0058, 2, 0.12, 0.0, 0, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " params['q'] = '1'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99086:Return_L76_C4", "label": "return", "type": "return", "loc": [76, 76], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99086:FunctionDef_L56_C0", "vector": [13, 1, 0.4419, 0.0058, 1, 0.34, 1.0, 0, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return (type, subtype, params)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99086:FunctionDef_L79_C0", "label": "fitness_and_quality_parsed", "type": "function", "loc": [79, 110], "level": 0, "parent": null, "vector": [2, 0, 0.5494, 0.186, 0, 0.66, 0.6667, 176, 0, 2, 1, 0, 0, 0, 5], "semantic": {"name": "fitness_and_quality_parsed", "arg_names": ["mime_type", "parsed_ranges"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def fitness_and_quality_parsed(mime_type, parsed_ranges):\n \"\"\"Find the best match for a mime-type amongst parsed media-ranges.\n\n Find the best match for a given mime-type against a list of media_ranges\n that have already been parsed by parse_media_range(). Returns a tuple of\n the fitness value and the value of the 'q' quality parameter of the best\n match, or (-1, 0) if no match was found. Just as for quality_parsed(),\n 'parsed_ranges' must be a list of parsed media ranges."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99086:Expr_L80_C4", "label": "expression", "type": "expression", "loc": [80, 87], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99086:FunctionDef_L79_C0", "vector": [8, 1, 0.4855, 0.0465, 1, 0.23, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Find the best match for a mime-type amongst parsed media-ranges.\n\n Find the best match for a given mime-type against a list of media_ranges\n that have already been parsed by parse_media_range(). Returns a tuple of\n the fitness value and the value of the 'q' quality parameter of the best\n match, or (-1, 0) if no match was found. Just as for quality_parsed(),\n 'parsed_ranges' must be a list of parsed media ranges.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99086:Assign_L88_C4", "label": "best_fitness =", "type": "assigned_variable", "loc": [88, 88], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99086:FunctionDef_L79_C0", "vector": [14, 1, 0.5116, 0.0058, 1, 0.23, 0.2, 745, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "best_fitness", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " best_fitness = -1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99086:Assign_L89_C4", "label": "best_fit_q =", "type": "assigned_variable", "loc": [89, 89], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99086:FunctionDef_L79_C0", "vector": [14, 1, 0.5174, 0.0058, 1, 0.23, 0.4, 26, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "best_fit_q", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " best_fit_q = 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99086:Assign_L90_C4", "label": "target_type, target_subtype, target_params = parse_media_range()", "type": "assigned_variable", "loc": [90, 91], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99086:FunctionDef_L79_C0", "vector": [14, 1, 0.5262, 0.0116, 1, 0.23, 0.6, 106, 3, 1, 0, 0, 68, 10, 1], "semantic": {"name": "target_type, target_subtype, target_params", "arg_names": [], "import_names": [], "rhs_call_name": "parse_media_range", "annotation": ""}, "snippet": " (target_type, target_subtype, target_params) =\\\n parse_media_range(mime_type)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99086:For_L92_C4", "label": "for type, subtype, params", "type": "for", "loc": [92, 108], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99086:FunctionDef_L79_C0", "vector": [6, 1, 0.5814, 0.0988, 1, 0.23, 0.8, 104, 2, 0, 0, 0, 0, 0, 3], "semantic": {"name": "type, subtype, params", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for (type, subtype, params) in parsed_ranges:\n type_match = (type == target_type or\\\n type == '*' or\\\n target_type == '*')\n subtype_match = (subtype == target_subtype or\\\n subtype == '*' or\\\n target_subtype == '*')\n if type_match and subtype_match:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99086:Assign_L93_C8", "label": "type_match =", "type": "assigned_variable", "loc": [93, 95], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99086:For_L92_C4", "vector": [14, 2, 0.5465, 0.0174, 2, 0.22, 0.0, 137, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "type_match", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " type_match = (type == target_type or\\\n type == '*' or\\\n target_type == '*')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99086:Assign_L96_C8", "label": "subtype_match =", "type": "assigned_variable", "loc": [96, 98], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99086:For_L92_C4", "vector": [14, 2, 0.564, 0.0174, 2, 0.22, 0.5, 399, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "subtype_match", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " subtype_match = (subtype == target_subtype or\\\n subtype == '*' or\\\n target_subtype == '*')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99086:If_L99_C8", "label": "if", "type": "if", "loc": [99, 108], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99086:For_L92_C4", "vector": [4, 2, 0.6017, 0.0581, 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 type_match and subtype_match:\n param_matches = reduce(lambda x, y: x + y, [1 for (key, value) in \\\n target_params.iteritems() if key != 'q' and \\\n params.has_key(key) and value == params[key]], 0)\n fitness = (type == target_type) and 100 or 0\n fitness += (subtype == target_subtype) and 10 or 0\n fitness += param_matches\n if fitness > best_fitness:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99086:Assign_L100_C12", "label": "param_matches = reduce()", "type": "assigned_variable", "loc": [100, 102], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99086:If_L99_C8", "vector": [14, 3, 0.5872, 0.0174, 3, 0.76, 0.0, 387, 3, 3, 0, 0, 622, 10, 3], "semantic": {"name": "param_matches", "arg_names": [], "import_names": [], "rhs_call_name": "reduce", "annotation": ""}, "snippet": " param_matches = reduce(lambda x, y: x + y, [1 for (key, value) in \\\n target_params.iteritems() if key != 'q' and \\\n params.has_key(key) and value == params[key]], 0)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99086:Assign_L103_C12", "label": "fitness =", "type": "assigned_variable", "loc": [103, 103], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99086:If_L99_C8", "vector": [14, 3, 0.5988, 0.0058, 3, 0.76, 0.5, 50, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "fitness", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " fitness = (type == target_type) and 100 or 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99086:If_L106_C12", "label": "if", "type": "if", "loc": [106, 108], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99086:If_L99_C8", "vector": [4, 3, 0.6221, 0.0174, 3, 0.76, 1.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if fitness > best_fitness:\n best_fitness = fitness\n best_fit_q = params['q']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99086:Assign_L107_C16", "label": "best_fitness =", "type": "assigned_variable", "loc": [107, 107], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99086:If_L106_C12", "vector": [14, 4, 0.6221, 0.0058, 4, 0.82, 0.0, 745, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "best_fitness", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " best_fitness = fitness"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99086:Assign_L108_C16", "label": "best_fit_q =", "type": "assigned_variable", "loc": [108, 108], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99086:If_L106_C12", "vector": [14, 4, 0.6279, 0.0058, 4, 0.82, 1.0, 26, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "best_fit_q", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " best_fit_q = params['q']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99086:Return_L110_C4", "label": "return", "type": "return", "loc": [110, 110], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99086:FunctionDef_L79_C0", "vector": [13, 1, 0.6395, 0.0058, 1, 0.23, 1.0, 0, 0, 0, 0, 0, 0, 8, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return best_fitness, float(best_fit_q)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99086:FunctionDef_L113_C0", "label": "quality_parsed", "type": "function", "loc": [113, 123], "level": 0, "parent": null, "vector": [2, 0, 0.686, 0.064, 0, 0.66, 0.75, 779, 0, 2, 1, 0, 0, 0, 1], "semantic": {"name": "quality_parsed", "arg_names": ["mime_type", "parsed_ranges"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def quality_parsed(mime_type, parsed_ranges):\n \"\"\"Find the best match for a mime-type amongst parsed media-ranges.\n\n Find the best match for a given mime-type against a list of media_ranges\n that have already been parsed by parse_media_range(). Returns the 'q'\n quality parameter of the best match, 0 if no match was found. This function\n bahaves the same as quality() except that 'parsed_ranges' must be a list of\n parsed media ranges."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99086:Expr_L114_C4", "label": "expression", "type": "expression", "loc": [114, 121], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99086:FunctionDef_L113_C0", "vector": [8, 1, 0.6831, 0.0465, 1, 0.33, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Find the best match for a mime-type amongst parsed media-ranges.\n\n Find the best match for a given mime-type against a list of media_ranges\n that have already been parsed by parse_media_range(). Returns the 'q'\n quality parameter of the best match, 0 if no match was found. This function\n bahaves the same as quality() except that 'parsed_ranges' must be a list of\n parsed media ranges.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99086:Return_L123_C4", "label": "return", "type": "return", "loc": [123, 123], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99086:FunctionDef_L113_C0", "vector": [13, 1, 0.7151, 0.0058, 1, 0.33, 1.0, 0, 6, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return fitness_and_quality_parsed(mime_type, parsed_ranges)[1]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99086:FunctionDef_L126_C0", "label": "quality", "type": "function", "loc": [126, 139], "level": 0, "parent": null, "vector": [2, 0, 0.7703, 0.0814, 0, 0.66, 0.8333, 897, 0, 2, 1, 0, 0, 0, 3], "semantic": {"name": "quality", "arg_names": ["mime_type", "ranges"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def quality(mime_type, ranges):\n \"\"\"Return the quality ('q') of a mime-type against a list of media-ranges.\n\n Returns the quality 'q' of a mime-type when compared against the\n media-ranges in ranges. For example:\n\n >>> quality('text/html','text/*;q=0.3, text/html;q=0.7,\n text/html;level=1, text/html;level=2;q=0.4, */*;q=0.5')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99086:Expr_L127_C4", "label": "expression", "type": "expression", "loc": [127, 136], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99086:FunctionDef_L126_C0", "vector": [8, 1, 0.7645, 0.0581, 1, 0.3, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Return the quality ('q') of a mime-type against a list of media-ranges.\n\n Returns the quality 'q' of a mime-type when compared against the\n media-ranges in ranges. For example:\n\n >>> quality('text/html','text/*;q=0.3, text/html;q=0.7,\n text/html;level=1, text/html;level=2;q=0.4, */*;q=0.5')\n 0.7"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99086:Assign_L137_C4", "label": "parsed_ranges =", "type": "assigned_variable", "loc": [137, 137], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99086:FunctionDef_L126_C0", "vector": [14, 1, 0.7965, 0.0058, 1, 0.3, 0.5, 859, 5, 0, 0, 0, 0, 0, 2], "semantic": {"name": "parsed_ranges", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " parsed_ranges = [parse_media_range(r) for r in ranges.split(',')]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99086:Return_L139_C4", "label": "return", "type": "return", "loc": [139, 139], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99086:FunctionDef_L126_C0", "vector": [13, 1, 0.8081, 0.0058, 1, 0.3, 1.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return quality_parsed(mime_type, parsed_ranges)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99086:FunctionDef_L142_C0", "label": "best_match", "type": "function", "loc": [142, 166], "level": 0, "parent": null, "vector": [2, 0, 0.8953, 0.1453, 0, 0.66, 0.9167, 400, 0, 2, 1, 0, 0, 0, 6], "semantic": {"name": "best_match", "arg_names": ["supported", "header"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def best_match(supported, header):\n \"\"\"Return mime-type with the highest quality ('q') from list of candidates.\n\n Takes a list of supported mime-types and finds the best match for all the\n media-ranges listed in header. The value of header must be a string that\n conforms to the format of the HTTP Accept: header. The value of 'supported'\n is a list of mime-types. The list of supported mime-types should be sorted\n in order of increasing desirability, in case of a situation where there is"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99086:Expr_L143_C4", "label": "expression", "type": "expression", "loc": [143, 155], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99086:FunctionDef_L142_C0", "vector": [8, 1, 0.8663, 0.0756, 1, 0.46, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Return mime-type with the highest quality ('q') from list of candidates.\n\n Takes a list of supported mime-types and finds the best match for all the\n media-ranges listed in header. The value of header must be a string that\n conforms to the format of the HTTP Accept: header. The value of 'supported'\n is a list of mime-types. The list of supported mime-types should be sorted\n in order of increasing desirability, in case of a situation where there is\n a tie."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99086:Assign_L156_C4", "label": "split_header = _filter_blank()", "type": "assigned_variable", "loc": [156, 156], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99086:FunctionDef_L142_C0", "vector": [14, 1, 0.907, 0.0058, 1, 0.46, 0.1429, 434, 3, 1, 0, 0, 519, 10, 2], "semantic": {"name": "split_header", "arg_names": [], "import_names": [], "rhs_call_name": "_filter_blank", "annotation": ""}, "snippet": " split_header = _filter_blank(header.split(','))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99086:Assign_L157_C4", "label": "parsed_header =", "type": "assigned_variable", "loc": [157, 157], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99086:FunctionDef_L142_C0", "vector": [14, 1, 0.9128, 0.0058, 1, 0.46, 0.2857, 633, 5, 0, 0, 0, 0, 0, 1], "semantic": {"name": "parsed_header", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " parsed_header = [parse_media_range(r) for r in split_header]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99086:Assign_L158_C4", "label": "weighted_matches =", "type": "assigned_variable", "loc": [158, 158], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99086:FunctionDef_L142_C0", "vector": [14, 1, 0.9186, 0.0058, 1, 0.46, 0.4286, 904, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "weighted_matches", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " weighted_matches = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99086:Assign_L159_C4", "label": "pos =", "type": "assigned_variable", "loc": [159, 159], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99086:FunctionDef_L142_C0", "vector": [14, 1, 0.9244, 0.0058, 1, 0.46, 0.5714, 627, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "pos", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " pos = 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99086:For_L160_C4", "label": "for mime_type", "type": "for", "loc": [160, 163], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99086:FunctionDef_L142_C0", "vector": [6, 1, 0.939, 0.0233, 1, 0.46, 0.7143, 188, 2, 0, 0, 0, 0, 0, 2], "semantic": {"name": "mime_type", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for mime_type in supported:\n weighted_matches.append((fitness_and_quality_parsed(mime_type,\n parsed_header), pos, mime_type))\n pos += 1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99086:Expr_L161_C8", "label": "append()", "type": "expression", "loc": [161, 162], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99086:For_L160_C4", "vector": [8, 2, 0.939, 0.0116, 2, 0.69, 0.0, 243, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " weighted_matches.append((fitness_and_quality_parsed(mime_type,\n parsed_header), pos, mime_type))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99086:Expr_L164_C4", "label": "sort()", "type": "expression", "loc": [164, 164], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99086:FunctionDef_L142_C0", "vector": [8, 1, 0.9535, 0.0058, 1, 0.46, 0.8571, 489, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "sort", "arg_names": [], "import_names": [], "rhs_call_name": "sort", "annotation": ""}, "snippet": " weighted_matches.sort()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99086:Return_L166_C4", "label": "return", "type": "return", "loc": [166, 166], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99086:FunctionDef_L142_C0", "vector": [13, 1, 0.9651, 0.0058, 1, 0.46, 1.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return weighted_matches[-1][0][1] and weighted_matches[-1][2] or ''"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99086:FunctionDef_L169_C0", "label": "_filter_blank", "type": "function", "loc": [169, 172], "level": 0, "parent": null, "vector": [2, 0, 0.9913, 0.0233, 0, 0.66, 1.0, 519, 0, 1, 0, 0, 0, 0, 1], "semantic": {"name": "_filter_blank", "arg_names": ["i"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def _filter_blank(i):\n for s in i:\n if s.strip():\n yield s"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99086:For_L170_C4", "label": "for s", "type": "for", "loc": [170, 172], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99086:FunctionDef_L169_C0", "vector": [6, 1, 0.9942, 0.0174, 1, 0.03, 0.0, 553, 2, 0, 0, 0, 0, 0, 1], "semantic": {"name": "s", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for s in i:\n if s.strip():\n yield s"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99086:If_L171_C8", "label": "if", "type": "if", "loc": [171, 172], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99086:For_L170_C4", "vector": [4, 2, 0.9971, 0.0116, 2, 0.62, 0.0, 0, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if s.strip():\n yield s"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99086:Expr_L172_C12", "label": "expression", "type": "expression", "loc": [172, 172], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99086:If_L171_C8", "vector": [8, 3, 1.0, 0.0058, 3, 0.89, 0.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " yield s"}]
[{"f": "ajibawa-2023/Python-Code-Large/train/row_99086:FunctionDef_L32_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99086:Expr_L33_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99086:FunctionDef_L32_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99086:Assign_L42_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99086:FunctionDef_L32_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99086:Assign_L43_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99086:FunctionDef_L32_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99086:Assign_L46_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99086:FunctionDef_L32_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99086:If_L49_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99086:If_L49_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99086:Assign_L50_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99086:FunctionDef_L32_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99086:Assign_L51_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99086:FunctionDef_L32_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99086:Return_L53_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99086:FunctionDef_L56_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99086:Expr_L57_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99086:FunctionDef_L56_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99086:Assign_L70_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99086:FunctionDef_L56_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99086:If_L71_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99086:If_L71_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99086:Assign_L74_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99086:FunctionDef_L56_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99086:Return_L76_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99086:FunctionDef_L79_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99086:Expr_L80_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99086:FunctionDef_L79_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99086:Assign_L88_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99086:FunctionDef_L79_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99086:Assign_L89_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99086:FunctionDef_L79_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99086:Assign_L90_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99086:FunctionDef_L79_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99086:For_L92_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99086:For_L92_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99086:Assign_L93_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99086:For_L92_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99086:Assign_L96_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99086:For_L92_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99086:If_L99_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99086:If_L99_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99086:Assign_L100_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99086:If_L99_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99086:Assign_L103_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99086:If_L99_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99086:If_L106_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99086:If_L106_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99086:Assign_L107_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99086:If_L106_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99086:Assign_L108_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99086:FunctionDef_L79_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99086:Return_L110_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99086:FunctionDef_L113_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99086:Expr_L114_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99086:FunctionDef_L113_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99086:Return_L123_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99086:FunctionDef_L126_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99086:Expr_L127_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99086:FunctionDef_L126_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99086:Assign_L137_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99086:FunctionDef_L126_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99086:Return_L139_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99086:FunctionDef_L142_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99086:Expr_L143_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99086:FunctionDef_L142_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99086:Assign_L156_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99086:FunctionDef_L142_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99086:Assign_L157_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99086:FunctionDef_L142_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99086:Assign_L158_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99086:FunctionDef_L142_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99086:Assign_L159_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99086:FunctionDef_L142_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99086:For_L160_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99086:For_L160_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99086:Expr_L161_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99086:FunctionDef_L142_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99086:Expr_L164_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99086:FunctionDef_L142_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99086:Return_L166_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99086:FunctionDef_L169_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99086:For_L170_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99086:For_L170_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99086:If_L171_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99086:If_L171_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99086:Expr_L172_C12"}]
# Copyright (C) 2010 Google Inc. # # 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. """Schema processing for discovery based APIs Schemas holds an APIs discovery schemas. It can return those schema as deserialized JSON objects, or pretty print them as prototype objects that conform to the schema. For example, given the schema: schema = \"\"\"{ "Foo": { "type": "object", "properties": { "etag": { "type": "string", "description": "ETag of the collection." }, "kind": { "type": "string", "description": "Type of the collection ('calendar#acl').", "default": "calendar#acl" }, "nextPageToken": { "type": "string", "description": "Token used to access the next page of this result. Omitted if no further results are available." } } } }\"\"\" s = Schemas(schema) print s.prettyPrintByName('Foo') Produces the following output: { "nextPageToken": "A String", # Token used to access the # next page of this result. Omitted if no further results are available. "kind": "A String", # Type of the collection ('calendar#acl'). "etag": "A String", # ETag of the collection. }, The constructor takes a discovery document in which to look up named schema. """ # TODO(jcgregorio) support format, enum, minimum, maximum __author__ = 'jcgregorio@google.com (Joe Gregorio)' import copy from oauth2client.anyjson import simplejson class Schemas(object): """Schemas for an API.""" def __init__(self, discovery): """Constructor. Args: discovery: object, Deserialized discovery document from which we pull out the named schema. """ self.schemas = discovery.get('schemas', {}) # Cache of pretty printed schemas. self.pretty = {} def _prettyPrintByName(self, name, seen=None, dent=0): """Get pretty printed object prototype from the schema name. Args: name: string, Name of schema in the discovery document. seen: list of string, Names of schema already seen. Used to handle recursive definitions. Returns: string, A string that contains a prototype object with comments that conforms to the given schema. """ if seen is None: seen = [] if name in seen: # Do not fall into an infinite loop over recursive definitions. return '# Object with schema name: %s' % name seen.append(name) if name not in self.pretty: self.pretty[name] = _SchemaToStruct(self.schemas[name], seen, dent).to_str(self._prettyPrintByName) seen.pop() return self.pretty[name] def prettyPrintByName(self, name): """Get pretty printed object prototype from the schema name. Args: name: string, Name of schema in the discovery document. Returns: string, A string that contains a prototype object with comments that conforms to the given schema. """ # Return with trailing comma and newline removed. return self._prettyPrintByName(name, seen=[], dent=1)[:-2] def _prettyPrintSchema(self, schema, seen=None, dent=0): """Get pretty printed object prototype of schema. Args: schema: object, Parsed JSON schema. seen: list of string, Names of schema already seen. Used to handle recursive definitions. Returns: string, A string that contains a prototype object with comments that conforms to the given schema. """ if seen is None: seen = [] return _SchemaToStruct(schema, seen, dent).to_str(self._prettyPrintByName) def prettyPrintSchema(self, schema): """Get pretty printed object prototype of schema. Args: schema: object, Parsed JSON schema. Returns: string, A string that contains a prototype object with comments that conforms to the given schema. """ # Return with trailing comma and newline removed. return self._prettyPrintSchema(schema, dent=1)[:-2] def get(self, name): """Get deserialized JSON schema from the schema name. Args: name: string, Schema name. """ return self.schemas[name] class _SchemaToStruct(object): """Convert schema to a prototype object.""" def __init__(self, schema, seen, dent=0): """Constructor. Args: schema: object, Parsed JSON schema. seen: list, List of names of schema already seen while parsing. Used to handle recursive definitions. dent: int, Initial indentation depth. """ # The result of this parsing kept as list of strings. self.value = [] # The final value of the parsing. self.string = None # The parsed JSON schema. self.schema = schema # Indentation level. self.dent = dent # Method that when called returns a prototype object for the schema with # the given name. self.from_cache = None # List of names of schema already seen while parsing. self.seen = seen def emit(self, text): """Add text as a line to the output. Args: text: string, Text to output. """ self.value.extend([" " * self.dent, text, '\n']) def emitBegin(self, text): """Add text to the output, but with no line terminator. Args: text: string, Text to output. """ self.value.extend([" " * self.dent, text]) def emitEnd(self, text, comment): """Add text and comment to the output with line terminator. Args: text: string, Text to output. comment: string, Python comment. """ if comment: divider = '\n' + ' ' * (self.dent + 2) + '# ' lines = comment.splitlines() lines = [x.rstrip() for x in lines] comment = divider.join(lines) self.value.extend([text, ' # ', comment, '\n']) else: self.value.extend([text, '\n']) def indent(self): """Increase indentation level.""" self.dent += 1 def undent(self): """Decrease indentation level.""" self.dent -= 1 def _to_str_impl(self, schema): """Prototype object based on the schema, in Python code with comments. Args: schema: object, Parsed JSON schema file. Returns: Prototype object based on the schema, in Python code with comments. """ stype = schema.get('type') if stype == 'object': self.emitEnd('{', schema.get('description', '')) self.indent() for pname, pschema in schema.get('properties', {}).iteritems(): self.emitBegin('"%s": ' % pname) self._to_str_impl(pschema) self.undent() self.emit('},') elif '$ref' in schema: schemaName = schema['$ref'] description = schema.get('description', '') s = self.from_cache(schemaName, self.seen) parts = s.splitlines() self.emitEnd(parts[0], description) for line in parts[1:]: self.emit(line.rstrip()) elif stype == 'boolean': value = schema.get('default', 'True or False') self.emitEnd('%s,' % str(value), schema.get('description', '')) elif stype == 'string': value = schema.get('default', 'A String') self.emitEnd('"%s",' % str(value), schema.get('description', '')) elif stype == 'integer': value = schema.get('default', '42') self.emitEnd('%s,' % str(value), schema.get('description', '')) elif stype == 'number': value = schema.get('default', '3.14') self.emitEnd('%s,' % str(value), schema.get('description', '')) elif stype == 'null': self.emitEnd('None,', schema.get('description', '')) elif stype == 'any': self.emitEnd('"",', schema.get('description', '')) elif stype == 'array': self.emitEnd('[', schema.get('description')) self.indent() self.emitBegin('') self._to_str_impl(schema['items']) self.undent() self.emit('],') else: self.emit('Unknown type! %s' % stype) self.emitEnd('', '') self.string = ''.join(self.value) return self.string def to_str(self, from_cache): """Prototype object based on the schema, in Python code with comments. Args: from_cache: callable(name, seen), Callable that retrieves an object prototype for a schema with the given name. Seen is a list of schema names already seen as we recursively descend the schema definition. Returns: Prototype object based on the schema, in Python code with comments. The lines of the code will all be properly indented. """ self.from_cache = from_cache return self._to_str_impl(self.schema)
ajibawa-2023/Python-Code-Large/train/row_99087
114
303
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_99087:Expr_L15_C0", "label": "expression", "type": "expression", "loc": [15, 58], "level": 0, "parent": null, "vector": [8, 0, 0.1205, 0.1452, 0, 0.66, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\"\"\"Schema processing for discovery based APIs\n\nSchemas holds an APIs discovery schemas. It can return those schema as\ndeserialized JSON objects, or pretty print them as prototype objects that\nconform to the schema.\n\nFor example, given the schema:\n"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99087:Assign_L62_C0", "label": "__author__ =", "type": "assigned_variable", "loc": [62, 62], "level": 0, "parent": null, "vector": [14, 0, 0.2046, 0.0033, 0, 0.66, 0.2, 777, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "__author__", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "__author__ = 'jcgregorio@google.com (Joe Gregorio)'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99087:Import_L64_C0", "label": "copy import copy", "type": "import", "loc": [64, 64], "level": 0, "parent": null, "vector": [1, 0, 0.2112, 0.0033, 0, 0.66, 0.4, 739, 0, 1, 0, 0, 739, 0, 0], "semantic": {"name": "copy", "arg_names": [], "import_names": ["copy"], "rhs_call_name": "", "annotation": ""}, "snippet": "import copy"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99087:ImportFrom_L65_C0", "label": "from oauth2client.anyjson import simplejson", "type": "import", "loc": [65, 65], "level": 0, "parent": null, "vector": [1, 0, 0.2145, 0.0033, 0, 0.66, 0.6, 822, 0, 1, 0, 0, 822, 0, 0], "semantic": {"name": "oauth2client.anyjson", "arg_names": [], "import_names": ["simplejson"], "rhs_call_name": "", "annotation": ""}, "snippet": "from oauth2client.anyjson import simplejson"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99087:ClassDef_L68_C0", "label": "Schemas", "type": "class", "loc": [68, 160], "level": 0, "parent": null, "vector": [3, 0, 0.3762, 0.3069, 0, 0.66, 0.8, 892, 0, 6, 0, 0, 186, 0, 9], "semantic": {"name": "Schemas", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class Schemas(object):\n \"\"\"Schemas for an API.\"\"\"\n\n def __init__(self, discovery):\n \"\"\"Constructor.\n\n Args:\n discovery: object, Deserialized discovery document from which we pull"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99087:Expr_L69_C2", "label": "expression", "type": "expression", "loc": [69, 69], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99087:ClassDef_L68_C0", "vector": [8, 1, 0.2277, 0.0033, 1, 0.22, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Schemas for an API.\"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99087:FunctionDef_L71_C2", "label": "__init__", "type": "function", "loc": [71, 81], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99087:ClassDef_L68_C0", "vector": [2, 1, 0.2508, 0.0363, 1, 0.22, 0.1667, 555, 0, 2, 0, 0, 0, 0, 1], "semantic": {"name": "__init__", "arg_names": ["self", "discovery"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, discovery):\n \"\"\"Constructor.\n\n Args:\n discovery: object, Deserialized discovery document from which we pull\n out the named schema.\n \"\"\"\n self.schemas = discovery.get('schemas', {})"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99087:Expr_L72_C4", "label": "expression", "type": "expression", "loc": [72, 77], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99087:FunctionDef_L71_C2", "vector": [8, 2, 0.2459, 0.0198, 2, 0.56, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Constructor.\n\n Args:\n discovery: object, Deserialized discovery document from which we pull\n out the named schema.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99087:Assign_L78_C4", "label": "self.schemas = get()", "type": "assigned_variable", "loc": [78, 78], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99087:FunctionDef_L71_C2", "vector": [14, 2, 0.2574, 0.0033, 2, 0.56, 0.5, 365, 3, 2, 0, 0, 607, 10, 1], "semantic": {"name": "self.schemas", "arg_names": [], "import_names": [], "rhs_call_name": "get", "annotation": ""}, "snippet": " self.schemas = discovery.get('schemas', {})"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99087:Assign_L81_C4", "label": "self.pretty =", "type": "assigned_variable", "loc": [81, 81], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99087:FunctionDef_L71_C2", "vector": [14, 2, 0.2673, 0.0033, 2, 0.56, 1.0, 608, 0, 0, 0, 0, 0, 6, 0], "semantic": {"name": "self.pretty", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.pretty = {}"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99087:FunctionDef_L83_C2", "label": "_prettyPrintByName", "type": "function", "loc": [83, 109], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99087:ClassDef_L68_C0", "vector": [2, 1, 0.3168, 0.0891, 1, 0.22, 0.3333, 869, 0, 4, 1, 0, 0, 0, 4], "semantic": {"name": "_prettyPrintByName", "arg_names": ["self", "name", "seen", "dent"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _prettyPrintByName(self, name, seen=None, dent=0):\n \"\"\"Get pretty printed object prototype from the schema name.\n\n Args:\n name: string, Name of schema in the discovery document.\n seen: list of string, Names of schema already seen. Used to handle\n recursive definitions.\n"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99087:Expr_L84_C4", "label": "expression", "type": "expression", "loc": [84, 94], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99087:FunctionDef_L83_C2", "vector": [8, 2, 0.2937, 0.0363, 2, 0.19, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Get pretty printed object prototype from the schema name.\n\n Args:\n name: string, Name of schema in the discovery document.\n seen: list of string, Names of schema already seen. Used to handle\n recursive definitions.\n\n Returns:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99087:If_L95_C4", "label": "if", "type": "if", "loc": [95, 96], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99087:FunctionDef_L83_C2", "vector": [4, 2, 0.3152, 0.0066, 2, 0.19, 0.1667, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if seen is None:\n seen = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99087:Assign_L96_C6", "label": "seen =", "type": "assigned_variable", "loc": [96, 96], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99087:If_L95_C4", "vector": [14, 3, 0.3168, 0.0033, 3, 0.85, 0.0, 212, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "seen", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " seen = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99087:If_L98_C4", "label": "if", "type": "if", "loc": [98, 100], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99087:FunctionDef_L83_C2", "vector": [4, 2, 0.3267, 0.0099, 2, 0.19, 0.3333, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if name in seen:\n # Do not fall into an infinite loop over recursive definitions.\n return '# Object with schema name: %s' % name"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99087:Return_L100_C6", "label": "return", "type": "return", "loc": [100, 100], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99087:If_L98_C4", "vector": [13, 3, 0.33, 0.0033, 3, 0.88, 0.0, 0, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return '# Object with schema name: %s' % name"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99087:Expr_L101_C4", "label": "append()", "type": "expression", "loc": [101, 101], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99087:FunctionDef_L83_C2", "vector": [8, 2, 0.3333, 0.0033, 2, 0.19, 0.5, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " seen.append(name)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99087:If_L103_C4", "label": "if", "type": "if", "loc": [103, 105], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99087:FunctionDef_L83_C2", "vector": [4, 2, 0.3432, 0.0099, 2, 0.19, 0.6667, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if name not in self.pretty:\n self.pretty[name] = _SchemaToStruct(self.schemas[name],\n seen, dent).to_str(self._prettyPrintByName)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99087:Assign_L104_C6", "label": " = to_str()", "type": "assigned_variable", "loc": [104, 105], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99087:If_L103_C4", "vector": [14, 3, 0.3449, 0.0066, 3, 0.43, 0.0, 0, 3, 1, 0, 0, 798, 10, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "to_str", "annotation": ""}, "snippet": " self.pretty[name] = _SchemaToStruct(self.schemas[name],\n seen, dent).to_str(self._prettyPrintByName)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99087:Expr_L107_C4", "label": "pop()", "type": "expression", "loc": [107, 107], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99087:FunctionDef_L83_C2", "vector": [8, 2, 0.3531, 0.0033, 2, 0.19, 0.8333, 969, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "pop", "arg_names": [], "import_names": [], "rhs_call_name": "pop", "annotation": ""}, "snippet": " seen.pop()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99087:Return_L109_C4", "label": "return", "type": "return", "loc": [109, 109], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99087:FunctionDef_L83_C2", "vector": [13, 2, 0.3597, 0.0033, 2, 0.19, 1.0, 0, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self.pretty[name]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99087:FunctionDef_L111_C2", "label": "prettyPrintByName", "type": "function", "loc": [111, 122], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99087:ClassDef_L68_C0", "vector": [2, 1, 0.3845, 0.0396, 1, 0.22, 0.5, 940, 0, 2, 1, 0, 0, 0, 1], "semantic": {"name": "prettyPrintByName", "arg_names": ["self", "name"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def prettyPrintByName(self, name):\n \"\"\"Get pretty printed object prototype from the schema name.\n\n Args:\n name: string, Name of schema in the discovery document.\n\n Returns:\n string, A string that contains a prototype object with"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99087:Expr_L112_C4", "label": "expression", "type": "expression", "loc": [112, 120], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99087:FunctionDef_L111_C2", "vector": [8, 2, 0.3828, 0.0297, 2, 0.93, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Get pretty printed object prototype from the schema name.\n\n Args:\n name: string, Name of schema in the discovery document.\n\n Returns:\n string, A string that contains a prototype object with\n comments that conforms to the given schema."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99087:Return_L122_C4", "label": "return", "type": "return", "loc": [122, 122], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99087:FunctionDef_L111_C2", "vector": [13, 2, 0.4026, 0.0033, 2, 0.93, 1.0, 0, 6, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self._prettyPrintByName(name, seen=[], dent=1)[:-2]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99087:FunctionDef_L124_C2", "label": "_prettyPrintSchema", "type": "function", "loc": [124, 139], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99087:ClassDef_L68_C0", "vector": [2, 1, 0.434, 0.0528, 1, 0.22, 0.6667, 62, 0, 4, 1, 0, 0, 0, 2], "semantic": {"name": "_prettyPrintSchema", "arg_names": ["self", "schema", "seen", "dent"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _prettyPrintSchema(self, schema, seen=None, dent=0):\n \"\"\"Get pretty printed object prototype of schema.\n\n Args:\n schema: object, Parsed JSON schema.\n seen: list of string, Names of schema already seen. Used to handle\n recursive definitions.\n"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99087:Expr_L125_C4", "label": "expression", "type": "expression", "loc": [125, 135], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99087:FunctionDef_L124_C2", "vector": [8, 2, 0.429, 0.0363, 2, 0.24, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Get pretty printed object prototype of schema.\n\n Args:\n schema: object, Parsed JSON schema.\n seen: list of string, Names of schema already seen. Used to handle\n recursive definitions.\n\n Returns:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99087:If_L136_C4", "label": "if", "type": "if", "loc": [136, 137], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99087:FunctionDef_L124_C2", "vector": [4, 2, 0.4505, 0.0066, 2, 0.24, 0.5, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if seen is None:\n seen = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99087:Assign_L137_C6", "label": "seen =", "type": "assigned_variable", "loc": [137, 137], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99087:If_L136_C4", "vector": [14, 3, 0.4521, 0.0033, 3, 0.72, 0.0, 212, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "seen", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " seen = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99087:Return_L139_C4", "label": "return", "type": "return", "loc": [139, 139], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99087:FunctionDef_L124_C2", "vector": [13, 2, 0.4587, 0.0033, 2, 0.24, 1.0, 0, 3, 0, 0, 0, 0, 10, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return _SchemaToStruct(schema, seen, dent).to_str(self._prettyPrintByName)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99087:FunctionDef_L141_C2", "label": "prettyPrintSchema", "type": "function", "loc": [141, 152], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99087:ClassDef_L68_C0", "vector": [2, 1, 0.4835, 0.0396, 1, 0.22, 0.8333, 276, 0, 2, 1, 0, 0, 0, 1], "semantic": {"name": "prettyPrintSchema", "arg_names": ["self", "schema"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def prettyPrintSchema(self, schema):\n \"\"\"Get pretty printed object prototype of schema.\n\n Args:\n schema: object, Parsed JSON schema.\n\n Returns:\n string, A string that contains a prototype object with"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99087:Expr_L142_C4", "label": "expression", "type": "expression", "loc": [142, 150], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99087:FunctionDef_L141_C2", "vector": [8, 2, 0.4818, 0.0297, 2, 0.55, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Get pretty printed object prototype of schema.\n\n Args:\n schema: object, Parsed JSON schema.\n\n Returns:\n string, A string that contains a prototype object with\n comments that conforms to the given schema."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99087:Return_L152_C4", "label": "return", "type": "return", "loc": [152, 152], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99087:FunctionDef_L141_C2", "vector": [13, 2, 0.5017, 0.0033, 2, 0.55, 1.0, 0, 6, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self._prettyPrintSchema(schema, dent=1)[:-2]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99087:FunctionDef_L154_C2", "label": "get", "type": "function", "loc": [154, 160], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99087:ClassDef_L68_C0", "vector": [2, 1, 0.5182, 0.0231, 1, 0.22, 1.0, 607, 0, 2, 1, 0, 0, 0, 0], "semantic": {"name": "get", "arg_names": ["self", "name"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def get(self, name):\n \"\"\"Get deserialized JSON schema from the schema name.\n\n Args:\n name: string, Schema name.\n \"\"\"\n return self.schemas[name]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99087:Expr_L155_C4", "label": "expression", "type": "expression", "loc": [155, 159], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99087:FunctionDef_L154_C2", "vector": [8, 2, 0.5182, 0.0165, 2, 0.67, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Get deserialized JSON schema from the schema name.\n\n Args:\n name: string, Schema name.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99087:Return_L160_C4", "label": "return", "type": "return", "loc": [160, 160], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99087:FunctionDef_L154_C2", "vector": [13, 2, 0.5281, 0.0033, 2, 0.67, 1.0, 0, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self.schemas[name]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99087:ClassDef_L163_C0", "label": "_SchemaToStruct", "type": "class", "loc": [163, 303], "level": 0, "parent": null, "vector": [3, 0, 0.769, 0.4653, 0, 0.66, 1.0, 130, 0, 8, 0, 0, 186, 0, 54], "semantic": {"name": "_SchemaToStruct", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class _SchemaToStruct(object):\n \"\"\"Convert schema to a prototype object.\"\"\"\n\n def __init__(self, schema, seen, dent=0):\n \"\"\"Constructor.\n\n Args:\n schema: object, Parsed JSON schema."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99087:Expr_L164_C2", "label": "expression", "type": "expression", "loc": [164, 164], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99087:ClassDef_L163_C0", "vector": [8, 1, 0.5413, 0.0033, 1, 0.31, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Convert schema to a prototype object.\"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99087:FunctionDef_L166_C2", "label": "__init__", "type": "function", "loc": [166, 192], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99087:ClassDef_L163_C0", "vector": [2, 1, 0.5908, 0.0891, 1, 0.31, 0.125, 555, 0, 4, 0, 0, 0, 0, 0], "semantic": {"name": "__init__", "arg_names": ["self", "schema", "seen", "dent"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, schema, seen, dent=0):\n \"\"\"Constructor.\n\n Args:\n schema: object, Parsed JSON schema.\n seen: list, List of names of schema already seen while parsing. Used to\n handle recursive definitions.\n dent: int, Initial indentation depth."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99087:Expr_L167_C4", "label": "expression", "type": "expression", "loc": [167, 174], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99087:FunctionDef_L166_C2", "vector": [8, 2, 0.5627, 0.0264, 2, 0.11, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Constructor.\n\n Args:\n schema: object, Parsed JSON schema.\n seen: list, List of names of schema already seen while parsing. Used to\n handle recursive definitions.\n dent: int, Initial indentation depth.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99087:Assign_L176_C4", "label": "self.value =", "type": "assigned_variable", "loc": [176, 176], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99087:FunctionDef_L166_C2", "vector": [14, 2, 0.5809, 0.0033, 2, 0.11, 0.1667, 966, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "self.value", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.value = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99087:Assign_L179_C4", "label": "self.string =", "type": "assigned_variable", "loc": [179, 179], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99087:FunctionDef_L166_C2", "vector": [14, 2, 0.5908, 0.0033, 2, 0.11, 0.3333, 182, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "self.string", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.string = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99087:Assign_L182_C4", "label": "self.schema =", "type": "assigned_variable", "loc": [182, 182], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99087:FunctionDef_L166_C2", "vector": [14, 2, 0.6007, 0.0033, 2, 0.11, 0.5, 698, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.schema", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.schema = schema"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99087:Assign_L185_C4", "label": "self.dent =", "type": "assigned_variable", "loc": [185, 185], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99087:FunctionDef_L166_C2", "vector": [14, 2, 0.6106, 0.0033, 2, 0.11, 0.6667, 840, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.dent", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.dent = dent"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99087:Assign_L189_C4", "label": "self.from_cache =", "type": "assigned_variable", "loc": [189, 189], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99087:FunctionDef_L166_C2", "vector": [14, 2, 0.6238, 0.0033, 2, 0.11, 0.8333, 122, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "self.from_cache", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.from_cache = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99087:Assign_L192_C4", "label": "self.seen =", "type": "assigned_variable", "loc": [192, 192], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99087:FunctionDef_L166_C2", "vector": [14, 2, 0.6337, 0.0033, 2, 0.11, 1.0, 607, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.seen", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.seen = seen"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99087:FunctionDef_L194_C2", "label": "emit", "type": "function", "loc": [194, 200], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99087:ClassDef_L163_C0", "vector": [2, 1, 0.6502, 0.0231, 1, 0.31, 0.25, 627, 0, 2, 0, 0, 0, 0, 1], "semantic": {"name": "emit", "arg_names": ["self", "text"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def emit(self, text):\n \"\"\"Add text as a line to the output.\n\n Args:\n text: string, Text to output.\n \"\"\"\n self.value.extend([\" \" * self.dent, text, '\\n'])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99087:Expr_L195_C4", "label": "expression", "type": "expression", "loc": [195, 199], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99087:FunctionDef_L194_C2", "vector": [8, 2, 0.6502, 0.0165, 2, 0.28, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Add text as a line to the output.\n\n Args:\n text: string, Text to output.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99087:Expr_L200_C4", "label": "extend()", "type": "expression", "loc": [200, 200], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99087:FunctionDef_L194_C2", "vector": [8, 2, 0.6601, 0.0033, 2, 0.28, 1.0, 660, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "extend", "arg_names": [], "import_names": [], "rhs_call_name": "extend", "annotation": ""}, "snippet": " self.value.extend([\" \" * self.dent, text, '\\n'])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99087:FunctionDef_L202_C2", "label": "emitBegin", "type": "function", "loc": [202, 208], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99087:ClassDef_L163_C0", "vector": [2, 1, 0.6766, 0.0231, 1, 0.31, 0.375, 293, 0, 2, 0, 0, 0, 0, 1], "semantic": {"name": "emitBegin", "arg_names": ["self", "text"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def emitBegin(self, text):\n \"\"\"Add text to the output, but with no line terminator.\n\n Args:\n text: string, Text to output.\n \"\"\"\n self.value.extend([\" \" * self.dent, text])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99087:Expr_L203_C4", "label": "expression", "type": "expression", "loc": [203, 207], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99087:FunctionDef_L202_C2", "vector": [8, 2, 0.6766, 0.0165, 2, 0.69, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Add text to the output, but with no line terminator.\n\n Args:\n text: string, Text to output.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99087:Expr_L208_C4", "label": "extend()", "type": "expression", "loc": [208, 208], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99087:FunctionDef_L202_C2", "vector": [8, 2, 0.6865, 0.0033, 2, 0.69, 1.0, 660, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "extend", "arg_names": [], "import_names": [], "rhs_call_name": "extend", "annotation": ""}, "snippet": " self.value.extend([\" \" * self.dent, text])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99087:FunctionDef_L210_C2", "label": "emitEnd", "type": "function", "loc": [210, 224], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99087:ClassDef_L163_C0", "vector": [2, 1, 0.7162, 0.0495, 1, 0.31, 0.5, 568, 0, 3, 0, 0, 0, 0, 5], "semantic": {"name": "emitEnd", "arg_names": ["self", "text", "comment"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def emitEnd(self, text, comment):\n \"\"\"Add text and comment to the output with line terminator.\n\n Args:\n text: string, Text to output.\n comment: string, Python comment.\n \"\"\"\n if comment:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99087:Expr_L211_C4", "label": "expression", "type": "expression", "loc": [211, 216], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99087:FunctionDef_L210_C2", "vector": [8, 2, 0.7046, 0.0198, 2, 0.88, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Add text and comment to the output with line terminator.\n\n Args:\n text: string, Text to output.\n comment: string, Python comment.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99087:If_L217_C4", "label": "if", "type": "if", "loc": [217, 224], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99087:FunctionDef_L210_C2", "vector": [4, 2, 0.7277, 0.0264, 2, 0.88, 1.0, 0, 2, 0, 0, 0, 0, 0, 5], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if comment:\n divider = '\\n' + ' ' * (self.dent + 2) + '# '\n lines = comment.splitlines()\n lines = [x.rstrip() for x in lines]\n comment = divider.join(lines)\n self.value.extend([text, ' # ', comment, '\\n'])\n else:\n self.value.extend([text, '\\n'])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99087:Assign_L218_C6", "label": "divider =", "type": "assigned_variable", "loc": [218, 218], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99087:If_L217_C4", "vector": [14, 3, 0.7195, 0.0033, 3, 0.87, 0.0, 275, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "divider", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " divider = '\\n' + ' ' * (self.dent + 2) + '# '"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99087:Assign_L219_C6", "label": "lines = splitlines()", "type": "assigned_variable", "loc": [219, 219], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99087:If_L217_C4", "vector": [14, 3, 0.7228, 0.0033, 3, 0.87, 0.2, 73, 3, 0, 0, 0, 296, 10, 1], "semantic": {"name": "lines", "arg_names": [], "import_names": [], "rhs_call_name": "splitlines", "annotation": ""}, "snippet": " lines = comment.splitlines()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99087:Assign_L220_C6", "label": "lines =", "type": "assigned_variable", "loc": [220, 220], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99087:If_L217_C4", "vector": [14, 3, 0.7261, 0.0033, 3, 0.87, 0.4, 73, 5, 0, 0, 0, 0, 0, 1], "semantic": {"name": "lines", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " lines = [x.rstrip() for x in lines]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99087:Assign_L221_C6", "label": "comment = join()", "type": "assigned_variable", "loc": [221, 221], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99087:If_L217_C4", "vector": [14, 3, 0.7294, 0.0033, 3, 0.87, 0.6, 34, 3, 1, 0, 0, 933, 10, 1], "semantic": {"name": "comment", "arg_names": [], "import_names": [], "rhs_call_name": "join", "annotation": ""}, "snippet": " comment = divider.join(lines)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99087:Expr_L222_C6", "label": "extend()", "type": "expression", "loc": [222, 222], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99087:If_L217_C4", "vector": [8, 3, 0.7327, 0.0033, 3, 0.87, 0.8, 660, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "extend", "arg_names": [], "import_names": [], "rhs_call_name": "extend", "annotation": ""}, "snippet": " self.value.extend([text, ' # ', comment, '\\n'])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99087:Expr_L224_C6", "label": "extend()", "type": "expression", "loc": [224, 224], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99087:If_L217_C4", "vector": [8, 3, 0.7393, 0.0033, 3, 0.87, 1.0, 660, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "extend", "arg_names": [], "import_names": [], "rhs_call_name": "extend", "annotation": ""}, "snippet": " self.value.extend([text, '\\n'])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99087:FunctionDef_L226_C2", "label": "indent", "type": "function", "loc": [226, 228], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99087:ClassDef_L163_C0", "vector": [2, 1, 0.7492, 0.0099, 1, 0.31, 0.625, 231, 0, 1, 0, 0, 0, 0, 0], "semantic": {"name": "indent", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def indent(self):\n \"\"\"Increase indentation level.\"\"\"\n self.dent += 1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99087:Expr_L227_C4", "label": "expression", "type": "expression", "loc": [227, 227], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99087:FunctionDef_L226_C2", "vector": [8, 2, 0.7492, 0.0033, 2, 0.03, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Increase indentation level.\"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99087:FunctionDef_L230_C2", "label": "undent", "type": "function", "loc": [230, 232], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99087:ClassDef_L163_C0", "vector": [2, 1, 0.7624, 0.0099, 1, 0.31, 0.75, 937, 0, 1, 0, 0, 0, 0, 0], "semantic": {"name": "undent", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def undent(self):\n \"\"\"Decrease indentation level.\"\"\"\n self.dent -= 1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99087:Expr_L231_C4", "label": "expression", "type": "expression", "loc": [231, 231], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99087:FunctionDef_L230_C2", "vector": [8, 2, 0.7624, 0.0033, 2, 0.7, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Decrease indentation level.\"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99087:FunctionDef_L234_C2", "label": "_to_str_impl", "type": "function", "loc": [234, 288], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99087:ClassDef_L163_C0", "vector": [2, 1, 0.8614, 0.1815, 1, 0.31, 0.875, 954, 0, 2, 1, 0, 0, 0, 46], "semantic": {"name": "_to_str_impl", "arg_names": ["self", "schema"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _to_str_impl(self, schema):\n \"\"\"Prototype object based on the schema, in Python code with comments.\n\n Args:\n schema: object, Parsed JSON schema file.\n\n Returns:\n Prototype object based on the schema, in Python code with comments."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99087:Expr_L235_C4", "label": "expression", "type": "expression", "loc": [235, 242], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99087:FunctionDef_L234_C2", "vector": [8, 2, 0.7871, 0.0264, 2, 0.53, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Prototype object based on the schema, in Python code with comments.\n\n Args:\n schema: object, Parsed JSON schema file.\n\n Returns:\n Prototype object based on the schema, in Python code with comments.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99087:Assign_L243_C4", "label": "stype = get()", "type": "assigned_variable", "loc": [243, 243], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99087:FunctionDef_L234_C2", "vector": [14, 2, 0.802, 0.0033, 2, 0.53, 0.25, 15, 3, 1, 0, 0, 607, 10, 1], "semantic": {"name": "stype", "arg_names": [], "import_names": [], "rhs_call_name": "get", "annotation": ""}, "snippet": " stype = schema.get('type')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99087:If_L244_C4", "label": "if", "type": "if", "loc": [244, 285], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99087:FunctionDef_L234_C2", "vector": [4, 2, 0.8729, 0.1386, 2, 0.53, 0.5, 0, 0, 0, 0, 0, 0, 0, 44], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if stype == 'object':\n self.emitEnd('{', schema.get('description', ''))\n self.indent()\n for pname, pschema in schema.get('properties', {}).iteritems():\n self.emitBegin('\"%s\": ' % pname)\n self._to_str_impl(pschema)\n self.undent()\n self.emit('},')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99087:Expr_L245_C6", "label": "emitEnd()", "type": "expression", "loc": [245, 245], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99087:If_L244_C4", "vector": [8, 3, 0.8086, 0.0033, 3, 0.89, 0.0, 568, 3, 2, 0, 0, 0, 0, 2], "semantic": {"name": "emitEnd", "arg_names": [], "import_names": [], "rhs_call_name": "emitEnd", "annotation": ""}, "snippet": " self.emitEnd('{', schema.get('description', ''))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99087:Expr_L246_C6", "label": "indent()", "type": "expression", "loc": [246, 246], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99087:If_L244_C4", "vector": [8, 3, 0.8119, 0.0033, 3, 0.89, 0.2, 231, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "indent", "arg_names": [], "import_names": [], "rhs_call_name": "indent", "annotation": ""}, "snippet": " self.indent()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99087:For_L247_C6", "label": "for pname, pschema", "type": "for", "loc": [247, 249], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99087:If_L244_C4", "vector": [6, 3, 0.8185, 0.0099, 3, 0.89, 0.4, 119, 3, 0, 0, 0, 0, 0, 4], "semantic": {"name": "pname, pschema", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for pname, pschema in schema.get('properties', {}).iteritems():\n self.emitBegin('\"%s\": ' % pname)\n self._to_str_impl(pschema)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99087:Expr_L248_C8", "label": "emitBegin()", "type": "expression", "loc": [248, 248], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99087:For_L247_C6", "vector": [8, 4, 0.8185, 0.0033, 4, 0.17, 0.0, 293, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "emitBegin", "arg_names": [], "import_names": [], "rhs_call_name": "emitBegin", "annotation": ""}, "snippet": " self.emitBegin('\"%s\": ' % pname)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99087:Expr_L249_C8", "label": "_to_str_impl()", "type": "expression", "loc": [249, 249], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99087:For_L247_C6", "vector": [8, 4, 0.8218, 0.0033, 4, 0.17, 1.0, 954, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "_to_str_impl", "arg_names": [], "import_names": [], "rhs_call_name": "_to_str_impl", "annotation": ""}, "snippet": " self._to_str_impl(pschema)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99087:Expr_L250_C6", "label": "undent()", "type": "expression", "loc": [250, 250], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99087:If_L244_C4", "vector": [8, 3, 0.8251, 0.0033, 3, 0.89, 0.6, 937, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "undent", "arg_names": [], "import_names": [], "rhs_call_name": "undent", "annotation": ""}, "snippet": " self.undent()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99087:Expr_L251_C6", "label": "emit()", "type": "expression", "loc": [251, 251], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99087:If_L244_C4", "vector": [8, 3, 0.8284, 0.0033, 3, 0.89, 0.8, 627, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "emit", "arg_names": [], "import_names": [], "rhs_call_name": "emit", "annotation": ""}, "snippet": " self.emit('},')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99087:If_L252_C4", "label": "if", "type": "if", "loc": [252, 285], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99087:If_L244_C4", "vector": [4, 3, 0.8861, 0.1122, 3, 0.89, 1.0, 0, 0, 0, 0, 0, 0, 0, 35], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " elif '$ref' in schema:\n schemaName = schema['$ref']\n description = schema.get('description', '')\n s = self.from_cache(schemaName, self.seen)\n parts = s.splitlines()\n self.emitEnd(parts[0], description)\n for line in parts[1:]:\n self.emit(line.rstrip())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99087:Assign_L253_C6", "label": "schemaName =", "type": "assigned_variable", "loc": [253, 253], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99087:If_L252_C4", "vector": [14, 4, 0.835, 0.0033, 4, 0.31, 0.0, 5, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "schemaName", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " schemaName = schema['$ref']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99087:Assign_L254_C6", "label": "description = get()", "type": "assigned_variable", "loc": [254, 254], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99087:If_L252_C4", "vector": [14, 4, 0.8383, 0.0033, 4, 0.31, 0.1667, 306, 3, 2, 0, 0, 607, 10, 1], "semantic": {"name": "description", "arg_names": [], "import_names": [], "rhs_call_name": "get", "annotation": ""}, "snippet": " description = schema.get('description', '')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99087:Assign_L255_C6", "label": "s = from_cache()", "type": "assigned_variable", "loc": [255, 255], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99087:If_L252_C4", "vector": [14, 4, 0.8416, 0.0033, 4, 0.31, 0.3333, 553, 3, 2, 0, 0, 27, 10, 1], "semantic": {"name": "s", "arg_names": [], "import_names": [], "rhs_call_name": "from_cache", "annotation": ""}, "snippet": " s = self.from_cache(schemaName, self.seen)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99087:Assign_L256_C6", "label": "parts = splitlines()", "type": "assigned_variable", "loc": [256, 256], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99087:If_L252_C4", "vector": [14, 4, 0.8449, 0.0033, 4, 0.31, 0.5, 13, 3, 0, 0, 0, 296, 10, 1], "semantic": {"name": "parts", "arg_names": [], "import_names": [], "rhs_call_name": "splitlines", "annotation": ""}, "snippet": " parts = s.splitlines()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99087:Expr_L257_C6", "label": "emitEnd()", "type": "expression", "loc": [257, 257], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99087:If_L252_C4", "vector": [8, 4, 0.8482, 0.0033, 4, 0.31, 0.6667, 568, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "emitEnd", "arg_names": [], "import_names": [], "rhs_call_name": "emitEnd", "annotation": ""}, "snippet": " self.emitEnd(parts[0], description)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99087:For_L258_C6", "label": "for line", "type": "for", "loc": [258, 259], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99087:If_L252_C4", "vector": [6, 4, 0.8531, 0.0066, 4, 0.31, 0.8333, 373, 6, 0, 0, 0, 0, 0, 2], "semantic": {"name": "line", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for line in parts[1:]:\n self.emit(line.rstrip())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99087:Expr_L259_C8", "label": "emit()", "type": "expression", "loc": [259, 259], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99087:For_L258_C6", "vector": [8, 5, 0.8548, 0.0033, 5, 0.34, 0.0, 627, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "emit", "arg_names": [], "import_names": [], "rhs_call_name": "emit", "annotation": ""}, "snippet": " self.emit(line.rstrip())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99087:If_L260_C4", "label": "if", "type": "if", "loc": [260, 285], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99087:If_L252_C4", "vector": [4, 4, 0.8993, 0.0858, 4, 0.31, 1.0, 0, 0, 0, 0, 0, 0, 0, 29], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " elif stype == 'boolean':\n value = schema.get('default', 'True or False')\n self.emitEnd('%s,' % str(value), schema.get('description', ''))\n elif stype == 'string':\n value = schema.get('default', 'A String')\n self.emitEnd('\"%s\",' % str(value), schema.get('description', ''))\n elif stype == 'integer':\n value = schema.get('default', '42')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99087:Assign_L261_C6", "label": "value = get()", "type": "assigned_variable", "loc": [261, 261], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99087:If_L260_C4", "vector": [14, 5, 0.8614, 0.0033, 5, 0.8, 0.0, 441, 3, 2, 0, 0, 607, 10, 1], "semantic": {"name": "value", "arg_names": [], "import_names": [], "rhs_call_name": "get", "annotation": ""}, "snippet": " value = schema.get('default', 'True or False')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99087:Expr_L262_C6", "label": "emitEnd()", "type": "expression", "loc": [262, 262], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99087:If_L260_C4", "vector": [8, 5, 0.8647, 0.0033, 5, 0.8, 0.5, 568, 3, 2, 0, 0, 0, 0, 3], "semantic": {"name": "emitEnd", "arg_names": [], "import_names": [], "rhs_call_name": "emitEnd", "annotation": ""}, "snippet": " self.emitEnd('%s,' % str(value), schema.get('description', ''))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99087:If_L263_C4", "label": "if", "type": "if", "loc": [263, 285], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99087:If_L260_C4", "vector": [4, 5, 0.9043, 0.0759, 5, 0.8, 1.0, 0, 0, 0, 0, 0, 0, 0, 25], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " elif stype == 'string':\n value = schema.get('default', 'A String')\n self.emitEnd('\"%s\",' % str(value), schema.get('description', ''))\n elif stype == 'integer':\n value = schema.get('default', '42')\n self.emitEnd('%s,' % str(value), schema.get('description', ''))\n elif stype == 'number':\n value = schema.get('default', '3.14')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99087:Assign_L264_C6", "label": "value = get()", "type": "assigned_variable", "loc": [264, 264], "level": 6, "parent": "ajibawa-2023/Python-Code-Large/train/row_99087:If_L263_C4", "vector": [14, 6, 0.8713, 0.0033, 6, 0.11, 0.0, 441, 3, 2, 0, 0, 607, 10, 1], "semantic": {"name": "value", "arg_names": [], "import_names": [], "rhs_call_name": "get", "annotation": ""}, "snippet": " value = schema.get('default', 'A String')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99087:Expr_L265_C6", "label": "emitEnd()", "type": "expression", "loc": [265, 265], "level": 6, "parent": "ajibawa-2023/Python-Code-Large/train/row_99087:If_L263_C4", "vector": [8, 6, 0.8746, 0.0033, 6, 0.11, 0.5, 568, 3, 2, 0, 0, 0, 0, 3], "semantic": {"name": "emitEnd", "arg_names": [], "import_names": [], "rhs_call_name": "emitEnd", "annotation": ""}, "snippet": " self.emitEnd('\"%s\",' % str(value), schema.get('description', ''))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99087:If_L266_C4", "label": "if", "type": "if", "loc": [266, 285], "level": 6, "parent": "ajibawa-2023/Python-Code-Large/train/row_99087:If_L263_C4", "vector": [4, 6, 0.9092, 0.066, 6, 0.11, 1.0, 0, 0, 0, 0, 0, 0, 0, 21], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " elif stype == 'integer':\n value = schema.get('default', '42')\n self.emitEnd('%s,' % str(value), schema.get('description', ''))\n elif stype == 'number':\n value = schema.get('default', '3.14')\n self.emitEnd('%s,' % str(value), schema.get('description', ''))\n elif stype == 'null':\n self.emitEnd('None,', schema.get('description', ''))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99087:Assign_L267_C6", "label": "value = get()", "type": "assigned_variable", "loc": [267, 267], "level": 7, "parent": "ajibawa-2023/Python-Code-Large/train/row_99087:If_L266_C4", "vector": [14, 7, 0.8812, 0.0033, 7, 0.33, 0.0, 441, 3, 2, 0, 0, 607, 10, 1], "semantic": {"name": "value", "arg_names": [], "import_names": [], "rhs_call_name": "get", "annotation": ""}, "snippet": " value = schema.get('default', '42')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99087:Expr_L268_C6", "label": "emitEnd()", "type": "expression", "loc": [268, 268], "level": 7, "parent": "ajibawa-2023/Python-Code-Large/train/row_99087:If_L266_C4", "vector": [8, 7, 0.8845, 0.0033, 7, 0.33, 0.5, 568, 3, 2, 0, 0, 0, 0, 3], "semantic": {"name": "emitEnd", "arg_names": [], "import_names": [], "rhs_call_name": "emitEnd", "annotation": ""}, "snippet": " self.emitEnd('%s,' % str(value), schema.get('description', ''))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99087:If_L269_C4", "label": "if", "type": "if", "loc": [269, 285], "level": 7, "parent": "ajibawa-2023/Python-Code-Large/train/row_99087:If_L266_C4", "vector": [4, 7, 0.9142, 0.0561, 7, 0.33, 1.0, 0, 0, 0, 0, 0, 0, 0, 17], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " elif stype == 'number':\n value = schema.get('default', '3.14')\n self.emitEnd('%s,' % str(value), schema.get('description', ''))\n elif stype == 'null':\n self.emitEnd('None,', schema.get('description', ''))\n elif stype == 'any':\n self.emitEnd('\"\",', schema.get('description', ''))\n elif stype == 'array':"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99087:Assign_L270_C6", "label": "value = get()", "type": "assigned_variable", "loc": [270, 270], "level": 8, "parent": "ajibawa-2023/Python-Code-Large/train/row_99087:If_L269_C4", "vector": [14, 8, 0.8911, 0.0033, 8, 0.24, 0.0, 441, 3, 2, 0, 0, 607, 10, 1], "semantic": {"name": "value", "arg_names": [], "import_names": [], "rhs_call_name": "get", "annotation": ""}, "snippet": " value = schema.get('default', '3.14')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99087:Expr_L271_C6", "label": "emitEnd()", "type": "expression", "loc": [271, 271], "level": 8, "parent": "ajibawa-2023/Python-Code-Large/train/row_99087:If_L269_C4", "vector": [8, 8, 0.8944, 0.0033, 8, 0.24, 0.5, 568, 3, 2, 0, 0, 0, 0, 3], "semantic": {"name": "emitEnd", "arg_names": [], "import_names": [], "rhs_call_name": "emitEnd", "annotation": ""}, "snippet": " self.emitEnd('%s,' % str(value), schema.get('description', ''))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99087:If_L272_C4", "label": "if", "type": "if", "loc": [272, 285], "level": 8, "parent": "ajibawa-2023/Python-Code-Large/train/row_99087:If_L269_C4", "vector": [4, 8, 0.9191, 0.0462, 8, 0.24, 1.0, 0, 0, 0, 0, 0, 0, 0, 13], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " elif stype == 'null':\n self.emitEnd('None,', schema.get('description', ''))\n elif stype == 'any':\n self.emitEnd('\"\",', schema.get('description', ''))\n elif stype == 'array':\n self.emitEnd('[', schema.get('description'))\n self.indent()\n self.emitBegin('')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99087:Expr_L273_C6", "label": "emitEnd()", "type": "expression", "loc": [273, 273], "level": 9, "parent": "ajibawa-2023/Python-Code-Large/train/row_99087:If_L272_C4", "vector": [8, 9, 0.901, 0.0033, 9, 0.55, 0.0, 568, 3, 2, 0, 0, 0, 0, 2], "semantic": {"name": "emitEnd", "arg_names": [], "import_names": [], "rhs_call_name": "emitEnd", "annotation": ""}, "snippet": " self.emitEnd('None,', schema.get('description', ''))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99087:If_L274_C4", "label": "if", "type": "if", "loc": [274, 285], "level": 9, "parent": "ajibawa-2023/Python-Code-Large/train/row_99087:If_L272_C4", "vector": [4, 9, 0.9224, 0.0396, 9, 0.55, 1.0, 0, 0, 0, 0, 0, 0, 0, 11], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " elif stype == 'any':\n self.emitEnd('\"\",', schema.get('description', ''))\n elif stype == 'array':\n self.emitEnd('[', schema.get('description'))\n self.indent()\n self.emitBegin('')\n self._to_str_impl(schema['items'])\n self.undent()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99087:Expr_L275_C6", "label": "emitEnd()", "type": "expression", "loc": [275, 275], "level": 10, "parent": "ajibawa-2023/Python-Code-Large/train/row_99087:If_L274_C4", "vector": [8, 10, 0.9076, 0.0033, 10, 0.75, 0.0, 568, 3, 2, 0, 0, 0, 0, 2], "semantic": {"name": "emitEnd", "arg_names": [], "import_names": [], "rhs_call_name": "emitEnd", "annotation": ""}, "snippet": " self.emitEnd('\"\",', schema.get('description', ''))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99087:If_L276_C4", "label": "if", "type": "if", "loc": [276, 285], "level": 10, "parent": "ajibawa-2023/Python-Code-Large/train/row_99087:If_L274_C4", "vector": [4, 10, 0.9257, 0.033, 10, 0.75, 1.0, 0, 0, 0, 0, 0, 0, 0, 9], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " elif stype == 'array':\n self.emitEnd('[', schema.get('description'))\n self.indent()\n self.emitBegin('')\n self._to_str_impl(schema['items'])\n self.undent()\n self.emit('],')\n else:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99087:Expr_L277_C6", "label": "emitEnd()", "type": "expression", "loc": [277, 277], "level": 11, "parent": "ajibawa-2023/Python-Code-Large/train/row_99087:If_L276_C4", "vector": [8, 11, 0.9142, 0.0033, 11, 0.44, 0.0, 568, 3, 2, 0, 0, 0, 0, 2], "semantic": {"name": "emitEnd", "arg_names": [], "import_names": [], "rhs_call_name": "emitEnd", "annotation": ""}, "snippet": " self.emitEnd('[', schema.get('description'))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99087:Expr_L278_C6", "label": "indent()", "type": "expression", "loc": [278, 278], "level": 11, "parent": "ajibawa-2023/Python-Code-Large/train/row_99087:If_L276_C4", "vector": [8, 11, 0.9175, 0.0033, 11, 0.44, 0.1429, 231, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "indent", "arg_names": [], "import_names": [], "rhs_call_name": "indent", "annotation": ""}, "snippet": " self.indent()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99087:Expr_L279_C6", "label": "emitBegin()", "type": "expression", "loc": [279, 279], "level": 11, "parent": "ajibawa-2023/Python-Code-Large/train/row_99087:If_L276_C4", "vector": [8, 11, 0.9208, 0.0033, 11, 0.44, 0.2857, 293, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "emitBegin", "arg_names": [], "import_names": [], "rhs_call_name": "emitBegin", "annotation": ""}, "snippet": " self.emitBegin('')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99087:Expr_L280_C6", "label": "_to_str_impl()", "type": "expression", "loc": [280, 280], "level": 11, "parent": "ajibawa-2023/Python-Code-Large/train/row_99087:If_L276_C4", "vector": [8, 11, 0.9241, 0.0033, 11, 0.44, 0.4286, 954, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "_to_str_impl", "arg_names": [], "import_names": [], "rhs_call_name": "_to_str_impl", "annotation": ""}, "snippet": " self._to_str_impl(schema['items'])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99087:Expr_L281_C6", "label": "undent()", "type": "expression", "loc": [281, 281], "level": 11, "parent": "ajibawa-2023/Python-Code-Large/train/row_99087:If_L276_C4", "vector": [8, 11, 0.9274, 0.0033, 11, 0.44, 0.5714, 937, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "undent", "arg_names": [], "import_names": [], "rhs_call_name": "undent", "annotation": ""}, "snippet": " self.undent()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99087:Expr_L282_C6", "label": "emit()", "type": "expression", "loc": [282, 282], "level": 11, "parent": "ajibawa-2023/Python-Code-Large/train/row_99087:If_L276_C4", "vector": [8, 11, 0.9307, 0.0033, 11, 0.44, 0.7143, 627, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "emit", "arg_names": [], "import_names": [], "rhs_call_name": "emit", "annotation": ""}, "snippet": " self.emit('],')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99087:Expr_L284_C6", "label": "emit()", "type": "expression", "loc": [284, 284], "level": 11, "parent": "ajibawa-2023/Python-Code-Large/train/row_99087:If_L276_C4", "vector": [8, 11, 0.9373, 0.0033, 11, 0.44, 0.8571, 627, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "emit", "arg_names": [], "import_names": [], "rhs_call_name": "emit", "annotation": ""}, "snippet": " self.emit('Unknown type! %s' % stype)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99087:Expr_L285_C6", "label": "emitEnd()", "type": "expression", "loc": [285, 285], "level": 11, "parent": "ajibawa-2023/Python-Code-Large/train/row_99087:If_L276_C4", "vector": [8, 11, 0.9406, 0.0033, 11, 0.44, 1.0, 568, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "emitEnd", "arg_names": [], "import_names": [], "rhs_call_name": "emitEnd", "annotation": ""}, "snippet": " self.emitEnd('', '')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99087:Assign_L287_C4", "label": "self.string = join()", "type": "assigned_variable", "loc": [287, 287], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99087:FunctionDef_L234_C2", "vector": [14, 2, 0.9472, 0.0033, 2, 0.53, 0.75, 182, 3, 1, 0, 0, 933, 10, 1], "semantic": {"name": "self.string", "arg_names": [], "import_names": [], "rhs_call_name": "join", "annotation": ""}, "snippet": " self.string = ''.join(self.value)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99087:Return_L288_C4", "label": "return", "type": "return", "loc": [288, 288], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99087:FunctionDef_L234_C2", "vector": [13, 2, 0.9505, 0.0033, 2, 0.53, 1.0, 0, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self.string"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99087:FunctionDef_L290_C2", "label": "to_str", "type": "function", "loc": [290, 303], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99087:ClassDef_L163_C0", "vector": [2, 1, 0.9785, 0.0462, 1, 0.31, 1.0, 798, 0, 2, 1, 0, 0, 0, 1], "semantic": {"name": "to_str", "arg_names": ["self", "from_cache"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def to_str(self, from_cache):\n \"\"\"Prototype object based on the schema, in Python code with comments.\n\n Args:\n from_cache: callable(name, seen), Callable that retrieves an object\n prototype for a schema with the given name. Seen is a list of schema\n names already seen as we recursively descend the schema definition.\n"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99087:Expr_L291_C4", "label": "expression", "type": "expression", "loc": [291, 301], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99087:FunctionDef_L290_C2", "vector": [8, 2, 0.9769, 0.0363, 2, 0.36, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Prototype object based on the schema, in Python code with comments.\n\n Args:\n from_cache: callable(name, seen), Callable that retrieves an object\n prototype for a schema with the given name. Seen is a list of schema\n names already seen as we recursively descend the schema definition.\n\n Returns:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99087:Assign_L302_C4", "label": "self.from_cache =", "type": "assigned_variable", "loc": [302, 302], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99087:FunctionDef_L290_C2", "vector": [14, 2, 0.9967, 0.0033, 2, 0.36, 0.5, 122, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.from_cache", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.from_cache = from_cache"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99087:Return_L303_C4", "label": "return", "type": "return", "loc": [303, 303], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99087:FunctionDef_L290_C2", "vector": [13, 2, 1.0, 0.0033, 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 self._to_str_impl(self.schema)"}]
[{"f": "ajibawa-2023/Python-Code-Large/train/row_99087:ClassDef_L68_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99087:Expr_L69_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99087:ClassDef_L68_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99087:FunctionDef_L71_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99087:FunctionDef_L71_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99087:Expr_L72_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99087:FunctionDef_L71_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99087:Assign_L78_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99087:FunctionDef_L71_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99087:Assign_L81_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99087:ClassDef_L68_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99087:FunctionDef_L83_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99087:FunctionDef_L83_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99087:Expr_L84_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99087:FunctionDef_L83_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99087:If_L95_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99087:If_L95_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99087:Assign_L96_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99087:FunctionDef_L83_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99087:If_L98_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99087:If_L98_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99087:Return_L100_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99087:FunctionDef_L83_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99087:Expr_L101_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99087:FunctionDef_L83_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99087:If_L103_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99087:If_L103_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99087:Assign_L104_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99087:FunctionDef_L83_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99087:Expr_L107_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99087:FunctionDef_L83_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99087:Return_L109_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99087:ClassDef_L68_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99087:FunctionDef_L111_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99087:FunctionDef_L111_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99087:Expr_L112_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99087:FunctionDef_L111_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99087:Return_L122_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99087:ClassDef_L68_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99087:FunctionDef_L124_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99087:FunctionDef_L124_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99087:Expr_L125_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99087:FunctionDef_L124_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99087:If_L136_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99087:If_L136_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99087:Assign_L137_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99087:FunctionDef_L124_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99087:Return_L139_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99087:ClassDef_L68_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99087:FunctionDef_L141_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99087:FunctionDef_L141_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99087:Expr_L142_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99087:FunctionDef_L141_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99087:Return_L152_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99087:ClassDef_L68_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99087:FunctionDef_L154_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99087:FunctionDef_L154_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99087:Expr_L155_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99087:FunctionDef_L154_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99087:Return_L160_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99087:ClassDef_L163_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99087:Expr_L164_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99087:ClassDef_L163_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99087:FunctionDef_L166_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99087:FunctionDef_L166_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99087:Expr_L167_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99087:FunctionDef_L166_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99087:Assign_L176_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99087:FunctionDef_L166_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99087:Assign_L179_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99087:FunctionDef_L166_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99087:Assign_L182_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99087:FunctionDef_L166_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99087:Assign_L185_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99087:FunctionDef_L166_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99087:Assign_L189_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99087:FunctionDef_L166_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99087:Assign_L192_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99087:ClassDef_L163_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99087:FunctionDef_L194_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99087:FunctionDef_L194_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99087:Expr_L195_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99087:FunctionDef_L194_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99087:Expr_L200_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99087:ClassDef_L163_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99087:FunctionDef_L202_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99087:FunctionDef_L202_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99087:Expr_L203_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99087:FunctionDef_L202_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99087:Expr_L208_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99087:ClassDef_L163_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99087:FunctionDef_L210_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99087:FunctionDef_L210_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99087:Expr_L211_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99087:FunctionDef_L210_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99087:If_L217_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99087:If_L217_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99087:Assign_L218_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99087:If_L217_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99087:Assign_L219_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99087:If_L217_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99087:Assign_L220_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99087:If_L217_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99087:Assign_L221_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99087:If_L217_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99087:Expr_L222_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99087:If_L217_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99087:Expr_L224_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99087:ClassDef_L163_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99087:FunctionDef_L226_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99087:FunctionDef_L226_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99087:Expr_L227_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99087:ClassDef_L163_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99087:FunctionDef_L230_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99087:FunctionDef_L230_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99087:Expr_L231_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99087:ClassDef_L163_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99087:FunctionDef_L234_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99087:FunctionDef_L234_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99087:Expr_L235_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99087:FunctionDef_L234_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99087:Assign_L243_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99087:FunctionDef_L234_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99087:If_L244_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99087:If_L244_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99087:Expr_L245_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99087:If_L244_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99087:Expr_L246_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99087:If_L244_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99087:For_L247_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99087:For_L247_C6", "t": "ajibawa-2023/Python-Code-Large/train/row_99087:Expr_L248_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99087:For_L247_C6", "t": "ajibawa-2023/Python-Code-Large/train/row_99087:Expr_L249_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99087:If_L244_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99087:Expr_L250_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99087:If_L244_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99087:Expr_L251_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99087:If_L244_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99087:If_L252_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99087:If_L252_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99087:Assign_L253_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99087:If_L252_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99087:Assign_L254_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99087:If_L252_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99087:Assign_L255_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99087:If_L252_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99087:Assign_L256_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99087:If_L252_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99087:Expr_L257_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99087:If_L252_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99087:For_L258_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99087:For_L258_C6", "t": "ajibawa-2023/Python-Code-Large/train/row_99087:Expr_L259_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99087:If_L252_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99087:If_L260_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99087:If_L260_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99087:Assign_L261_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99087:If_L260_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99087:Expr_L262_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99087:If_L260_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99087:If_L263_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99087:If_L263_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99087:Assign_L264_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99087:If_L263_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99087:Expr_L265_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99087:If_L263_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99087:If_L266_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99087:If_L266_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99087:Assign_L267_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99087:If_L266_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99087:Expr_L268_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99087:If_L266_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99087:If_L269_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99087:If_L269_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99087:Assign_L270_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99087:If_L269_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99087:Expr_L271_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99087:If_L269_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99087:If_L272_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99087:If_L272_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99087:Expr_L273_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99087:If_L272_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99087:If_L274_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99087:If_L274_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99087:Expr_L275_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99087:If_L274_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99087:If_L276_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99087:If_L276_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99087:Expr_L277_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99087:If_L276_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99087:Expr_L278_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99087:If_L276_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99087:Expr_L279_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99087:If_L276_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99087:Expr_L280_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99087:If_L276_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99087:Expr_L281_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99087:If_L276_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99087:Expr_L282_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99087:If_L276_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99087:Expr_L284_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99087:If_L276_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99087:Expr_L285_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99087:FunctionDef_L234_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99087:Assign_L287_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99087:FunctionDef_L234_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99087:Return_L288_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99087:ClassDef_L163_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99087:FunctionDef_L290_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99087:FunctionDef_L290_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99087:Expr_L291_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99087:FunctionDef_L290_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99087:Assign_L302_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99087:FunctionDef_L290_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99087:Return_L303_C4"}]
# Copyright (C) 2010 Google Inc. # # 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. """Utility module to import a JSON module Hides all the messy details of exactly where we get a simplejson module from. """ __author__ = 'jcgregorio@google.com (Joe Gregorio)' try: # pragma: no cover import simplejson except ImportError: # pragma: no cover try: # Try to import from django, should work on App Engine from django.utils import simplejson except ImportError: # Should work for Python2.6 and higher. import json as simplejson
ajibawa-2023/Python-Code-Large/train/row_99088
7
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_99088:Expr_L15_C0", "label": "expression", "type": "expression", "loc": [15, 19], "level": 0, "parent": null, "vector": [8, 0, 0.5312, 0.1562, 0, 0.66, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\"\"\"Utility module to import a JSON module\n\nHides all the messy details of exactly where\nwe get a simplejson module from.\n\"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99088:Assign_L21_C0", "label": "__author__ =", "type": "assigned_variable", "loc": [21, 21], "level": 0, "parent": null, "vector": [14, 0, 0.6562, 0.0312, 0, 0.66, 0.5, 777, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "__author__", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "__author__ = 'jcgregorio@google.com (Joe Gregorio)'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99088:Try_L24_C0", "label": "try", "type": "try", "loc": [24, 32], "level": 0, "parent": null, "vector": [7, 0, 0.875, 0.2812, 0, 0.66, 1.0, 0, 0, 1, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "try: # pragma: no cover\n import simplejson\nexcept ImportError: # pragma: no cover\n try:\n # Try to import from django, should work on App Engine\n from django.utils import simplejson\n except ImportError:\n # Should work for Python2.6 and higher."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99088:Import_L25_C2", "label": "simplejson import simplejson", "type": "import", "loc": [25, 25], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99088:Try_L24_C0", "vector": [1, 1, 0.7812, 0.0312, 1, 0.74, 0.0, 386, 0, 1, 0, 0, 386, 0, 0], "semantic": {"name": "simplejson", "arg_names": [], "import_names": ["simplejson"], "rhs_call_name": "", "annotation": ""}, "snippet": " import simplejson"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99088:Try_L27_C2", "label": "try", "type": "try", "loc": [27, 32], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99088:Try_L24_C0", "vector": [7, 1, 0.9219, 0.1875, 1, 0.74, 0.0, 0, 0, 1, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " try:\n # Try to import from django, should work on App Engine\n from django.utils import simplejson\n except ImportError:\n # Should work for Python2.6 and higher.\n import json as simplejson"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99088:ImportFrom_L29_C4", "label": "from django.utils import simplejson", "type": "import", "loc": [29, 29], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99088:Try_L27_C2", "vector": [1, 2, 0.9062, 0.0312, 2, 0.7, 0.0, 944, 0, 1, 0, 0, 944, 0, 0], "semantic": {"name": "django.utils", "arg_names": [], "import_names": ["simplejson"], "rhs_call_name": "", "annotation": ""}, "snippet": " from django.utils import simplejson"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99088:Import_L32_C4", "label": "json import simplejson", "type": "import", "loc": [32, 32], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99088:Try_L27_C2", "vector": [1, 2, 1.0, 0.0312, 2, 0.7, 0.0, 463, 0, 1, 0, 0, 463, 0, 0], "semantic": {"name": "json", "arg_names": [], "import_names": ["simplejson"], "rhs_call_name": "", "annotation": ""}, "snippet": " import json as simplejson"}]
[{"f": "ajibawa-2023/Python-Code-Large/train/row_99088:Try_L24_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99088:Import_L25_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99088:Try_L24_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99088:Try_L27_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99088:Try_L27_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99088:ImportFrom_L29_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99088:Try_L27_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99088:Import_L32_C4"}]
# Copyright (C) 2010 Google Inc. # # 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. """Utilities for OAuth. Utilities for making it easier to work with OAuth. """ __author__ = 'jcgregorio@google.com (Joe Gregorio)' import copy import httplib2 import logging import oauth2 as oauth import urllib import urlparse from anyjson import simplejson try: from urlparse import parse_qsl except ImportError: from cgi import parse_qsl class Error(Exception): """Base error for this module.""" pass class RequestError(Error): """Error occurred during request.""" pass class MissingParameter(Error): pass class CredentialsInvalidError(Error): pass def _abstract(): raise NotImplementedError('You need to override this function') def _oauth_uri(name, discovery, params): """Look up the OAuth URI from the discovery document and add query parameters based on params. name - The name of the OAuth URI to lookup, one of 'request', 'access', or 'authorize'. discovery - Portion of discovery document the describes the OAuth endpoints. params - Dictionary that is used to form the query parameters for the specified URI. """ if name not in ['request', 'access', 'authorize']: raise KeyError(name) keys = discovery[name]['parameters'].keys() query = {} for key in keys: if key in params: query[key] = params[key] return discovery[name]['url'] + '?' + urllib.urlencode(query) class Credentials(object): """Base class for all Credentials objects. Subclasses must define an authorize() method that applies the credentials to an HTTP transport. """ def authorize(self, http): """Take an httplib2.Http instance (or equivalent) and authorizes it for the set of credentials, usually by replacing http.request() with a method that adds in the appropriate headers and then delegates to the original Http.request() method. """ _abstract() class Flow(object): """Base class for all Flow objects.""" pass class Storage(object): """Base class for all Storage objects. Store and retrieve a single credential. """ def get(self): """Retrieve credential. Returns: apiclient.oauth.Credentials """ _abstract() def put(self, credentials): """Write a credential. Args: credentials: Credentials, the credentials to store. """ _abstract() class OAuthCredentials(Credentials): """Credentials object for OAuth 1.0a """ def __init__(self, consumer, token, user_agent): """ consumer - An instance of oauth.Consumer. token - An instance of oauth.Token constructed with the access token and secret. user_agent - The HTTP User-Agent to provide for this application. """ self.consumer = consumer self.token = token self.user_agent = user_agent self.store = None # True if the credentials have been revoked self._invalid = False @property def invalid(self): """True if the credentials are invalid, such as being revoked.""" return getattr(self, "_invalid", False) def set_store(self, store): """Set the storage for the credential. Args: store: callable, a callable that when passed a Credential will store the credential back to where it came from. This is needed to store the latest access_token if it has been revoked. """ self.store = store def __getstate__(self): """Trim the state down to something that can be pickled.""" d = copy.copy(self.__dict__) del d['store'] return d def __setstate__(self, state): """Reconstitute the state of the object from being pickled.""" self.__dict__.update(state) self.store = None def authorize(self, http): """Authorize an httplib2.Http instance with these Credentials Args: http - An instance of httplib2.Http or something that acts like it. Returns: A modified instance of http that was passed in. Example: h = httplib2.Http() h = credentials.authorize(h) You can't create a new OAuth subclass of httplib2.Authenication because it never gets passed the absolute URI, which is needed for signing. So instead we have to overload 'request' with a closure that adds in the Authorization header and then calls the original version of 'request()'. """ request_orig = http.request signer = oauth.SignatureMethod_HMAC_SHA1() # The closure that will replace 'httplib2.Http.request'. def new_request(uri, method='GET', body=None, headers=None, redirections=httplib2.DEFAULT_MAX_REDIRECTS, connection_type=None): """Modify the request headers to add the appropriate Authorization header.""" response_code = 302 http.follow_redirects = False while response_code in [301, 302]: req = oauth.Request.from_consumer_and_token( self.consumer, self.token, http_method=method, http_url=uri) req.sign_request(signer, self.consumer, self.token) if headers is None: headers = {} headers.update(req.to_header()) if 'user-agent' in headers: headers['user-agent'] = self.user_agent + ' ' + headers['user-agent'] else: headers['user-agent'] = self.user_agent resp, content = request_orig(uri, method, body, headers, redirections, connection_type) response_code = resp.status if response_code in [301, 302]: uri = resp['location'] # Update the stored credential if it becomes invalid. if response_code == 401: logging.info('Access token no longer valid: %s' % content) self._invalid = True if self.store is not None: self.store(self) raise CredentialsInvalidError("Credentials are no longer valid.") return resp, content http.request = new_request return http class TwoLeggedOAuthCredentials(Credentials): """Two Legged Credentials object for OAuth 1.0a. The Two Legged object is created directly, not from a flow. Once you authorize and httplib2.Http instance you can change the requestor and that change will propogate to the authorized httplib2.Http instance. For example: http = httplib2.Http() http = credentials.authorize(http) credentials.requestor = 'foo@example.info' http.request(...) credentials.requestor = 'bar@example.info' http.request(...) """ def __init__(self, consumer_key, consumer_secret, user_agent): """ Args: consumer_key: string, An OAuth 1.0 consumer key consumer_secret: string, An OAuth 1.0 consumer secret user_agent: string, The HTTP User-Agent to provide for this application. """ self.consumer = oauth.Consumer(consumer_key, consumer_secret) self.user_agent = user_agent self.store = None # email address of the user to act on the behalf of. self._requestor = None @property def invalid(self): """True if the credentials are invalid, such as being revoked. Always returns False for Two Legged Credentials. """ return False def getrequestor(self): return self._requestor def setrequestor(self, email): self._requestor = email requestor = property(getrequestor, setrequestor, None, 'The email address of the user to act on behalf of') def set_store(self, store): """Set the storage for the credential. Args: store: callable, a callable that when passed a Credential will store the credential back to where it came from. This is needed to store the latest access_token if it has been revoked. """ self.store = store def __getstate__(self): """Trim the state down to something that can be pickled.""" d = copy.copy(self.__dict__) del d['store'] return d def __setstate__(self, state): """Reconstitute the state of the object from being pickled.""" self.__dict__.update(state) self.store = None def authorize(self, http): """Authorize an httplib2.Http instance with these Credentials Args: http - An instance of httplib2.Http or something that acts like it. Returns: A modified instance of http that was passed in. Example: h = httplib2.Http() h = credentials.authorize(h) You can't create a new OAuth subclass of httplib2.Authenication because it never gets passed the absolute URI, which is needed for signing. So instead we have to overload 'request' with a closure that adds in the Authorization header and then calls the original version of 'request()'. """ request_orig = http.request signer = oauth.SignatureMethod_HMAC_SHA1() # The closure that will replace 'httplib2.Http.request'. def new_request(uri, method='GET', body=None, headers=None, redirections=httplib2.DEFAULT_MAX_REDIRECTS, connection_type=None): """Modify the request headers to add the appropriate Authorization header.""" response_code = 302 http.follow_redirects = False while response_code in [301, 302]: # add in xoauth_requestor_id=self._requestor to the uri if self._requestor is None: raise MissingParameter( 'Requestor must be set before using TwoLeggedOAuthCredentials') parsed = list(urlparse.urlparse(uri)) q = parse_qsl(parsed[4]) q.append(('xoauth_requestor_id', self._requestor)) parsed[4] = urllib.urlencode(q) uri = urlparse.urlunparse(parsed) req = oauth.Request.from_consumer_and_token( self.consumer, None, http_method=method, http_url=uri) req.sign_request(signer, self.consumer, None) if headers is None: headers = {} headers.update(req.to_header()) if 'user-agent' in headers: headers['user-agent'] = self.user_agent + ' ' + headers['user-agent'] else: headers['user-agent'] = self.user_agent resp, content = request_orig(uri, method, body, headers, redirections, connection_type) response_code = resp.status if response_code in [301, 302]: uri = resp['location'] if response_code == 401: logging.info('Access token no longer valid: %s' % content) # Do not store the invalid state of the Credentials because # being 2LO they could be reinstated in the future. raise CredentialsInvalidError("Credentials are invalid.") return resp, content http.request = new_request return http class FlowThreeLegged(Flow): """Does the Three Legged Dance for OAuth 1.0a. """ def __init__(self, discovery, consumer_key, consumer_secret, user_agent, **kwargs): """ discovery - Section of the API discovery document that describes the OAuth endpoints. consumer_key - OAuth consumer key consumer_secret - OAuth consumer secret user_agent - The HTTP User-Agent that identifies the application. **kwargs - The keyword arguments are all optional and required parameters for the OAuth calls. """ self.discovery = discovery self.consumer_key = consumer_key self.consumer_secret = consumer_secret self.user_agent = user_agent self.params = kwargs self.request_token = {} required = {} for uriinfo in discovery.itervalues(): for name, value in uriinfo['parameters'].iteritems(): if value['required'] and not name.startswith('oauth_'): required[name] = 1 for key in required.iterkeys(): if key not in self.params: raise MissingParameter('Required parameter %s not supplied' % key) def step1_get_authorize_url(self, oauth_callback='oob'): """Returns a URI to redirect to the provider. oauth_callback - Either the string 'oob' for a non-web-based application, or a URI that handles the callback from the authorization server. If oauth_callback is 'oob' then pass in the generated verification code to step2_exchange, otherwise pass in the query parameters received at the callback uri to step2_exchange. """ consumer = oauth.Consumer(self.consumer_key, self.consumer_secret) client = oauth.Client(consumer) headers = { 'user-agent': self.user_agent, 'content-type': 'application/x-www-form-urlencoded' } body = urllib.urlencode({'oauth_callback': oauth_callback}) uri = _oauth_uri('request', self.discovery, self.params) resp, content = client.request(uri, 'POST', headers=headers, body=body) if resp['status'] != '200': logging.error('Failed to retrieve temporary authorization: %s', content) raise RequestError('Invalid response %s.' % resp['status']) self.request_token = dict(parse_qsl(content)) auth_params = copy.copy(self.params) auth_params['oauth_token'] = self.request_token['oauth_token'] return _oauth_uri('authorize', self.discovery, auth_params) def step2_exchange(self, verifier): """Exhanges an authorized request token for OAuthCredentials. Args: verifier: string, dict - either the verifier token, or a dictionary of the query parameters to the callback, which contains the oauth_verifier. Returns: The Credentials object. """ if not (isinstance(verifier, str) or isinstance(verifier, unicode)): verifier = verifier['oauth_verifier'] token = oauth.Token( self.request_token['oauth_token'], self.request_token['oauth_token_secret']) token.set_verifier(verifier) consumer = oauth.Consumer(self.consumer_key, self.consumer_secret) client = oauth.Client(consumer, token) headers = { 'user-agent': self.user_agent, 'content-type': 'application/x-www-form-urlencoded' } uri = _oauth_uri('access', self.discovery, self.params) resp, content = client.request(uri, 'POST', headers=headers) if resp['status'] != '200': logging.error('Failed to retrieve access token: %s', content) raise RequestError('Invalid response %s.' % resp['status']) oauth_params = dict(parse_qsl(content)) token = oauth.Token( oauth_params['oauth_token'], oauth_params['oauth_token_secret']) return OAuthCredentials(consumer, token, self.user_agent)
ajibawa-2023/Python-Code-Large/train/row_99089
201
483
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_99089:Expr_L15_C0", "label": "expression", "type": "expression", "loc": [15, 18], "level": 0, "parent": null, "vector": [8, 0, 0.0342, 0.0083, 0, 0.66, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\"\"\"Utilities for OAuth.\n\nUtilities for making it easier to work with OAuth.\n\"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99089:Assign_L20_C0", "label": "__author__ =", "type": "assigned_variable", "loc": [20, 20], "level": 0, "parent": null, "vector": [14, 0, 0.0414, 0.0021, 0, 0.66, 0.0476, 777, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "__author__", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "__author__ = 'jcgregorio@google.com (Joe Gregorio)'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99089:Import_L23_C0", "label": "copy import copy", "type": "import", "loc": [23, 23], "level": 0, "parent": null, "vector": [1, 0, 0.0476, 0.0021, 0, 0.66, 0.0952, 739, 0, 1, 0, 0, 739, 0, 0], "semantic": {"name": "copy", "arg_names": [], "import_names": ["copy"], "rhs_call_name": "", "annotation": ""}, "snippet": "import copy"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99089:Import_L24_C0", "label": "httplib2 import httplib2", "type": "import", "loc": [24, 24], "level": 0, "parent": null, "vector": [1, 0, 0.0497, 0.0021, 0, 0.66, 0.1429, 273, 0, 1, 0, 0, 273, 0, 0], "semantic": {"name": "httplib2", "arg_names": [], "import_names": ["httplib2"], "rhs_call_name": "", "annotation": ""}, "snippet": "import httplib2"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99089:Import_L25_C0", "label": "logging import logging", "type": "import", "loc": [25, 25], "level": 0, "parent": null, "vector": [1, 0, 0.0518, 0.0021, 0, 0.66, 0.1905, 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_99089:Import_L26_C0", "label": "oauth2 import oauth", "type": "import", "loc": [26, 26], "level": 0, "parent": null, "vector": [1, 0, 0.0538, 0.0021, 0, 0.66, 0.2381, 311, 0, 1, 0, 0, 311, 0, 0], "semantic": {"name": "oauth2", "arg_names": [], "import_names": ["oauth"], "rhs_call_name": "", "annotation": ""}, "snippet": "import oauth2 as oauth"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99089:Import_L27_C0", "label": "urllib import urllib", "type": "import", "loc": [27, 27], "level": 0, "parent": null, "vector": [1, 0, 0.0559, 0.0021, 0, 0.66, 0.2857, 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_99089:Import_L28_C0", "label": "urlparse import urlparse", "type": "import", "loc": [28, 28], "level": 0, "parent": null, "vector": [1, 0, 0.058, 0.0021, 0, 0.66, 0.3333, 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_99089:ImportFrom_L29_C0", "label": "from anyjson import simplejson", "type": "import", "loc": [29, 29], "level": 0, "parent": null, "vector": [1, 0, 0.06, 0.0021, 0, 0.66, 0.381, 877, 0, 1, 0, 0, 877, 0, 0], "semantic": {"name": "anyjson", "arg_names": [], "import_names": ["simplejson"], "rhs_call_name": "", "annotation": ""}, "snippet": "from anyjson import simplejson"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99089:Try_L31_C0", "label": "try", "type": "try", "loc": [31, 34], "level": 0, "parent": null, "vector": [7, 0, 0.0673, 0.0083, 0, 0.66, 0.4286, 0, 0, 1, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "try:\n from urlparse import parse_qsl\nexcept ImportError:\n from cgi import parse_qsl"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99089:ImportFrom_L32_C2", "label": "from urlparse import parse_qsl", "type": "import", "loc": [32, 32], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99089:Try_L31_C0", "vector": [1, 1, 0.0663, 0.0021, 1, 0.9, 0.0, 857, 0, 1, 0, 0, 857, 0, 0], "semantic": {"name": "urlparse", "arg_names": [], "import_names": ["parse_qsl"], "rhs_call_name": "", "annotation": ""}, "snippet": " from urlparse import parse_qsl"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99089:ImportFrom_L34_C2", "label": "from cgi import parse_qsl", "type": "import", "loc": [34, 34], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99089:Try_L31_C0", "vector": [1, 1, 0.0704, 0.0021, 1, 0.9, 0.0, 934, 0, 1, 0, 0, 934, 0, 0], "semantic": {"name": "cgi", "arg_names": [], "import_names": ["parse_qsl"], "rhs_call_name": "", "annotation": ""}, "snippet": " from cgi import parse_qsl"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99089:ClassDef_L37_C0", "label": "Error", "type": "class", "loc": [37, 39], "level": 0, "parent": null, "vector": [3, 0, 0.0787, 0.0062, 0, 0.66, 0.4762, 529, 0, 0, 0, 0, 645, 0, 0], "semantic": {"name": "Error", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class Error(Exception):\n \"\"\"Base error for this module.\"\"\"\n pass"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99089:Expr_L38_C2", "label": "expression", "type": "expression", "loc": [38, 38], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99089:ClassDef_L37_C0", "vector": [8, 1, 0.0787, 0.0021, 1, 0.3, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Base error for this module.\"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99089:ClassDef_L42_C0", "label": "RequestError", "type": "class", "loc": [42, 44], "level": 0, "parent": null, "vector": [3, 0, 0.089, 0.0062, 0, 0.66, 0.5238, 183, 0, 0, 0, 0, 529, 0, 0], "semantic": {"name": "RequestError", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class RequestError(Error):\n \"\"\"Error occurred during request.\"\"\"\n pass"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99089:Expr_L43_C2", "label": "expression", "type": "expression", "loc": [43, 43], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99089:ClassDef_L42_C0", "vector": [8, 1, 0.089, 0.0021, 1, 0.8, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Error occurred during request.\"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99089:ClassDef_L47_C0", "label": "MissingParameter", "type": "class", "loc": [47, 48], "level": 0, "parent": null, "vector": [3, 0, 0.0983, 0.0041, 0, 0.66, 0.5714, 595, 0, 0, 0, 0, 529, 0, 0], "semantic": {"name": "MissingParameter", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class MissingParameter(Error):\n pass"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99089:ClassDef_L51_C0", "label": "CredentialsInvalidError", "type": "class", "loc": [51, 52], "level": 0, "parent": null, "vector": [3, 0, 0.1066, 0.0041, 0, 0.66, 0.619, 436, 0, 0, 0, 0, 529, 0, 0], "semantic": {"name": "CredentialsInvalidError", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class CredentialsInvalidError(Error):\n pass"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99089:FunctionDef_L55_C0", "label": "_abstract", "type": "function", "loc": [55, 56], "level": 0, "parent": null, "vector": [2, 0, 0.1149, 0.0041, 0, 0.66, 0.6667, 629, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "_abstract", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def _abstract():\n raise NotImplementedError('You need to override this function')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99089:FunctionDef_L59_C0", "label": "_oauth_uri", "type": "function", "loc": [59, 78], "level": 0, "parent": null, "vector": [2, 0, 0.1418, 0.0414, 0, 0.66, 0.7143, 122, 0, 3, 1, 0, 0, 0, 3], "semantic": {"name": "_oauth_uri", "arg_names": ["name", "discovery", "params"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def _oauth_uri(name, discovery, params):\n \"\"\"Look up the OAuth URI from the discovery\n document and add query parameters based on\n params.\n\n name - The name of the OAuth URI to lookup, one\n of 'request', 'access', or 'authorize'.\n discovery - Portion of discovery document the describes"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99089:Expr_L60_C2", "label": "expression", "type": "expression", "loc": [60, 70], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99089:FunctionDef_L59_C0", "vector": [8, 1, 0.1346, 0.0228, 1, 0.72, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Look up the OAuth URI from the discovery\n document and add query parameters based on\n params.\n\n name - The name of the OAuth URI to lookup, one\n of 'request', 'access', or 'authorize'.\n discovery - Portion of discovery document the describes\n the OAuth endpoints."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99089:If_L71_C2", "label": "if", "type": "if", "loc": [71, 72], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99089:FunctionDef_L59_C0", "vector": [4, 1, 0.148, 0.0041, 1, 0.72, 0.2, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if name not in ['request', 'access', 'authorize']:\n raise KeyError(name)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99089:Assign_L73_C2", "label": "keys = keys()", "type": "assigned_variable", "loc": [73, 73], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99089:FunctionDef_L59_C0", "vector": [14, 1, 0.1511, 0.0021, 1, 0.72, 0.4, 204, 3, 0, 0, 0, 204, 10, 1], "semantic": {"name": "keys", "arg_names": [], "import_names": [], "rhs_call_name": "keys", "annotation": ""}, "snippet": " keys = discovery[name]['parameters'].keys()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99089:Assign_L74_C2", "label": "query =", "type": "assigned_variable", "loc": [74, 74], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99089:FunctionDef_L59_C0", "vector": [14, 1, 0.1532, 0.0021, 1, 0.72, 0.6, 546, 0, 0, 0, 0, 0, 6, 0], "semantic": {"name": "query", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " query = {}"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99089:For_L75_C2", "label": "for key", "type": "for", "loc": [75, 77], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99089:FunctionDef_L59_C0", "vector": [6, 1, 0.1573, 0.0062, 1, 0.72, 0.8, 230, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "key", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for key in keys:\n if key in params:\n query[key] = params[key]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99089:If_L76_C4", "label": "if", "type": "if", "loc": [76, 77], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99089:For_L75_C2", "vector": [4, 2, 0.1584, 0.0041, 2, 0.49, 0.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if key in params:\n query[key] = params[key]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99089:Assign_L77_C6", "label": "assign", "type": "assigned_variable", "loc": [77, 77], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99089:If_L76_C4", "vector": [14, 3, 0.1594, 0.0021, 3, 0.78, 0.0, 0, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " query[key] = params[key]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99089:Return_L78_C2", "label": "return", "type": "return", "loc": [78, 78], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99089:FunctionDef_L59_C0", "vector": [13, 1, 0.1615, 0.0021, 1, 0.72, 1.0, 0, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return discovery[name]['url'] + '?' + urllib.urlencode(query)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99089:ClassDef_L81_C0", "label": "Credentials", "type": "class", "loc": [81, 95], "level": 0, "parent": null, "vector": [3, 0, 0.1822, 0.0311, 0, 0.66, 0.7619, 309, 0, 1, 0, 0, 186, 0, 1], "semantic": {"name": "Credentials", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class Credentials(object):\n \"\"\"Base class for all Credentials objects.\n\n Subclasses must define an authorize() method\n that applies the credentials to an HTTP transport.\n \"\"\"\n\n def authorize(self, http):"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99089:Expr_L82_C2", "label": "expression", "type": "expression", "loc": [82, 86], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99089:ClassDef_L81_C0", "vector": [8, 1, 0.1739, 0.0104, 1, 0.14, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Base class for all Credentials objects.\n\n Subclasses must define an authorize() method\n that applies the credentials to an HTTP transport.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99089:FunctionDef_L88_C2", "label": "authorize", "type": "function", "loc": [88, 95], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99089:ClassDef_L81_C0", "vector": [2, 1, 0.1894, 0.0166, 1, 0.14, 1.0, 880, 0, 2, 0, 0, 0, 0, 1], "semantic": {"name": "authorize", "arg_names": ["self", "http"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def authorize(self, http):\n \"\"\"Take an httplib2.Http instance (or equivalent) and\n authorizes it for the set of credentials, usually by\n replacing http.request() with a method that adds in\n the appropriate headers and then delegates to the original\n Http.request() method.\n \"\"\"\n _abstract()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99089:Expr_L89_C4", "label": "expression", "type": "expression", "loc": [89, 94], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99089:FunctionDef_L88_C2", "vector": [8, 2, 0.1894, 0.0124, 2, 0.07, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Take an httplib2.Http instance (or equivalent) and\n authorizes it for the set of credentials, usually by\n replacing http.request() with a method that adds in\n the appropriate headers and then delegates to the original\n Http.request() method.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99089:Expr_L95_C4", "label": "_abstract()", "type": "expression", "loc": [95, 95], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99089:FunctionDef_L88_C2", "vector": [8, 2, 0.1967, 0.0021, 2, 0.07, 1.0, 629, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "_abstract", "arg_names": [], "import_names": [], "rhs_call_name": "_abstract", "annotation": ""}, "snippet": " _abstract()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99089:ClassDef_L98_C0", "label": "Flow", "type": "class", "loc": [98, 100], "level": 0, "parent": null, "vector": [3, 0, 0.205, 0.0062, 0, 0.66, 0.8095, 746, 0, 0, 0, 0, 186, 0, 0], "semantic": {"name": "Flow", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class Flow(object):\n \"\"\"Base class for all Flow objects.\"\"\"\n pass"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99089:Expr_L99_C2", "label": "expression", "type": "expression", "loc": [99, 99], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99089:ClassDef_L98_C0", "vector": [8, 1, 0.205, 0.0021, 1, 0.45, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Base class for all Flow objects.\"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99089:ClassDef_L103_C0", "label": "Storage", "type": "class", "loc": [103, 123], "level": 0, "parent": null, "vector": [3, 0, 0.234, 0.0435, 0, 0.66, 0.8571, 850, 0, 2, 0, 0, 186, 0, 2], "semantic": {"name": "Storage", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class Storage(object):\n \"\"\"Base class for all Storage objects.\n\n Store and retrieve a single credential.\n \"\"\"\n\n def get(self):\n \"\"\"Retrieve credential."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99089:Expr_L104_C2", "label": "expression", "type": "expression", "loc": [104, 107], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99089:ClassDef_L103_C0", "vector": [8, 1, 0.2184, 0.0083, 1, 0.75, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Base class for all Storage objects.\n\n Store and retrieve a single credential.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99089:FunctionDef_L109_C2", "label": "get", "type": "function", "loc": [109, 115], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99089:ClassDef_L103_C0", "vector": [2, 1, 0.2319, 0.0145, 1, 0.75, 0.5, 607, 0, 1, 0, 0, 0, 0, 1], "semantic": {"name": "get", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def get(self):\n \"\"\"Retrieve credential.\n\n Returns:\n apiclient.oauth.Credentials\n \"\"\"\n _abstract()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99089:Expr_L110_C4", "label": "expression", "type": "expression", "loc": [110, 114], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99089:FunctionDef_L109_C2", "vector": [8, 2, 0.2319, 0.0104, 2, 0.92, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Retrieve credential.\n\n Returns:\n apiclient.oauth.Credentials\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99089:Expr_L115_C4", "label": "_abstract()", "type": "expression", "loc": [115, 115], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99089:FunctionDef_L109_C2", "vector": [8, 2, 0.2381, 0.0021, 2, 0.92, 1.0, 629, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "_abstract", "arg_names": [], "import_names": [], "rhs_call_name": "_abstract", "annotation": ""}, "snippet": " _abstract()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99089:FunctionDef_L117_C2", "label": "put", "type": "function", "loc": [117, 123], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99089:ClassDef_L103_C0", "vector": [2, 1, 0.2484, 0.0145, 1, 0.75, 1.0, 636, 0, 2, 0, 0, 0, 0, 1], "semantic": {"name": "put", "arg_names": ["self", "credentials"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def put(self, credentials):\n \"\"\"Write a credential.\n\n Args:\n credentials: Credentials, the credentials to store.\n \"\"\"\n _abstract()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99089:Expr_L118_C4", "label": "expression", "type": "expression", "loc": [118, 122], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99089:FunctionDef_L117_C2", "vector": [8, 2, 0.2484, 0.0104, 2, 0.16, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Write a credential.\n\n Args:\n credentials: Credentials, the credentials to store.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99089:Expr_L123_C4", "label": "_abstract()", "type": "expression", "loc": [123, 123], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99089:FunctionDef_L117_C2", "vector": [8, 2, 0.2547, 0.0021, 2, 0.16, 1.0, 629, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "_abstract", "arg_names": [], "import_names": [], "rhs_call_name": "_abstract", "annotation": ""}, "snippet": " _abstract()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99089:ClassDef_L126_C0", "label": "OAuthCredentials", "type": "class", "loc": [126, 235], "level": 0, "parent": null, "vector": [3, 0, 0.3737, 0.2277, 0, 0.66, 0.9048, 549, 0, 7, 0, 0, 309, 0, 12], "semantic": {"name": "OAuthCredentials", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class OAuthCredentials(Credentials):\n \"\"\"Credentials object for OAuth 1.0a\n \"\"\"\n\n def __init__(self, consumer, token, user_agent):\n \"\"\"\n consumer - An instance of oauth.Consumer.\n token - An instance of oauth.Token constructed with"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99089:Expr_L127_C2", "label": "expression", "type": "expression", "loc": [127, 128], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99089:ClassDef_L126_C0", "vector": [8, 1, 0.264, 0.0041, 1, 0.68, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Credentials object for OAuth 1.0a\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99089:FunctionDef_L130_C2", "label": "__init__", "type": "function", "loc": [130, 143], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99089:ClassDef_L126_C0", "vector": [2, 1, 0.2826, 0.029, 1, 0.68, 0.1667, 555, 0, 4, 0, 0, 0, 0, 0], "semantic": {"name": "__init__", "arg_names": ["self", "consumer", "token", "user_agent"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, consumer, token, user_agent):\n \"\"\"\n consumer - An instance of oauth.Consumer.\n token - An instance of oauth.Token constructed with\n the access token and secret.\n user_agent - The HTTP User-Agent to provide for this application.\n \"\"\"\n self.consumer = consumer"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99089:Expr_L131_C4", "label": "expression", "type": "expression", "loc": [131, 136], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99089:FunctionDef_L130_C2", "vector": [8, 2, 0.2764, 0.0124, 2, 0.74, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"\n consumer - An instance of oauth.Consumer.\n token - An instance of oauth.Token constructed with\n the access token and secret.\n user_agent - The HTTP User-Agent to provide for this application.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99089:Assign_L137_C4", "label": "self.consumer =", "type": "assigned_variable", "loc": [137, 137], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99089:FunctionDef_L130_C2", "vector": [14, 2, 0.2836, 0.0021, 2, 0.74, 0.2, 33, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.consumer", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.consumer = consumer"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99089:Assign_L138_C4", "label": "self.token =", "type": "assigned_variable", "loc": [138, 138], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99089:FunctionDef_L130_C2", "vector": [14, 2, 0.2857, 0.0021, 2, 0.74, 0.4, 150, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.token", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.token = token"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99089:Assign_L139_C4", "label": "self.user_agent =", "type": "assigned_variable", "loc": [139, 139], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99089:FunctionDef_L130_C2", "vector": [14, 2, 0.2878, 0.0021, 2, 0.74, 0.6, 723, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.user_agent", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.user_agent = user_agent"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99089:Assign_L140_C4", "label": "self.store =", "type": "assigned_variable", "loc": [140, 140], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99089:FunctionDef_L130_C2", "vector": [14, 2, 0.2899, 0.0021, 2, 0.74, 0.8, 375, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "self.store", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.store = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99089:Assign_L143_C4", "label": "self._invalid =", "type": "assigned_variable", "loc": [143, 143], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99089:FunctionDef_L130_C2", "vector": [14, 2, 0.2961, 0.0021, 2, 0.74, 1.0, 390, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "self._invalid", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self._invalid = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99089:FunctionDef_L146_C2", "label": "invalid", "type": "function", "loc": [146, 148], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99089:ClassDef_L126_C0", "vector": [2, 1, 0.3043, 0.0062, 1, 0.68, 0.3333, 420, 0, 1, 1, 0, 0, 0, 1], "semantic": {"name": "invalid", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def invalid(self):\n \"\"\"True if the credentials are invalid, such as being revoked.\"\"\"\n return getattr(self, \"_invalid\", False)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99089:Expr_L147_C4", "label": "expression", "type": "expression", "loc": [147, 147], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99089:FunctionDef_L146_C2", "vector": [8, 2, 0.3043, 0.0021, 2, 0.71, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"True if the credentials are invalid, such as being revoked.\"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99089:Return_L148_C4", "label": "return", "type": "return", "loc": [148, 148], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99089:FunctionDef_L146_C2", "vector": [13, 2, 0.3064, 0.0021, 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 getattr(self, \"_invalid\", False)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99089:FunctionDef_L150_C2", "label": "set_store", "type": "function", "loc": [150, 159], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99089:ClassDef_L126_C0", "vector": [2, 1, 0.3199, 0.0207, 1, 0.68, 0.5, 939, 0, 2, 0, 0, 0, 0, 0], "semantic": {"name": "set_store", "arg_names": ["self", "store"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def set_store(self, store):\n \"\"\"Set the storage for the credential.\n\n Args:\n store: callable, a callable that when passed a Credential\n will store the credential back to where it came from.\n This is needed to store the latest access_token if it\n has been revoked."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99089:Expr_L151_C4", "label": "expression", "type": "expression", "loc": [151, 158], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99089:FunctionDef_L150_C2", "vector": [8, 2, 0.3199, 0.0166, 2, 0.25, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Set the storage for the credential.\n\n Args:\n store: callable, a callable that when passed a Credential\n will store the credential back to where it came from.\n This is needed to store the latest access_token if it\n has been revoked.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99089:Assign_L159_C4", "label": "self.store =", "type": "assigned_variable", "loc": [159, 159], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99089:FunctionDef_L150_C2", "vector": [14, 2, 0.3292, 0.0021, 2, 0.25, 1.0, 375, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.store", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.store = store"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99089:FunctionDef_L161_C2", "label": "__getstate__", "type": "function", "loc": [161, 165], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99089:ClassDef_L126_C0", "vector": [2, 1, 0.3375, 0.0104, 1, 0.68, 0.6667, 250, 0, 1, 1, 0, 0, 0, 1], "semantic": {"name": "__getstate__", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __getstate__(self):\n \"\"\"Trim the state down to something that can be pickled.\"\"\"\n d = copy.copy(self.__dict__)\n del d['store']\n return d"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99089:Expr_L162_C4", "label": "expression", "type": "expression", "loc": [162, 162], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99089:FunctionDef_L161_C2", "vector": [8, 2, 0.3354, 0.0021, 2, 0.51, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Trim the state down to something that can be pickled.\"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99089:Assign_L163_C4", "label": "d = copy()", "type": "assigned_variable", "loc": [163, 163], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99089:FunctionDef_L161_C2", "vector": [14, 2, 0.3375, 0.0021, 2, 0.51, 0.5, 355, 3, 1, 0, 0, 739, 10, 1], "semantic": {"name": "d", "arg_names": [], "import_names": [], "rhs_call_name": "copy", "annotation": ""}, "snippet": " d = copy.copy(self.__dict__)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99089:Return_L165_C4", "label": "return", "type": "return", "loc": [165, 165], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99089:FunctionDef_L161_C2", "vector": [13, 2, 0.3416, 0.0021, 2, 0.51, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return d"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99089:FunctionDef_L167_C2", "label": "__setstate__", "type": "function", "loc": [167, 170], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99089:ClassDef_L126_C0", "vector": [2, 1, 0.3489, 0.0083, 1, 0.68, 0.8333, 698, 0, 2, 0, 0, 0, 0, 1], "semantic": {"name": "__setstate__", "arg_names": ["self", "state"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __setstate__(self, state):\n \"\"\"Reconstitute the state of the object from being pickled.\"\"\"\n self.__dict__.update(state)\n self.store = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99089:Expr_L168_C4", "label": "expression", "type": "expression", "loc": [168, 168], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99089:FunctionDef_L167_C2", "vector": [8, 2, 0.3478, 0.0021, 2, 0.98, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Reconstitute the state of the object from being pickled.\"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99089:Expr_L169_C4", "label": "update()", "type": "expression", "loc": [169, 169], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99089:FunctionDef_L167_C2", "vector": [8, 2, 0.3499, 0.0021, 2, 0.98, 0.5, 637, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "update", "arg_names": [], "import_names": [], "rhs_call_name": "update", "annotation": ""}, "snippet": " self.__dict__.update(state)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99089:Assign_L170_C4", "label": "self.store =", "type": "assigned_variable", "loc": [170, 170], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99089:FunctionDef_L167_C2", "vector": [14, 2, 0.352, 0.0021, 2, 0.98, 1.0, 375, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "self.store", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.store = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99089:FunctionDef_L172_C2", "label": "authorize", "type": "function", "loc": [172, 235], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99089:ClassDef_L126_C0", "vector": [2, 1, 0.4213, 0.1325, 1, 0.68, 1.0, 880, 0, 2, 1, 0, 0, 0, 9], "semantic": {"name": "authorize", "arg_names": ["self", "http"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def authorize(self, http):\n \"\"\"Authorize an httplib2.Http instance with these Credentials\n\n Args:\n http - An instance of httplib2.Http\n or something that acts like it.\n\n Returns:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99089:Expr_L173_C4", "label": "expression", "type": "expression", "loc": [173, 194], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99089:FunctionDef_L172_C2", "vector": [8, 2, 0.3799, 0.0455, 2, 0.19, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Authorize an httplib2.Http instance with these Credentials\n\n Args:\n http - An instance of httplib2.Http\n or something that acts like it.\n\n Returns:\n A modified instance of http that was passed in."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99089:Assign_L195_C4", "label": "request_orig =", "type": "assigned_variable", "loc": [195, 195], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99089:FunctionDef_L172_C2", "vector": [14, 2, 0.4037, 0.0021, 2, 0.19, 0.2, 112, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "request_orig", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " request_orig = http.request"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99089:Assign_L196_C4", "label": "signer = SignatureMethod_HMAC_SHA1()", "type": "assigned_variable", "loc": [196, 196], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99089:FunctionDef_L172_C2", "vector": [14, 2, 0.4058, 0.0021, 2, 0.19, 0.4, 12, 3, 0, 0, 0, 948, 10, 1], "semantic": {"name": "signer", "arg_names": [], "import_names": [], "rhs_call_name": "SignatureMethod_HMAC_SHA1", "annotation": ""}, "snippet": " signer = oauth.SignatureMethod_HMAC_SHA1()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99089:FunctionDef_L199_C4", "label": "new_request", "type": "function", "loc": [199, 232], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99089:FunctionDef_L172_C2", "vector": [2, 2, 0.4462, 0.0704, 2, 0.19, 0.6, 23, 0, 6, 1, 0, 0, 0, 8], "semantic": {"name": "new_request", "arg_names": ["uri", "method", "body", "headers", "redirections", "connection_type"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def new_request(uri, method='GET', body=None, headers=None,\n redirections=httplib2.DEFAULT_MAX_REDIRECTS,\n connection_type=None):\n \"\"\"Modify the request headers to add the appropriate\n Authorization header.\"\"\"\n response_code = 302\n http.follow_redirects = False\n while response_code in [301, 302]:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99089:Expr_L202_C6", "label": "expression", "type": "expression", "loc": [202, 203], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99089:FunctionDef_L199_C4", "vector": [8, 3, 0.4193, 0.0041, 3, 0.35, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Modify the request headers to add the appropriate\n Authorization header.\"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99089:Assign_L204_C6", "label": "response_code =", "type": "assigned_variable", "loc": [204, 204], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99089:FunctionDef_L199_C4", "vector": [14, 3, 0.4224, 0.0021, 3, 0.35, 0.2, 558, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "response_code", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " response_code = 302"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99089:Assign_L205_C6", "label": "http.follow_redirects =", "type": "assigned_variable", "loc": [205, 205], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99089:FunctionDef_L199_C4", "vector": [14, 3, 0.4244, 0.0021, 3, 0.35, 0.4, 45, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "http.follow_redirects", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " http.follow_redirects = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99089:While_L206_C6", "label": "while", "type": "while", "loc": [206, 222], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99089:FunctionDef_L199_C4", "vector": [5, 3, 0.4431, 0.0352, 3, 0.35, 0.6, 0, 0, 0, 0, 0, 0, 0, 5], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " while response_code in [301, 302]:\n req = oauth.Request.from_consumer_and_token(\n self.consumer, self.token, http_method=method, http_url=uri)\n req.sign_request(signer, self.consumer, self.token)\n if headers is None:\n headers = {}\n headers.update(req.to_header())\n if 'user-agent' in headers:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99089:Assign_L207_C8", "label": "req = from_consumer_and_token()", "type": "assigned_variable", "loc": [207, 208], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99089:While_L206_C6", "vector": [14, 4, 0.4296, 0.0041, 4, 0.57, 0.0, 233, 3, 4, 0, 0, 319, 10, 1], "semantic": {"name": "req", "arg_names": [], "import_names": [], "rhs_call_name": "from_consumer_and_token", "annotation": ""}, "snippet": " req = oauth.Request.from_consumer_and_token(\n self.consumer, self.token, http_method=method, http_url=uri)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99089:Expr_L209_C8", "label": "sign_request()", "type": "expression", "loc": [209, 209], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99089:While_L206_C6", "vector": [8, 4, 0.4327, 0.0021, 4, 0.57, 0.1429, 817, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "sign_request", "arg_names": [], "import_names": [], "rhs_call_name": "sign_request", "annotation": ""}, "snippet": " req.sign_request(signer, self.consumer, self.token)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99089:If_L210_C8", "label": "if", "type": "if", "loc": [210, 211], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99089:While_L206_C6", "vector": [4, 4, 0.4358, 0.0041, 4, 0.57, 0.2857, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if headers is None:\n headers = {}"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99089:Assign_L211_C10", "label": "headers =", "type": "assigned_variable", "loc": [211, 211], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99089:If_L210_C8", "vector": [14, 5, 0.4369, 0.0021, 5, 0.54, 0.0, 950, 0, 0, 0, 0, 0, 6, 0], "semantic": {"name": "headers", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " headers = {}"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99089:Expr_L212_C8", "label": "update()", "type": "expression", "loc": [212, 212], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99089:While_L206_C6", "vector": [8, 4, 0.4389, 0.0021, 4, 0.57, 0.4286, 637, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "update", "arg_names": [], "import_names": [], "rhs_call_name": "update", "annotation": ""}, "snippet": " headers.update(req.to_header())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99089:If_L213_C8", "label": "if", "type": "if", "loc": [213, 216], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99089:While_L206_C6", "vector": [4, 4, 0.4441, 0.0083, 4, 0.57, 0.5714, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if 'user-agent' in headers:\n headers['user-agent'] = self.user_agent + ' ' + headers['user-agent']\n else:\n headers['user-agent'] = self.user_agent"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99089:Assign_L214_C10", "label": "assign", "type": "assigned_variable", "loc": [214, 214], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99089:If_L213_C8", "vector": [14, 5, 0.4431, 0.0021, 5, 0.86, 0.0, 0, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " headers['user-agent'] = self.user_agent + ' ' + headers['user-agent']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99089:Assign_L216_C10", "label": "assign", "type": "assigned_variable", "loc": [216, 216], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99089:If_L213_C8", "vector": [14, 5, 0.4472, 0.0021, 5, 0.86, 1.0, 0, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " headers['user-agent'] = self.user_agent"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99089:Assign_L218_C8", "label": "resp, content = request_orig()", "type": "assigned_variable", "loc": [218, 219], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99089:While_L206_C6", "vector": [14, 4, 0.4524, 0.0041, 4, 0.57, 0.7143, 339, 3, 6, 0, 0, 112, 10, 1], "semantic": {"name": "resp, content", "arg_names": [], "import_names": [], "rhs_call_name": "request_orig", "annotation": ""}, "snippet": " resp, content = request_orig(uri, method, body, headers,\n redirections, connection_type)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99089:Assign_L220_C8", "label": "response_code =", "type": "assigned_variable", "loc": [220, 220], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99089:While_L206_C6", "vector": [14, 4, 0.4555, 0.0021, 4, 0.57, 0.8571, 558, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "response_code", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " response_code = resp.status"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99089:If_L221_C8", "label": "if", "type": "if", "loc": [221, 222], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99089:While_L206_C6", "vector": [4, 4, 0.4586, 0.0041, 4, 0.57, 1.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if response_code in [301, 302]:\n uri = resp['location']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99089:Assign_L222_C10", "label": "uri =", "type": "assigned_variable", "loc": [222, 222], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99089:If_L221_C8", "vector": [14, 5, 0.4596, 0.0021, 5, 0.5, 0.0, 600, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "uri", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " uri = resp['location']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99089:If_L225_C6", "label": "if", "type": "if", "loc": [225, 230], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99089:FunctionDef_L199_C4", "vector": [4, 3, 0.471, 0.0124, 3, 0.35, 0.8, 0, 0, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if response_code == 401:\n logging.info('Access token no longer valid: %s' % content)\n self._invalid = True\n if self.store is not None:\n self.store(self)\n raise CredentialsInvalidError(\"Credentials are no longer valid.\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99089:Expr_L226_C8", "label": "info()", "type": "expression", "loc": [226, 226], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99089:If_L225_C6", "vector": [8, 4, 0.4679, 0.0021, 4, 0.68, 0.0, 730, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "info", "arg_names": [], "import_names": [], "rhs_call_name": "info", "annotation": ""}, "snippet": " logging.info('Access token no longer valid: %s' % content)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99089:Assign_L227_C8", "label": "self._invalid =", "type": "assigned_variable", "loc": [227, 227], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99089:If_L225_C6", "vector": [14, 4, 0.47, 0.0021, 4, 0.68, 0.5, 390, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "self._invalid", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self._invalid = True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99089:If_L228_C8", "label": "if", "type": "if", "loc": [228, 229], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99089:If_L225_C6", "vector": [4, 4, 0.4731, 0.0041, 4, 0.68, 1.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self.store is not None:\n self.store(self)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99089:Expr_L229_C10", "label": "store()", "type": "expression", "loc": [229, 229], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99089:If_L228_C8", "vector": [8, 5, 0.4741, 0.0021, 5, 0.87, 0.0, 354, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "store", "arg_names": [], "import_names": [], "rhs_call_name": "store", "annotation": ""}, "snippet": " self.store(self)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99089:Return_L232_C6", "label": "return", "type": "return", "loc": [232, 232], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99089:FunctionDef_L199_C4", "vector": [13, 3, 0.4803, 0.0021, 3, 0.35, 1.0, 0, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return resp, content"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99089:Assign_L234_C4", "label": "http.request =", "type": "assigned_variable", "loc": [234, 234], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99089:FunctionDef_L172_C2", "vector": [14, 2, 0.4845, 0.0021, 2, 0.19, 0.8, 47, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "http.request", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " http.request = new_request"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99089:Return_L235_C4", "label": "return", "type": "return", "loc": [235, 235], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99089:FunctionDef_L172_C2", "vector": [13, 2, 0.4865, 0.0021, 2, 0.19, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return http"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99089:ClassDef_L238_C0", "label": "TwoLeggedOAuthCredentials", "type": "class", "loc": [238, 377], "level": 0, "parent": null, "vector": [3, 0, 0.6366, 0.2899, 0, 0.66, 0.9524, 463, 0, 9, 0, 0, 309, 0, 19], "semantic": {"name": "TwoLeggedOAuthCredentials", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class TwoLeggedOAuthCredentials(Credentials):\n \"\"\"Two Legged Credentials object for OAuth 1.0a.\n\n The Two Legged object is created directly, not from a flow. Once you\n authorize and httplib2.Http instance you can change the requestor and that\n change will propogate to the authorized httplib2.Http instance. For example:\n\n http = httplib2.Http()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99089:Expr_L239_C2", "label": "expression", "type": "expression", "loc": [239, 252], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99089:ClassDef_L238_C0", "vector": [8, 1, 0.5083, 0.029, 1, 0.58, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Two Legged Credentials object for OAuth 1.0a.\n\n The Two Legged object is created directly, not from a flow. Once you\n authorize and httplib2.Http instance you can change the requestor and that\n change will propogate to the authorized httplib2.Http instance. For example:\n\n http = httplib2.Http()\n http = credentials.authorize(http)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99089:FunctionDef_L254_C2", "label": "__init__", "type": "function", "loc": [254, 266], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99089:ClassDef_L238_C0", "vector": [2, 1, 0.5383, 0.0269, 1, 0.58, 0.1111, 555, 0, 4, 0, 0, 0, 0, 1], "semantic": {"name": "__init__", "arg_names": ["self", "consumer_key", "consumer_secret", "user_agent"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, consumer_key, consumer_secret, user_agent):\n \"\"\"\n Args:\n consumer_key: string, An OAuth 1.0 consumer key\n consumer_secret: string, An OAuth 1.0 consumer secret\n user_agent: string, The HTTP User-Agent to provide for this application.\n \"\"\"\n self.consumer = oauth.Consumer(consumer_key, consumer_secret)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99089:Expr_L255_C4", "label": "expression", "type": "expression", "loc": [255, 260], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99089:FunctionDef_L254_C2", "vector": [8, 2, 0.5331, 0.0124, 2, 0.11, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"\n Args:\n consumer_key: string, An OAuth 1.0 consumer key\n consumer_secret: string, An OAuth 1.0 consumer secret\n user_agent: string, The HTTP User-Agent to provide for this application.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99089:Assign_L261_C4", "label": "self.consumer = Consumer()", "type": "assigned_variable", "loc": [261, 261], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99089:FunctionDef_L254_C2", "vector": [14, 2, 0.5404, 0.0021, 2, 0.11, 0.25, 33, 3, 2, 0, 0, 881, 10, 1], "semantic": {"name": "self.consumer", "arg_names": [], "import_names": [], "rhs_call_name": "Consumer", "annotation": ""}, "snippet": " self.consumer = oauth.Consumer(consumer_key, consumer_secret)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99089:Assign_L262_C4", "label": "self.user_agent =", "type": "assigned_variable", "loc": [262, 262], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99089:FunctionDef_L254_C2", "vector": [14, 2, 0.5424, 0.0021, 2, 0.11, 0.5, 723, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.user_agent", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.user_agent = user_agent"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99089:Assign_L263_C4", "label": "self.store =", "type": "assigned_variable", "loc": [263, 263], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99089:FunctionDef_L254_C2", "vector": [14, 2, 0.5445, 0.0021, 2, 0.11, 0.75, 375, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "self.store", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.store = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99089:Assign_L266_C4", "label": "self._requestor =", "type": "assigned_variable", "loc": [266, 266], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99089:FunctionDef_L254_C2", "vector": [14, 2, 0.5507, 0.0021, 2, 0.11, 1.0, 413, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "self._requestor", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self._requestor = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99089:FunctionDef_L269_C2", "label": "invalid", "type": "function", "loc": [269, 274], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99089:ClassDef_L238_C0", "vector": [2, 1, 0.5621, 0.0124, 1, 0.58, 0.2222, 420, 0, 1, 1, 0, 0, 0, 0], "semantic": {"name": "invalid", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def invalid(self):\n \"\"\"True if the credentials are invalid, such as being revoked.\n\n Always returns False for Two Legged Credentials.\n \"\"\"\n return False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99089:Expr_L270_C4", "label": "expression", "type": "expression", "loc": [270, 273], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99089:FunctionDef_L269_C2", "vector": [8, 2, 0.5621, 0.0083, 2, 0.32, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"True if the credentials are invalid, such as being revoked.\n\n Always returns False for Two Legged Credentials.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99089:Return_L274_C4", "label": "return", "type": "return", "loc": [274, 274], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99089:FunctionDef_L269_C2", "vector": [13, 2, 0.5673, 0.0021, 2, 0.32, 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_99089:FunctionDef_L276_C2", "label": "getrequestor", "type": "function", "loc": [276, 277], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99089:ClassDef_L238_C0", "vector": [2, 1, 0.5725, 0.0041, 1, 0.58, 0.3333, 217, 0, 1, 1, 0, 0, 0, 0], "semantic": {"name": "getrequestor", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def getrequestor(self):\n return self._requestor"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99089:Return_L277_C4", "label": "return", "type": "return", "loc": [277, 277], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99089:FunctionDef_L276_C2", "vector": [13, 2, 0.5735, 0.0021, 2, 0.16, 0.0, 0, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self._requestor"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99089:FunctionDef_L279_C2", "label": "setrequestor", "type": "function", "loc": [279, 280], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99089:ClassDef_L238_C0", "vector": [2, 1, 0.5787, 0.0041, 1, 0.58, 0.4444, 716, 0, 2, 0, 0, 0, 0, 0], "semantic": {"name": "setrequestor", "arg_names": ["self", "email"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def setrequestor(self, email):\n self._requestor = email"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99089:Assign_L280_C4", "label": "self._requestor =", "type": "assigned_variable", "loc": [280, 280], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99089:FunctionDef_L279_C2", "vector": [14, 2, 0.5797, 0.0021, 2, 0.61, 0.0, 413, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self._requestor", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self._requestor = email"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99089:Assign_L282_C2", "label": "requestor = property()", "type": "assigned_variable", "loc": [282, 283], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99089:ClassDef_L238_C0", "vector": [14, 1, 0.5849, 0.0041, 1, 0.58, 0.5556, 483, 3, 4, 0, 0, 244, 10, 1], "semantic": {"name": "requestor", "arg_names": [], "import_names": [], "rhs_call_name": "property", "annotation": ""}, "snippet": " requestor = property(getrequestor, setrequestor, None,\n 'The email address of the user to act on behalf of')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99089:FunctionDef_L285_C2", "label": "set_store", "type": "function", "loc": [285, 294], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99089:ClassDef_L238_C0", "vector": [2, 1, 0.5994, 0.0207, 1, 0.58, 0.6667, 939, 0, 2, 0, 0, 0, 0, 0], "semantic": {"name": "set_store", "arg_names": ["self", "store"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def set_store(self, store):\n \"\"\"Set the storage for the credential.\n\n Args:\n store: callable, a callable that when passed a Credential\n will store the credential back to where it came from.\n This is needed to store the latest access_token if it\n has been revoked."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99089:Expr_L286_C4", "label": "expression", "type": "expression", "loc": [286, 293], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99089:FunctionDef_L285_C2", "vector": [8, 2, 0.5994, 0.0166, 2, 0.46, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Set the storage for the credential.\n\n Args:\n store: callable, a callable that when passed a Credential\n will store the credential back to where it came from.\n This is needed to store the latest access_token if it\n has been revoked.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99089:Assign_L294_C4", "label": "self.store =", "type": "assigned_variable", "loc": [294, 294], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99089:FunctionDef_L285_C2", "vector": [14, 2, 0.6087, 0.0021, 2, 0.46, 1.0, 375, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.store", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.store = store"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99089:FunctionDef_L296_C2", "label": "__getstate__", "type": "function", "loc": [296, 300], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99089:ClassDef_L238_C0", "vector": [2, 1, 0.617, 0.0104, 1, 0.58, 0.7778, 250, 0, 1, 1, 0, 0, 0, 1], "semantic": {"name": "__getstate__", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __getstate__(self):\n \"\"\"Trim the state down to something that can be pickled.\"\"\"\n d = copy.copy(self.__dict__)\n del d['store']\n return d"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99089:Expr_L297_C4", "label": "expression", "type": "expression", "loc": [297, 297], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99089:FunctionDef_L296_C2", "vector": [8, 2, 0.6149, 0.0021, 2, 0.0, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Trim the state down to something that can be pickled.\"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99089:Assign_L298_C4", "label": "d = copy()", "type": "assigned_variable", "loc": [298, 298], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99089:FunctionDef_L296_C2", "vector": [14, 2, 0.617, 0.0021, 2, 0.0, 0.5, 355, 3, 1, 0, 0, 739, 10, 1], "semantic": {"name": "d", "arg_names": [], "import_names": [], "rhs_call_name": "copy", "annotation": ""}, "snippet": " d = copy.copy(self.__dict__)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99089:Return_L300_C4", "label": "return", "type": "return", "loc": [300, 300], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99089:FunctionDef_L296_C2", "vector": [13, 2, 0.6211, 0.0021, 2, 0.0, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return d"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99089:FunctionDef_L302_C2", "label": "__setstate__", "type": "function", "loc": [302, 305], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99089:ClassDef_L238_C0", "vector": [2, 1, 0.6284, 0.0083, 1, 0.58, 0.8889, 698, 0, 2, 0, 0, 0, 0, 1], "semantic": {"name": "__setstate__", "arg_names": ["self", "state"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __setstate__(self, state):\n \"\"\"Reconstitute the state of the object from being pickled.\"\"\"\n self.__dict__.update(state)\n self.store = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99089:Expr_L303_C4", "label": "expression", "type": "expression", "loc": [303, 303], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99089:FunctionDef_L302_C2", "vector": [8, 2, 0.6273, 0.0021, 2, 0.6, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Reconstitute the state of the object from being pickled.\"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99089:Expr_L304_C4", "label": "update()", "type": "expression", "loc": [304, 304], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99089:FunctionDef_L302_C2", "vector": [8, 2, 0.6294, 0.0021, 2, 0.6, 0.5, 637, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "update", "arg_names": [], "import_names": [], "rhs_call_name": "update", "annotation": ""}, "snippet": " self.__dict__.update(state)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99089:Assign_L305_C4", "label": "self.store =", "type": "assigned_variable", "loc": [305, 305], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99089:FunctionDef_L302_C2", "vector": [14, 2, 0.6315, 0.0021, 2, 0.6, 1.0, 375, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "self.store", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.store = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99089:FunctionDef_L307_C2", "label": "authorize", "type": "function", "loc": [307, 377], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99089:ClassDef_L238_C0", "vector": [2, 1, 0.7081, 0.147, 1, 0.58, 1.0, 880, 0, 2, 1, 0, 0, 0, 15], "semantic": {"name": "authorize", "arg_names": ["self", "http"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def authorize(self, http):\n \"\"\"Authorize an httplib2.Http instance with these Credentials\n\n Args:\n http - An instance of httplib2.Http\n or something that acts like it.\n\n Returns:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99089:Expr_L308_C4", "label": "expression", "type": "expression", "loc": [308, 329], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99089:FunctionDef_L307_C2", "vector": [8, 2, 0.6594, 0.0455, 2, 0.89, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Authorize an httplib2.Http instance with these Credentials\n\n Args:\n http - An instance of httplib2.Http\n or something that acts like it.\n\n Returns:\n A modified instance of http that was passed in."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99089:Assign_L330_C4", "label": "request_orig =", "type": "assigned_variable", "loc": [330, 330], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99089:FunctionDef_L307_C2", "vector": [14, 2, 0.6832, 0.0021, 2, 0.89, 0.2, 112, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "request_orig", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " request_orig = http.request"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99089:Assign_L331_C4", "label": "signer = SignatureMethod_HMAC_SHA1()", "type": "assigned_variable", "loc": [331, 331], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99089:FunctionDef_L307_C2", "vector": [14, 2, 0.6853, 0.0021, 2, 0.89, 0.4, 12, 3, 0, 0, 0, 948, 10, 1], "semantic": {"name": "signer", "arg_names": [], "import_names": [], "rhs_call_name": "SignatureMethod_HMAC_SHA1", "annotation": ""}, "snippet": " signer = oauth.SignatureMethod_HMAC_SHA1()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99089:FunctionDef_L334_C4", "label": "new_request", "type": "function", "loc": [334, 374], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99089:FunctionDef_L307_C2", "vector": [2, 2, 0.7329, 0.0849, 2, 0.89, 0.6, 23, 0, 6, 1, 0, 0, 0, 14], "semantic": {"name": "new_request", "arg_names": ["uri", "method", "body", "headers", "redirections", "connection_type"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def new_request(uri, method='GET', body=None, headers=None,\n redirections=httplib2.DEFAULT_MAX_REDIRECTS,\n connection_type=None):\n \"\"\"Modify the request headers to add the appropriate\n Authorization header.\"\"\"\n response_code = 302\n http.follow_redirects = False\n while response_code in [301, 302]:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99089:Expr_L337_C6", "label": "expression", "type": "expression", "loc": [337, 338], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99089:FunctionDef_L334_C4", "vector": [8, 3, 0.6988, 0.0041, 3, 0.37, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Modify the request headers to add the appropriate\n Authorization header.\"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99089:Assign_L339_C6", "label": "response_code =", "type": "assigned_variable", "loc": [339, 339], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99089:FunctionDef_L334_C4", "vector": [14, 3, 0.7019, 0.0021, 3, 0.37, 0.2, 558, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "response_code", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " response_code = 302"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99089:Assign_L340_C6", "label": "http.follow_redirects =", "type": "assigned_variable", "loc": [340, 340], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99089:FunctionDef_L334_C4", "vector": [14, 3, 0.7039, 0.0021, 3, 0.37, 0.4, 45, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "http.follow_redirects", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " http.follow_redirects = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99089:While_L341_C6", "label": "while", "type": "while", "loc": [341, 366], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99089:FunctionDef_L334_C4", "vector": [5, 3, 0.7319, 0.0538, 3, 0.37, 0.6, 0, 0, 0, 0, 0, 0, 0, 12], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " while response_code in [301, 302]:\n # add in xoauth_requestor_id=self._requestor to the uri\n if self._requestor is None:\n raise MissingParameter(\n 'Requestor must be set before using TwoLeggedOAuthCredentials')\n parsed = list(urlparse.urlparse(uri))\n q = parse_qsl(parsed[4])\n q.append(('xoauth_requestor_id', self._requestor))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99089:If_L343_C8", "label": "if", "type": "if", "loc": [343, 345], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99089:While_L341_C6", "vector": [4, 4, 0.7122, 0.0062, 4, 0.37, 0.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self._requestor is None:\n raise MissingParameter(\n 'Requestor must be set before using TwoLeggedOAuthCredentials')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99089:Assign_L346_C8", "label": "parsed = list()", "type": "assigned_variable", "loc": [346, 346], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99089:While_L341_C6", "vector": [14, 4, 0.7164, 0.0021, 4, 0.37, 0.0769, 313, 3, 1, 0, 0, 430, 10, 2], "semantic": {"name": "parsed", "arg_names": [], "import_names": [], "rhs_call_name": "list", "annotation": ""}, "snippet": " parsed = list(urlparse.urlparse(uri))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99089:Assign_L347_C8", "label": "q = parse_qsl()", "type": "assigned_variable", "loc": [347, 347], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99089:While_L341_C6", "vector": [14, 4, 0.7184, 0.0021, 4, 0.37, 0.1538, 516, 3, 1, 0, 0, 6, 10, 1], "semantic": {"name": "q", "arg_names": [], "import_names": [], "rhs_call_name": "parse_qsl", "annotation": ""}, "snippet": " q = parse_qsl(parsed[4])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99089:Expr_L348_C8", "label": "append()", "type": "expression", "loc": [348, 348], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99089:While_L341_C6", "vector": [8, 4, 0.7205, 0.0021, 4, 0.37, 0.2308, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " q.append(('xoauth_requestor_id', self._requestor))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99089:Assign_L349_C8", "label": " = urlencode()", "type": "assigned_variable", "loc": [349, 349], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99089:While_L341_C6", "vector": [14, 4, 0.7226, 0.0021, 4, 0.37, 0.3077, 0, 3, 1, 0, 0, 414, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "urlencode", "annotation": ""}, "snippet": " parsed[4] = urllib.urlencode(q)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99089:Assign_L350_C8", "label": "uri = urlunparse()", "type": "assigned_variable", "loc": [350, 350], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99089:While_L341_C6", "vector": [14, 4, 0.7246, 0.0021, 4, 0.37, 0.3846, 600, 3, 1, 0, 0, 618, 10, 1], "semantic": {"name": "uri", "arg_names": [], "import_names": [], "rhs_call_name": "urlunparse", "annotation": ""}, "snippet": " uri = urlparse.urlunparse(parsed)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99089:Assign_L352_C8", "label": "req = from_consumer_and_token()", "type": "assigned_variable", "loc": [352, 353], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99089:While_L341_C6", "vector": [14, 4, 0.7298, 0.0041, 4, 0.37, 0.4615, 233, 3, 4, 0, 0, 319, 10, 1], "semantic": {"name": "req", "arg_names": [], "import_names": [], "rhs_call_name": "from_consumer_and_token", "annotation": ""}, "snippet": " req = oauth.Request.from_consumer_and_token(\n self.consumer, None, http_method=method, http_url=uri)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99089:Expr_L354_C8", "label": "sign_request()", "type": "expression", "loc": [354, 354], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99089:While_L341_C6", "vector": [8, 4, 0.7329, 0.0021, 4, 0.37, 0.5385, 817, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "sign_request", "arg_names": [], "import_names": [], "rhs_call_name": "sign_request", "annotation": ""}, "snippet": " req.sign_request(signer, self.consumer, None)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99089:If_L355_C8", "label": "if", "type": "if", "loc": [355, 356], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99089:While_L341_C6", "vector": [4, 4, 0.736, 0.0041, 4, 0.37, 0.6154, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if headers is None:\n headers = {}"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99089:Assign_L356_C10", "label": "headers =", "type": "assigned_variable", "loc": [356, 356], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99089:If_L355_C8", "vector": [14, 5, 0.7371, 0.0021, 5, 0.37, 0.0, 950, 0, 0, 0, 0, 0, 6, 0], "semantic": {"name": "headers", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " headers = {}"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99089:Expr_L357_C8", "label": "update()", "type": "expression", "loc": [357, 357], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99089:While_L341_C6", "vector": [8, 4, 0.7391, 0.0021, 4, 0.37, 0.6923, 637, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "update", "arg_names": [], "import_names": [], "rhs_call_name": "update", "annotation": ""}, "snippet": " headers.update(req.to_header())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99089:If_L358_C8", "label": "if", "type": "if", "loc": [358, 361], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99089:While_L341_C6", "vector": [4, 4, 0.7443, 0.0083, 4, 0.37, 0.7692, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if 'user-agent' in headers:\n headers['user-agent'] = self.user_agent + ' ' + headers['user-agent']\n else:\n headers['user-agent'] = self.user_agent"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99089:Assign_L359_C10", "label": "assign", "type": "assigned_variable", "loc": [359, 359], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99089:If_L358_C8", "vector": [14, 5, 0.7433, 0.0021, 5, 0.02, 0.0, 0, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " headers['user-agent'] = self.user_agent + ' ' + headers['user-agent']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99089:Assign_L361_C10", "label": "assign", "type": "assigned_variable", "loc": [361, 361], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99089:If_L358_C8", "vector": [14, 5, 0.7474, 0.0021, 5, 0.02, 1.0, 0, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " headers['user-agent'] = self.user_agent"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99089:Assign_L362_C8", "label": "resp, content = request_orig()", "type": "assigned_variable", "loc": [362, 363], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99089:While_L341_C6", "vector": [14, 4, 0.7505, 0.0041, 4, 0.37, 0.8462, 339, 3, 6, 0, 0, 112, 10, 1], "semantic": {"name": "resp, content", "arg_names": [], "import_names": [], "rhs_call_name": "request_orig", "annotation": ""}, "snippet": " resp, content = request_orig(uri, method, body, headers,\n redirections, connection_type)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99089:Assign_L364_C8", "label": "response_code =", "type": "assigned_variable", "loc": [364, 364], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99089:While_L341_C6", "vector": [14, 4, 0.7536, 0.0021, 4, 0.37, 0.9231, 558, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "response_code", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " response_code = resp.status"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99089:If_L365_C8", "label": "if", "type": "if", "loc": [365, 366], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99089:While_L341_C6", "vector": [4, 4, 0.7567, 0.0041, 4, 0.37, 1.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if response_code in [301, 302]:\n uri = resp['location']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99089:Assign_L366_C10", "label": "uri =", "type": "assigned_variable", "loc": [366, 366], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99089:If_L365_C8", "vector": [14, 5, 0.7578, 0.0021, 5, 0.85, 0.0, 600, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "uri", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " uri = resp['location']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99089:If_L368_C6", "label": "if", "type": "if", "loc": [368, 372], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99089:FunctionDef_L334_C4", "vector": [4, 3, 0.766, 0.0104, 3, 0.37, 0.8, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if response_code == 401:\n logging.info('Access token no longer valid: %s' % content)\n # Do not store the invalid state of the Credentials because\n # being 2LO they could be reinstated in the future.\n raise CredentialsInvalidError(\"Credentials are invalid.\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99089:Expr_L369_C8", "label": "info()", "type": "expression", "loc": [369, 369], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99089:If_L368_C6", "vector": [8, 4, 0.764, 0.0021, 4, 0.51, 0.0, 730, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "info", "arg_names": [], "import_names": [], "rhs_call_name": "info", "annotation": ""}, "snippet": " logging.info('Access token no longer valid: %s' % content)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99089:Return_L374_C6", "label": "return", "type": "return", "loc": [374, 374], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99089:FunctionDef_L334_C4", "vector": [13, 3, 0.7743, 0.0021, 3, 0.37, 1.0, 0, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return resp, content"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99089:Assign_L376_C4", "label": "http.request =", "type": "assigned_variable", "loc": [376, 376], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99089:FunctionDef_L307_C2", "vector": [14, 2, 0.7785, 0.0021, 2, 0.89, 0.8, 47, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "http.request", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " http.request = new_request"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99089:Return_L377_C4", "label": "return", "type": "return", "loc": [377, 377], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99089:FunctionDef_L307_C2", "vector": [13, 2, 0.7805, 0.0021, 2, 0.89, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return http"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99089:ClassDef_L380_C0", "label": "FlowThreeLegged", "type": "class", "loc": [380, 483], "level": 0, "parent": null, "vector": [3, 0, 0.8934, 0.2153, 0, 0.66, 1.0, 273, 0, 3, 0, 0, 746, 0, 30], "semantic": {"name": "FlowThreeLegged", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class FlowThreeLegged(Flow):\n \"\"\"Does the Three Legged Dance for OAuth 1.0a.\n \"\"\"\n\n def __init__(self, discovery, consumer_key, consumer_secret, user_agent,\n **kwargs):\n \"\"\"\n discovery - Section of the API discovery document that describes"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99089:Expr_L381_C2", "label": "expression", "type": "expression", "loc": [381, 382], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99089:ClassDef_L380_C0", "vector": [8, 1, 0.7899, 0.0041, 1, 0.93, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Does the Three Legged Dance for OAuth 1.0a.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99089:FunctionDef_L384_C2", "label": "__init__", "type": "function", "loc": [384, 408], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99089:ClassDef_L380_C0", "vector": [2, 1, 0.8199, 0.0518, 1, 0.93, 0.3333, 555, 0, 6, 0, 0, 0, 0, 5], "semantic": {"name": "__init__", "arg_names": ["self", "discovery", "consumer_key", "consumer_secret", "user_agent", "kwargs"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, discovery, consumer_key, consumer_secret, user_agent,\n **kwargs):\n \"\"\"\n discovery - Section of the API discovery document that describes\n the OAuth endpoints.\n consumer_key - OAuth consumer key\n consumer_secret - OAuth consumer secret\n user_agent - The HTTP User-Agent that identifies the application."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99089:Expr_L386_C4", "label": "expression", "type": "expression", "loc": [386, 394], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99089:FunctionDef_L384_C2", "vector": [8, 2, 0.8075, 0.0186, 2, 0.42, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"\n discovery - Section of the API discovery document that describes\n the OAuth endpoints.\n consumer_key - OAuth consumer key\n consumer_secret - OAuth consumer secret\n user_agent - The HTTP User-Agent that identifies the application.\n **kwargs - The keyword arguments are all optional and required\n parameters for the OAuth calls."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99089:Assign_L395_C4", "label": "self.discovery =", "type": "assigned_variable", "loc": [395, 395], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99089:FunctionDef_L384_C2", "vector": [14, 2, 0.8178, 0.0021, 2, 0.42, 0.1111, 432, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.discovery", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.discovery = discovery"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99089:Assign_L396_C4", "label": "self.consumer_key =", "type": "assigned_variable", "loc": [396, 396], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99089:FunctionDef_L384_C2", "vector": [14, 2, 0.8199, 0.0021, 2, 0.42, 0.2222, 126, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.consumer_key", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.consumer_key = consumer_key"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99089:Assign_L397_C4", "label": "self.consumer_secret =", "type": "assigned_variable", "loc": [397, 397], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99089:FunctionDef_L384_C2", "vector": [14, 2, 0.8219, 0.0021, 2, 0.42, 0.3333, 519, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.consumer_secret", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.consumer_secret = consumer_secret"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99089:Assign_L398_C4", "label": "self.user_agent =", "type": "assigned_variable", "loc": [398, 398], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99089:FunctionDef_L384_C2", "vector": [14, 2, 0.824, 0.0021, 2, 0.42, 0.4444, 723, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.user_agent", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.user_agent = user_agent"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99089:Assign_L399_C4", "label": "self.params =", "type": "assigned_variable", "loc": [399, 399], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99089:FunctionDef_L384_C2", "vector": [14, 2, 0.8261, 0.0021, 2, 0.42, 0.5556, 402, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.params", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.params = kwargs"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99089:Assign_L400_C4", "label": "self.request_token =", "type": "assigned_variable", "loc": [400, 400], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99089:FunctionDef_L384_C2", "vector": [14, 2, 0.8282, 0.0021, 2, 0.42, 0.6667, 763, 0, 0, 0, 0, 0, 6, 0], "semantic": {"name": "self.request_token", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.request_token = {}"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99089:Assign_L401_C4", "label": "required =", "type": "assigned_variable", "loc": [401, 401], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99089:FunctionDef_L384_C2", "vector": [14, 2, 0.8302, 0.0021, 2, 0.42, 0.7778, 984, 0, 0, 0, 0, 0, 6, 0], "semantic": {"name": "required", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " required = {}"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99089:For_L402_C4", "label": "for uriinfo", "type": "for", "loc": [402, 405], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99089:FunctionDef_L384_C2", "vector": [6, 2, 0.8354, 0.0083, 2, 0.42, 0.8889, 825, 3, 0, 0, 0, 0, 0, 3], "semantic": {"name": "uriinfo", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for uriinfo in discovery.itervalues():\n for name, value in uriinfo['parameters'].iteritems():\n if value['required'] and not name.startswith('oauth_'):\n required[name] = 1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99089:For_L403_C6", "label": "for name, value", "type": "for", "loc": [403, 405], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99089:For_L402_C4", "vector": [6, 3, 0.8364, 0.0062, 3, 0.66, 0.0, 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 uriinfo['parameters'].iteritems():\n if value['required'] and not name.startswith('oauth_'):\n required[name] = 1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99089:If_L404_C8", "label": "if", "type": "if", "loc": [404, 405], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99089:For_L403_C6", "vector": [4, 4, 0.8375, 0.0041, 4, 0.75, 0.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if value['required'] and not name.startswith('oauth_'):\n required[name] = 1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99089:Assign_L405_C10", "label": "assign", "type": "assigned_variable", "loc": [405, 405], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99089:If_L404_C8", "vector": [14, 5, 0.8385, 0.0021, 5, 0.35, 0.0, 0, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " required[name] = 1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99089:For_L406_C4", "label": "for key", "type": "for", "loc": [406, 408], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99089:FunctionDef_L384_C2", "vector": [6, 2, 0.8427, 0.0062, 2, 0.42, 1.0, 230, 3, 0, 0, 0, 0, 0, 2], "semantic": {"name": "key", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for key in required.iterkeys():\n if key not in self.params:\n raise MissingParameter('Required parameter %s not supplied' % key)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99089:If_L407_C6", "label": "if", "type": "if", "loc": [407, 408], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99089:For_L406_C4", "vector": [4, 3, 0.8437, 0.0041, 3, 0.42, 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.params:\n raise MissingParameter('Required parameter %s not supplied' % key)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99089:FunctionDef_L410_C2", "label": "step1_get_authorize_url", "type": "function", "loc": [410, 443], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99089:ClassDef_L380_C0", "vector": [2, 1, 0.883, 0.0704, 1, 0.93, 0.6667, 752, 0, 2, 1, 0, 0, 0, 11], "semantic": {"name": "step1_get_authorize_url", "arg_names": ["self", "oauth_callback"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def step1_get_authorize_url(self, oauth_callback='oob'):\n \"\"\"Returns a URI to redirect to the provider.\n\n oauth_callback - Either the string 'oob' for a non-web-based application,\n or a URI that handles the callback from the authorization\n server.\n\n If oauth_callback is 'oob' then pass in the"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99089:Expr_L411_C4", "label": "expression", "type": "expression", "loc": [411, 421], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99089:FunctionDef_L410_C2", "vector": [8, 2, 0.8613, 0.0228, 2, 0.89, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Returns a URI to redirect to the provider.\n\n oauth_callback - Either the string 'oob' for a non-web-based application,\n or a URI that handles the callback from the authorization\n server.\n\n If oauth_callback is 'oob' then pass in the\n generated verification code to step2_exchange,"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99089:Assign_L422_C4", "label": "consumer = Consumer()", "type": "assigned_variable", "loc": [422, 422], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99089:FunctionDef_L410_C2", "vector": [14, 2, 0.8737, 0.0021, 2, 0.89, 0.0909, 352, 3, 2, 0, 0, 881, 10, 1], "semantic": {"name": "consumer", "arg_names": [], "import_names": [], "rhs_call_name": "Consumer", "annotation": ""}, "snippet": " consumer = oauth.Consumer(self.consumer_key, self.consumer_secret)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99089:Assign_L423_C4", "label": "client = Client()", "type": "assigned_variable", "loc": [423, 423], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99089:FunctionDef_L410_C2", "vector": [14, 2, 0.8758, 0.0021, 2, 0.89, 0.1818, 608, 3, 1, 0, 0, 412, 10, 1], "semantic": {"name": "client", "arg_names": [], "import_names": [], "rhs_call_name": "Client", "annotation": ""}, "snippet": " client = oauth.Client(consumer)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99089:Assign_L425_C4", "label": "headers =", "type": "assigned_variable", "loc": [425, 428], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99089:FunctionDef_L410_C2", "vector": [14, 2, 0.883, 0.0083, 2, 0.89, 0.2727, 950, 0, 0, 0, 0, 0, 6, 0], "semantic": {"name": "headers", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " headers = {\n 'user-agent': self.user_agent,\n 'content-type': 'application/x-www-form-urlencoded'\n }"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99089:Assign_L429_C4", "label": "body = urlencode()", "type": "assigned_variable", "loc": [429, 429], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99089:FunctionDef_L410_C2", "vector": [14, 2, 0.8882, 0.0021, 2, 0.89, 0.3636, 477, 3, 1, 0, 0, 414, 10, 1], "semantic": {"name": "body", "arg_names": [], "import_names": [], "rhs_call_name": "urlencode", "annotation": ""}, "snippet": " body = urllib.urlencode({'oauth_callback': oauth_callback})"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99089:Assign_L430_C4", "label": "uri = _oauth_uri()", "type": "assigned_variable", "loc": [430, 430], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99089:FunctionDef_L410_C2", "vector": [14, 2, 0.8903, 0.0021, 2, 0.89, 0.4545, 600, 3, 3, 0, 0, 122, 10, 1], "semantic": {"name": "uri", "arg_names": [], "import_names": [], "rhs_call_name": "_oauth_uri", "annotation": ""}, "snippet": " uri = _oauth_uri('request', self.discovery, self.params)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99089:Assign_L432_C4", "label": "resp, content = request()", "type": "assigned_variable", "loc": [432, 433], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99089:FunctionDef_L410_C2", "vector": [14, 2, 0.8954, 0.0041, 2, 0.89, 0.5455, 339, 3, 4, 0, 0, 50, 10, 1], "semantic": {"name": "resp, content", "arg_names": [], "import_names": [], "rhs_call_name": "request", "annotation": ""}, "snippet": " resp, content = client.request(uri, 'POST', headers=headers,\n body=body)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99089:If_L434_C4", "label": "if", "type": "if", "loc": [434, 436], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99089:FunctionDef_L410_C2", "vector": [4, 2, 0.9006, 0.0062, 2, 0.89, 0.6364, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if resp['status'] != '200':\n logging.error('Failed to retrieve temporary authorization: %s', content)\n raise RequestError('Invalid response %s.' % resp['status'])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99089:Expr_L435_C6", "label": "error()", "type": "expression", "loc": [435, 435], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99089:If_L434_C4", "vector": [8, 3, 0.9006, 0.0021, 3, 0.83, 0.0, 771, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "error", "arg_names": [], "import_names": [], "rhs_call_name": "error", "annotation": ""}, "snippet": " logging.error('Failed to retrieve temporary authorization: %s', content)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99089:Assign_L438_C4", "label": "self.request_token = dict()", "type": "assigned_variable", "loc": [438, 438], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99089:FunctionDef_L410_C2", "vector": [14, 2, 0.9068, 0.0021, 2, 0.89, 0.7273, 763, 3, 1, 0, 0, 827, 10, 2], "semantic": {"name": "self.request_token", "arg_names": [], "import_names": [], "rhs_call_name": "dict", "annotation": ""}, "snippet": " self.request_token = dict(parse_qsl(content))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99089:Assign_L440_C4", "label": "auth_params = copy()", "type": "assigned_variable", "loc": [440, 440], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99089:FunctionDef_L410_C2", "vector": [14, 2, 0.911, 0.0021, 2, 0.89, 0.8182, 601, 3, 1, 0, 0, 739, 10, 1], "semantic": {"name": "auth_params", "arg_names": [], "import_names": [], "rhs_call_name": "copy", "annotation": ""}, "snippet": " auth_params = copy.copy(self.params)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99089:Assign_L441_C4", "label": "assign", "type": "assigned_variable", "loc": [441, 441], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99089:FunctionDef_L410_C2", "vector": [14, 2, 0.913, 0.0021, 2, 0.89, 0.9091, 0, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " auth_params['oauth_token'] = self.request_token['oauth_token']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99089:Return_L443_C4", "label": "return", "type": "return", "loc": [443, 443], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99089:FunctionDef_L410_C2", "vector": [13, 2, 0.9172, 0.0021, 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 _oauth_uri('authorize', self.discovery, auth_params)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99089:FunctionDef_L445_C2", "label": "step2_exchange", "type": "function", "loc": [445, 483], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99089:ClassDef_L380_C0", "vector": [2, 1, 0.9607, 0.0807, 1, 0.93, 1.0, 471, 0, 2, 1, 0, 0, 0, 14], "semantic": {"name": "step2_exchange", "arg_names": ["self", "verifier"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def step2_exchange(self, verifier):\n \"\"\"Exhanges an authorized request token\n for OAuthCredentials.\n\n Args:\n verifier: string, dict - either the verifier token, or a dictionary\n of the query parameters to the callback, which contains\n the oauth_verifier."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99089:Expr_L446_C4", "label": "expression", "type": "expression", "loc": [446, 455], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99089:FunctionDef_L445_C2", "vector": [8, 2, 0.9327, 0.0207, 2, 0.53, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Exhanges an authorized request token\n for OAuthCredentials.\n\n Args:\n verifier: string, dict - either the verifier token, or a dictionary\n of the query parameters to the callback, which contains\n the oauth_verifier.\n Returns:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99089:If_L457_C4", "label": "if", "type": "if", "loc": [457, 458], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99089:FunctionDef_L445_C2", "vector": [4, 2, 0.9472, 0.0041, 2, 0.53, 0.0833, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not (isinstance(verifier, str) or isinstance(verifier, unicode)):\n verifier = verifier['oauth_verifier']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99089:Assign_L458_C6", "label": "verifier =", "type": "assigned_variable", "loc": [458, 458], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99089:If_L457_C4", "vector": [14, 3, 0.9482, 0.0021, 3, 0.93, 0.0, 629, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "verifier", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " verifier = verifier['oauth_verifier']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99089:Assign_L460_C4", "label": "token = Token()", "type": "assigned_variable", "loc": [460, 462], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99089:FunctionDef_L445_C2", "vector": [14, 2, 0.9545, 0.0062, 2, 0.53, 0.1667, 129, 3, 2, 0, 0, 92, 10, 1], "semantic": {"name": "token", "arg_names": [], "import_names": [], "rhs_call_name": "Token", "annotation": ""}, "snippet": " token = oauth.Token(\n self.request_token['oauth_token'],\n self.request_token['oauth_token_secret'])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99089:Expr_L463_C4", "label": "set_verifier()", "type": "expression", "loc": [463, 463], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99089:FunctionDef_L445_C2", "vector": [8, 2, 0.9586, 0.0021, 2, 0.53, 0.25, 943, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "set_verifier", "arg_names": [], "import_names": [], "rhs_call_name": "set_verifier", "annotation": ""}, "snippet": " token.set_verifier(verifier)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99089:Assign_L464_C4", "label": "consumer = Consumer()", "type": "assigned_variable", "loc": [464, 464], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99089:FunctionDef_L445_C2", "vector": [14, 2, 0.9607, 0.0021, 2, 0.53, 0.3333, 352, 3, 2, 0, 0, 881, 10, 1], "semantic": {"name": "consumer", "arg_names": [], "import_names": [], "rhs_call_name": "Consumer", "annotation": ""}, "snippet": " consumer = oauth.Consumer(self.consumer_key, self.consumer_secret)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99089:Assign_L465_C4", "label": "client = Client()", "type": "assigned_variable", "loc": [465, 465], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99089:FunctionDef_L445_C2", "vector": [14, 2, 0.9627, 0.0021, 2, 0.53, 0.4167, 608, 3, 2, 0, 0, 412, 10, 1], "semantic": {"name": "client", "arg_names": [], "import_names": [], "rhs_call_name": "Client", "annotation": ""}, "snippet": " client = oauth.Client(consumer, token)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99089:Assign_L467_C4", "label": "headers =", "type": "assigned_variable", "loc": [467, 470], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99089:FunctionDef_L445_C2", "vector": [14, 2, 0.97, 0.0083, 2, 0.53, 0.5, 950, 0, 0, 0, 0, 0, 6, 0], "semantic": {"name": "headers", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " headers = {\n 'user-agent': self.user_agent,\n 'content-type': 'application/x-www-form-urlencoded'\n }"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99089:Assign_L472_C4", "label": "uri = _oauth_uri()", "type": "assigned_variable", "loc": [472, 472], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99089:FunctionDef_L445_C2", "vector": [14, 2, 0.9772, 0.0021, 2, 0.53, 0.5833, 600, 3, 3, 0, 0, 122, 10, 1], "semantic": {"name": "uri", "arg_names": [], "import_names": [], "rhs_call_name": "_oauth_uri", "annotation": ""}, "snippet": " uri = _oauth_uri('access', self.discovery, self.params)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99089:Assign_L473_C4", "label": "resp, content = request()", "type": "assigned_variable", "loc": [473, 473], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99089:FunctionDef_L445_C2", "vector": [14, 2, 0.9793, 0.0021, 2, 0.53, 0.6667, 339, 3, 3, 0, 0, 50, 10, 1], "semantic": {"name": "resp, content", "arg_names": [], "import_names": [], "rhs_call_name": "request", "annotation": ""}, "snippet": " resp, content = client.request(uri, 'POST', headers=headers)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99089:If_L474_C4", "label": "if", "type": "if", "loc": [474, 476], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99089:FunctionDef_L445_C2", "vector": [4, 2, 0.9834, 0.0062, 2, 0.53, 0.75, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if resp['status'] != '200':\n logging.error('Failed to retrieve access token: %s', content)\n raise RequestError('Invalid response %s.' % resp['status'])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99089:Expr_L475_C6", "label": "error()", "type": "expression", "loc": [475, 475], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99089:If_L474_C4", "vector": [8, 3, 0.9834, 0.0021, 3, 0.52, 0.0, 771, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "error", "arg_names": [], "import_names": [], "rhs_call_name": "error", "annotation": ""}, "snippet": " logging.error('Failed to retrieve access token: %s', content)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99089:Assign_L478_C4", "label": "oauth_params = dict()", "type": "assigned_variable", "loc": [478, 478], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99089:FunctionDef_L445_C2", "vector": [14, 2, 0.9896, 0.0021, 2, 0.53, 0.8333, 47, 3, 1, 0, 0, 827, 10, 2], "semantic": {"name": "oauth_params", "arg_names": [], "import_names": [], "rhs_call_name": "dict", "annotation": ""}, "snippet": " oauth_params = dict(parse_qsl(content))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99089:Assign_L479_C4", "label": "token = Token()", "type": "assigned_variable", "loc": [479, 481], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99089:FunctionDef_L445_C2", "vector": [14, 2, 0.9938, 0.0062, 2, 0.53, 0.9167, 129, 3, 2, 0, 0, 92, 10, 1], "semantic": {"name": "token", "arg_names": [], "import_names": [], "rhs_call_name": "Token", "annotation": ""}, "snippet": " token = oauth.Token(\n oauth_params['oauth_token'],\n oauth_params['oauth_token_secret'])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99089:Return_L483_C4", "label": "return", "type": "return", "loc": [483, 483], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99089:FunctionDef_L445_C2", "vector": [13, 2, 1.0, 0.0021, 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 OAuthCredentials(consumer, token, self.user_agent)"}]
[{"f": "ajibawa-2023/Python-Code-Large/train/row_99089:Try_L31_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99089:ImportFrom_L32_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99089:Try_L31_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99089:ImportFrom_L34_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99089:ClassDef_L37_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99089:Expr_L38_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99089:ClassDef_L42_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99089:Expr_L43_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99089:FunctionDef_L59_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99089:Expr_L60_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99089:FunctionDef_L59_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99089:If_L71_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99089:FunctionDef_L59_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99089:Assign_L73_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99089:FunctionDef_L59_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99089:Assign_L74_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99089:FunctionDef_L59_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99089:For_L75_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99089:For_L75_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99089:If_L76_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99089:If_L76_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99089:Assign_L77_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99089:FunctionDef_L59_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99089:Return_L78_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99089:ClassDef_L81_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99089:Expr_L82_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99089:ClassDef_L81_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99089:FunctionDef_L88_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99089:FunctionDef_L88_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99089:Expr_L89_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99089:FunctionDef_L88_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99089:Expr_L95_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99089:ClassDef_L98_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99089:Expr_L99_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99089:ClassDef_L103_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99089:Expr_L104_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99089:ClassDef_L103_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99089:FunctionDef_L109_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99089:FunctionDef_L109_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99089:Expr_L110_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99089:FunctionDef_L109_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99089:Expr_L115_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99089:ClassDef_L103_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99089:FunctionDef_L117_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99089:FunctionDef_L117_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99089:Expr_L118_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99089:FunctionDef_L117_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99089:Expr_L123_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99089:ClassDef_L126_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99089:Expr_L127_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99089:ClassDef_L126_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99089:FunctionDef_L130_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99089:FunctionDef_L130_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99089:Expr_L131_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99089:FunctionDef_L130_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99089:Assign_L137_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99089:FunctionDef_L130_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99089:Assign_L138_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99089:FunctionDef_L130_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99089:Assign_L139_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99089:FunctionDef_L130_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99089:Assign_L140_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99089:FunctionDef_L130_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99089:Assign_L143_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99089:ClassDef_L126_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99089:FunctionDef_L146_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99089:FunctionDef_L146_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99089:Expr_L147_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99089:FunctionDef_L146_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99089:Return_L148_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99089:ClassDef_L126_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99089:FunctionDef_L150_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99089:FunctionDef_L150_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99089:Expr_L151_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99089:FunctionDef_L150_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99089:Assign_L159_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99089:ClassDef_L126_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99089:FunctionDef_L161_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99089:FunctionDef_L161_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99089:Expr_L162_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99089:FunctionDef_L161_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99089:Assign_L163_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99089:FunctionDef_L161_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99089:Return_L165_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99089:ClassDef_L126_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99089:FunctionDef_L167_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99089:FunctionDef_L167_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99089:Expr_L168_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99089:FunctionDef_L167_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99089:Expr_L169_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99089:FunctionDef_L167_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99089:Assign_L170_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99089:ClassDef_L126_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99089:FunctionDef_L172_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99089:FunctionDef_L172_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99089:Expr_L173_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99089:FunctionDef_L172_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99089:Assign_L195_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99089:FunctionDef_L172_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99089:Assign_L196_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99089:FunctionDef_L172_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99089:FunctionDef_L199_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99089:FunctionDef_L199_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99089:Expr_L202_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99089:FunctionDef_L199_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99089:Assign_L204_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99089:FunctionDef_L199_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99089:Assign_L205_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99089:FunctionDef_L199_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99089:While_L206_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99089:While_L206_C6", "t": "ajibawa-2023/Python-Code-Large/train/row_99089:Assign_L207_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99089:While_L206_C6", "t": "ajibawa-2023/Python-Code-Large/train/row_99089:Expr_L209_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99089:While_L206_C6", "t": "ajibawa-2023/Python-Code-Large/train/row_99089:If_L210_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99089:If_L210_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99089:Assign_L211_C10"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99089:While_L206_C6", "t": "ajibawa-2023/Python-Code-Large/train/row_99089:Expr_L212_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99089:While_L206_C6", "t": "ajibawa-2023/Python-Code-Large/train/row_99089:If_L213_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99089:If_L213_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99089:Assign_L214_C10"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99089:If_L213_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99089:Assign_L216_C10"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99089:While_L206_C6", "t": "ajibawa-2023/Python-Code-Large/train/row_99089:Assign_L218_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99089:While_L206_C6", "t": "ajibawa-2023/Python-Code-Large/train/row_99089:Assign_L220_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99089:While_L206_C6", "t": "ajibawa-2023/Python-Code-Large/train/row_99089:If_L221_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99089:If_L221_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99089:Assign_L222_C10"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99089:FunctionDef_L199_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99089:If_L225_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99089:If_L225_C6", "t": "ajibawa-2023/Python-Code-Large/train/row_99089:Expr_L226_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99089:If_L225_C6", "t": "ajibawa-2023/Python-Code-Large/train/row_99089:Assign_L227_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99089:If_L225_C6", "t": "ajibawa-2023/Python-Code-Large/train/row_99089:If_L228_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99089:If_L228_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99089:Expr_L229_C10"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99089:FunctionDef_L199_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99089:Return_L232_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99089:FunctionDef_L172_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99089:Assign_L234_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99089:FunctionDef_L172_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99089:Return_L235_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99089:ClassDef_L238_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99089:Expr_L239_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99089:ClassDef_L238_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99089:FunctionDef_L254_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99089:FunctionDef_L254_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99089:Expr_L255_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99089:FunctionDef_L254_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99089:Assign_L261_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99089:FunctionDef_L254_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99089:Assign_L262_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99089:FunctionDef_L254_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99089:Assign_L263_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99089:FunctionDef_L254_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99089:Assign_L266_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99089:ClassDef_L238_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99089:FunctionDef_L269_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99089:FunctionDef_L269_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99089:Expr_L270_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99089:FunctionDef_L269_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99089:Return_L274_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99089:ClassDef_L238_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99089:FunctionDef_L276_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99089:FunctionDef_L276_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99089:Return_L277_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99089:ClassDef_L238_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99089:FunctionDef_L279_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99089:FunctionDef_L279_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99089:Assign_L280_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99089:ClassDef_L238_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99089:Assign_L282_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99089:ClassDef_L238_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99089:FunctionDef_L285_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99089:FunctionDef_L285_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99089:Expr_L286_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99089:FunctionDef_L285_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99089:Assign_L294_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99089:ClassDef_L238_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99089:FunctionDef_L296_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99089:FunctionDef_L296_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99089:Expr_L297_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99089:FunctionDef_L296_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99089:Assign_L298_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99089:FunctionDef_L296_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99089:Return_L300_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99089:ClassDef_L238_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99089:FunctionDef_L302_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99089:FunctionDef_L302_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99089:Expr_L303_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99089:FunctionDef_L302_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99089:Expr_L304_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99089:FunctionDef_L302_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99089:Assign_L305_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99089:ClassDef_L238_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99089:FunctionDef_L307_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99089:FunctionDef_L307_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99089:Expr_L308_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99089:FunctionDef_L307_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99089:Assign_L330_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99089:FunctionDef_L307_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99089:Assign_L331_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99089:FunctionDef_L307_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99089:FunctionDef_L334_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99089:FunctionDef_L334_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99089:Expr_L337_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99089:FunctionDef_L334_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99089:Assign_L339_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99089:FunctionDef_L334_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99089:Assign_L340_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99089:FunctionDef_L334_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99089:While_L341_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99089:While_L341_C6", "t": "ajibawa-2023/Python-Code-Large/train/row_99089:If_L343_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99089:While_L341_C6", "t": "ajibawa-2023/Python-Code-Large/train/row_99089:Assign_L346_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99089:While_L341_C6", "t": "ajibawa-2023/Python-Code-Large/train/row_99089:Assign_L347_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99089:While_L341_C6", "t": "ajibawa-2023/Python-Code-Large/train/row_99089:Expr_L348_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99089:While_L341_C6", "t": "ajibawa-2023/Python-Code-Large/train/row_99089:Assign_L349_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99089:While_L341_C6", "t": "ajibawa-2023/Python-Code-Large/train/row_99089:Assign_L350_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99089:While_L341_C6", "t": "ajibawa-2023/Python-Code-Large/train/row_99089:Assign_L352_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99089:While_L341_C6", "t": "ajibawa-2023/Python-Code-Large/train/row_99089:Expr_L354_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99089:While_L341_C6", "t": "ajibawa-2023/Python-Code-Large/train/row_99089:If_L355_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99089:If_L355_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99089:Assign_L356_C10"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99089:While_L341_C6", "t": "ajibawa-2023/Python-Code-Large/train/row_99089:Expr_L357_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99089:While_L341_C6", "t": "ajibawa-2023/Python-Code-Large/train/row_99089:If_L358_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99089:If_L358_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99089:Assign_L359_C10"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99089:If_L358_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99089:Assign_L361_C10"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99089:While_L341_C6", "t": "ajibawa-2023/Python-Code-Large/train/row_99089:Assign_L362_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99089:While_L341_C6", "t": "ajibawa-2023/Python-Code-Large/train/row_99089:Assign_L364_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99089:While_L341_C6", "t": "ajibawa-2023/Python-Code-Large/train/row_99089:If_L365_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99089:If_L365_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99089:Assign_L366_C10"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99089:FunctionDef_L334_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99089:If_L368_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99089:If_L368_C6", "t": "ajibawa-2023/Python-Code-Large/train/row_99089:Expr_L369_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99089:FunctionDef_L334_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99089:Return_L374_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99089:FunctionDef_L307_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99089:Assign_L376_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99089:FunctionDef_L307_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99089:Return_L377_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99089:ClassDef_L380_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99089:Expr_L381_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99089:ClassDef_L380_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99089:FunctionDef_L384_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99089:FunctionDef_L384_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99089:Expr_L386_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99089:FunctionDef_L384_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99089:Assign_L395_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99089:FunctionDef_L384_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99089:Assign_L396_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99089:FunctionDef_L384_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99089:Assign_L397_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99089:FunctionDef_L384_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99089:Assign_L398_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99089:FunctionDef_L384_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99089:Assign_L399_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99089:FunctionDef_L384_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99089:Assign_L400_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99089:FunctionDef_L384_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99089:Assign_L401_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99089:FunctionDef_L384_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99089:For_L402_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99089:For_L402_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99089:For_L403_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99089:For_L403_C6", "t": "ajibawa-2023/Python-Code-Large/train/row_99089:If_L404_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99089:If_L404_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99089:Assign_L405_C10"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99089:FunctionDef_L384_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99089:For_L406_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99089:For_L406_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99089:If_L407_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99089:ClassDef_L380_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99089:FunctionDef_L410_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99089:FunctionDef_L410_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99089:Expr_L411_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99089:FunctionDef_L410_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99089:Assign_L422_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99089:FunctionDef_L410_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99089:Assign_L423_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99089:FunctionDef_L410_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99089:Assign_L425_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99089:FunctionDef_L410_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99089:Assign_L429_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99089:FunctionDef_L410_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99089:Assign_L430_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99089:FunctionDef_L410_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99089:Assign_L432_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99089:FunctionDef_L410_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99089:If_L434_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99089:If_L434_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99089:Expr_L435_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99089:FunctionDef_L410_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99089:Assign_L438_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99089:FunctionDef_L410_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99089:Assign_L440_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99089:FunctionDef_L410_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99089:Assign_L441_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99089:FunctionDef_L410_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99089:Return_L443_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99089:ClassDef_L380_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99089:FunctionDef_L445_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99089:FunctionDef_L445_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99089:Expr_L446_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99089:FunctionDef_L445_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99089:If_L457_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99089:If_L457_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99089:Assign_L458_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99089:FunctionDef_L445_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99089:Assign_L460_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99089:FunctionDef_L445_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99089:Expr_L463_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99089:FunctionDef_L445_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99089:Assign_L464_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99089:FunctionDef_L445_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99089:Assign_L465_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99089:FunctionDef_L445_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99089:Assign_L467_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99089:FunctionDef_L445_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99089:Assign_L472_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99089:FunctionDef_L445_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99089:Assign_L473_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99089:FunctionDef_L445_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99089:If_L474_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99089:If_L474_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99089:Expr_L475_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99089:FunctionDef_L445_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99089:Assign_L478_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99089:FunctionDef_L445_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99089:Assign_L479_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99089:FunctionDef_L445_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99089:Return_L483_C4"}]
# Copyright (C) 2010 Google Inc. # # 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. """Utilities for Google App Engine Utilities for making it easier to use the Google API Client for Python on Google App Engine. """ __author__ = 'jcgregorio@google.com (Joe Gregorio)' import pickle from google.appengine.ext import db from apiclient.oauth import OAuthCredentials from apiclient.oauth import FlowThreeLegged class FlowThreeLeggedProperty(db.Property): """Utility property that allows easy storage and retreival of an apiclient.oauth.FlowThreeLegged""" # Tell what the user type is. data_type = FlowThreeLegged # For writing to datastore. def get_value_for_datastore(self, model_instance): flow = super(FlowThreeLeggedProperty, self).get_value_for_datastore(model_instance) return db.Blob(pickle.dumps(flow)) # For reading from datastore. def make_value_from_datastore(self, value): if value is None: return None return pickle.loads(value) def validate(self, value): if value is not None and not isinstance(value, FlowThreeLegged): raise BadValueError('Property %s must be convertible ' 'to a FlowThreeLegged instance (%s)' % (self.name, value)) return super(FlowThreeLeggedProperty, self).validate(value) def empty(self, value): return not value class OAuthCredentialsProperty(db.Property): """Utility property that allows easy storage and retrieval of apiclient.oath.OAuthCredentials """ # Tell what the user type is. data_type = OAuthCredentials # For writing to datastore. def get_value_for_datastore(self, model_instance): cred = super(OAuthCredentialsProperty, self).get_value_for_datastore(model_instance) return db.Blob(pickle.dumps(cred)) # For reading from datastore. def make_value_from_datastore(self, value): if value is None: return None return pickle.loads(value) def validate(self, value): if value is not None and not isinstance(value, OAuthCredentials): raise BadValueError('Property %s must be convertible ' 'to an OAuthCredentials instance (%s)' % (self.name, value)) return super(OAuthCredentialsProperty, self).validate(value) def empty(self, value): return not value class StorageByKeyName(object): """Store and retrieve a single credential to and from the App Engine datastore. This Storage helper presumes the Credentials have been stored as a CredenialsProperty on a datastore model class, and that entities are stored by key_name. """ def __init__(self, model, key_name, property_name): """Constructor for Storage. Args: model: db.Model, model class key_name: string, key name for the entity that has the credentials property_name: string, name of the property that is a CredentialsProperty """ self.model = model self.key_name = key_name self.property_name = property_name def get(self): """Retrieve Credential from datastore. Returns: Credentials """ entity = self.model.get_or_insert(self.key_name) credential = getattr(entity, self.property_name) if credential and hasattr(credential, 'set_store'): credential.set_store(self.put) return credential def put(self, credentials): """Write a Credentials to the datastore. Args: credentials: Credentials, the credentials to store. """ entity = self.model.get_or_insert(self.key_name) setattr(entity, self.property_name, credentials) entity.put()
ajibawa-2023/Python-Code-Large/train/row_99091
55
135
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_99091:Expr_L15_C0", "label": "expression", "type": "expression", "loc": [15, 19], "level": 0, "parent": null, "vector": [8, 0, 0.1259, 0.037, 0, 0.66, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\"\"\"Utilities for Google App Engine\n\nUtilities for making it easier to use the\nGoogle API Client for Python on Google App Engine.\n\"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99091:Assign_L21_C0", "label": "__author__ =", "type": "assigned_variable", "loc": [21, 21], "level": 0, "parent": null, "vector": [14, 0, 0.1556, 0.0074, 0, 0.66, 0.125, 777, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "__author__", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "__author__ = 'jcgregorio@google.com (Joe Gregorio)'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99091:Import_L23_C0", "label": "pickle import pickle", "type": "import", "loc": [23, 23], "level": 0, "parent": null, "vector": [1, 0, 0.1704, 0.0074, 0, 0.66, 0.25, 848, 0, 1, 0, 0, 848, 0, 0], "semantic": {"name": "pickle", "arg_names": [], "import_names": ["pickle"], "rhs_call_name": "", "annotation": ""}, "snippet": "import pickle"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99091:ImportFrom_L25_C0", "label": "from google.appengine.ext import db", "type": "import", "loc": [25, 25], "level": 0, "parent": null, "vector": [1, 0, 0.1852, 0.0074, 0, 0.66, 0.375, 167, 0, 1, 0, 0, 167, 0, 0], "semantic": {"name": "google.appengine.ext", "arg_names": [], "import_names": ["db"], "rhs_call_name": "", "annotation": ""}, "snippet": "from google.appengine.ext import db"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99091:ImportFrom_L26_C0", "label": "from apiclient.oauth import OAuthCredentials", "type": "import", "loc": [26, 26], "level": 0, "parent": null, "vector": [1, 0, 0.1926, 0.0074, 0, 0.66, 0.5, 791, 0, 1, 0, 0, 791, 0, 0], "semantic": {"name": "apiclient.oauth", "arg_names": [], "import_names": ["OAuthCredentials"], "rhs_call_name": "", "annotation": ""}, "snippet": "from apiclient.oauth import OAuthCredentials"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99091:ImportFrom_L27_C0", "label": "from apiclient.oauth import FlowThreeLegged", "type": "import", "loc": [27, 27], "level": 0, "parent": null, "vector": [1, 0, 0.2, 0.0074, 0, 0.66, 0.625, 791, 0, 1, 0, 0, 791, 0, 0], "semantic": {"name": "apiclient.oauth", "arg_names": [], "import_names": ["FlowThreeLegged"], "rhs_call_name": "", "annotation": ""}, "snippet": "from apiclient.oauth import FlowThreeLegged"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99091:ClassDef_L30_C0", "label": "FlowThreeLeggedProperty", "type": "class", "loc": [30, 58], "level": 0, "parent": null, "vector": [3, 0, 0.3259, 0.2148, 0, 0.66, 0.75, 427, 0, 4, 0, 0, 394, 0, 9], "semantic": {"name": "FlowThreeLeggedProperty", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class FlowThreeLeggedProperty(db.Property):\n \"\"\"Utility property that allows easy\n storage and retreival of an\n apiclient.oauth.FlowThreeLegged\"\"\"\n\n # Tell what the user type is.\n data_type = FlowThreeLegged\n"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99091:Expr_L31_C2", "label": "expression", "type": "expression", "loc": [31, 33], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99091:ClassDef_L30_C0", "vector": [8, 1, 0.237, 0.0222, 1, 0.64, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Utility property that allows easy\n storage and retreival of an\n apiclient.oauth.FlowThreeLegged\"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99091:Assign_L36_C2", "label": "data_type =", "type": "assigned_variable", "loc": [36, 36], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99091:ClassDef_L30_C0", "vector": [14, 1, 0.2667, 0.0074, 1, 0.64, 0.2, 5, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "data_type", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " data_type = FlowThreeLegged"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99091:FunctionDef_L39_C2", "label": "get_value_for_datastore", "type": "function", "loc": [39, 42], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99091:ClassDef_L30_C0", "vector": [2, 1, 0.3, 0.0296, 1, 0.64, 0.4, 18, 0, 2, 1, 0, 0, 0, 4], "semantic": {"name": "get_value_for_datastore", "arg_names": ["self", "model_instance"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def get_value_for_datastore(self, model_instance):\n flow = super(FlowThreeLeggedProperty,\n self).get_value_for_datastore(model_instance)\n return db.Blob(pickle.dumps(flow))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99091:Assign_L40_C4", "label": "flow = get_value_for_datastore()", "type": "assigned_variable", "loc": [40, 41], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99091:FunctionDef_L39_C2", "vector": [14, 2, 0.3, 0.0148, 2, 0.39, 0.0, 258, 3, 1, 0, 0, 18, 10, 2], "semantic": {"name": "flow", "arg_names": [], "import_names": [], "rhs_call_name": "get_value_for_datastore", "annotation": ""}, "snippet": " flow = super(FlowThreeLeggedProperty,\n self).get_value_for_datastore(model_instance)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99091:Return_L42_C4", "label": "return", "type": "return", "loc": [42, 42], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99091:FunctionDef_L39_C2", "vector": [13, 2, 0.3111, 0.0074, 2, 0.39, 1.0, 0, 3, 0, 0, 0, 0, 10, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return db.Blob(pickle.dumps(flow))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99091:FunctionDef_L45_C2", "label": "make_value_from_datastore", "type": "function", "loc": [45, 48], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99091:ClassDef_L30_C0", "vector": [2, 1, 0.3444, 0.0296, 1, 0.64, 0.6, 331, 0, 2, 1, 0, 0, 0, 1], "semantic": {"name": "make_value_from_datastore", "arg_names": ["self", "value"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def make_value_from_datastore(self, value):\n if value is None:\n return None\n return pickle.loads(value)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99091:If_L46_C4", "label": "if", "type": "if", "loc": [46, 47], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99091:FunctionDef_L45_C2", "vector": [4, 2, 0.3444, 0.0148, 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 value is None:\n return None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99091:Return_L47_C6", "label": "return", "type": "return", "loc": [47, 47], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99091:If_L46_C4", "vector": [13, 3, 0.3481, 0.0074, 3, 0.68, 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_99091:Return_L48_C4", "label": "return", "type": "return", "loc": [48, 48], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99091:FunctionDef_L45_C2", "vector": [13, 2, 0.3556, 0.0074, 2, 0.67, 1.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return pickle.loads(value)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99091:FunctionDef_L50_C2", "label": "validate", "type": "function", "loc": [50, 55], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99091:ClassDef_L30_C0", "vector": [2, 1, 0.3889, 0.0444, 1, 0.64, 0.8, 628, 0, 2, 1, 0, 0, 0, 4], "semantic": {"name": "validate", "arg_names": ["self", "value"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def validate(self, value):\n if value is not None and not isinstance(value, FlowThreeLegged):\n raise BadValueError('Property %s must be convertible '\n 'to a FlowThreeLegged instance (%s)' %\n (self.name, value))\n return super(FlowThreeLeggedProperty, self).validate(value)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99091:If_L51_C4", "label": "if", "type": "if", "loc": [51, 54], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99091:FunctionDef_L50_C2", "vector": [4, 2, 0.3889, 0.0296, 2, 0.74, 0.0, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if value is not None and not isinstance(value, FlowThreeLegged):\n raise BadValueError('Property %s must be convertible '\n 'to a FlowThreeLegged instance (%s)' %\n (self.name, value))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99091:Return_L55_C4", "label": "return", "type": "return", "loc": [55, 55], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99091:FunctionDef_L50_C2", "vector": [13, 2, 0.4074, 0.0074, 2, 0.74, 1.0, 0, 3, 0, 0, 0, 0, 10, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return super(FlowThreeLeggedProperty, self).validate(value)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99091:FunctionDef_L57_C2", "label": "empty", "type": "function", "loc": [57, 58], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99091:ClassDef_L30_C0", "vector": [2, 1, 0.4259, 0.0148, 1, 0.64, 1.0, 365, 0, 2, 1, 0, 0, 0, 0], "semantic": {"name": "empty", "arg_names": ["self", "value"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def empty(self, value):\n return not value"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99091:Return_L58_C4", "label": "return", "type": "return", "loc": [58, 58], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99091:FunctionDef_L57_C2", "vector": [13, 2, 0.4296, 0.0074, 2, 0.26, 0.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return not value"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99091:ClassDef_L61_C0", "label": "OAuthCredentialsProperty", "type": "class", "loc": [61, 90], "level": 0, "parent": null, "vector": [3, 0, 0.5593, 0.2222, 0, 0.66, 0.875, 211, 0, 4, 0, 0, 394, 0, 9], "semantic": {"name": "OAuthCredentialsProperty", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class OAuthCredentialsProperty(db.Property):\n \"\"\"Utility property that allows easy\n storage and retrieval of\n apiclient.oath.OAuthCredentials\n \"\"\"\n\n # Tell what the user type is.\n data_type = OAuthCredentials"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99091:Expr_L62_C2", "label": "expression", "type": "expression", "loc": [62, 65], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99091:ClassDef_L61_C0", "vector": [8, 1, 0.4704, 0.0296, 1, 0.08, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Utility property that allows easy\n storage and retrieval of\n apiclient.oath.OAuthCredentials\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99091:Assign_L68_C2", "label": "data_type =", "type": "assigned_variable", "loc": [68, 68], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99091:ClassDef_L61_C0", "vector": [14, 1, 0.5037, 0.0074, 1, 0.08, 0.2, 5, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "data_type", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " data_type = OAuthCredentials"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99091:FunctionDef_L71_C2", "label": "get_value_for_datastore", "type": "function", "loc": [71, 74], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99091:ClassDef_L61_C0", "vector": [2, 1, 0.537, 0.0296, 1, 0.08, 0.4, 18, 0, 2, 1, 0, 0, 0, 4], "semantic": {"name": "get_value_for_datastore", "arg_names": ["self", "model_instance"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def get_value_for_datastore(self, model_instance):\n cred = super(OAuthCredentialsProperty,\n self).get_value_for_datastore(model_instance)\n return db.Blob(pickle.dumps(cred))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99091:Assign_L72_C4", "label": "cred = get_value_for_datastore()", "type": "assigned_variable", "loc": [72, 73], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99091:FunctionDef_L71_C2", "vector": [14, 2, 0.537, 0.0148, 2, 0.81, 0.0, 458, 3, 1, 0, 0, 18, 10, 2], "semantic": {"name": "cred", "arg_names": [], "import_names": [], "rhs_call_name": "get_value_for_datastore", "annotation": ""}, "snippet": " cred = super(OAuthCredentialsProperty,\n self).get_value_for_datastore(model_instance)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99091:Return_L74_C4", "label": "return", "type": "return", "loc": [74, 74], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99091:FunctionDef_L71_C2", "vector": [13, 2, 0.5481, 0.0074, 2, 0.81, 1.0, 0, 3, 0, 0, 0, 0, 10, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return db.Blob(pickle.dumps(cred))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99091:FunctionDef_L77_C2", "label": "make_value_from_datastore", "type": "function", "loc": [77, 80], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99091:ClassDef_L61_C0", "vector": [2, 1, 0.5815, 0.0296, 1, 0.08, 0.6, 331, 0, 2, 1, 0, 0, 0, 1], "semantic": {"name": "make_value_from_datastore", "arg_names": ["self", "value"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def make_value_from_datastore(self, value):\n if value is None:\n return None\n return pickle.loads(value)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99091:If_L78_C4", "label": "if", "type": "if", "loc": [78, 79], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99091:FunctionDef_L77_C2", "vector": [4, 2, 0.5815, 0.0148, 2, 0.93, 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_99091:Return_L79_C6", "label": "return", "type": "return", "loc": [79, 79], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99091:If_L78_C4", "vector": [13, 3, 0.5852, 0.0074, 3, 0.56, 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_99091:Return_L80_C4", "label": "return", "type": "return", "loc": [80, 80], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99091:FunctionDef_L77_C2", "vector": [13, 2, 0.5926, 0.0074, 2, 0.93, 1.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return pickle.loads(value)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99091:FunctionDef_L82_C2", "label": "validate", "type": "function", "loc": [82, 87], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99091:ClassDef_L61_C0", "vector": [2, 1, 0.6259, 0.0444, 1, 0.08, 0.8, 628, 0, 2, 1, 0, 0, 0, 4], "semantic": {"name": "validate", "arg_names": ["self", "value"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def validate(self, value):\n if value is not None and not isinstance(value, OAuthCredentials):\n raise BadValueError('Property %s must be convertible '\n 'to an OAuthCredentials instance (%s)' %\n (self.name, value))\n return super(OAuthCredentialsProperty, self).validate(value)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99091:If_L83_C4", "label": "if", "type": "if", "loc": [83, 86], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99091:FunctionDef_L82_C2", "vector": [4, 2, 0.6259, 0.0296, 2, 0.78, 0.0, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if value is not None and not isinstance(value, OAuthCredentials):\n raise BadValueError('Property %s must be convertible '\n 'to an OAuthCredentials instance (%s)' %\n (self.name, value))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99091:Return_L87_C4", "label": "return", "type": "return", "loc": [87, 87], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99091:FunctionDef_L82_C2", "vector": [13, 2, 0.6444, 0.0074, 2, 0.78, 1.0, 0, 3, 0, 0, 0, 0, 10, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return super(OAuthCredentialsProperty, self).validate(value)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99091:FunctionDef_L89_C2", "label": "empty", "type": "function", "loc": [89, 90], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99091:ClassDef_L61_C0", "vector": [2, 1, 0.663, 0.0148, 1, 0.08, 1.0, 365, 0, 2, 1, 0, 0, 0, 0], "semantic": {"name": "empty", "arg_names": ["self", "value"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def empty(self, value):\n return not value"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99091:Return_L90_C4", "label": "return", "type": "return", "loc": [90, 90], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99091:FunctionDef_L89_C2", "vector": [13, 2, 0.6667, 0.0074, 2, 0.24, 0.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return not value"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99091:ClassDef_L93_C0", "label": "StorageByKeyName", "type": "class", "loc": [93, 135], "level": 0, "parent": null, "vector": [3, 0, 0.8444, 0.3185, 0, 0.66, 1.0, 621, 0, 3, 0, 0, 186, 0, 7], "semantic": {"name": "StorageByKeyName", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class StorageByKeyName(object):\n \"\"\"Store and retrieve a single credential to and from\n the App Engine datastore.\n\n This Storage helper presumes the Credentials\n have been stored as a CredenialsProperty\n on a datastore model class, and that entities\n are stored by key_name."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99091:Expr_L94_C2", "label": "expression", "type": "expression", "loc": [94, 101], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99091:ClassDef_L93_C0", "vector": [8, 1, 0.7222, 0.0593, 1, 0.76, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Store and retrieve a single credential to and from\n the App Engine datastore.\n\n This Storage helper presumes the Credentials\n have been stored as a CredenialsProperty\n on a datastore model class, and that entities\n are stored by key_name.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99091:FunctionDef_L103_C2", "label": "__init__", "type": "function", "loc": [103, 113], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99091:ClassDef_L93_C0", "vector": [2, 1, 0.8, 0.0815, 1, 0.76, 0.3333, 555, 0, 4, 0, 0, 0, 0, 0], "semantic": {"name": "__init__", "arg_names": ["self", "model", "key_name", "property_name"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, model, key_name, property_name):\n \"\"\"Constructor for Storage.\n\n Args:\n model: db.Model, model class\n key_name: string, key name for the entity that has the credentials\n property_name: string, name of the property that is a CredentialsProperty\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99091:Expr_L104_C4", "label": "expression", "type": "expression", "loc": [104, 110], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99091:FunctionDef_L103_C2", "vector": [8, 2, 0.7926, 0.0519, 2, 0.51, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Constructor for Storage.\n\n Args:\n model: db.Model, model class\n key_name: string, key name for the entity that has the credentials\n property_name: string, name of the property that is a CredentialsProperty\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99091:Assign_L111_C4", "label": "self.model =", "type": "assigned_variable", "loc": [111, 111], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99091:FunctionDef_L103_C2", "vector": [14, 2, 0.8222, 0.0074, 2, 0.51, 0.3333, 81, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.model", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.model = model"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99091:Assign_L112_C4", "label": "self.key_name =", "type": "assigned_variable", "loc": [112, 112], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99091:FunctionDef_L103_C2", "vector": [14, 2, 0.8296, 0.0074, 2, 0.51, 0.6667, 40, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.key_name", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.key_name = key_name"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99091:Assign_L113_C4", "label": "self.property_name =", "type": "assigned_variable", "loc": [113, 113], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99091:FunctionDef_L103_C2", "vector": [14, 2, 0.837, 0.0074, 2, 0.51, 1.0, 742, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.property_name", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.property_name = property_name"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99091:FunctionDef_L115_C2", "label": "get", "type": "function", "loc": [115, 125], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99091:ClassDef_L93_C0", "vector": [2, 1, 0.8889, 0.0815, 1, 0.76, 0.6667, 607, 0, 1, 1, 0, 0, 0, 4], "semantic": {"name": "get", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def get(self):\n \"\"\"Retrieve Credential from datastore.\n\n Returns:\n Credentials\n \"\"\"\n entity = self.model.get_or_insert(self.key_name)\n credential = getattr(entity, self.property_name)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99091:Expr_L116_C4", "label": "expression", "type": "expression", "loc": [116, 120], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99091:FunctionDef_L115_C2", "vector": [8, 2, 0.8741, 0.037, 2, 0.71, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Retrieve Credential from datastore.\n\n Returns:\n Credentials\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99091:Assign_L121_C4", "label": "entity = get_or_insert()", "type": "assigned_variable", "loc": [121, 121], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99091:FunctionDef_L115_C2", "vector": [14, 2, 0.8963, 0.0074, 2, 0.71, 0.25, 214, 3, 1, 0, 0, 323, 10, 1], "semantic": {"name": "entity", "arg_names": [], "import_names": [], "rhs_call_name": "get_or_insert", "annotation": ""}, "snippet": " entity = self.model.get_or_insert(self.key_name)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99091:Assign_L122_C4", "label": "credential = getattr()", "type": "assigned_variable", "loc": [122, 122], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99091:FunctionDef_L115_C2", "vector": [14, 2, 0.9037, 0.0074, 2, 0.71, 0.5, 443, 3, 2, 0, 0, 121, 10, 1], "semantic": {"name": "credential", "arg_names": [], "import_names": [], "rhs_call_name": "getattr", "annotation": ""}, "snippet": " credential = getattr(entity, self.property_name)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99091:If_L123_C4", "label": "if", "type": "if", "loc": [123, 124], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99091:FunctionDef_L115_C2", "vector": [4, 2, 0.9148, 0.0148, 2, 0.71, 0.75, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if credential and hasattr(credential, 'set_store'):\n credential.set_store(self.put)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99091:Expr_L124_C6", "label": "set_store()", "type": "expression", "loc": [124, 124], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99091:If_L123_C4", "vector": [8, 3, 0.9185, 0.0074, 3, 0.3, 0.0, 939, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "set_store", "arg_names": [], "import_names": [], "rhs_call_name": "set_store", "annotation": ""}, "snippet": " credential.set_store(self.put)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99091:Return_L125_C4", "label": "return", "type": "return", "loc": [125, 125], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99091:FunctionDef_L115_C2", "vector": [13, 2, 0.9259, 0.0074, 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 credential"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99091:FunctionDef_L127_C2", "label": "put", "type": "function", "loc": [127, 135], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99091:ClassDef_L93_C0", "vector": [2, 1, 0.9704, 0.0667, 1, 0.76, 1.0, 636, 0, 2, 0, 0, 0, 0, 3], "semantic": {"name": "put", "arg_names": ["self", "credentials"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def put(self, credentials):\n \"\"\"Write a Credentials to the datastore.\n\n Args:\n credentials: Credentials, the credentials to store.\n \"\"\"\n entity = self.model.get_or_insert(self.key_name)\n setattr(entity, self.property_name, credentials)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99091:Expr_L128_C4", "label": "expression", "type": "expression", "loc": [128, 132], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99091:FunctionDef_L127_C2", "vector": [8, 2, 0.963, 0.037, 2, 0.18, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Write a Credentials to the datastore.\n\n Args:\n credentials: Credentials, the credentials to store.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99091:Assign_L133_C4", "label": "entity = get_or_insert()", "type": "assigned_variable", "loc": [133, 133], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99091:FunctionDef_L127_C2", "vector": [14, 2, 0.9852, 0.0074, 2, 0.18, 0.3333, 214, 3, 1, 0, 0, 323, 10, 1], "semantic": {"name": "entity", "arg_names": [], "import_names": [], "rhs_call_name": "get_or_insert", "annotation": ""}, "snippet": " entity = self.model.get_or_insert(self.key_name)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99091:Expr_L134_C4", "label": "setattr()", "type": "expression", "loc": [134, 134], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99091:FunctionDef_L127_C2", "vector": [8, 2, 0.9926, 0.0074, 2, 0.18, 0.6667, 501, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "setattr", "arg_names": [], "import_names": [], "rhs_call_name": "setattr", "annotation": ""}, "snippet": " setattr(entity, self.property_name, credentials)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99091:Expr_L135_C4", "label": "put()", "type": "expression", "loc": [135, 135], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99091:FunctionDef_L127_C2", "vector": [8, 2, 1.0, 0.0074, 2, 0.18, 1.0, 636, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "put", "arg_names": [], "import_names": [], "rhs_call_name": "put", "annotation": ""}, "snippet": " entity.put()"}]
[{"f": "ajibawa-2023/Python-Code-Large/train/row_99091:ClassDef_L30_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99091:Expr_L31_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99091:ClassDef_L30_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99091:Assign_L36_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99091:ClassDef_L30_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99091:FunctionDef_L39_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99091:FunctionDef_L39_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99091:Assign_L40_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99091:FunctionDef_L39_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99091:Return_L42_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99091:ClassDef_L30_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99091:FunctionDef_L45_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99091:FunctionDef_L45_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99091:If_L46_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99091:If_L46_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99091:Return_L47_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99091:FunctionDef_L45_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99091:Return_L48_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99091:ClassDef_L30_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99091:FunctionDef_L50_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99091:FunctionDef_L50_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99091:If_L51_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99091:FunctionDef_L50_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99091:Return_L55_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99091:ClassDef_L30_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99091:FunctionDef_L57_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99091:FunctionDef_L57_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99091:Return_L58_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99091:ClassDef_L61_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99091:Expr_L62_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99091:ClassDef_L61_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99091:Assign_L68_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99091:ClassDef_L61_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99091:FunctionDef_L71_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99091:FunctionDef_L71_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99091:Assign_L72_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99091:FunctionDef_L71_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99091:Return_L74_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99091:ClassDef_L61_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99091:FunctionDef_L77_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99091:FunctionDef_L77_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99091:If_L78_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99091:If_L78_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99091:Return_L79_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99091:FunctionDef_L77_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99091:Return_L80_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99091:ClassDef_L61_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99091:FunctionDef_L82_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99091:FunctionDef_L82_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99091:If_L83_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99091:FunctionDef_L82_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99091:Return_L87_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99091:ClassDef_L61_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99091:FunctionDef_L89_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99091:FunctionDef_L89_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99091:Return_L90_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99091:ClassDef_L93_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99091:Expr_L94_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99091:ClassDef_L93_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99091:FunctionDef_L103_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99091:FunctionDef_L103_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99091:Expr_L104_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99091:FunctionDef_L103_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99091:Assign_L111_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99091:FunctionDef_L103_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99091:Assign_L112_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99091:FunctionDef_L103_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99091:Assign_L113_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99091:ClassDef_L93_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99091:FunctionDef_L115_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99091:FunctionDef_L115_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99091:Expr_L116_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99091:FunctionDef_L115_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99091:Assign_L121_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99091:FunctionDef_L115_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99091:Assign_L122_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99091:FunctionDef_L115_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99091:If_L123_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99091:If_L123_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99091:Expr_L124_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99091:FunctionDef_L115_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99091:Return_L125_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99091:ClassDef_L93_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99091:FunctionDef_L127_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99091:FunctionDef_L127_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99091:Expr_L128_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99091:FunctionDef_L127_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99091:Assign_L133_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99091:FunctionDef_L127_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99091:Expr_L134_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99091:FunctionDef_L127_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99091:Expr_L135_C4"}]
# Copyright (C) 2010 Google Inc. # # 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. """Utilities for OAuth. Utilities for making it easier to work with OAuth 1.0 credentials. """ __author__ = 'jcgregorio@google.com (Joe Gregorio)' import pickle import threading from apiclient.oauth import Storage as BaseStorage class Storage(BaseStorage): """Store and retrieve a single credential to and from a file.""" def __init__(self, filename): self._filename = filename self._lock = threading.Lock() def get(self): """Retrieve Credential from file. Returns: apiclient.oauth.Credentials """ self._lock.acquire() try: f = open(self._filename, 'r') credentials = pickle.loads(f.read()) f.close() credentials.set_store(self.put) except: credentials = None self._lock.release() return credentials def put(self, credentials): """Write a pickled Credentials to file. Args: credentials: Credentials, the credentials to store. """ self._lock.acquire() f = open(self._filename, 'w') f.write(pickle.dumps(credentials)) f.close() self._lock.release()
ajibawa-2023/Python-Code-Large/train/row_99093
28
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_99093:Expr_L15_C0", "label": "expression", "type": "expression", "loc": [15, 18], "level": 0, "parent": null, "vector": [8, 0, 0.2619, 0.0635, 0, 0.66, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\"\"\"Utilities for OAuth.\n\nUtilities for making it easier to work with OAuth 1.0 credentials.\n\"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99093:Assign_L20_C0", "label": "__author__ =", "type": "assigned_variable", "loc": [20, 20], "level": 0, "parent": null, "vector": [14, 0, 0.3175, 0.0159, 0, 0.66, 0.2, 777, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "__author__", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "__author__ = 'jcgregorio@google.com (Joe Gregorio)'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99093:Import_L22_C0", "label": "pickle import pickle", "type": "import", "loc": [22, 22], "level": 0, "parent": null, "vector": [1, 0, 0.3492, 0.0159, 0, 0.66, 0.4, 848, 0, 1, 0, 0, 848, 0, 0], "semantic": {"name": "pickle", "arg_names": [], "import_names": ["pickle"], "rhs_call_name": "", "annotation": ""}, "snippet": "import pickle"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99093:Import_L23_C0", "label": "threading import threading", "type": "import", "loc": [23, 23], "level": 0, "parent": null, "vector": [1, 0, 0.3651, 0.0159, 0, 0.66, 0.6, 83, 0, 1, 0, 0, 83, 0, 0], "semantic": {"name": "threading", "arg_names": [], "import_names": ["threading"], "rhs_call_name": "", "annotation": ""}, "snippet": "import threading"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99093:ImportFrom_L25_C0", "label": "from apiclient.oauth import BaseStorage", "type": "import", "loc": [25, 25], "level": 0, "parent": null, "vector": [1, 0, 0.3968, 0.0159, 0, 0.66, 0.8, 791, 0, 1, 0, 0, 791, 0, 0], "semantic": {"name": "apiclient.oauth", "arg_names": [], "import_names": ["BaseStorage"], "rhs_call_name": "", "annotation": ""}, "snippet": "from apiclient.oauth import Storage as BaseStorage"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99093:ClassDef_L28_C0", "label": "Storage", "type": "class", "loc": [28, 63], "level": 0, "parent": null, "vector": [3, 0, 0.7222, 0.5714, 0, 0.66, 1.0, 850, 0, 3, 0, 0, 775, 0, 14], "semantic": {"name": "Storage", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class Storage(BaseStorage):\n \"\"\"Store and retrieve a single credential to and from a file.\"\"\"\n\n def __init__(self, filename):\n self._filename = filename\n self._lock = threading.Lock()\n\n def get(self):"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99093:Expr_L29_C2", "label": "expression", "type": "expression", "loc": [29, 29], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99093:ClassDef_L28_C0", "vector": [8, 1, 0.4603, 0.0159, 1, 0.56, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Store and retrieve a single credential to and from a file.\"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99093:FunctionDef_L31_C2", "label": "__init__", "type": "function", "loc": [31, 33], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99093:ClassDef_L28_C0", "vector": [2, 1, 0.5079, 0.0476, 1, 0.56, 0.3333, 555, 0, 2, 0, 0, 0, 0, 1], "semantic": {"name": "__init__", "arg_names": ["self", "filename"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, filename):\n self._filename = filename\n self._lock = threading.Lock()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99093:Assign_L32_C4", "label": "self._filename =", "type": "assigned_variable", "loc": [32, 32], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99093:FunctionDef_L31_C2", "vector": [14, 2, 0.5079, 0.0159, 2, 0.67, 0.0, 146, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self._filename", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self._filename = filename"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99093:Assign_L33_C4", "label": "self._lock = Lock()", "type": "assigned_variable", "loc": [33, 33], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99093:FunctionDef_L31_C2", "vector": [14, 2, 0.5238, 0.0159, 2, 0.67, 1.0, 143, 3, 0, 0, 0, 843, 10, 1], "semantic": {"name": "self._lock", "arg_names": [], "import_names": [], "rhs_call_name": "Lock", "annotation": ""}, "snippet": " self._lock = threading.Lock()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99093:FunctionDef_L35_C2", "label": "get", "type": "function", "loc": [35, 51], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99093:ClassDef_L28_C0", "vector": [2, 1, 0.6825, 0.2698, 1, 0.56, 0.6667, 607, 0, 1, 1, 0, 0, 0, 7], "semantic": {"name": "get", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def get(self):\n \"\"\"Retrieve Credential from file.\n\n Returns:\n apiclient.oauth.Credentials\n \"\"\"\n self._lock.acquire()\n try:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99093:Expr_L36_C4", "label": "expression", "type": "expression", "loc": [36, 40], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99093:FunctionDef_L35_C2", "vector": [8, 2, 0.6032, 0.0794, 2, 0.43, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Retrieve Credential from file.\n\n Returns:\n apiclient.oauth.Credentials\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99093:Expr_L41_C4", "label": "acquire()", "type": "expression", "loc": [41, 41], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99093:FunctionDef_L35_C2", "vector": [8, 2, 0.6508, 0.0159, 2, 0.43, 0.25, 229, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "acquire", "arg_names": [], "import_names": [], "rhs_call_name": "acquire", "annotation": ""}, "snippet": " self._lock.acquire()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99093:Try_L42_C4", "label": "try", "type": "try", "loc": [42, 48], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99093:FunctionDef_L35_C2", "vector": [7, 2, 0.7143, 0.1111, 2, 0.43, 0.5, 0, 0, 1, 0, 0, 0, 0, 5], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " try:\n f = open(self._filename, 'r')\n credentials = pickle.loads(f.read())\n f.close()\n credentials.set_store(self.put)\n except:\n credentials = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99093:Assign_L43_C6", "label": "f = open()", "type": "assigned_variable", "loc": [43, 43], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99093:Try_L42_C4", "vector": [14, 3, 0.6825, 0.0159, 3, 0.8, 0.0, 899, 3, 2, 0, 0, 693, 10, 1], "semantic": {"name": "f", "arg_names": [], "import_names": [], "rhs_call_name": "open", "annotation": ""}, "snippet": " f = open(self._filename, 'r')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99093:Assign_L44_C6", "label": "credentials = loads()", "type": "assigned_variable", "loc": [44, 44], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99093:Try_L42_C4", "vector": [14, 3, 0.6984, 0.0159, 3, 0.8, 0.3333, 198, 3, 1, 0, 0, 88, 10, 2], "semantic": {"name": "credentials", "arg_names": [], "import_names": [], "rhs_call_name": "loads", "annotation": ""}, "snippet": " credentials = pickle.loads(f.read())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99093:Expr_L45_C6", "label": "close()", "type": "expression", "loc": [45, 45], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99093:Try_L42_C4", "vector": [8, 3, 0.7143, 0.0159, 3, 0.8, 0.6667, 77, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "close", "arg_names": [], "import_names": [], "rhs_call_name": "close", "annotation": ""}, "snippet": " f.close()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99093:Expr_L46_C6", "label": "set_store()", "type": "expression", "loc": [46, 46], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99093:Try_L42_C4", "vector": [8, 3, 0.7302, 0.0159, 3, 0.8, 1.0, 939, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "set_store", "arg_names": [], "import_names": [], "rhs_call_name": "set_store", "annotation": ""}, "snippet": " credentials.set_store(self.put)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99093:Assign_L48_C6", "label": "credentials =", "type": "assigned_variable", "loc": [48, 48], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99093:Try_L42_C4", "vector": [14, 3, 0.7619, 0.0159, 3, 0.8, 0.0, 198, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "credentials", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " credentials = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99093:Expr_L49_C4", "label": "release()", "type": "expression", "loc": [49, 49], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99093:FunctionDef_L35_C2", "vector": [8, 2, 0.7778, 0.0159, 2, 0.43, 0.75, 784, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "release", "arg_names": [], "import_names": [], "rhs_call_name": "release", "annotation": ""}, "snippet": " self._lock.release()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99093:Return_L51_C4", "label": "return", "type": "return", "loc": [51, 51], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99093:FunctionDef_L35_C2", "vector": [13, 2, 0.8095, 0.0159, 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 credentials"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99093:FunctionDef_L53_C2", "label": "put", "type": "function", "loc": [53, 63], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99093:ClassDef_L28_C0", "vector": [2, 1, 0.9206, 0.1746, 1, 0.56, 1.0, 636, 0, 2, 0, 0, 0, 0, 6], "semantic": {"name": "put", "arg_names": ["self", "credentials"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def put(self, credentials):\n \"\"\"Write a pickled Credentials to file.\n\n Args:\n credentials: Credentials, the credentials to store.\n \"\"\"\n self._lock.acquire()\n f = open(self._filename, 'w')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99093:Expr_L54_C4", "label": "expression", "type": "expression", "loc": [54, 58], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99093:FunctionDef_L53_C2", "vector": [8, 2, 0.8889, 0.0794, 2, 0.2, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Write a pickled Credentials to file.\n\n Args:\n credentials: Credentials, the credentials to store.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99093:Expr_L59_C4", "label": "acquire()", "type": "expression", "loc": [59, 59], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99093:FunctionDef_L53_C2", "vector": [8, 2, 0.9365, 0.0159, 2, 0.2, 0.2, 229, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "acquire", "arg_names": [], "import_names": [], "rhs_call_name": "acquire", "annotation": ""}, "snippet": " self._lock.acquire()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99093:Assign_L60_C4", "label": "f = open()", "type": "assigned_variable", "loc": [60, 60], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99093:FunctionDef_L53_C2", "vector": [14, 2, 0.9524, 0.0159, 2, 0.2, 0.4, 899, 3, 2, 0, 0, 693, 10, 1], "semantic": {"name": "f", "arg_names": [], "import_names": [], "rhs_call_name": "open", "annotation": ""}, "snippet": " f = open(self._filename, 'w')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99093:Expr_L61_C4", "label": "write()", "type": "expression", "loc": [61, 61], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99093:FunctionDef_L53_C2", "vector": [8, 2, 0.9683, 0.0159, 2, 0.2, 0.6, 837, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "write", "arg_names": [], "import_names": [], "rhs_call_name": "write", "annotation": ""}, "snippet": " f.write(pickle.dumps(credentials))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99093:Expr_L62_C4", "label": "close()", "type": "expression", "loc": [62, 62], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99093:FunctionDef_L53_C2", "vector": [8, 2, 0.9841, 0.0159, 2, 0.2, 0.8, 77, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "close", "arg_names": [], "import_names": [], "rhs_call_name": "close", "annotation": ""}, "snippet": " f.close()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99093:Expr_L63_C4", "label": "release()", "type": "expression", "loc": [63, 63], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99093:FunctionDef_L53_C2", "vector": [8, 2, 1.0, 0.0159, 2, 0.2, 1.0, 784, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "release", "arg_names": [], "import_names": [], "rhs_call_name": "release", "annotation": ""}, "snippet": " self._lock.release()"}]
[{"f": "ajibawa-2023/Python-Code-Large/train/row_99093:ClassDef_L28_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99093:Expr_L29_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99093:ClassDef_L28_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99093:FunctionDef_L31_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99093:FunctionDef_L31_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99093:Assign_L32_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99093:FunctionDef_L31_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99093:Assign_L33_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99093:ClassDef_L28_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99093:FunctionDef_L35_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99093:FunctionDef_L35_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99093:Expr_L36_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99093:FunctionDef_L35_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99093:Expr_L41_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99093:FunctionDef_L35_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99093:Try_L42_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99093:Try_L42_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99093:Assign_L43_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99093:Try_L42_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99093:Assign_L44_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99093:Try_L42_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99093:Expr_L45_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99093:Try_L42_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99093:Expr_L46_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99093:Try_L42_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99093:Assign_L48_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99093:FunctionDef_L35_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99093:Expr_L49_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99093:FunctionDef_L35_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99093:Return_L51_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99093:ClassDef_L28_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99093:FunctionDef_L53_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99093:FunctionDef_L53_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99093:Expr_L54_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99093:FunctionDef_L53_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99093:Expr_L59_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99093:FunctionDef_L53_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99093:Assign_L60_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99093:FunctionDef_L53_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99093:Expr_L61_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99093:FunctionDef_L53_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99093:Expr_L62_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99093:FunctionDef_L53_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99093:Expr_L63_C4"}]
# Copyright (C) 2010 Google Inc. # # 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 apiclient import base64 import pickle from django.db import models class OAuthCredentialsField(models.Field): __metaclass__ = models.SubfieldBase def db_type(self): return 'VARCHAR' def to_python(self, value): if value is None: return None if isinstance(value, apiclient.oauth.Credentials): return value return pickle.loads(base64.b64decode(value)) def get_db_prep_value(self, value): return base64.b64encode(pickle.dumps(value)) class FlowThreeLeggedField(models.Field): __metaclass__ = models.SubfieldBase def db_type(self): return 'VARCHAR' def to_python(self, value): print "In to_python", value if value is None: return None if isinstance(value, apiclient.oauth.FlowThreeLegged): return value return pickle.loads(base64.b64decode(value)) def get_db_prep_value(self, value): return base64.b64encode(pickle.dumps(value))
ajibawa-2023/Python-Code-Large/train/row_99094
29
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_99094:Import_L15_C0", "label": "apiclient import apiclient", "type": "import", "loc": [15, 15], "level": 0, "parent": null, "vector": [1, 0, 0.2679, 0.0179, 0, 0.66, 0.0, 629, 0, 1, 0, 0, 629, 0, 0], "semantic": {"name": "apiclient", "arg_names": [], "import_names": ["apiclient"], "rhs_call_name": "", "annotation": ""}, "snippet": "import apiclient"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99094:Import_L16_C0", "label": "base64 import base64", "type": "import", "loc": [16, 16], "level": 0, "parent": null, "vector": [1, 0, 0.2857, 0.0179, 0, 0.66, 0.2, 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_99094:Import_L17_C0", "label": "pickle import pickle", "type": "import", "loc": [17, 17], "level": 0, "parent": null, "vector": [1, 0, 0.3036, 0.0179, 0, 0.66, 0.4, 848, 0, 1, 0, 0, 848, 0, 0], "semantic": {"name": "pickle", "arg_names": [], "import_names": ["pickle"], "rhs_call_name": "", "annotation": ""}, "snippet": "import pickle"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99094:ImportFrom_L19_C0", "label": "from django.db import models", "type": "import", "loc": [19, 19], "level": 0, "parent": null, "vector": [1, 0, 0.3393, 0.0179, 0, 0.66, 0.6, 40, 0, 1, 0, 0, 40, 0, 0], "semantic": {"name": "django.db", "arg_names": [], "import_names": ["models"], "rhs_call_name": "", "annotation": ""}, "snippet": "from django.db import models"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99094:ClassDef_L22_C0", "label": "OAuthCredentialsField", "type": "class", "loc": [22, 37], "level": 0, "parent": null, "vector": [3, 0, 0.5268, 0.2857, 0, 0.66, 0.8, 325, 0, 3, 0, 0, 922, 0, 5], "semantic": {"name": "OAuthCredentialsField", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class OAuthCredentialsField(models.Field):\n\n __metaclass__ = models.SubfieldBase\n\n def db_type(self):\n return 'VARCHAR'\n\n def to_python(self, value):"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99094:Assign_L24_C2", "label": "__metaclass__ =", "type": "assigned_variable", "loc": [24, 24], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99094:ClassDef_L22_C0", "vector": [14, 1, 0.4286, 0.0179, 1, 0.34, 0.0, 203, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "__metaclass__", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " __metaclass__ = models.SubfieldBase"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99094:FunctionDef_L26_C2", "label": "db_type", "type": "function", "loc": [26, 27], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99094:ClassDef_L22_C0", "vector": [2, 1, 0.4732, 0.0357, 1, 0.34, 0.3333, 976, 0, 1, 1, 0, 0, 0, 0], "semantic": {"name": "db_type", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def db_type(self):\n return 'VARCHAR'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99094:Return_L27_C4", "label": "return", "type": "return", "loc": [27, 27], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99094:FunctionDef_L26_C2", "vector": [13, 2, 0.4821, 0.0179, 2, 0.92, 0.0, 0, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return 'VARCHAR'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99094:FunctionDef_L29_C2", "label": "to_python", "type": "function", "loc": [29, 34], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99094:ClassDef_L22_C0", "vector": [2, 1, 0.5625, 0.1071, 1, 0.34, 0.6667, 800, 0, 2, 1, 0, 0, 0, 3], "semantic": {"name": "to_python", "arg_names": ["self", "value"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def to_python(self, value):\n if value is None:\n return None\n if isinstance(value, apiclient.oauth.Credentials):\n return value\n return pickle.loads(base64.b64decode(value))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99094:If_L30_C4", "label": "if", "type": "if", "loc": [30, 31], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99094:FunctionDef_L29_C2", "vector": [4, 2, 0.5446, 0.0357, 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 value is None:\n return None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99094:Return_L31_C6", "label": "return", "type": "return", "loc": [31, 31], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99094:If_L30_C4", "vector": [13, 3, 0.5536, 0.0179, 3, 0.44, 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_99094:If_L32_C4", "label": "if", "type": "if", "loc": [32, 33], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99094:FunctionDef_L29_C2", "vector": [4, 2, 0.5804, 0.0357, 2, 0.86, 0.5, 0, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if isinstance(value, apiclient.oauth.Credentials):\n return value"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99094:Return_L33_C6", "label": "return", "type": "return", "loc": [33, 33], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99094:If_L32_C4", "vector": [13, 3, 0.5893, 0.0179, 3, 0.69, 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_99094:Return_L34_C4", "label": "return", "type": "return", "loc": [34, 34], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99094:FunctionDef_L29_C2", "vector": [13, 2, 0.6071, 0.0179, 2, 0.86, 1.0, 0, 3, 0, 0, 0, 0, 10, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return pickle.loads(base64.b64decode(value))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99094:FunctionDef_L36_C2", "label": "get_db_prep_value", "type": "function", "loc": [36, 37], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99094:ClassDef_L22_C0", "vector": [2, 1, 0.6518, 0.0357, 1, 0.34, 1.0, 728, 0, 2, 1, 0, 0, 0, 2], "semantic": {"name": "get_db_prep_value", "arg_names": ["self", "value"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def get_db_prep_value(self, value):\n return base64.b64encode(pickle.dumps(value))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99094:Return_L37_C4", "label": "return", "type": "return", "loc": [37, 37], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99094:FunctionDef_L36_C2", "vector": [13, 2, 0.6607, 0.0179, 2, 0.98, 0.0, 0, 3, 0, 0, 0, 0, 10, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return base64.b64encode(pickle.dumps(value))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99094:ClassDef_L40_C0", "label": "FlowThreeLeggedField", "type": "class", "loc": [40, 56], "level": 0, "parent": null, "vector": [3, 0, 0.8571, 0.3036, 0, 0.66, 1.0, 390, 0, 3, 0, 0, 922, 0, 6], "semantic": {"name": "FlowThreeLeggedField", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class FlowThreeLeggedField(models.Field):\n\n __metaclass__ = models.SubfieldBase\n\n def db_type(self):\n return 'VARCHAR'\n\n def to_python(self, value):"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99094:Assign_L42_C2", "label": "__metaclass__ =", "type": "assigned_variable", "loc": [42, 42], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99094:ClassDef_L40_C0", "vector": [14, 1, 0.75, 0.0179, 1, 0.19, 0.0, 203, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "__metaclass__", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " __metaclass__ = models.SubfieldBase"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99094:FunctionDef_L44_C2", "label": "db_type", "type": "function", "loc": [44, 45], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99094:ClassDef_L40_C0", "vector": [2, 1, 0.7946, 0.0357, 1, 0.19, 0.3333, 976, 0, 1, 1, 0, 0, 0, 0], "semantic": {"name": "db_type", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def db_type(self):\n return 'VARCHAR'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99094:Return_L45_C4", "label": "return", "type": "return", "loc": [45, 45], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99094:FunctionDef_L44_C2", "vector": [13, 2, 0.8036, 0.0179, 2, 0.85, 0.0, 0, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return 'VARCHAR'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99094:FunctionDef_L47_C2", "label": "to_python", "type": "function", "loc": [47, 53], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99094:ClassDef_L40_C0", "vector": [2, 1, 0.8929, 0.125, 1, 0.19, 0.6667, 800, 0, 2, 1, 0, 0, 0, 4], "semantic": {"name": "to_python", "arg_names": ["self", "value"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def to_python(self, value):\n print(\"In to_python\", value)\n if value is None:\n return None\n if isinstance(value, apiclient.oauth.FlowThreeLegged):\n return value\n return pickle.loads(base64.b64decode(value))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99094:Expr_L48_C4", "label": "print()", "type": "expression", "loc": [48, 48], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99094:FunctionDef_L47_C2", "vector": [8, 2, 0.8571, 0.0179, 2, 0.5, 0.0, 535, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print(\"In to_python\", value)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99094:If_L49_C4", "label": "if", "type": "if", "loc": [49, 50], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99094:FunctionDef_L47_C2", "vector": [4, 2, 0.8839, 0.0357, 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 value is None:\n return None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99094:Return_L50_C6", "label": "return", "type": "return", "loc": [50, 50], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99094:If_L49_C4", "vector": [13, 3, 0.8929, 0.0179, 3, 0.76, 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_99094:If_L51_C4", "label": "if", "type": "if", "loc": [51, 52], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99094:FunctionDef_L47_C2", "vector": [4, 2, 0.9196, 0.0357, 2, 0.5, 0.6667, 0, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if isinstance(value, apiclient.oauth.FlowThreeLegged):\n return value"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99094:Return_L52_C6", "label": "return", "type": "return", "loc": [52, 52], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99094:If_L51_C4", "vector": [13, 3, 0.9286, 0.0179, 3, 0.11, 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_99094:Return_L53_C4", "label": "return", "type": "return", "loc": [53, 53], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99094:FunctionDef_L47_C2", "vector": [13, 2, 0.9464, 0.0179, 2, 0.5, 1.0, 0, 3, 0, 0, 0, 0, 10, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return pickle.loads(base64.b64decode(value))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99094:FunctionDef_L55_C2", "label": "get_db_prep_value", "type": "function", "loc": [55, 56], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99094:ClassDef_L40_C0", "vector": [2, 1, 0.9911, 0.0357, 1, 0.19, 1.0, 728, 0, 2, 1, 0, 0, 0, 2], "semantic": {"name": "get_db_prep_value", "arg_names": ["self", "value"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def get_db_prep_value(self, value):\n return base64.b64encode(pickle.dumps(value))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99094:Return_L56_C4", "label": "return", "type": "return", "loc": [56, 56], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99094:FunctionDef_L55_C2", "vector": [13, 2, 1.0, 0.0179, 2, 0.66, 0.0, 0, 3, 0, 0, 0, 0, 10, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return base64.b64encode(pickle.dumps(value))"}]
[{"f": "ajibawa-2023/Python-Code-Large/train/row_99094:ClassDef_L22_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99094:Assign_L24_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99094:ClassDef_L22_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99094:FunctionDef_L26_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99094:FunctionDef_L26_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99094:Return_L27_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99094:ClassDef_L22_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99094:FunctionDef_L29_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99094:FunctionDef_L29_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99094:If_L30_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99094:If_L30_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99094:Return_L31_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99094:FunctionDef_L29_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99094:If_L32_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99094:If_L32_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99094:Return_L33_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99094:FunctionDef_L29_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99094:Return_L34_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99094:ClassDef_L22_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99094:FunctionDef_L36_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99094:FunctionDef_L36_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99094:Return_L37_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99094:ClassDef_L40_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99094:Assign_L42_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99094:ClassDef_L40_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99094:FunctionDef_L44_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99094:FunctionDef_L44_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99094:Return_L45_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99094:ClassDef_L40_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99094:FunctionDef_L47_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99094:FunctionDef_L47_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99094:Expr_L48_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99094:FunctionDef_L47_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99094:If_L49_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99094:If_L49_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99094:Return_L50_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99094:FunctionDef_L47_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99094:If_L51_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99094:If_L51_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99094:Return_L52_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99094:FunctionDef_L47_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99094:Return_L53_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99094:ClassDef_L40_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99094:FunctionDef_L55_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99094:FunctionDef_L55_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99094:Return_L56_C4"}]
__version__ = "1.0c2"
ajibawa-2023/Python-Code-Large/train/row_99095
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_99095:Assign_L1_C0", "label": "__version__ =", "type": "assigned_variable", "loc": [1, 1], "level": 0, "parent": null, "vector": [14, 0, 1.0, 1.0, 0, 0.66, 0.0, 162, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "__version__", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "__version__ = \"1.0c2\""}]
[]
#!/usr/bin/python2.4 # # Copyright (C) 2010 Google Inc. # # 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. """Model objects for requests and responses. Each API may support one or more serializations, such as JSON, Atom, etc. The model classes are responsible for converting between the wire format and the Python object representation. """ __author__ = 'jcgregorio@google.com (Joe Gregorio)' import gflags import logging import urllib from errors import HttpError from oauth2client.anyjson import simplejson FLAGS = gflags.FLAGS gflags.DEFINE_boolean('dump_request_response', False, 'Dump all http server requests and responses. ' ) def _abstract(): raise NotImplementedError('You need to override this function') class Model(object): """Model base class. All Model classes should implement this interface. The Model serializes and de-serializes between a wire format such as JSON and a Python object representation. """ def request(self, headers, path_params, query_params, body_value): """Updates outgoing requests with a serialized body. Args: headers: dict, request headers path_params: dict, parameters that appear in the request path query_params: dict, parameters that appear in the query body_value: object, the request body as a Python object, which must be serializable. Returns: A tuple of (headers, path_params, query, body) headers: dict, request headers path_params: dict, parameters that appear in the request path query: string, query part of the request URI body: string, the body serialized in the desired wire format. """ _abstract() def response(self, resp, content): """Convert the response wire format into a Python object. Args: resp: httplib2.Response, the HTTP response headers and status content: string, the body of the HTTP response Returns: The body de-serialized as a Python object. Raises: apiclient.errors.HttpError if a non 2xx response is received. """ _abstract() class BaseModel(Model): """Base model class. Subclasses should provide implementations for the "serialize" and "deserialize" methods, as well as values for the following class attributes. Attributes: accept: The value to use for the HTTP Accept header. content_type: The value to use for the HTTP Content-type header. no_content_response: The value to return when deserializing a 204 "No Content" response. alt_param: The value to supply as the "alt" query parameter for requests. """ accept = None content_type = None no_content_response = None alt_param = None def _log_request(self, headers, path_params, query, body): """Logs debugging information about the request if requested.""" if FLAGS.dump_request_response: logging.info('--request-start--') logging.info('-headers-start-') for h, v in headers.iteritems(): logging.info('%s: %s', h, v) logging.info('-headers-end-') logging.info('-path-parameters-start-') for h, v in path_params.iteritems(): logging.info('%s: %s', h, v) logging.info('-path-parameters-end-') logging.info('body: %s', body) logging.info('query: %s', query) logging.info('--request-end--') def request(self, headers, path_params, query_params, body_value): """Updates outgoing requests with a serialized body. Args: headers: dict, request headers path_params: dict, parameters that appear in the request path query_params: dict, parameters that appear in the query body_value: object, the request body as a Python object, which must be serializable by simplejson. Returns: A tuple of (headers, path_params, query, body) headers: dict, request headers path_params: dict, parameters that appear in the request path query: string, query part of the request URI body: string, the body serialized as JSON """ query = self._build_query(query_params) headers['accept'] = self.accept headers['accept-encoding'] = 'gzip, deflate' if 'user-agent' in headers: headers['user-agent'] += ' ' else: headers['user-agent'] = '' headers['user-agent'] += 'google-api-python-client/1.0' if body_value is not None: headers['content-type'] = self.content_type body_value = self.serialize(body_value) self._log_request(headers, path_params, query, body_value) return (headers, path_params, query, body_value) def _build_query(self, params): """Builds a query string. Args: params: dict, the query parameters Returns: The query parameters properly encoded into an HTTP URI query string. """ if self.alt_param is not None: params.update({'alt': self.alt_param}) astuples = [] for key, value in params.iteritems(): if type(value) == type([]): for x in value: x = x.encode('utf-8') astuples.append((key, x)) else: if getattr(value, 'encode', False) and callable(value.encode): value = value.encode('utf-8') astuples.append((key, value)) return '?' + urllib.urlencode(astuples) def _log_response(self, resp, content): """Logs debugging information about the response if requested.""" if FLAGS.dump_request_response: logging.info('--response-start--') for h, v in resp.iteritems(): logging.info('%s: %s', h, v) if content: logging.info(content) logging.info('--response-end--') def response(self, resp, content): """Convert the response wire format into a Python object. Args: resp: httplib2.Response, the HTTP response headers and status content: string, the body of the HTTP response Returns: The body de-serialized as a Python object. Raises: apiclient.errors.HttpError if a non 2xx response is received. """ self._log_response(resp, content) # Error handling is TBD, for example, do we retry # for some operation/error combinations? if resp.status < 300: if resp.status == 204: # A 204: No Content response should be treated differently # to all the other success states return self.no_content_response return self.deserialize(content) else: logging.debug('Content from bad request was: %s' % content) raise HttpError(resp, content) def serialize(self, body_value): """Perform the actual Python object serialization. Args: body_value: object, the request body as a Python object. Returns: string, the body in serialized form. """ _abstract() def deserialize(self, content): """Perform the actual deserialization from response string to Python object. Args: content: string, the body of the HTTP response Returns: The body de-serialized as a Python object. """ _abstract() class JsonModel(BaseModel): """Model class for JSON. Serializes and de-serializes between JSON and the Python object representation of HTTP request and response bodies. """ accept = 'application/json' content_type = 'application/json' alt_param = 'json' def __init__(self, data_wrapper=False): """Construct a JsonModel. Args: data_wrapper: boolean, wrap requests and responses in a data wrapper """ self._data_wrapper = data_wrapper def serialize(self, body_value): if (isinstance(body_value, dict) and 'data' not in body_value and self._data_wrapper): body_value = {'data': body_value} return simplejson.dumps(body_value) def deserialize(self, content): body = simplejson.loads(content) if isinstance(body, dict) and 'data' in body: body = body['data'] return body @property def no_content_response(self): return {} class RawModel(JsonModel): """Model class for requests that don't return JSON. Serializes and de-serializes between JSON and the Python object representation of HTTP request, and returns the raw bytes of the response body. """ accept = '*/*' content_type = 'application/json' alt_param = None def deserialize(self, content): return content @property def no_content_response(self): return '' class MediaModel(JsonModel): """Model class for requests that return Media. Serializes and de-serializes between JSON and the Python object representation of HTTP request, and returns the raw bytes of the response body. """ accept = '*/*' content_type = 'application/json' alt_param = 'media' def deserialize(self, content): return content @property def no_content_response(self): return '' class ProtocolBufferModel(BaseModel): """Model class for protocol buffers. Serializes and de-serializes the binary protocol buffer sent in the HTTP request and response bodies. """ accept = 'application/x-protobuf' content_type = 'application/x-protobuf' alt_param = 'proto' def __init__(self, protocol_buffer): """Constructs a ProtocolBufferModel. The serialzed protocol buffer returned in an HTTP response will be de-serialized using the given protocol buffer class. Args: protocol_buffer: The protocol buffer class used to de-serialize a response from the API. """ self._protocol_buffer = protocol_buffer def serialize(self, body_value): return body_value.SerializeToString() def deserialize(self, content): return self._protocol_buffer.FromString(content) @property def no_content_response(self): return self._protocol_buffer() def makepatch(original, modified): """Create a patch object. Some methods support PATCH, an efficient way to send updates to a resource. This method allows the easy construction of patch bodies by looking at the differences between a resource before and after it was modified. Args: original: object, the original deserialized resource modified: object, the modified deserialized resource Returns: An object that contains only the changes from original to modified, in a form suitable to pass to a PATCH method. Example usage: item = service.activities().get(postid=postid, userid=userid).execute() original = copy.deepcopy(item) item['object']['content'] = 'This is updated.' service.activities.patch(postid=postid, userid=userid, body=makepatch(original, item)).execute() """ patch = {} for key, original_value in original.iteritems(): modified_value = modified.get(key, None) if modified_value is None: # Use None to signal that the element is deleted patch[key] = None elif original_value != modified_value: if type(original_value) == type({}): # Recursively descend objects patch[key] = makepatch(original_value, modified_value) else: # In the case of simple types or arrays we just replace patch[key] = modified_value else: # Don't add anything to patch if there's no change pass for key in modified: if key not in original: patch[key] = modified[key] return patch
ajibawa-2023/Python-Code-Large/train/row_99096
154
385
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_99096:Expr_L17_C0", "label": "expression", "type": "expression", "loc": [17, 23], "level": 0, "parent": null, "vector": [8, 0, 0.0519, 0.0182, 0, 0.66, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\"\"\"Model objects for requests and responses.\n\nEach API may support one or more serializations, such\nas JSON, Atom, etc. The model classes are responsible\nfor converting between the wire format and the Python\nobject representation.\n\"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99096:Assign_L25_C0", "label": "__author__ =", "type": "assigned_variable", "loc": [25, 25], "level": 0, "parent": null, "vector": [14, 0, 0.0649, 0.0026, 0, 0.66, 0.0625, 777, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "__author__", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "__author__ = 'jcgregorio@google.com (Joe Gregorio)'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99096:Import_L27_C0", "label": "gflags import gflags", "type": "import", "loc": [27, 27], "level": 0, "parent": null, "vector": [1, 0, 0.0701, 0.0026, 0, 0.66, 0.125, 927, 0, 1, 0, 0, 927, 0, 0], "semantic": {"name": "gflags", "arg_names": [], "import_names": ["gflags"], "rhs_call_name": "", "annotation": ""}, "snippet": "import gflags"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99096:Import_L28_C0", "label": "logging import logging", "type": "import", "loc": [28, 28], "level": 0, "parent": null, "vector": [1, 0, 0.0727, 0.0026, 0, 0.66, 0.1875, 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_99096:Import_L29_C0", "label": "urllib import urllib", "type": "import", "loc": [29, 29], "level": 0, "parent": null, "vector": [1, 0, 0.0753, 0.0026, 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_99096:ImportFrom_L31_C0", "label": "from errors import HttpError", "type": "import", "loc": [31, 31], "level": 0, "parent": null, "vector": [1, 0, 0.0805, 0.0026, 0, 0.66, 0.3125, 841, 0, 1, 0, 0, 841, 0, 0], "semantic": {"name": "errors", "arg_names": [], "import_names": ["HttpError"], "rhs_call_name": "", "annotation": ""}, "snippet": "from errors import HttpError"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99096:ImportFrom_L32_C0", "label": "from oauth2client.anyjson import simplejson", "type": "import", "loc": [32, 32], "level": 0, "parent": null, "vector": [1, 0, 0.0831, 0.0026, 0, 0.66, 0.375, 822, 0, 1, 0, 0, 822, 0, 0], "semantic": {"name": "oauth2client.anyjson", "arg_names": [], "import_names": ["simplejson"], "rhs_call_name": "", "annotation": ""}, "snippet": "from oauth2client.anyjson import simplejson"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99096:Assign_L34_C0", "label": "FLAGS =", "type": "assigned_variable", "loc": [34, 34], "level": 0, "parent": null, "vector": [14, 0, 0.0883, 0.0026, 0, 0.66, 0.4375, 578, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "FLAGS", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "FLAGS = gflags.FLAGS"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99096:Expr_L36_C0", "label": "DEFINE_boolean()", "type": "expression", "loc": [36, 38], "level": 0, "parent": null, "vector": [8, 0, 0.0961, 0.0078, 0, 0.66, 0.5, 403, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "DEFINE_boolean", "arg_names": [], "import_names": [], "rhs_call_name": "DEFINE_boolean", "annotation": ""}, "snippet": "gflags.DEFINE_boolean('dump_request_response', False,\n 'Dump all http server requests and responses. '\n )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99096:FunctionDef_L41_C0", "label": "_abstract", "type": "function", "loc": [41, 42], "level": 0, "parent": null, "vector": [2, 0, 0.1078, 0.0052, 0, 0.66, 0.5625, 629, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "_abstract", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def _abstract():\n raise NotImplementedError('You need to override this function')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99096:ClassDef_L45_C0", "label": "Model", "type": "class", "loc": [45, 85], "level": 0, "parent": null, "vector": [3, 0, 0.1688, 0.1065, 0, 0.66, 0.625, 929, 0, 2, 0, 0, 186, 0, 2], "semantic": {"name": "Model", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class Model(object):\n \"\"\"Model base class.\n\n All Model classes should implement this interface.\n The Model serializes and de-serializes between a wire\n format such as JSON and a Python object representation.\n \"\"\"\n"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99096:Expr_L46_C2", "label": "expression", "type": "expression", "loc": [46, 51], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99096:ClassDef_L45_C0", "vector": [8, 1, 0.126, 0.0156, 1, 0.05, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Model base class.\n\n All Model classes should implement this interface.\n The Model serializes and de-serializes between a wire\n format such as JSON and a Python object representation.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99096:FunctionDef_L53_C2", "label": "request", "type": "function", "loc": [53, 70], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99096:ClassDef_L45_C0", "vector": [2, 1, 0.1597, 0.0468, 1, 0.05, 0.5, 50, 0, 5, 0, 0, 0, 0, 1], "semantic": {"name": "request", "arg_names": ["self", "headers", "path_params", "query_params", "body_value"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def request(self, headers, path_params, query_params, body_value):\n \"\"\"Updates outgoing requests with a serialized body.\n\n Args:\n headers: dict, request headers\n path_params: dict, parameters that appear in the request path\n query_params: dict, parameters that appear in the query\n body_value: object, the request body as a Python object, which must be"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99096:Expr_L54_C4", "label": "expression", "type": "expression", "loc": [54, 69], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99096:FunctionDef_L53_C2", "vector": [8, 2, 0.1597, 0.0416, 2, 0.49, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Updates outgoing requests with a serialized body.\n\n Args:\n headers: dict, request headers\n path_params: dict, parameters that appear in the request path\n query_params: dict, parameters that appear in the query\n body_value: object, the request body as a Python object, which must be\n serializable."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99096:Expr_L70_C4", "label": "_abstract()", "type": "expression", "loc": [70, 70], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99096:FunctionDef_L53_C2", "vector": [8, 2, 0.1818, 0.0026, 2, 0.49, 1.0, 629, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "_abstract", "arg_names": [], "import_names": [], "rhs_call_name": "_abstract", "annotation": ""}, "snippet": " _abstract()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99096:FunctionDef_L72_C2", "label": "response", "type": "function", "loc": [72, 85], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99096:ClassDef_L45_C0", "vector": [2, 1, 0.2039, 0.0364, 1, 0.05, 1.0, 511, 0, 3, 0, 0, 0, 0, 1], "semantic": {"name": "response", "arg_names": ["self", "resp", "content"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def response(self, resp, content):\n \"\"\"Convert the response wire format into a Python object.\n\n Args:\n resp: httplib2.Response, the HTTP response headers and status\n content: string, the body of the HTTP response\n\n Returns:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99096:Expr_L73_C4", "label": "expression", "type": "expression", "loc": [73, 84], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99096:FunctionDef_L72_C2", "vector": [8, 2, 0.2039, 0.0312, 2, 0.09, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Convert the response wire format into a Python object.\n\n Args:\n resp: httplib2.Response, the HTTP response headers and status\n content: string, the body of the HTTP response\n\n Returns:\n The body de-serialized as a Python object."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99096:Expr_L85_C4", "label": "_abstract()", "type": "expression", "loc": [85, 85], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99096:FunctionDef_L72_C2", "vector": [8, 2, 0.2208, 0.0026, 2, 0.09, 1.0, 629, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "_abstract", "arg_names": [], "import_names": [], "rhs_call_name": "_abstract", "annotation": ""}, "snippet": " _abstract()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99096:ClassDef_L88_C0", "label": "BaseModel", "type": "class", "loc": [88, 235], "level": 0, "parent": null, "vector": [3, 0, 0.4195, 0.3844, 0, 0.66, 0.6875, 389, 0, 7, 0, 0, 929, 0, 37], "semantic": {"name": "BaseModel", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class BaseModel(Model):\n \"\"\"Base model class.\n\n Subclasses should provide implementations for the \"serialize\" and\n \"deserialize\" methods, as well as values for the following class attributes.\n\n Attributes:\n accept: The value to use for the HTTP Accept header."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99096:Expr_L89_C2", "label": "expression", "type": "expression", "loc": [89, 100], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99096:ClassDef_L88_C0", "vector": [8, 1, 0.2455, 0.0312, 1, 0.34, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Base model class.\n\n Subclasses should provide implementations for the \"serialize\" and\n \"deserialize\" methods, as well as values for the following class attributes.\n\n Attributes:\n accept: The value to use for the HTTP Accept header.\n content_type: The value to use for the HTTP Content-type header."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99096:Assign_L102_C2", "label": "accept =", "type": "assigned_variable", "loc": [102, 102], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99096:ClassDef_L88_C0", "vector": [14, 1, 0.2649, 0.0026, 1, 0.34, 0.0909, 829, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "accept", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " accept = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99096:Assign_L103_C2", "label": "content_type =", "type": "assigned_variable", "loc": [103, 103], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99096:ClassDef_L88_C0", "vector": [14, 1, 0.2675, 0.0026, 1, 0.34, 0.1818, 610, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "content_type", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " content_type = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99096:Assign_L104_C2", "label": "no_content_response =", "type": "assigned_variable", "loc": [104, 104], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99096:ClassDef_L88_C0", "vector": [14, 1, 0.2701, 0.0026, 1, 0.34, 0.2727, 329, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "no_content_response", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " no_content_response = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99096:Assign_L105_C2", "label": "alt_param =", "type": "assigned_variable", "loc": [105, 105], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99096:ClassDef_L88_C0", "vector": [14, 1, 0.2727, 0.0026, 1, 0.34, 0.3636, 776, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "alt_param", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " alt_param = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99096:FunctionDef_L107_C2", "label": "_log_request", "type": "function", "loc": [107, 121], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99096:ClassDef_L88_C0", "vector": [2, 1, 0.2961, 0.039, 1, 0.34, 0.4545, 720, 0, 5, 0, 0, 0, 0, 12], "semantic": {"name": "_log_request", "arg_names": ["self", "headers", "path_params", "query", "body"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _log_request(self, headers, path_params, query, body):\n \"\"\"Logs debugging information about the request if requested.\"\"\"\n if FLAGS.dump_request_response:\n logging.info('--request-start--')\n logging.info('-headers-start-')\n for h, v in headers.iteritems():\n logging.info('%s: %s', h, v)\n logging.info('-headers-end-')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99096:Expr_L108_C4", "label": "expression", "type": "expression", "loc": [108, 108], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99096:FunctionDef_L107_C2", "vector": [8, 2, 0.2805, 0.0026, 2, 0.93, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Logs debugging information about the request if requested.\"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99096:If_L109_C4", "label": "if", "type": "if", "loc": [109, 121], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99096:FunctionDef_L107_C2", "vector": [4, 2, 0.2987, 0.0338, 2, 0.93, 1.0, 0, 7, 0, 0, 0, 0, 0, 12], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if FLAGS.dump_request_response:\n logging.info('--request-start--')\n logging.info('-headers-start-')\n for h, v in headers.iteritems():\n logging.info('%s: %s', h, v)\n logging.info('-headers-end-')\n logging.info('-path-parameters-start-')\n for h, v in path_params.iteritems():"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99096:Expr_L110_C6", "label": "info()", "type": "expression", "loc": [110, 110], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99096:If_L109_C4", "vector": [8, 3, 0.2857, 0.0026, 3, 0.61, 0.0, 730, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "info", "arg_names": [], "import_names": [], "rhs_call_name": "info", "annotation": ""}, "snippet": " logging.info('--request-start--')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99096:Expr_L111_C6", "label": "info()", "type": "expression", "loc": [111, 111], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99096:If_L109_C4", "vector": [8, 3, 0.2883, 0.0026, 3, 0.61, 0.1111, 730, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "info", "arg_names": [], "import_names": [], "rhs_call_name": "info", "annotation": ""}, "snippet": " logging.info('-headers-start-')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99096:For_L112_C6", "label": "for h, v", "type": "for", "loc": [112, 113], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99096:If_L109_C4", "vector": [6, 3, 0.2922, 0.0052, 3, 0.61, 0.2222, 971, 3, 0, 0, 0, 0, 0, 2], "semantic": {"name": "h, v", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for h, v in headers.iteritems():\n logging.info('%s: %s', h, v)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99096:Expr_L113_C8", "label": "info()", "type": "expression", "loc": [113, 113], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99096:For_L112_C6", "vector": [8, 4, 0.2935, 0.0026, 4, 0.84, 0.0, 730, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "info", "arg_names": [], "import_names": [], "rhs_call_name": "info", "annotation": ""}, "snippet": " logging.info('%s: %s', h, v)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99096:Expr_L114_C6", "label": "info()", "type": "expression", "loc": [114, 114], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99096:If_L109_C4", "vector": [8, 3, 0.2961, 0.0026, 3, 0.61, 0.3333, 730, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "info", "arg_names": [], "import_names": [], "rhs_call_name": "info", "annotation": ""}, "snippet": " logging.info('-headers-end-')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99096:Expr_L115_C6", "label": "info()", "type": "expression", "loc": [115, 115], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99096:If_L109_C4", "vector": [8, 3, 0.2987, 0.0026, 3, 0.61, 0.4444, 730, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "info", "arg_names": [], "import_names": [], "rhs_call_name": "info", "annotation": ""}, "snippet": " logging.info('-path-parameters-start-')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99096:For_L116_C6", "label": "for h, v", "type": "for", "loc": [116, 117], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99096:If_L109_C4", "vector": [6, 3, 0.3026, 0.0052, 3, 0.61, 0.5556, 971, 3, 0, 0, 0, 0, 0, 2], "semantic": {"name": "h, v", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for h, v in path_params.iteritems():\n logging.info('%s: %s', h, v)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99096:Expr_L117_C8", "label": "info()", "type": "expression", "loc": [117, 117], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99096:For_L116_C6", "vector": [8, 4, 0.3039, 0.0026, 4, 0.42, 0.0, 730, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "info", "arg_names": [], "import_names": [], "rhs_call_name": "info", "annotation": ""}, "snippet": " logging.info('%s: %s', h, v)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99096:Expr_L118_C6", "label": "info()", "type": "expression", "loc": [118, 118], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99096:If_L109_C4", "vector": [8, 3, 0.3065, 0.0026, 3, 0.61, 0.6667, 730, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "info", "arg_names": [], "import_names": [], "rhs_call_name": "info", "annotation": ""}, "snippet": " logging.info('-path-parameters-end-')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99096:Expr_L119_C6", "label": "info()", "type": "expression", "loc": [119, 119], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99096:If_L109_C4", "vector": [8, 3, 0.3091, 0.0026, 3, 0.61, 0.7778, 730, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "info", "arg_names": [], "import_names": [], "rhs_call_name": "info", "annotation": ""}, "snippet": " logging.info('body: %s', body)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99096:Expr_L120_C6", "label": "info()", "type": "expression", "loc": [120, 120], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99096:If_L109_C4", "vector": [8, 3, 0.3117, 0.0026, 3, 0.61, 0.8889, 730, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "info", "arg_names": [], "import_names": [], "rhs_call_name": "info", "annotation": ""}, "snippet": " logging.info('query: %s', query)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99096:Expr_L121_C6", "label": "info()", "type": "expression", "loc": [121, 121], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99096:If_L109_C4", "vector": [8, 3, 0.3143, 0.0026, 3, 0.61, 1.0, 730, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "info", "arg_names": [], "import_names": [], "rhs_call_name": "info", "annotation": ""}, "snippet": " logging.info('--request-end--')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99096:FunctionDef_L123_C2", "label": "request", "type": "function", "loc": [123, 153], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99096:ClassDef_L88_C0", "vector": [2, 1, 0.3584, 0.0805, 1, 0.34, 0.5455, 50, 0, 5, 1, 0, 0, 0, 3], "semantic": {"name": "request", "arg_names": ["self", "headers", "path_params", "query_params", "body_value"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def request(self, headers, path_params, query_params, body_value):\n \"\"\"Updates outgoing requests with a serialized body.\n\n Args:\n headers: dict, request headers\n path_params: dict, parameters that appear in the request path\n query_params: dict, parameters that appear in the query\n body_value: object, the request body as a Python object, which must be"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99096:Expr_L124_C4", "label": "expression", "type": "expression", "loc": [124, 139], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99096:FunctionDef_L123_C2", "vector": [8, 2, 0.3416, 0.0416, 2, 0.17, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Updates outgoing requests with a serialized body.\n\n Args:\n headers: dict, request headers\n path_params: dict, parameters that appear in the request path\n query_params: dict, parameters that appear in the query\n body_value: object, the request body as a Python object, which must be\n serializable by simplejson."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99096:Assign_L140_C4", "label": "query = _build_query()", "type": "assigned_variable", "loc": [140, 140], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99096:FunctionDef_L123_C2", "vector": [14, 2, 0.3636, 0.0026, 2, 0.17, 0.1429, 546, 3, 1, 0, 0, 453, 10, 1], "semantic": {"name": "query", "arg_names": [], "import_names": [], "rhs_call_name": "_build_query", "annotation": ""}, "snippet": " query = self._build_query(query_params)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99096:Assign_L141_C4", "label": "assign", "type": "assigned_variable", "loc": [141, 141], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99096:FunctionDef_L123_C2", "vector": [14, 2, 0.3662, 0.0026, 2, 0.17, 0.2857, 0, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " headers['accept'] = self.accept"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99096:Assign_L142_C4", "label": "assign", "type": "assigned_variable", "loc": [142, 142], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99096:FunctionDef_L123_C2", "vector": [14, 2, 0.3688, 0.0026, 2, 0.17, 0.4286, 0, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " headers['accept-encoding'] = 'gzip, deflate'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99096:If_L143_C4", "label": "if", "type": "if", "loc": [143, 146], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99096:FunctionDef_L123_C2", "vector": [4, 2, 0.3753, 0.0104, 2, 0.17, 0.5714, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if 'user-agent' in headers:\n headers['user-agent'] += ' '\n else:\n headers['user-agent'] = ''"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99096:Assign_L146_C6", "label": "assign", "type": "assigned_variable", "loc": [146, 146], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99096:If_L143_C4", "vector": [14, 3, 0.3792, 0.0026, 3, 0.68, 0.0, 0, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " headers['user-agent'] = ''"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99096:If_L149_C4", "label": "if", "type": "if", "loc": [149, 151], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99096:FunctionDef_L123_C2", "vector": [4, 2, 0.3896, 0.0078, 2, 0.17, 0.7143, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if body_value is not None:\n headers['content-type'] = self.content_type\n body_value = self.serialize(body_value)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99096:Assign_L150_C6", "label": "assign", "type": "assigned_variable", "loc": [150, 150], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99096:If_L149_C4", "vector": [14, 3, 0.3896, 0.0026, 3, 0.94, 0.0, 0, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " headers['content-type'] = self.content_type"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99096:Assign_L151_C6", "label": "body_value = serialize()", "type": "assigned_variable", "loc": [151, 151], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99096:If_L149_C4", "vector": [14, 3, 0.3922, 0.0026, 3, 0.94, 1.0, 70, 3, 1, 0, 0, 50, 10, 1], "semantic": {"name": "body_value", "arg_names": [], "import_names": [], "rhs_call_name": "serialize", "annotation": ""}, "snippet": " body_value = self.serialize(body_value)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99096:Expr_L152_C4", "label": "_log_request()", "type": "expression", "loc": [152, 152], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99096:FunctionDef_L123_C2", "vector": [8, 2, 0.3948, 0.0026, 2, 0.17, 0.8571, 720, 3, 4, 0, 0, 0, 0, 1], "semantic": {"name": "_log_request", "arg_names": [], "import_names": [], "rhs_call_name": "_log_request", "annotation": ""}, "snippet": " self._log_request(headers, path_params, query, body_value)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99096:Return_L153_C4", "label": "return", "type": "return", "loc": [153, 153], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99096:FunctionDef_L123_C2", "vector": [13, 2, 0.3974, 0.0026, 2, 0.17, 1.0, 0, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return (headers, path_params, query, body_value)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99096:FunctionDef_L155_C2", "label": "_build_query", "type": "function", "loc": [155, 176], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99096:ClassDef_L88_C0", "vector": [2, 1, 0.4299, 0.0571, 1, 0.34, 0.6364, 453, 0, 2, 1, 0, 0, 0, 11], "semantic": {"name": "_build_query", "arg_names": ["self", "params"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _build_query(self, params):\n \"\"\"Builds a query string.\n\n Args:\n params: dict, the query parameters\n\n Returns:\n The query parameters properly encoded into an HTTP URI query string."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99096:Expr_L156_C4", "label": "expression", "type": "expression", "loc": [156, 163], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99096:FunctionDef_L155_C2", "vector": [8, 2, 0.4143, 0.0208, 2, 0.27, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Builds a query string.\n\n Args:\n params: dict, the query parameters\n\n Returns:\n The query parameters properly encoded into an HTTP URI query string.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99096:If_L164_C4", "label": "if", "type": "if", "loc": [164, 165], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99096:FunctionDef_L155_C2", "vector": [4, 2, 0.4273, 0.0052, 2, 0.27, 0.25, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self.alt_param is not None:\n params.update({'alt': self.alt_param})"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99096:Expr_L165_C6", "label": "update()", "type": "expression", "loc": [165, 165], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99096:If_L164_C4", "vector": [8, 3, 0.4286, 0.0026, 3, 0.67, 0.0, 637, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "update", "arg_names": [], "import_names": [], "rhs_call_name": "update", "annotation": ""}, "snippet": " params.update({'alt': self.alt_param})"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99096:Assign_L166_C4", "label": "astuples =", "type": "assigned_variable", "loc": [166, 166], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99096:FunctionDef_L155_C2", "vector": [14, 2, 0.4312, 0.0026, 2, 0.27, 0.5, 731, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "astuples", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " astuples = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99096:For_L167_C4", "label": "for key, value", "type": "for", "loc": [167, 175], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99096:FunctionDef_L155_C2", "vector": [6, 2, 0.4442, 0.0234, 2, 0.27, 0.75, 839, 3, 0, 0, 0, 0, 0, 9], "semantic": {"name": "key, value", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for key, value in params.iteritems():\n if type(value) == type([]):\n for x in value:\n x = x.encode('utf-8')\n astuples.append((key, x))\n else:\n if getattr(value, 'encode', False) and callable(value.encode):\n value = value.encode('utf-8')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99096:If_L168_C6", "label": "if", "type": "if", "loc": [168, 175], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99096:For_L167_C4", "vector": [4, 3, 0.4455, 0.0208, 3, 0.59, 0.0, 0, 0, 0, 0, 0, 0, 0, 8], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if type(value) == type([]):\n for x in value:\n x = x.encode('utf-8')\n astuples.append((key, x))\n else:\n if getattr(value, 'encode', False) and callable(value.encode):\n value = value.encode('utf-8')\n astuples.append((key, value))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99096:For_L169_C8", "label": "for x", "type": "for", "loc": [169, 171], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99096:If_L168_C6", "vector": [6, 4, 0.4416, 0.0078, 4, 0.69, 0.0, 190, 2, 0, 0, 0, 0, 0, 2], "semantic": {"name": "x", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for x in value:\n x = x.encode('utf-8')\n astuples.append((key, x))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99096:Assign_L170_C10", "label": "x = encode()", "type": "assigned_variable", "loc": [170, 170], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99096:For_L169_C8", "vector": [14, 5, 0.4416, 0.0026, 5, 0.64, 0.0, 190, 3, 1, 0, 0, 623, 10, 1], "semantic": {"name": "x", "arg_names": [], "import_names": [], "rhs_call_name": "encode", "annotation": ""}, "snippet": " x = x.encode('utf-8')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99096:Expr_L171_C10", "label": "append()", "type": "expression", "loc": [171, 171], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99096:For_L169_C8", "vector": [8, 5, 0.4442, 0.0026, 5, 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": " astuples.append((key, x))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99096:If_L173_C8", "label": "if", "type": "if", "loc": [173, 174], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99096:If_L168_C6", "vector": [4, 4, 0.4506, 0.0052, 4, 0.69, 0.5, 0, 0, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if getattr(value, 'encode', False) and callable(value.encode):\n value = value.encode('utf-8')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99096:Assign_L174_C10", "label": "value = encode()", "type": "assigned_variable", "loc": [174, 174], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99096:If_L173_C8", "vector": [14, 5, 0.4519, 0.0026, 5, 0.92, 0.0, 441, 3, 1, 0, 0, 623, 10, 1], "semantic": {"name": "value", "arg_names": [], "import_names": [], "rhs_call_name": "encode", "annotation": ""}, "snippet": " value = value.encode('utf-8')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99096:Expr_L175_C8", "label": "append()", "type": "expression", "loc": [175, 175], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99096:If_L168_C6", "vector": [8, 4, 0.4545, 0.0026, 4, 0.69, 1.0, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " astuples.append((key, value))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99096:Return_L176_C4", "label": "return", "type": "return", "loc": [176, 176], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99096:FunctionDef_L155_C2", "vector": [13, 2, 0.4571, 0.0026, 2, 0.27, 1.0, 0, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return '?' + urllib.urlencode(astuples)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99096:FunctionDef_L178_C2", "label": "_log_response", "type": "function", "loc": [178, 186], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99096:ClassDef_L88_C0", "vector": [2, 1, 0.4727, 0.0234, 1, 0.34, 0.7273, 660, 0, 3, 0, 0, 0, 0, 5], "semantic": {"name": "_log_response", "arg_names": ["self", "resp", "content"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _log_response(self, resp, content):\n \"\"\"Logs debugging information about the response if requested.\"\"\"\n if FLAGS.dump_request_response:\n logging.info('--response-start--')\n for h, v in resp.iteritems():\n logging.info('%s: %s', h, v)\n if content:\n logging.info(content)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99096:Expr_L179_C4", "label": "expression", "type": "expression", "loc": [179, 179], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99096:FunctionDef_L178_C2", "vector": [8, 2, 0.4649, 0.0026, 2, 0.85, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Logs debugging information about the response if requested.\"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99096:If_L180_C4", "label": "if", "type": "if", "loc": [180, 186], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99096:FunctionDef_L178_C2", "vector": [4, 2, 0.4753, 0.0182, 2, 0.85, 1.0, 0, 7, 0, 0, 0, 0, 0, 5], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if FLAGS.dump_request_response:\n logging.info('--response-start--')\n for h, v in resp.iteritems():\n logging.info('%s: %s', h, v)\n if content:\n logging.info(content)\n logging.info('--response-end--')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99096:Expr_L181_C6", "label": "info()", "type": "expression", "loc": [181, 181], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99096:If_L180_C4", "vector": [8, 3, 0.4701, 0.0026, 3, 0.72, 0.0, 730, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "info", "arg_names": [], "import_names": [], "rhs_call_name": "info", "annotation": ""}, "snippet": " logging.info('--response-start--')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99096:For_L182_C6", "label": "for h, v", "type": "for", "loc": [182, 183], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99096:If_L180_C4", "vector": [6, 3, 0.474, 0.0052, 3, 0.72, 0.3333, 971, 3, 0, 0, 0, 0, 0, 2], "semantic": {"name": "h, v", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for h, v in resp.iteritems():\n logging.info('%s: %s', h, v)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99096:Expr_L183_C8", "label": "info()", "type": "expression", "loc": [183, 183], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99096:For_L182_C6", "vector": [8, 4, 0.4753, 0.0026, 4, 0.64, 0.0, 730, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "info", "arg_names": [], "import_names": [], "rhs_call_name": "info", "annotation": ""}, "snippet": " logging.info('%s: %s', h, v)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99096:If_L184_C6", "label": "if", "type": "if", "loc": [184, 185], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99096:If_L180_C4", "vector": [4, 3, 0.4792, 0.0052, 3, 0.72, 0.6667, 0, 2, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if content:\n logging.info(content)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99096:Expr_L185_C8", "label": "info()", "type": "expression", "loc": [185, 185], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99096:If_L184_C6", "vector": [8, 4, 0.4805, 0.0026, 4, 0.9, 0.0, 730, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "info", "arg_names": [], "import_names": [], "rhs_call_name": "info", "annotation": ""}, "snippet": " logging.info(content)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99096:Expr_L186_C6", "label": "info()", "type": "expression", "loc": [186, 186], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99096:If_L180_C4", "vector": [8, 3, 0.4831, 0.0026, 3, 0.72, 1.0, 730, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "info", "arg_names": [], "import_names": [], "rhs_call_name": "info", "annotation": ""}, "snippet": " logging.info('--response-end--')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99096:FunctionDef_L188_C2", "label": "response", "type": "function", "loc": [188, 212], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99096:ClassDef_L88_C0", "vector": [2, 1, 0.5195, 0.0649, 1, 0.34, 0.8182, 511, 0, 3, 1, 0, 0, 0, 4], "semantic": {"name": "response", "arg_names": ["self", "resp", "content"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def response(self, resp, content):\n \"\"\"Convert the response wire format into a Python object.\n\n Args:\n resp: httplib2.Response, the HTTP response headers and status\n content: string, the body of the HTTP response\n\n Returns:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99096:Expr_L189_C4", "label": "expression", "type": "expression", "loc": [189, 200], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99096:FunctionDef_L188_C2", "vector": [8, 2, 0.5052, 0.0312, 2, 0.99, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Convert the response wire format into a Python object.\n\n Args:\n resp: httplib2.Response, the HTTP response headers and status\n content: string, the body of the HTTP response\n\n Returns:\n The body de-serialized as a Python object."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99096:Expr_L201_C4", "label": "_log_response()", "type": "expression", "loc": [201, 201], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99096:FunctionDef_L188_C2", "vector": [8, 2, 0.5221, 0.0026, 2, 0.99, 0.5, 660, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "_log_response", "arg_names": [], "import_names": [], "rhs_call_name": "_log_response", "annotation": ""}, "snippet": " self._log_response(resp, content)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99096:If_L204_C4", "label": "if", "type": "if", "loc": [204, 212], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99096:FunctionDef_L188_C2", "vector": [4, 2, 0.5403, 0.0234, 2, 0.99, 1.0, 0, 0, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if resp.status < 300:\n if resp.status == 204:\n # A 204: No Content response should be treated differently\n # to all the other success states\n return self.no_content_response\n return self.deserialize(content)\n else:\n logging.debug('Content from bad request was: %s' % content)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99096:If_L205_C6", "label": "if", "type": "if", "loc": [205, 208], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99096:If_L204_C4", "vector": [4, 3, 0.5364, 0.0104, 3, 0.03, 0.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if resp.status == 204:\n # A 204: No Content response should be treated differently\n # to all the other success states\n return self.no_content_response"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99096:Return_L208_C8", "label": "return", "type": "return", "loc": [208, 208], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99096:If_L205_C6", "vector": [13, 4, 0.5403, 0.0026, 4, 0.01, 0.0, 0, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self.no_content_response"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99096:Return_L209_C6", "label": "return", "type": "return", "loc": [209, 209], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99096:If_L204_C4", "vector": [13, 3, 0.5429, 0.0026, 3, 0.03, 0.5, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self.deserialize(content)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99096:Expr_L211_C6", "label": "debug()", "type": "expression", "loc": [211, 211], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99096:If_L204_C4", "vector": [8, 3, 0.5481, 0.0026, 3, 0.03, 1.0, 924, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "debug", "arg_names": [], "import_names": [], "rhs_call_name": "debug", "annotation": ""}, "snippet": " logging.debug('Content from bad request was: %s' % content)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99096:FunctionDef_L214_C2", "label": "serialize", "type": "function", "loc": [214, 223], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99096:ClassDef_L88_C0", "vector": [2, 1, 0.5675, 0.026, 1, 0.34, 0.9091, 50, 0, 2, 0, 0, 0, 0, 1], "semantic": {"name": "serialize", "arg_names": ["self", "body_value"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def serialize(self, body_value):\n \"\"\"Perform the actual Python object serialization.\n\n Args:\n body_value: object, the request body as a Python object.\n\n Returns:\n string, the body in serialized form."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99096:Expr_L215_C4", "label": "expression", "type": "expression", "loc": [215, 222], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99096:FunctionDef_L214_C2", "vector": [8, 2, 0.5675, 0.0208, 2, 0.31, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Perform the actual Python object serialization.\n\n Args:\n body_value: object, the request body as a Python object.\n\n Returns:\n string, the body in serialized form.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99096:Expr_L223_C4", "label": "_abstract()", "type": "expression", "loc": [223, 223], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99096:FunctionDef_L214_C2", "vector": [8, 2, 0.5792, 0.0026, 2, 0.31, 1.0, 629, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "_abstract", "arg_names": [], "import_names": [], "rhs_call_name": "_abstract", "annotation": ""}, "snippet": " _abstract()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99096:FunctionDef_L225_C2", "label": "deserialize", "type": "function", "loc": [225, 235], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99096:ClassDef_L88_C0", "vector": [2, 1, 0.5974, 0.0286, 1, 0.34, 1.0, 223, 0, 2, 0, 0, 0, 0, 1], "semantic": {"name": "deserialize", "arg_names": ["self", "content"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def deserialize(self, content):\n \"\"\"Perform the actual deserialization from response string to Python\n object.\n\n Args:\n content: string, the body of the HTTP response\n\n Returns:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99096:Expr_L226_C4", "label": "expression", "type": "expression", "loc": [226, 234], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99096:FunctionDef_L225_C2", "vector": [8, 2, 0.5974, 0.0234, 2, 0.8, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Perform the actual deserialization from response string to Python\n object.\n\n Args:\n content: string, the body of the HTTP response\n\n Returns:\n The body de-serialized as a Python object."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99096:Expr_L235_C4", "label": "_abstract()", "type": "expression", "loc": [235, 235], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99096:FunctionDef_L225_C2", "vector": [8, 2, 0.6104, 0.0026, 2, 0.8, 1.0, 629, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "_abstract", "arg_names": [], "import_names": [], "rhs_call_name": "_abstract", "annotation": ""}, "snippet": " _abstract()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99096:ClassDef_L238_C0", "label": "JsonModel", "type": "class", "loc": [238, 270], "level": 0, "parent": null, "vector": [3, 0, 0.6597, 0.0857, 0, 0.66, 0.75, 705, 0, 4, 0, 0, 389, 0, 4], "semantic": {"name": "JsonModel", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class JsonModel(BaseModel):\n \"\"\"Model class for JSON.\n\n Serializes and de-serializes between JSON and the Python\n object representation of HTTP request and response bodies.\n \"\"\"\n accept = 'application/json'\n content_type = 'application/json'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99096:Expr_L239_C2", "label": "expression", "type": "expression", "loc": [239, 243], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99096:ClassDef_L238_C0", "vector": [8, 1, 0.626, 0.013, 1, 0.14, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Model class for JSON.\n\n Serializes and de-serializes between JSON and the Python\n object representation of HTTP request and response bodies.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99096:Assign_L244_C2", "label": "accept =", "type": "assigned_variable", "loc": [244, 244], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99096:ClassDef_L238_C0", "vector": [14, 1, 0.6338, 0.0026, 1, 0.14, 0.1429, 829, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "accept", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " accept = 'application/json'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99096:Assign_L245_C2", "label": "content_type =", "type": "assigned_variable", "loc": [245, 245], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99096:ClassDef_L238_C0", "vector": [14, 1, 0.6364, 0.0026, 1, 0.14, 0.2857, 610, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "content_type", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " content_type = 'application/json'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99096:Assign_L246_C2", "label": "alt_param =", "type": "assigned_variable", "loc": [246, 246], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99096:ClassDef_L238_C0", "vector": [14, 1, 0.639, 0.0026, 1, 0.14, 0.4286, 776, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "alt_param", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " alt_param = 'json'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99096:FunctionDef_L248_C2", "label": "__init__", "type": "function", "loc": [248, 254], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99096:ClassDef_L238_C0", "vector": [2, 1, 0.6519, 0.0182, 1, 0.14, 0.5714, 555, 0, 2, 0, 0, 0, 0, 0], "semantic": {"name": "__init__", "arg_names": ["self", "data_wrapper"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, data_wrapper=False):\n \"\"\"Construct a JsonModel.\n\n Args:\n data_wrapper: boolean, wrap requests and responses in a data wrapper\n \"\"\"\n self._data_wrapper = data_wrapper"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99096:Expr_L249_C4", "label": "expression", "type": "expression", "loc": [249, 253], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99096:FunctionDef_L248_C2", "vector": [8, 2, 0.6519, 0.013, 2, 0.41, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Construct a JsonModel.\n\n Args:\n data_wrapper: boolean, wrap requests and responses in a data wrapper\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99096:Assign_L254_C4", "label": "self._data_wrapper =", "type": "assigned_variable", "loc": [254, 254], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99096:FunctionDef_L248_C2", "vector": [14, 2, 0.6597, 0.0026, 2, 0.41, 1.0, 282, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self._data_wrapper", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self._data_wrapper = data_wrapper"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99096:FunctionDef_L256_C2", "label": "serialize", "type": "function", "loc": [256, 260], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99096:ClassDef_L238_C0", "vector": [2, 1, 0.6701, 0.013, 1, 0.14, 0.7143, 50, 0, 2, 1, 0, 0, 0, 2], "semantic": {"name": "serialize", "arg_names": ["self", "body_value"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def serialize(self, body_value):\n if (isinstance(body_value, dict) and 'data' not in body_value and\n self._data_wrapper):\n body_value = {'data': body_value}\n return simplejson.dumps(body_value)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99096:If_L257_C4", "label": "if", "type": "if", "loc": [257, 259], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99096:FunctionDef_L256_C2", "vector": [4, 2, 0.6701, 0.0078, 2, 0.76, 0.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if (isinstance(body_value, dict) and 'data' not in body_value and\n self._data_wrapper):\n body_value = {'data': body_value}"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99096:Assign_L259_C6", "label": "body_value =", "type": "assigned_variable", "loc": [259, 259], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99096:If_L257_C4", "vector": [14, 3, 0.6727, 0.0026, 3, 0.5, 0.0, 70, 0, 0, 0, 0, 0, 6, 0], "semantic": {"name": "body_value", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " body_value = {'data': body_value}"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99096:Return_L260_C4", "label": "return", "type": "return", "loc": [260, 260], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99096:FunctionDef_L256_C2", "vector": [13, 2, 0.6753, 0.0026, 2, 0.76, 1.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return simplejson.dumps(body_value)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99096:FunctionDef_L262_C2", "label": "deserialize", "type": "function", "loc": [262, 266], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99096:ClassDef_L238_C0", "vector": [2, 1, 0.6857, 0.013, 1, 0.14, 0.8571, 223, 0, 2, 1, 0, 0, 0, 2], "semantic": {"name": "deserialize", "arg_names": ["self", "content"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def deserialize(self, content):\n body = simplejson.loads(content)\n if isinstance(body, dict) and 'data' in body:\n body = body['data']\n return body"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99096:Assign_L263_C4", "label": "body = loads()", "type": "assigned_variable", "loc": [263, 263], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99096:FunctionDef_L262_C2", "vector": [14, 2, 0.6831, 0.0026, 2, 0.91, 0.0, 477, 3, 1, 0, 0, 88, 10, 1], "semantic": {"name": "body", "arg_names": [], "import_names": [], "rhs_call_name": "loads", "annotation": ""}, "snippet": " body = simplejson.loads(content)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99096:If_L264_C4", "label": "if", "type": "if", "loc": [264, 265], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99096:FunctionDef_L262_C2", "vector": [4, 2, 0.687, 0.0052, 2, 0.91, 0.5, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if isinstance(body, dict) and 'data' in body:\n body = body['data']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99096:Assign_L265_C6", "label": "body =", "type": "assigned_variable", "loc": [265, 265], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99096:If_L264_C4", "vector": [14, 3, 0.6883, 0.0026, 3, 0.29, 0.0, 477, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "body", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " body = body['data']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99096:Return_L266_C4", "label": "return", "type": "return", "loc": [266, 266], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99096:FunctionDef_L262_C2", "vector": [13, 2, 0.6909, 0.0026, 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 body"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99096:FunctionDef_L269_C2", "label": "no_content_response", "type": "function", "loc": [269, 270], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99096:ClassDef_L238_C0", "vector": [2, 1, 0.7, 0.0052, 1, 0.14, 1.0, 329, 0, 1, 1, 0, 0, 0, 0], "semantic": {"name": "no_content_response", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def no_content_response(self):\n return {}"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99096:Return_L270_C4", "label": "return", "type": "return", "loc": [270, 270], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99096:FunctionDef_L269_C2", "vector": [13, 2, 0.7013, 0.0026, 2, 0.26, 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_99096:ClassDef_L273_C0", "label": "RawModel", "type": "class", "loc": [273, 289], "level": 0, "parent": null, "vector": [3, 0, 0.7299, 0.0442, 0, 0.66, 0.8125, 845, 0, 2, 0, 0, 705, 0, 0], "semantic": {"name": "RawModel", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class RawModel(JsonModel):\n \"\"\"Model class for requests that don't return JSON.\n\n Serializes and de-serializes between JSON and the Python\n object representation of HTTP request, and returns the raw bytes\n of the response body.\n \"\"\"\n accept = '*/*'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99096:Expr_L274_C2", "label": "expression", "type": "expression", "loc": [274, 279], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99096:ClassDef_L273_C0", "vector": [8, 1, 0.7182, 0.0156, 1, 0.92, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Model class for requests that don't return JSON.\n\n Serializes and de-serializes between JSON and the Python\n object representation of HTTP request, and returns the raw bytes\n of the response body.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99096:Assign_L280_C2", "label": "accept =", "type": "assigned_variable", "loc": [280, 280], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99096:ClassDef_L273_C0", "vector": [14, 1, 0.7273, 0.0026, 1, 0.92, 0.2, 829, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "accept", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " accept = '*/*'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99096:Assign_L281_C2", "label": "content_type =", "type": "assigned_variable", "loc": [281, 281], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99096:ClassDef_L273_C0", "vector": [14, 1, 0.7299, 0.0026, 1, 0.92, 0.4, 610, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "content_type", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " content_type = 'application/json'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99096:Assign_L282_C2", "label": "alt_param =", "type": "assigned_variable", "loc": [282, 282], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99096:ClassDef_L273_C0", "vector": [14, 1, 0.7325, 0.0026, 1, 0.92, 0.6, 776, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "alt_param", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " alt_param = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99096:FunctionDef_L284_C2", "label": "deserialize", "type": "function", "loc": [284, 285], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99096:ClassDef_L273_C0", "vector": [2, 1, 0.739, 0.0052, 1, 0.92, 0.8, 223, 0, 2, 1, 0, 0, 0, 0], "semantic": {"name": "deserialize", "arg_names": ["self", "content"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def deserialize(self, content):\n return content"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99096:Return_L285_C4", "label": "return", "type": "return", "loc": [285, 285], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99096:FunctionDef_L284_C2", "vector": [13, 2, 0.7403, 0.0026, 2, 0.75, 0.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return content"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99096:FunctionDef_L288_C2", "label": "no_content_response", "type": "function", "loc": [288, 289], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99096:ClassDef_L273_C0", "vector": [2, 1, 0.7494, 0.0052, 1, 0.92, 1.0, 329, 0, 1, 1, 0, 0, 0, 0], "semantic": {"name": "no_content_response", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def no_content_response(self):\n return ''"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99096:Return_L289_C4", "label": "return", "type": "return", "loc": [289, 289], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99096:FunctionDef_L288_C2", "vector": [13, 2, 0.7506, 0.0026, 2, 0.51, 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_99096:ClassDef_L292_C0", "label": "MediaModel", "type": "class", "loc": [292, 308], "level": 0, "parent": null, "vector": [3, 0, 0.7792, 0.0442, 0, 0.66, 0.875, 632, 0, 2, 0, 0, 705, 0, 0], "semantic": {"name": "MediaModel", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class MediaModel(JsonModel):\n \"\"\"Model class for requests that return Media.\n\n Serializes and de-serializes between JSON and the Python\n object representation of HTTP request, and returns the raw bytes\n of the response body.\n \"\"\"\n accept = '*/*'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99096:Expr_L293_C2", "label": "expression", "type": "expression", "loc": [293, 298], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99096:ClassDef_L292_C0", "vector": [8, 1, 0.7675, 0.0156, 1, 0.43, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Model class for requests that return Media.\n\n Serializes and de-serializes between JSON and the Python\n object representation of HTTP request, and returns the raw bytes\n of the response body.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99096:Assign_L299_C2", "label": "accept =", "type": "assigned_variable", "loc": [299, 299], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99096:ClassDef_L292_C0", "vector": [14, 1, 0.7766, 0.0026, 1, 0.43, 0.2, 829, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "accept", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " accept = '*/*'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99096:Assign_L300_C2", "label": "content_type =", "type": "assigned_variable", "loc": [300, 300], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99096:ClassDef_L292_C0", "vector": [14, 1, 0.7792, 0.0026, 1, 0.43, 0.4, 610, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "content_type", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " content_type = 'application/json'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99096:Assign_L301_C2", "label": "alt_param =", "type": "assigned_variable", "loc": [301, 301], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99096:ClassDef_L292_C0", "vector": [14, 1, 0.7818, 0.0026, 1, 0.43, 0.6, 776, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "alt_param", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " alt_param = 'media'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99096:FunctionDef_L303_C2", "label": "deserialize", "type": "function", "loc": [303, 304], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99096:ClassDef_L292_C0", "vector": [2, 1, 0.7883, 0.0052, 1, 0.43, 0.8, 223, 0, 2, 1, 0, 0, 0, 0], "semantic": {"name": "deserialize", "arg_names": ["self", "content"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def deserialize(self, content):\n return content"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99096:Return_L304_C4", "label": "return", "type": "return", "loc": [304, 304], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99096:FunctionDef_L303_C2", "vector": [13, 2, 0.7896, 0.0026, 2, 0.91, 0.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return content"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99096:FunctionDef_L307_C2", "label": "no_content_response", "type": "function", "loc": [307, 308], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99096:ClassDef_L292_C0", "vector": [2, 1, 0.7987, 0.0052, 1, 0.43, 1.0, 329, 0, 1, 1, 0, 0, 0, 0], "semantic": {"name": "no_content_response", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def no_content_response(self):\n return ''"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99096:Return_L308_C4", "label": "return", "type": "return", "loc": [308, 308], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99096:FunctionDef_L307_C2", "vector": [13, 2, 0.8, 0.0026, 2, 0.44, 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_99096:ClassDef_L311_C0", "label": "ProtocolBufferModel", "type": "class", "loc": [311, 341], "level": 0, "parent": null, "vector": [3, 0, 0.8468, 0.0805, 0, 0.66, 0.9375, 730, 0, 4, 0, 0, 389, 0, 3], "semantic": {"name": "ProtocolBufferModel", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class ProtocolBufferModel(BaseModel):\n \"\"\"Model class for protocol buffers.\n\n Serializes and de-serializes the binary protocol buffer sent in the HTTP\n request and response bodies.\n \"\"\"\n accept = 'application/x-protobuf'\n content_type = 'application/x-protobuf'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99096:Expr_L312_C2", "label": "expression", "type": "expression", "loc": [312, 316], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99096:ClassDef_L311_C0", "vector": [8, 1, 0.8156, 0.013, 1, 0.33, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Model class for protocol buffers.\n\n Serializes and de-serializes the binary protocol buffer sent in the HTTP\n request and response bodies.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99096:Assign_L317_C2", "label": "accept =", "type": "assigned_variable", "loc": [317, 317], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99096:ClassDef_L311_C0", "vector": [14, 1, 0.8234, 0.0026, 1, 0.33, 0.1429, 829, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "accept", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " accept = 'application/x-protobuf'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99096:Assign_L318_C2", "label": "content_type =", "type": "assigned_variable", "loc": [318, 318], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99096:ClassDef_L311_C0", "vector": [14, 1, 0.826, 0.0026, 1, 0.33, 0.2857, 610, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "content_type", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " content_type = 'application/x-protobuf'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99096:Assign_L319_C2", "label": "alt_param =", "type": "assigned_variable", "loc": [319, 319], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99096:ClassDef_L311_C0", "vector": [14, 1, 0.8286, 0.0026, 1, 0.33, 0.4286, 776, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "alt_param", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " alt_param = 'proto'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99096:FunctionDef_L321_C2", "label": "__init__", "type": "function", "loc": [321, 331], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99096:ClassDef_L311_C0", "vector": [2, 1, 0.8468, 0.0286, 1, 0.33, 0.5714, 555, 0, 2, 0, 0, 0, 0, 0], "semantic": {"name": "__init__", "arg_names": ["self", "protocol_buffer"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, protocol_buffer):\n \"\"\"Constructs a ProtocolBufferModel.\n\n The serialzed protocol buffer returned in an HTTP response will be\n de-serialized using the given protocol buffer class.\n\n Args:\n protocol_buffer: The protocol buffer class used to de-serialize a"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99096:Expr_L322_C4", "label": "expression", "type": "expression", "loc": [322, 330], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99096:FunctionDef_L321_C2", "vector": [8, 2, 0.8468, 0.0234, 2, 0.87, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Constructs a ProtocolBufferModel.\n\n The serialzed protocol buffer returned in an HTTP response will be\n de-serialized using the given protocol buffer class.\n\n Args:\n protocol_buffer: The protocol buffer class used to de-serialize a\n response from the API."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99096:Assign_L331_C4", "label": "self._protocol_buffer =", "type": "assigned_variable", "loc": [331, 331], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99096:FunctionDef_L321_C2", "vector": [14, 2, 0.8597, 0.0026, 2, 0.87, 1.0, 175, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self._protocol_buffer", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self._protocol_buffer = protocol_buffer"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99096:FunctionDef_L333_C2", "label": "serialize", "type": "function", "loc": [333, 334], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99096:ClassDef_L311_C0", "vector": [2, 1, 0.8662, 0.0052, 1, 0.33, 0.7143, 50, 0, 2, 1, 0, 0, 0, 1], "semantic": {"name": "serialize", "arg_names": ["self", "body_value"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def serialize(self, body_value):\n return body_value.SerializeToString()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99096:Return_L334_C4", "label": "return", "type": "return", "loc": [334, 334], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99096:FunctionDef_L333_C2", "vector": [13, 2, 0.8675, 0.0026, 2, 0.33, 0.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return body_value.SerializeToString()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99096:FunctionDef_L336_C2", "label": "deserialize", "type": "function", "loc": [336, 337], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99096:ClassDef_L311_C0", "vector": [2, 1, 0.874, 0.0052, 1, 0.33, 0.8571, 223, 0, 2, 1, 0, 0, 0, 1], "semantic": {"name": "deserialize", "arg_names": ["self", "content"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def deserialize(self, content):\n return self._protocol_buffer.FromString(content)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99096:Return_L337_C4", "label": "return", "type": "return", "loc": [337, 337], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99096:FunctionDef_L336_C2", "vector": [13, 2, 0.8753, 0.0026, 2, 0.33, 0.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self._protocol_buffer.FromString(content)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99096:FunctionDef_L340_C2", "label": "no_content_response", "type": "function", "loc": [340, 341], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99096:ClassDef_L311_C0", "vector": [2, 1, 0.8844, 0.0052, 1, 0.33, 1.0, 329, 0, 1, 1, 0, 0, 0, 1], "semantic": {"name": "no_content_response", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def no_content_response(self):\n return self._protocol_buffer()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99096:Return_L341_C4", "label": "return", "type": "return", "loc": [341, 341], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99096:FunctionDef_L340_C2", "vector": [13, 2, 0.8857, 0.0026, 2, 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._protocol_buffer()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99096:FunctionDef_L344_C0", "label": "makepatch", "type": "function", "loc": [344, 385], "level": 0, "parent": null, "vector": [2, 0, 0.9468, 0.1091, 0, 0.66, 1.0, 703, 0, 2, 1, 0, 0, 0, 5], "semantic": {"name": "makepatch", "arg_names": ["original", "modified"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def makepatch(original, modified):\n \"\"\"Create a patch object.\n\n Some methods support PATCH, an efficient way to send updates to a resource.\n This method allows the easy construction of patch bodies by looking at the\n differences between a resource before and after it was modified.\n\n Args:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99096:Expr_L345_C2", "label": "expression", "type": "expression", "loc": [345, 364], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99096:FunctionDef_L344_C0", "vector": [8, 1, 0.9208, 0.0519, 1, 0.59, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Create a patch object.\n\n Some methods support PATCH, an efficient way to send updates to a resource.\n This method allows the easy construction of patch bodies by looking at the\n differences between a resource before and after it was modified.\n\n Args:\n original: object, the original deserialized resource"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99096:Assign_L365_C2", "label": "patch =", "type": "assigned_variable", "loc": [365, 365], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99096:FunctionDef_L344_C0", "vector": [14, 1, 0.9481, 0.0026, 1, 0.59, 0.25, 775, 0, 0, 0, 0, 0, 6, 0], "semantic": {"name": "patch", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " patch = {}"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99096:For_L366_C2", "label": "for key, original_value", "type": "for", "loc": [366, 380], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99096:FunctionDef_L344_C0", "vector": [6, 1, 0.9688, 0.039, 1, 0.59, 0.5, 200, 3, 0, 0, 0, 0, 0, 5], "semantic": {"name": "key, original_value", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for key, original_value in original.iteritems():\n modified_value = modified.get(key, None)\n if modified_value is None:\n # Use None to signal that the element is deleted\n patch[key] = None\n elif original_value != modified_value:\n if type(original_value) == type({}):\n # Recursively descend objects"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99096:Assign_L367_C4", "label": "modified_value = get()", "type": "assigned_variable", "loc": [367, 367], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99096:For_L366_C2", "vector": [14, 2, 0.9532, 0.0026, 2, 0.16, 0.0, 243, 3, 2, 0, 0, 607, 10, 1], "semantic": {"name": "modified_value", "arg_names": [], "import_names": [], "rhs_call_name": "get", "annotation": ""}, "snippet": " modified_value = modified.get(key, None)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99096:If_L368_C4", "label": "if", "type": "if", "loc": [368, 380], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99096:For_L366_C2", "vector": [4, 2, 0.9714, 0.0338, 2, 0.16, 1.0, 0, 0, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if modified_value is None:\n # Use None to signal that the element is deleted\n patch[key] = None\n elif original_value != modified_value:\n if type(original_value) == type({}):\n # Recursively descend objects\n patch[key] = makepatch(original_value, modified_value)\n else:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99096:Assign_L370_C6", "label": "assign", "type": "assigned_variable", "loc": [370, 370], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99096:If_L368_C4", "vector": [14, 3, 0.961, 0.0026, 3, 0.25, 0.0, 0, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " patch[key] = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99096:If_L371_C4", "label": "if", "type": "if", "loc": [371, 380], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99096:If_L368_C4", "vector": [4, 3, 0.9753, 0.026, 3, 0.25, 1.0, 0, 0, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " elif original_value != modified_value:\n if type(original_value) == type({}):\n # Recursively descend objects\n patch[key] = makepatch(original_value, modified_value)\n else:\n # In the case of simple types or arrays we just replace\n patch[key] = modified_value\n else:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99096:If_L372_C6", "label": "if", "type": "if", "loc": [372, 377], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99096:If_L371_C4", "vector": [4, 4, 0.9727, 0.0156, 4, 0.37, 0.0, 0, 0, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if type(original_value) == type({}):\n # Recursively descend objects\n patch[key] = makepatch(original_value, modified_value)\n else:\n # In the case of simple types or arrays we just replace\n patch[key] = modified_value"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99096:Assign_L374_C8", "label": " = makepatch()", "type": "assigned_variable", "loc": [374, 374], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99096:If_L372_C6", "vector": [14, 5, 0.9714, 0.0026, 5, 0.43, 0.0, 0, 3, 2, 0, 0, 703, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "makepatch", "annotation": ""}, "snippet": " patch[key] = makepatch(original_value, modified_value)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99096:Assign_L377_C8", "label": "assign", "type": "assigned_variable", "loc": [377, 377], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99096:If_L372_C6", "vector": [14, 5, 0.9792, 0.0026, 5, 0.43, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " patch[key] = modified_value"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99096:For_L381_C2", "label": "for key", "type": "for", "loc": [381, 383], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99096:FunctionDef_L344_C0", "vector": [6, 1, 0.9922, 0.0078, 1, 0.59, 0.75, 230, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "key", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for key in modified:\n if key not in original:\n patch[key] = modified[key]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99096:If_L382_C4", "label": "if", "type": "if", "loc": [382, 383], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99096:For_L381_C2", "vector": [4, 2, 0.9935, 0.0052, 2, 0.73, 0.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if key not in original:\n patch[key] = modified[key]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99096:Assign_L383_C6", "label": "assign", "type": "assigned_variable", "loc": [383, 383], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99096:If_L382_C4", "vector": [14, 3, 0.9948, 0.0026, 3, 0.82, 0.0, 0, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " patch[key] = modified[key]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99096:Return_L385_C2", "label": "return", "type": "return", "loc": [385, 385], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99096:FunctionDef_L344_C0", "vector": [13, 1, 1.0, 0.0026, 1, 0.59, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return patch"}]
[{"f": "ajibawa-2023/Python-Code-Large/train/row_99096:ClassDef_L45_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99096:Expr_L46_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99096:ClassDef_L45_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99096:FunctionDef_L53_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99096:FunctionDef_L53_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99096:Expr_L54_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99096:FunctionDef_L53_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99096:Expr_L70_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99096:ClassDef_L45_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99096:FunctionDef_L72_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99096:FunctionDef_L72_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99096:Expr_L73_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99096:FunctionDef_L72_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99096:Expr_L85_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99096:ClassDef_L88_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99096:Expr_L89_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99096:ClassDef_L88_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99096:Assign_L102_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99096:ClassDef_L88_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99096:Assign_L103_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99096:ClassDef_L88_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99096:Assign_L104_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99096:ClassDef_L88_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99096:Assign_L105_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99096:ClassDef_L88_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99096:FunctionDef_L107_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99096:FunctionDef_L107_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99096:Expr_L108_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99096:FunctionDef_L107_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99096:If_L109_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99096:If_L109_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99096:Expr_L110_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99096:If_L109_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99096:Expr_L111_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99096:If_L109_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99096:For_L112_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99096:For_L112_C6", "t": "ajibawa-2023/Python-Code-Large/train/row_99096:Expr_L113_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99096:If_L109_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99096:Expr_L114_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99096:If_L109_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99096:Expr_L115_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99096:If_L109_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99096:For_L116_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99096:For_L116_C6", "t": "ajibawa-2023/Python-Code-Large/train/row_99096:Expr_L117_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99096:If_L109_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99096:Expr_L118_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99096:If_L109_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99096:Expr_L119_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99096:If_L109_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99096:Expr_L120_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99096:If_L109_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99096:Expr_L121_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99096:ClassDef_L88_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99096:FunctionDef_L123_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99096:FunctionDef_L123_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99096:Expr_L124_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99096:FunctionDef_L123_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99096:Assign_L140_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99096:FunctionDef_L123_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99096:Assign_L141_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99096:FunctionDef_L123_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99096:Assign_L142_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99096:FunctionDef_L123_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99096:If_L143_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99096:If_L143_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99096:Assign_L146_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99096:FunctionDef_L123_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99096:If_L149_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99096:If_L149_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99096:Assign_L150_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99096:If_L149_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99096:Assign_L151_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99096:FunctionDef_L123_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99096:Expr_L152_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99096:FunctionDef_L123_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99096:Return_L153_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99096:ClassDef_L88_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99096:FunctionDef_L155_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99096:FunctionDef_L155_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99096:Expr_L156_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99096:FunctionDef_L155_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99096:If_L164_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99096:If_L164_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99096:Expr_L165_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99096:FunctionDef_L155_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99096:Assign_L166_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99096:FunctionDef_L155_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99096:For_L167_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99096:For_L167_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99096:If_L168_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99096:If_L168_C6", "t": "ajibawa-2023/Python-Code-Large/train/row_99096:For_L169_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99096:For_L169_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99096:Assign_L170_C10"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99096:For_L169_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99096:Expr_L171_C10"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99096:If_L168_C6", "t": "ajibawa-2023/Python-Code-Large/train/row_99096:If_L173_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99096:If_L173_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99096:Assign_L174_C10"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99096:If_L168_C6", "t": "ajibawa-2023/Python-Code-Large/train/row_99096:Expr_L175_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99096:FunctionDef_L155_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99096:Return_L176_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99096:ClassDef_L88_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99096:FunctionDef_L178_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99096:FunctionDef_L178_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99096:Expr_L179_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99096:FunctionDef_L178_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99096:If_L180_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99096:If_L180_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99096:Expr_L181_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99096:If_L180_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99096:For_L182_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99096:For_L182_C6", "t": "ajibawa-2023/Python-Code-Large/train/row_99096:Expr_L183_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99096:If_L180_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99096:If_L184_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99096:If_L184_C6", "t": "ajibawa-2023/Python-Code-Large/train/row_99096:Expr_L185_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99096:If_L180_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99096:Expr_L186_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99096:ClassDef_L88_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99096:FunctionDef_L188_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99096:FunctionDef_L188_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99096:Expr_L189_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99096:FunctionDef_L188_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99096:Expr_L201_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99096:FunctionDef_L188_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99096:If_L204_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99096:If_L204_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99096:If_L205_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99096:If_L205_C6", "t": "ajibawa-2023/Python-Code-Large/train/row_99096:Return_L208_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99096:If_L204_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99096:Return_L209_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99096:If_L204_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99096:Expr_L211_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99096:ClassDef_L88_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99096:FunctionDef_L214_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99096:FunctionDef_L214_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99096:Expr_L215_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99096:FunctionDef_L214_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99096:Expr_L223_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99096:ClassDef_L88_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99096:FunctionDef_L225_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99096:FunctionDef_L225_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99096:Expr_L226_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99096:FunctionDef_L225_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99096:Expr_L235_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99096:ClassDef_L238_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99096:Expr_L239_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99096:ClassDef_L238_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99096:Assign_L244_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99096:ClassDef_L238_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99096:Assign_L245_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99096:ClassDef_L238_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99096:Assign_L246_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99096:ClassDef_L238_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99096:FunctionDef_L248_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99096:FunctionDef_L248_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99096:Expr_L249_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99096:FunctionDef_L248_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99096:Assign_L254_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99096:ClassDef_L238_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99096:FunctionDef_L256_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99096:FunctionDef_L256_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99096:If_L257_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99096:If_L257_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99096:Assign_L259_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99096:FunctionDef_L256_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99096:Return_L260_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99096:ClassDef_L238_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99096:FunctionDef_L262_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99096:FunctionDef_L262_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99096:Assign_L263_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99096:FunctionDef_L262_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99096:If_L264_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99096:If_L264_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99096:Assign_L265_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99096:FunctionDef_L262_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99096:Return_L266_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99096:ClassDef_L238_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99096:FunctionDef_L269_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99096:FunctionDef_L269_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99096:Return_L270_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99096:ClassDef_L273_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99096:Expr_L274_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99096:ClassDef_L273_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99096:Assign_L280_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99096:ClassDef_L273_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99096:Assign_L281_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99096:ClassDef_L273_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99096:Assign_L282_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99096:ClassDef_L273_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99096:FunctionDef_L284_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99096:FunctionDef_L284_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99096:Return_L285_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99096:ClassDef_L273_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99096:FunctionDef_L288_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99096:FunctionDef_L288_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99096:Return_L289_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99096:ClassDef_L292_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99096:Expr_L293_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99096:ClassDef_L292_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99096:Assign_L299_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99096:ClassDef_L292_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99096:Assign_L300_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99096:ClassDef_L292_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99096:Assign_L301_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99096:ClassDef_L292_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99096:FunctionDef_L303_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99096:FunctionDef_L303_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99096:Return_L304_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99096:ClassDef_L292_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99096:FunctionDef_L307_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99096:FunctionDef_L307_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99096:Return_L308_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99096:ClassDef_L311_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99096:Expr_L312_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99096:ClassDef_L311_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99096:Assign_L317_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99096:ClassDef_L311_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99096:Assign_L318_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99096:ClassDef_L311_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99096:Assign_L319_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99096:ClassDef_L311_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99096:FunctionDef_L321_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99096:FunctionDef_L321_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99096:Expr_L322_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99096:FunctionDef_L321_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99096:Assign_L331_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99096:ClassDef_L311_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99096:FunctionDef_L333_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99096:FunctionDef_L333_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99096:Return_L334_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99096:ClassDef_L311_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99096:FunctionDef_L336_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99096:FunctionDef_L336_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99096:Return_L337_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99096:ClassDef_L311_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99096:FunctionDef_L340_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99096:FunctionDef_L340_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99096:Return_L341_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99096:FunctionDef_L344_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99096:Expr_L345_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99096:FunctionDef_L344_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99096:Assign_L365_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99096:FunctionDef_L344_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99096:For_L366_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99096:For_L366_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99096:Assign_L367_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99096:For_L366_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99096:If_L368_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99096:If_L368_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99096:Assign_L370_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99096:If_L368_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99096:If_L371_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99096:If_L371_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99096:If_L372_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99096:If_L372_C6", "t": "ajibawa-2023/Python-Code-Large/train/row_99096:Assign_L374_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99096:If_L372_C6", "t": "ajibawa-2023/Python-Code-Large/train/row_99096:Assign_L377_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99096:FunctionDef_L344_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99096:For_L381_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99096:For_L381_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99096:If_L382_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99096:If_L382_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99096:Assign_L383_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99096:FunctionDef_L344_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99096:Return_L385_C2"}]
#!/usr/bin/python2.4 # # Copyright (C) 2010 Google Inc. # # 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. """Errors for the library. All exceptions defined by the library should be defined in this file. """ __author__ = 'jcgregorio@google.com (Joe Gregorio)' from oauth2client.anyjson import simplejson class Error(Exception): """Base error for this module.""" pass class HttpError(Error): """HTTP data was invalid or unexpected.""" def __init__(self, resp, content, uri=None): self.resp = resp self.content = content self.uri = uri def _get_reason(self): """Calculate the reason for the error from the response content.""" if self.resp.get('content-type', '').startswith('application/json'): try: data = simplejson.loads(self.content) reason = data['error']['message'] except (ValueError, KeyError): reason = self.content else: reason = self.resp.reason return reason def __repr__(self): if self.uri: return '<HttpError %s when requesting %s returned "%s">' % ( self.resp.status, self.uri, self._get_reason()) else: return '<HttpError %s "%s">' % (self.resp.status, self._get_reason()) __str__ = __repr__ class InvalidJsonError(Error): """The JSON returned could not be parsed.""" pass class UnknownLinkType(Error): """Link type unknown or unexpected.""" pass class UnknownApiNameOrVersion(Error): """No API with that name and version exists.""" pass class UnacceptableMimeTypeError(Error): """That is an unacceptable mimetype for this operation.""" pass class MediaUploadSizeError(Error): """Media is larger than the method can accept.""" pass class ResumableUploadError(Error): """Error occured during resumable upload.""" pass class BatchError(HttpError): """Error occured during batch operations.""" def __init__(self, reason, resp=None, content=None): self.resp = resp self.content = content self.reason = reason def __repr__(self): return '<BatchError %s "%s">' % (self.resp.status, self.reason) __str__ = __repr__ class UnexpectedMethodError(Error): """Exception raised by RequestMockBuilder on unexpected calls.""" def __init__(self, methodId=None): """Constructor for an UnexpectedMethodError.""" super(UnexpectedMethodError, self).__init__( 'Received unexpected call %s' % methodId) class UnexpectedBodyError(Error): """Exception raised by RequestMockBuilder on unexpected bodies.""" def __init__(self, expected, provided): """Constructor for an UnexpectedMethodError.""" super(UnexpectedBodyError, self).__init__( 'Expected: [%s] - Provided: [%s]' % (expected, provided))
ajibawa-2023/Python-Code-Large/train/row_99097
56
123
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_99097:Expr_L17_C0", "label": "expression", "type": "expression", "loc": [17, 21], "level": 0, "parent": null, "vector": [8, 0, 0.1545, 0.0407, 0, 0.66, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\"\"\"Errors for the library.\n\nAll exceptions defined by the library\nshould be defined in this file.\n\"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99097:Assign_L23_C0", "label": "__author__ =", "type": "assigned_variable", "loc": [23, 23], "level": 0, "parent": null, "vector": [14, 0, 0.187, 0.0081, 0, 0.66, 0.0769, 777, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "__author__", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "__author__ = 'jcgregorio@google.com (Joe Gregorio)'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99097:ImportFrom_L26_C0", "label": "from oauth2client.anyjson import simplejson", "type": "import", "loc": [26, 26], "level": 0, "parent": null, "vector": [1, 0, 0.2114, 0.0081, 0, 0.66, 0.1538, 822, 0, 1, 0, 0, 822, 0, 0], "semantic": {"name": "oauth2client.anyjson", "arg_names": [], "import_names": ["simplejson"], "rhs_call_name": "", "annotation": ""}, "snippet": "from oauth2client.anyjson import simplejson"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99097:ClassDef_L29_C0", "label": "Error", "type": "class", "loc": [29, 31], "level": 0, "parent": null, "vector": [3, 0, 0.2439, 0.0244, 0, 0.66, 0.2308, 529, 0, 0, 0, 0, 645, 0, 0], "semantic": {"name": "Error", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class Error(Exception):\n \"\"\"Base error for this module.\"\"\"\n pass"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99097:Expr_L30_C2", "label": "expression", "type": "expression", "loc": [30, 30], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99097:ClassDef_L29_C0", "vector": [8, 1, 0.2439, 0.0081, 1, 0.62, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Base error for this module.\"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99097:ClassDef_L34_C0", "label": "HttpError", "type": "class", "loc": [34, 61], "level": 0, "parent": null, "vector": [3, 0, 0.3862, 0.2276, 0, 0.66, 0.3077, 466, 0, 3, 0, 0, 529, 0, 5], "semantic": {"name": "HttpError", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class HttpError(Error):\n \"\"\"HTTP data was invalid or unexpected.\"\"\"\n\n def __init__(self, resp, content, uri=None):\n self.resp = resp\n self.content = content\n self.uri = uri\n"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99097:Expr_L35_C2", "label": "expression", "type": "expression", "loc": [35, 35], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99097:ClassDef_L34_C0", "vector": [8, 1, 0.2846, 0.0081, 1, 0.1, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"HTTP data was invalid or unexpected.\"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99097:FunctionDef_L37_C2", "label": "__init__", "type": "function", "loc": [37, 40], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99097:ClassDef_L34_C0", "vector": [2, 1, 0.313, 0.0325, 1, 0.1, 0.25, 555, 0, 4, 0, 0, 0, 0, 0], "semantic": {"name": "__init__", "arg_names": ["self", "resp", "content", "uri"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, resp, content, uri=None):\n self.resp = resp\n self.content = content\n self.uri = uri"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99097:Assign_L38_C4", "label": "self.resp =", "type": "assigned_variable", "loc": [38, 38], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99097:FunctionDef_L37_C2", "vector": [14, 2, 0.3089, 0.0081, 2, 0.12, 0.0, 454, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.resp", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.resp = resp"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99097:Assign_L39_C4", "label": "self.content =", "type": "assigned_variable", "loc": [39, 39], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99097:FunctionDef_L37_C2", "vector": [14, 2, 0.3171, 0.0081, 2, 0.12, 0.5, 943, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.content", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.content = content"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99097:Assign_L40_C4", "label": "self.uri =", "type": "assigned_variable", "loc": [40, 40], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99097:FunctionDef_L37_C2", "vector": [14, 2, 0.3252, 0.0081, 2, 0.12, 1.0, 399, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.uri", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.uri = uri"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99097:FunctionDef_L42_C2", "label": "_get_reason", "type": "function", "loc": [42, 52], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99097:ClassDef_L34_C0", "vector": [2, 1, 0.3821, 0.0894, 1, 0.1, 0.5, 385, 0, 1, 1, 0, 0, 0, 3], "semantic": {"name": "_get_reason", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _get_reason(self):\n \"\"\"Calculate the reason for the error from the response content.\"\"\"\n if self.resp.get('content-type', '').startswith('application/json'):\n try:\n data = simplejson.loads(self.content)\n reason = data['error']['message']\n except (ValueError, KeyError):\n reason = self.content"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99097:Expr_L43_C4", "label": "expression", "type": "expression", "loc": [43, 43], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99097:FunctionDef_L42_C2", "vector": [8, 2, 0.3496, 0.0081, 2, 0.29, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Calculate the reason for the error from the response content.\"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99097:If_L44_C4", "label": "if", "type": "if", "loc": [44, 51], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99097:FunctionDef_L42_C2", "vector": [4, 2, 0.3862, 0.065, 2, 0.29, 0.5, 0, 3, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self.resp.get('content-type', '').startswith('application/json'):\n try:\n data = simplejson.loads(self.content)\n reason = data['error']['message']\n except (ValueError, KeyError):\n reason = self.content\n else:\n reason = self.resp.reason"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99097:Try_L45_C6", "label": "try", "type": "try", "loc": [45, 49], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99097:If_L44_C4", "vector": [7, 3, 0.3821, 0.0407, 3, 0.16, 0.0, 0, 0, 1, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " try:\n data = simplejson.loads(self.content)\n reason = data['error']['message']\n except (ValueError, KeyError):\n reason = self.content"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99097:Assign_L46_C8", "label": "data = loads()", "type": "assigned_variable", "loc": [46, 46], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99097:Try_L45_C6", "vector": [14, 4, 0.374, 0.0081, 4, 0.23, 0.0, 929, 3, 1, 0, 0, 88, 10, 1], "semantic": {"name": "data", "arg_names": [], "import_names": [], "rhs_call_name": "loads", "annotation": ""}, "snippet": " data = simplejson.loads(self.content)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99097:Assign_L47_C8", "label": "reason =", "type": "assigned_variable", "loc": [47, 47], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99097:Try_L45_C6", "vector": [14, 4, 0.3821, 0.0081, 4, 0.23, 1.0, 424, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "reason", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " reason = data['error']['message']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99097:Assign_L49_C8", "label": "reason =", "type": "assigned_variable", "loc": [49, 49], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99097:Try_L45_C6", "vector": [14, 4, 0.3984, 0.0081, 4, 0.23, 0.0, 424, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "reason", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " reason = self.content"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99097:Assign_L51_C6", "label": "reason =", "type": "assigned_variable", "loc": [51, 51], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99097:If_L44_C4", "vector": [14, 3, 0.4146, 0.0081, 3, 0.16, 1.0, 424, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "reason", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " reason = self.resp.reason"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99097:Return_L52_C4", "label": "return", "type": "return", "loc": [52, 52], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99097:FunctionDef_L42_C2", "vector": [13, 2, 0.4228, 0.0081, 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 reason"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99097:FunctionDef_L54_C2", "label": "__repr__", "type": "function", "loc": [54, 59], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99097:ClassDef_L34_C0", "vector": [2, 1, 0.4593, 0.0488, 1, 0.1, 0.75, 204, 0, 1, 1, 0, 0, 0, 2], "semantic": {"name": "__repr__", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __repr__(self):\n if self.uri:\n return '<HttpError %s when requesting %s returned \"%s\">' % (\n self.resp.status, self.uri, self._get_reason())\n else:\n return '<HttpError %s \"%s\">' % (self.resp.status, self._get_reason())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99097:If_L55_C4", "label": "if", "type": "if", "loc": [55, 59], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99097:FunctionDef_L54_C2", "vector": [4, 2, 0.4634, 0.0407, 2, 0.92, 0.0, 0, 7, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self.uri:\n return '<HttpError %s when requesting %s returned \"%s\">' % (\n self.resp.status, self.uri, self._get_reason())\n else:\n return '<HttpError %s \"%s\">' % (self.resp.status, self._get_reason())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99097:Return_L56_C6", "label": "return", "type": "return", "loc": [56, 57], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99097:If_L55_C4", "vector": [13, 3, 0.4593, 0.0163, 3, 0.89, 0.0, 0, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return '<HttpError %s when requesting %s returned \"%s\">' % (\n self.resp.status, self.uri, self._get_reason())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99097:Return_L59_C6", "label": "return", "type": "return", "loc": [59, 59], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99097:If_L55_C4", "vector": [13, 3, 0.4797, 0.0081, 3, 0.89, 1.0, 0, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return '<HttpError %s \"%s\">' % (self.resp.status, self._get_reason())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99097:Assign_L61_C2", "label": "__str__ =", "type": "assigned_variable", "loc": [61, 61], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99097:ClassDef_L34_C0", "vector": [14, 1, 0.4959, 0.0081, 1, 0.1, 1.0, 527, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "__str__", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " __str__ = __repr__"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99097:ClassDef_L64_C0", "label": "InvalidJsonError", "type": "class", "loc": [64, 66], "level": 0, "parent": null, "vector": [3, 0, 0.5285, 0.0244, 0, 0.66, 0.3846, 57, 0, 0, 0, 0, 529, 0, 0], "semantic": {"name": "InvalidJsonError", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class InvalidJsonError(Error):\n \"\"\"The JSON returned could not be parsed.\"\"\"\n pass"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99097:Expr_L65_C2", "label": "expression", "type": "expression", "loc": [65, 65], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99097:ClassDef_L64_C0", "vector": [8, 1, 0.5285, 0.0081, 1, 0.86, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"The JSON returned could not be parsed.\"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99097:ClassDef_L69_C0", "label": "UnknownLinkType", "type": "class", "loc": [69, 71], "level": 0, "parent": null, "vector": [3, 0, 0.5691, 0.0244, 0, 0.66, 0.4615, 980, 0, 0, 0, 0, 529, 0, 0], "semantic": {"name": "UnknownLinkType", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class UnknownLinkType(Error):\n \"\"\"Link type unknown or unexpected.\"\"\"\n pass"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99097:Expr_L70_C2", "label": "expression", "type": "expression", "loc": [70, 70], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99097:ClassDef_L69_C0", "vector": [8, 1, 0.5691, 0.0081, 1, 0.41, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Link type unknown or unexpected.\"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99097:ClassDef_L74_C0", "label": "UnknownApiNameOrVersion", "type": "class", "loc": [74, 76], "level": 0, "parent": null, "vector": [3, 0, 0.6098, 0.0244, 0, 0.66, 0.5385, 850, 0, 0, 0, 0, 529, 0, 0], "semantic": {"name": "UnknownApiNameOrVersion", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class UnknownApiNameOrVersion(Error):\n \"\"\"No API with that name and version exists.\"\"\"\n pass"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99097:Expr_L75_C2", "label": "expression", "type": "expression", "loc": [75, 75], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99097:ClassDef_L74_C0", "vector": [8, 1, 0.6098, 0.0081, 1, 0.21, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"No API with that name and version exists.\"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99097:ClassDef_L79_C0", "label": "UnacceptableMimeTypeError", "type": "class", "loc": [79, 81], "level": 0, "parent": null, "vector": [3, 0, 0.6504, 0.0244, 0, 0.66, 0.6154, 915, 0, 0, 0, 0, 529, 0, 0], "semantic": {"name": "UnacceptableMimeTypeError", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class UnacceptableMimeTypeError(Error):\n \"\"\"That is an unacceptable mimetype for this operation.\"\"\"\n pass"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99097:Expr_L80_C2", "label": "expression", "type": "expression", "loc": [80, 80], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99097:ClassDef_L79_C0", "vector": [8, 1, 0.6504, 0.0081, 1, 0.81, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"That is an unacceptable mimetype for this operation.\"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99097:ClassDef_L84_C0", "label": "MediaUploadSizeError", "type": "class", "loc": [84, 86], "level": 0, "parent": null, "vector": [3, 0, 0.6911, 0.0244, 0, 0.66, 0.6923, 809, 0, 0, 0, 0, 529, 0, 0], "semantic": {"name": "MediaUploadSizeError", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class MediaUploadSizeError(Error):\n \"\"\"Media is larger than the method can accept.\"\"\"\n pass"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99097:Expr_L85_C2", "label": "expression", "type": "expression", "loc": [85, 85], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99097:ClassDef_L84_C0", "vector": [8, 1, 0.6911, 0.0081, 1, 0.23, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Media is larger than the method can accept.\"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99097:ClassDef_L89_C0", "label": "ResumableUploadError", "type": "class", "loc": [89, 91], "level": 0, "parent": null, "vector": [3, 0, 0.7317, 0.0244, 0, 0.66, 0.7692, 519, 0, 0, 0, 0, 529, 0, 0], "semantic": {"name": "ResumableUploadError", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class ResumableUploadError(Error):\n \"\"\"Error occured during resumable upload.\"\"\"\n pass"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99097:Expr_L90_C2", "label": "expression", "type": "expression", "loc": [90, 90], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99097:ClassDef_L89_C0", "vector": [8, 1, 0.7317, 0.0081, 1, 0.45, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Error occured during resumable upload.\"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99097:ClassDef_L94_C0", "label": "BatchError", "type": "class", "loc": [94, 105], "level": 0, "parent": null, "vector": [3, 0, 0.8089, 0.0976, 0, 0.66, 0.8462, 864, 0, 2, 0, 0, 466, 0, 0], "semantic": {"name": "BatchError", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class BatchError(HttpError):\n \"\"\"Error occured during batch operations.\"\"\"\n\n def __init__(self, reason, resp=None, content=None):\n self.resp = resp\n self.content = content\n self.reason = reason\n"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99097:Expr_L95_C2", "label": "expression", "type": "expression", "loc": [95, 95], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99097:ClassDef_L94_C0", "vector": [8, 1, 0.7724, 0.0081, 1, 0.81, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Error occured during batch operations.\"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99097:FunctionDef_L97_C2", "label": "__init__", "type": "function", "loc": [97, 100], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99097:ClassDef_L94_C0", "vector": [2, 1, 0.8008, 0.0325, 1, 0.81, 0.3333, 555, 0, 4, 0, 0, 0, 0, 0], "semantic": {"name": "__init__", "arg_names": ["self", "reason", "resp", "content"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, reason, resp=None, content=None):\n self.resp = resp\n self.content = content\n self.reason = reason"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99097:Assign_L98_C4", "label": "self.resp =", "type": "assigned_variable", "loc": [98, 98], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99097:FunctionDef_L97_C2", "vector": [14, 2, 0.7967, 0.0081, 2, 0.69, 0.0, 454, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.resp", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.resp = resp"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99097:Assign_L99_C4", "label": "self.content =", "type": "assigned_variable", "loc": [99, 99], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99097:FunctionDef_L97_C2", "vector": [14, 2, 0.8049, 0.0081, 2, 0.69, 0.5, 943, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.content", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.content = content"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99097:Assign_L100_C4", "label": "self.reason =", "type": "assigned_variable", "loc": [100, 100], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99097:FunctionDef_L97_C2", "vector": [14, 2, 0.813, 0.0081, 2, 0.69, 1.0, 831, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.reason", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.reason = reason"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99097:FunctionDef_L102_C2", "label": "__repr__", "type": "function", "loc": [102, 103], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99097:ClassDef_L94_C0", "vector": [2, 1, 0.8333, 0.0163, 1, 0.81, 0.6667, 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 '<BatchError %s \"%s\">' % (self.resp.status, self.reason)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99097:Return_L103_C6", "label": "return", "type": "return", "loc": [103, 103], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99097:FunctionDef_L102_C2", "vector": [13, 2, 0.8374, 0.0081, 2, 0.8, 0.0, 0, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return '<BatchError %s \"%s\">' % (self.resp.status, self.reason)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99097:Assign_L105_C2", "label": "__str__ =", "type": "assigned_variable", "loc": [105, 105], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99097:ClassDef_L94_C0", "vector": [14, 1, 0.8537, 0.0081, 1, 0.81, 1.0, 527, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "__str__", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " __str__ = __repr__"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99097:ClassDef_L108_C0", "label": "UnexpectedMethodError", "type": "class", "loc": [108, 114], "level": 0, "parent": null, "vector": [3, 0, 0.9024, 0.0569, 0, 0.66, 0.9231, 748, 0, 1, 0, 0, 529, 0, 2], "semantic": {"name": "UnexpectedMethodError", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class UnexpectedMethodError(Error):\n \"\"\"Exception raised by RequestMockBuilder on unexpected calls.\"\"\"\n\n def __init__(self, methodId=None):\n \"\"\"Constructor for an UnexpectedMethodError.\"\"\"\n super(UnexpectedMethodError, self).__init__(\n 'Received unexpected call %s' % methodId)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99097:Expr_L109_C2", "label": "expression", "type": "expression", "loc": [109, 109], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99097:ClassDef_L108_C0", "vector": [8, 1, 0.8862, 0.0081, 1, 0.47, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Exception raised by RequestMockBuilder on unexpected calls.\"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99097:FunctionDef_L111_C2", "label": "__init__", "type": "function", "loc": [111, 114], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99097:ClassDef_L108_C0", "vector": [2, 1, 0.9146, 0.0325, 1, 0.47, 1.0, 555, 0, 2, 0, 0, 0, 0, 2], "semantic": {"name": "__init__", "arg_names": ["self", "methodId"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, methodId=None):\n \"\"\"Constructor for an UnexpectedMethodError.\"\"\"\n super(UnexpectedMethodError, self).__init__(\n 'Received unexpected call %s' % methodId)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99097:Expr_L112_C4", "label": "expression", "type": "expression", "loc": [112, 112], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99097:FunctionDef_L111_C2", "vector": [8, 2, 0.9106, 0.0081, 2, 0.32, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Constructor for an UnexpectedMethodError.\"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99097:Expr_L113_C4", "label": "__init__()", "type": "expression", "loc": [113, 114], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99097:FunctionDef_L111_C2", "vector": [8, 2, 0.9228, 0.0163, 2, 0.32, 1.0, 555, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "__init__", "arg_names": [], "import_names": [], "rhs_call_name": "__init__", "annotation": ""}, "snippet": " super(UnexpectedMethodError, self).__init__(\n 'Received unexpected call %s' % methodId)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99097:ClassDef_L117_C0", "label": "UnexpectedBodyError", "type": "class", "loc": [117, 123], "level": 0, "parent": null, "vector": [3, 0, 0.9756, 0.0569, 0, 0.66, 1.0, 14, 0, 1, 0, 0, 529, 0, 2], "semantic": {"name": "UnexpectedBodyError", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class UnexpectedBodyError(Error):\n \"\"\"Exception raised by RequestMockBuilder on unexpected bodies.\"\"\"\n\n def __init__(self, expected, provided):\n \"\"\"Constructor for an UnexpectedMethodError.\"\"\"\n super(UnexpectedBodyError, self).__init__(\n 'Expected: [%s] - Provided: [%s]' % (expected, provided))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99097:Expr_L118_C2", "label": "expression", "type": "expression", "loc": [118, 118], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99097:ClassDef_L117_C0", "vector": [8, 1, 0.9593, 0.0081, 1, 0.19, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Exception raised by RequestMockBuilder on unexpected bodies.\"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99097:FunctionDef_L120_C2", "label": "__init__", "type": "function", "loc": [120, 123], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99097:ClassDef_L117_C0", "vector": [2, 1, 0.9878, 0.0325, 1, 0.19, 1.0, 555, 0, 3, 0, 0, 0, 0, 2], "semantic": {"name": "__init__", "arg_names": ["self", "expected", "provided"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, expected, provided):\n \"\"\"Constructor for an UnexpectedMethodError.\"\"\"\n super(UnexpectedBodyError, self).__init__(\n 'Expected: [%s] - Provided: [%s]' % (expected, provided))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99097:Expr_L121_C4", "label": "expression", "type": "expression", "loc": [121, 121], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99097:FunctionDef_L120_C2", "vector": [8, 2, 0.9837, 0.0081, 2, 0.82, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Constructor for an UnexpectedMethodError.\"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99097:Expr_L122_C4", "label": "__init__()", "type": "expression", "loc": [122, 123], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99097:FunctionDef_L120_C2", "vector": [8, 2, 0.9959, 0.0163, 2, 0.82, 1.0, 555, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "__init__", "arg_names": [], "import_names": [], "rhs_call_name": "__init__", "annotation": ""}, "snippet": " super(UnexpectedBodyError, self).__init__(\n 'Expected: [%s] - Provided: [%s]' % (expected, provided))"}]
[{"f": "ajibawa-2023/Python-Code-Large/train/row_99097:ClassDef_L29_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99097:Expr_L30_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99097:ClassDef_L34_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99097:Expr_L35_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99097:ClassDef_L34_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99097:FunctionDef_L37_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99097:FunctionDef_L37_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99097:Assign_L38_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99097:FunctionDef_L37_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99097:Assign_L39_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99097:FunctionDef_L37_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99097:Assign_L40_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99097:ClassDef_L34_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99097:FunctionDef_L42_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99097:FunctionDef_L42_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99097:Expr_L43_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99097:FunctionDef_L42_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99097:If_L44_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99097:If_L44_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99097:Try_L45_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99097:Try_L45_C6", "t": "ajibawa-2023/Python-Code-Large/train/row_99097:Assign_L46_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99097:Try_L45_C6", "t": "ajibawa-2023/Python-Code-Large/train/row_99097:Assign_L47_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99097:Try_L45_C6", "t": "ajibawa-2023/Python-Code-Large/train/row_99097:Assign_L49_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99097:If_L44_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99097:Assign_L51_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99097:FunctionDef_L42_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99097:Return_L52_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99097:ClassDef_L34_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99097:FunctionDef_L54_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99097:FunctionDef_L54_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99097:If_L55_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99097:If_L55_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99097:Return_L56_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99097:If_L55_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99097:Return_L59_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99097:ClassDef_L34_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99097:Assign_L61_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99097:ClassDef_L64_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99097:Expr_L65_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99097:ClassDef_L69_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99097:Expr_L70_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99097:ClassDef_L74_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99097:Expr_L75_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99097:ClassDef_L79_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99097:Expr_L80_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99097:ClassDef_L84_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99097:Expr_L85_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99097:ClassDef_L89_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99097:Expr_L90_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99097:ClassDef_L94_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99097:Expr_L95_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99097:ClassDef_L94_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99097:FunctionDef_L97_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99097:FunctionDef_L97_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99097:Assign_L98_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99097:FunctionDef_L97_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99097:Assign_L99_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99097:FunctionDef_L97_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99097:Assign_L100_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99097:ClassDef_L94_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99097:FunctionDef_L102_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99097:FunctionDef_L102_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99097:Return_L103_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99097:ClassDef_L94_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99097:Assign_L105_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99097:ClassDef_L108_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99097:Expr_L109_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99097:ClassDef_L108_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99097:FunctionDef_L111_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99097:FunctionDef_L111_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99097:Expr_L112_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99097:FunctionDef_L111_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99097:Expr_L113_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99097:ClassDef_L117_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99097:Expr_L118_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99097:ClassDef_L117_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99097:FunctionDef_L120_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99097:FunctionDef_L120_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99097:Expr_L121_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99097:FunctionDef_L120_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99097:Expr_L122_C4"}]
""" iri2uri Converts an IRI to a URI. """ __author__ = "Joe Gregorio (joe@bitworking.org)" __copyright__ = "Copyright 2006, Joe Gregorio" __contributors__ = [] __version__ = "1.0.0" __license__ = "MIT" __history__ = """ """ import urlparse # Convert an IRI to a URI following the rules in RFC 3987 # # The characters we need to enocde and escape are defined in the spec: # # iprivate = %xE000-F8FF / %xF0000-FFFFD / %x100000-10FFFD # ucschar = %xA0-D7FF / %xF900-FDCF / %xFDF0-FFEF # / %x10000-1FFFD / %x20000-2FFFD / %x30000-3FFFD # / %x40000-4FFFD / %x50000-5FFFD / %x60000-6FFFD # / %x70000-7FFFD / %x80000-8FFFD / %x90000-9FFFD # / %xA0000-AFFFD / %xB0000-BFFFD / %xC0000-CFFFD # / %xD0000-DFFFD / %xE1000-EFFFD escape_range = [ (0xA0, 0xD7FF ), (0xE000, 0xF8FF ), (0xF900, 0xFDCF ), (0xFDF0, 0xFFEF), (0x10000, 0x1FFFD ), (0x20000, 0x2FFFD ), (0x30000, 0x3FFFD), (0x40000, 0x4FFFD ), (0x50000, 0x5FFFD ), (0x60000, 0x6FFFD), (0x70000, 0x7FFFD ), (0x80000, 0x8FFFD ), (0x90000, 0x9FFFD), (0xA0000, 0xAFFFD ), (0xB0000, 0xBFFFD ), (0xC0000, 0xCFFFD), (0xD0000, 0xDFFFD ), (0xE1000, 0xEFFFD), (0xF0000, 0xFFFFD ), (0x100000, 0x10FFFD) ] def encode(c): retval = c i = ord(c) for low, high in escape_range: if i < low: break if i >= low and i <= high: retval = "".join(["%%%2X" % ord(o) for o in c.encode('utf-8')]) break return retval def iri2uri(uri): """Convert an IRI to a URI. Note that IRIs must be passed in a unicode strings. That is, do not utf-8 encode the IRI before passing it into the function.""" if isinstance(uri ,unicode): (scheme, authority, path, query, fragment) = urlparse.urlsplit(uri) authority = authority.encode('idna') # For each character in 'ucschar' or 'iprivate' # 1. encode as utf-8 # 2. then %-encode each octet of that utf-8 uri = urlparse.urlunsplit((scheme, authority, path, query, fragment)) uri = "".join([encode(c) for c in uri]) return uri if __name__ == "__main__": import unittest class Test(unittest.TestCase): def test_uris(self): """Test that URIs are invariant under the transformation.""" invariant = [ u"ftp://ftp.is.co.za/rfc/rfc1808.txt", u"http://www.ietf.org/rfc/rfc2396.txt", u"ldap://[2001:db8::7]/c=GB?objectClass?one", u"mailto:John.Doe@example.com", u"news:comp.infosystems.www.servers.unix", u"tel:+1-816-555-1212", u"telnet://192.0.2.16:80/", u"urn:oasis:names:specification:docbook:dtd:xml:4.1.2" ] for uri in invariant: self.assertEqual(uri, iri2uri(uri)) def test_iri(self): """ Test that the right type of escaping is done for each part of the URI.""" self.assertEqual("http://xn--o3h.com/%E2%98%84", iri2uri(u"http://\N{COMET}.com/\N{COMET}")) self.assertEqual("http://bitworking.org/?fred=%E2%98%84", iri2uri(u"http://bitworking.org/?fred=\N{COMET}")) self.assertEqual("http://bitworking.org/#%E2%98%84", iri2uri(u"http://bitworking.org/#\N{COMET}")) self.assertEqual("#%E2%98%84", iri2uri(u"#\N{COMET}")) self.assertEqual("/fred?bar=%E2%98%9A#%E2%98%84", iri2uri(u"/fred?bar=\N{BLACK LEFT POINTING INDEX}#\N{COMET}")) self.assertEqual("/fred?bar=%E2%98%9A#%E2%98%84", iri2uri(iri2uri(u"/fred?bar=\N{BLACK LEFT POINTING INDEX}#\N{COMET}"))) self.assertNotEqual("/fred?bar=%E2%98%9A#%E2%98%84", iri2uri(u"/fred?bar=\N{BLACK LEFT POINTING INDEX}#\N{COMET}".encode('utf-8'))) unittest.main()
ajibawa-2023/Python-Code-Large/train/row_99098
43
110
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_99098:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 6], "level": 0, "parent": null, "vector": [8, 0, 0.0318, 0.0545, 0, 0.66, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\"\"\"\niri2uri\n\nConverts an IRI to a URI.\n\n\"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99098:Assign_L7_C0", "label": "__author__ =", "type": "assigned_variable", "loc": [7, 7], "level": 0, "parent": null, "vector": [14, 0, 0.0636, 0.0091, 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__ = \"Joe Gregorio (joe@bitworking.org)\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99098:Assign_L8_C0", "label": "__copyright__ =", "type": "assigned_variable", "loc": [8, 8], "level": 0, "parent": null, "vector": [14, 0, 0.0727, 0.0091, 0, 0.66, 0.1818, 200, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "__copyright__", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "__copyright__ = \"Copyright 2006, Joe Gregorio\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99098:Assign_L9_C0", "label": "__contributors__ =", "type": "assigned_variable", "loc": [9, 9], "level": 0, "parent": null, "vector": [14, 0, 0.0818, 0.0091, 0, 0.66, 0.2727, 292, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "__contributors__", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "__contributors__ = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99098:Assign_L10_C0", "label": "__version__ =", "type": "assigned_variable", "loc": [10, 10], "level": 0, "parent": null, "vector": [14, 0, 0.0909, 0.0091, 0, 0.66, 0.3636, 162, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "__version__", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "__version__ = \"1.0.0\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99098:Assign_L11_C0", "label": "__license__ =", "type": "assigned_variable", "loc": [11, 11], "level": 0, "parent": null, "vector": [14, 0, 0.1, 0.0091, 0, 0.66, 0.4545, 11, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "__license__", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "__license__ = \"MIT\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99098:Assign_L12_C0", "label": "__history__ =", "type": "assigned_variable", "loc": [12, 13], "level": 0, "parent": null, "vector": [14, 0, 0.1136, 0.0182, 0, 0.66, 0.5455, 473, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "__history__", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "__history__ = \"\"\"\n\"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99098:Import_L15_C0", "label": "urlparse import urlparse", "type": "import", "loc": [15, 15], "level": 0, "parent": null, "vector": [1, 0, 0.1364, 0.0091, 0, 0.66, 0.6364, 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_99098:Assign_L30_C0", "label": "escape_range =", "type": "assigned_variable", "loc": [30, 51], "level": 0, "parent": null, "vector": [14, 0, 0.3682, 0.2, 0, 0.66, 0.7273, 996, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "escape_range", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "escape_range = [\n (0xA0, 0xD7FF ),\n (0xE000, 0xF8FF ),\n (0xF900, 0xFDCF ),\n (0xFDF0, 0xFFEF),\n (0x10000, 0x1FFFD ),\n (0x20000, 0x2FFFD ),\n (0x30000, 0x3FFFD),"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99098:FunctionDef_L53_C0", "label": "encode", "type": "function", "loc": [53, 62], "level": 0, "parent": null, "vector": [2, 0, 0.5227, 0.0909, 0, 0.66, 0.8182, 623, 0, 1, 1, 0, 0, 0, 4], "semantic": {"name": "encode", "arg_names": ["c"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def encode(c):\n retval = c\n i = ord(c)\n for low, high in escape_range:\n if i < low:\n break\n if i >= low and i <= high:\n retval = \"\".join([\"%%%2X\" % ord(o) for o in c.encode('utf-8')])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99098:Assign_L54_C4", "label": "retval =", "type": "assigned_variable", "loc": [54, 54], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99098:FunctionDef_L53_C0", "vector": [14, 1, 0.4909, 0.0091, 1, 0.5, 0.0, 991, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "retval", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " retval = c"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99098:Assign_L55_C4", "label": "i = ord()", "type": "assigned_variable", "loc": [55, 55], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99098:FunctionDef_L53_C0", "vector": [14, 1, 0.5, 0.0091, 1, 0.5, 0.3333, 826, 3, 1, 0, 0, 171, 10, 1], "semantic": {"name": "i", "arg_names": [], "import_names": [], "rhs_call_name": "ord", "annotation": ""}, "snippet": " i = ord(c)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99098:For_L56_C4", "label": "for low, high", "type": "for", "loc": [56, 61], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99098:FunctionDef_L53_C0", "vector": [6, 1, 0.5318, 0.0545, 1, 0.5, 0.6667, 628, 2, 0, 0, 0, 0, 0, 3], "semantic": {"name": "low, high", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for low, high in escape_range:\n if i < low:\n break\n if i >= low and i <= high:\n retval = \"\".join([\"%%%2X\" % ord(o) for o in c.encode('utf-8')])\n break"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99098:If_L57_C8", "label": "if", "type": "if", "loc": [57, 58], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99098:For_L56_C4", "vector": [4, 2, 0.5227, 0.0182, 2, 0.93, 0.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if i < low:\n break"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99098:If_L59_C8", "label": "if", "type": "if", "loc": [59, 61], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99098:For_L56_C4", "vector": [4, 2, 0.5455, 0.0273, 2, 0.93, 1.0, 0, 0, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if i >= low and i <= high:\n retval = \"\".join([\"%%%2X\" % ord(o) for o in c.encode('utf-8')])\n break"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99098:Assign_L60_C12", "label": "retval = join()", "type": "assigned_variable", "loc": [60, 60], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99098:If_L59_C8", "vector": [14, 3, 0.5455, 0.0091, 3, 0.75, 0.0, 991, 3, 1, 0, 0, 933, 10, 3], "semantic": {"name": "retval", "arg_names": [], "import_names": [], "rhs_call_name": "join", "annotation": ""}, "snippet": " retval = \"\".join([\"%%%2X\" % ord(o) for o in c.encode('utf-8')])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99098:Return_L62_C4", "label": "return", "type": "return", "loc": [62, 62], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99098:FunctionDef_L53_C0", "vector": [13, 1, 0.5636, 0.0091, 1, 0.5, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return retval"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99098:FunctionDef_L65_C0", "label": "iri2uri", "type": "function", "loc": [65, 77], "level": 0, "parent": null, "vector": [2, 0, 0.6455, 0.1182, 0, 0.66, 0.9091, 588, 0, 1, 1, 0, 0, 0, 6], "semantic": {"name": "iri2uri", "arg_names": ["uri"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def iri2uri(uri):\n \"\"\"Convert an IRI to a URI. Note that IRIs must be \n passed in a unicode strings. That is, do not utf-8 encode\n the IRI before passing it into the function.\"\"\" \n if isinstance(uri ,unicode):\n (scheme, authority, path, query, fragment) = urlparse.urlsplit(uri)\n authority = authority.encode('idna')\n # For each character in 'ucschar' or 'iprivate'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99098:Expr_L66_C4", "label": "expression", "type": "expression", "loc": [66, 68], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99098:FunctionDef_L65_C0", "vector": [8, 1, 0.6091, 0.0273, 1, 0.16, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Convert an IRI to a URI. Note that IRIs must be \n passed in a unicode strings. That is, do not utf-8 encode\n the IRI before passing it into the function.\"\"\" "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99098:If_L69_C4", "label": "if", "type": "if", "loc": [69, 76], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99098:FunctionDef_L65_C0", "vector": [4, 1, 0.6591, 0.0727, 1, 0.16, 0.5, 0, 3, 0, 0, 0, 0, 0, 6], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if isinstance(uri ,unicode):\n (scheme, authority, path, query, fragment) = urlparse.urlsplit(uri)\n authority = authority.encode('idna')\n # For each character in 'ucschar' or 'iprivate'\n # 1. encode as utf-8\n # 2. then %-encode each octet of that utf-8 \n uri = urlparse.urlunsplit((scheme, authority, path, query, fragment))\n uri = \"\".join([encode(c) for c in uri])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99098:Assign_L70_C8", "label": "scheme, authority, path, query, fragment = urlsplit()", "type": "assigned_variable", "loc": [70, 70], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99098:If_L69_C4", "vector": [14, 2, 0.6364, 0.0091, 2, 0.08, 0.0, 171, 3, 1, 0, 0, 637, 10, 1], "semantic": {"name": "scheme, authority, path, query, fragment", "arg_names": [], "import_names": [], "rhs_call_name": "urlsplit", "annotation": ""}, "snippet": " (scheme, authority, path, query, fragment) = urlparse.urlsplit(uri)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99098:Assign_L71_C8", "label": "authority = encode()", "type": "assigned_variable", "loc": [71, 71], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99098:If_L69_C4", "vector": [14, 2, 0.6455, 0.0091, 2, 0.08, 0.3333, 372, 3, 1, 0, 0, 623, 10, 1], "semantic": {"name": "authority", "arg_names": [], "import_names": [], "rhs_call_name": "encode", "annotation": ""}, "snippet": " authority = authority.encode('idna')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99098:Assign_L75_C8", "label": "uri = urlunsplit()", "type": "assigned_variable", "loc": [75, 75], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99098:If_L69_C4", "vector": [14, 2, 0.6818, 0.0091, 2, 0.08, 0.6667, 600, 3, 1, 0, 0, 302, 10, 1], "semantic": {"name": "uri", "arg_names": [], "import_names": [], "rhs_call_name": "urlunsplit", "annotation": ""}, "snippet": " uri = urlparse.urlunsplit((scheme, authority, path, query, fragment))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99098:Assign_L76_C8", "label": "uri = join()", "type": "assigned_variable", "loc": [76, 76], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99098:If_L69_C4", "vector": [14, 2, 0.6909, 0.0091, 2, 0.08, 1.0, 600, 3, 1, 0, 0, 933, 10, 2], "semantic": {"name": "uri", "arg_names": [], "import_names": [], "rhs_call_name": "join", "annotation": ""}, "snippet": " uri = \"\".join([encode(c) for c in uri])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99098:Return_L77_C4", "label": "return", "type": "return", "loc": [77, 77], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99098:FunctionDef_L65_C0", "vector": [13, 1, 0.7, 0.0091, 1, 0.16, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return uri"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99098:If_L79_C0", "label": "if", "type": "if", "loc": [79, 108], "level": 0, "parent": null, "vector": [4, 0, 0.85, 0.2727, 0, 0.66, 1.0, 0, 0, 0, 0, 0, 0, 0, 19], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "if __name__ == \"__main__\":\n import unittest\n\n class Test(unittest.TestCase):\n\n def test_uris(self):\n \"\"\"Test that URIs are invariant under the transformation.\"\"\"\n invariant = [ "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99098:Import_L80_C4", "label": "unittest import unittest", "type": "import", "loc": [80, 80], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99098:If_L79_C0", "vector": [1, 1, 0.7273, 0.0091, 1, 0.07, 0.0, 88, 0, 1, 0, 0, 88, 0, 0], "semantic": {"name": "unittest", "arg_names": [], "import_names": ["unittest"], "rhs_call_name": "", "annotation": ""}, "snippet": " import unittest"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99098:ClassDef_L82_C4", "label": "Test", "type": "class", "loc": [82, 106], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99098:If_L79_C0", "vector": [3, 1, 0.8545, 0.2273, 1, 0.07, 0.5, 786, 0, 2, 0, 0, 878, 0, 18], "semantic": {"name": "Test", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " class Test(unittest.TestCase):\n\n def test_uris(self):\n \"\"\"Test that URIs are invariant under the transformation.\"\"\"\n invariant = [ \n u\"ftp://ftp.is.co.za/rfc/rfc1808.txt\",\n u\"http://www.ietf.org/rfc/rfc2396.txt\",\n u\"ldap://[2001:db8::7]/c=GB?objectClass?one\","}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99098:FunctionDef_L84_C8", "label": "test_uris", "type": "function", "loc": [84, 96], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99098:ClassDef_L82_C4", "vector": [2, 2, 0.8182, 0.1182, 2, 0.22, 0.0, 521, 0, 1, 0, 0, 0, 0, 2], "semantic": {"name": "test_uris", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def test_uris(self):\n \"\"\"Test that URIs are invariant under the transformation.\"\"\"\n invariant = [ \n u\"ftp://ftp.is.co.za/rfc/rfc1808.txt\",\n u\"http://www.ietf.org/rfc/rfc2396.txt\",\n u\"ldap://[2001:db8::7]/c=GB?objectClass?one\",\n u\"mailto:John.Doe@example.com\",\n u\"news:comp.infosystems.www.servers.unix\","}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99098:Expr_L85_C12", "label": "expression", "type": "expression", "loc": [85, 85], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99098:FunctionDef_L84_C8", "vector": [8, 3, 0.7727, 0.0091, 3, 0.72, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Test that URIs are invariant under the transformation.\"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99098:Assign_L86_C12", "label": "invariant =", "type": "assigned_variable", "loc": [86, 94], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99098:FunctionDef_L84_C8", "vector": [14, 3, 0.8182, 0.0818, 3, 0.72, 0.5, 348, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "invariant", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " invariant = [ \n u\"ftp://ftp.is.co.za/rfc/rfc1808.txt\",\n u\"http://www.ietf.org/rfc/rfc2396.txt\",\n u\"ldap://[2001:db8::7]/c=GB?objectClass?one\",\n u\"mailto:John.Doe@example.com\",\n u\"news:comp.infosystems.www.servers.unix\",\n u\"tel:+1-816-555-1212\",\n u\"telnet://192.0.2.16:80/\","}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99098:For_L95_C12", "label": "for uri", "type": "for", "loc": [95, 96], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99098:FunctionDef_L84_C8", "vector": [6, 3, 0.8682, 0.0182, 3, 0.72, 1.0, 600, 2, 0, 0, 0, 0, 0, 2], "semantic": {"name": "uri", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for uri in invariant:\n self.assertEqual(uri, iri2uri(uri))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99098:Expr_L96_C16", "label": "assertEqual()", "type": "expression", "loc": [96, 96], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99098:For_L95_C12", "vector": [8, 4, 0.8727, 0.0091, 4, 0.7, 0.0, 299, 3, 2, 0, 0, 0, 0, 2], "semantic": {"name": "assertEqual", "arg_names": [], "import_names": [], "rhs_call_name": "assertEqual", "annotation": ""}, "snippet": " self.assertEqual(uri, iri2uri(uri))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99098:FunctionDef_L98_C8", "label": "test_iri", "type": "function", "loc": [98, 106], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99098:ClassDef_L82_C4", "vector": [2, 2, 0.9273, 0.0818, 2, 0.22, 1.0, 2, 0, 1, 0, 0, 0, 0, 16], "semantic": {"name": "test_iri", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def test_iri(self):\n \"\"\" Test that the right type of escaping is done for each part of the URI.\"\"\"\n self.assertEqual(\"http://xn--o3h.com/%E2%98%84\", iri2uri(u\"http://\\N{COMET}.com/\\N{COMET}\"))\n self.assertEqual(\"http://bitworking.org/?fred=%E2%98%84\", iri2uri(u\"http://bitworking.org/?fred=\\N{COMET}\"))\n self.assertEqual(\"http://bitworking.org/#%E2%98%84\", iri2uri(u\"http://bitworking.org/#\\N{COMET}\"))\n self.assertEqual(\"#%E2%98%84\", iri2uri(u\"#\\N{COMET}\"))\n self.assertEqual(\"/fred?bar=%E2%98%9A#%E2%98%84\", iri2uri(u\"/fred?bar=\\N{BLACK LEFT POINTING INDEX}#\\N{COMET}\"))\n self.assertEqual(\"/fred?bar=%E2%98%9A#%E2%98%84\", iri2uri(iri2uri(u\"/fred?bar=\\N{BLACK LEFT POINTING INDEX}#\\N{COMET}\")))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99098:Expr_L99_C12", "label": "expression", "type": "expression", "loc": [99, 99], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99098:FunctionDef_L98_C8", "vector": [8, 3, 0.9, 0.0091, 3, 0.98, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\" Test that the right type of escaping is done for each part of the URI.\"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99098:Expr_L100_C12", "label": "assertEqual()", "type": "expression", "loc": [100, 100], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99098:FunctionDef_L98_C8", "vector": [8, 3, 0.9091, 0.0091, 3, 0.98, 0.1429, 299, 3, 2, 0, 0, 0, 0, 2], "semantic": {"name": "assertEqual", "arg_names": [], "import_names": [], "rhs_call_name": "assertEqual", "annotation": ""}, "snippet": " self.assertEqual(\"http://xn--o3h.com/%E2%98%84\", iri2uri(u\"http://\\N{COMET}.com/\\N{COMET}\"))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99098:Expr_L101_C12", "label": "assertEqual()", "type": "expression", "loc": [101, 101], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99098:FunctionDef_L98_C8", "vector": [8, 3, 0.9182, 0.0091, 3, 0.98, 0.2857, 299, 3, 2, 0, 0, 0, 0, 2], "semantic": {"name": "assertEqual", "arg_names": [], "import_names": [], "rhs_call_name": "assertEqual", "annotation": ""}, "snippet": " self.assertEqual(\"http://bitworking.org/?fred=%E2%98%84\", iri2uri(u\"http://bitworking.org/?fred=\\N{COMET}\"))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99098:Expr_L102_C12", "label": "assertEqual()", "type": "expression", "loc": [102, 102], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99098:FunctionDef_L98_C8", "vector": [8, 3, 0.9273, 0.0091, 3, 0.98, 0.4286, 299, 3, 2, 0, 0, 0, 0, 2], "semantic": {"name": "assertEqual", "arg_names": [], "import_names": [], "rhs_call_name": "assertEqual", "annotation": ""}, "snippet": " self.assertEqual(\"http://bitworking.org/#%E2%98%84\", iri2uri(u\"http://bitworking.org/#\\N{COMET}\"))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99098:Expr_L103_C12", "label": "assertEqual()", "type": "expression", "loc": [103, 103], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99098:FunctionDef_L98_C8", "vector": [8, 3, 0.9364, 0.0091, 3, 0.98, 0.5714, 299, 3, 2, 0, 0, 0, 0, 2], "semantic": {"name": "assertEqual", "arg_names": [], "import_names": [], "rhs_call_name": "assertEqual", "annotation": ""}, "snippet": " self.assertEqual(\"#%E2%98%84\", iri2uri(u\"#\\N{COMET}\"))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99098:Expr_L104_C12", "label": "assertEqual()", "type": "expression", "loc": [104, 104], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99098:FunctionDef_L98_C8", "vector": [8, 3, 0.9455, 0.0091, 3, 0.98, 0.7143, 299, 3, 2, 0, 0, 0, 0, 2], "semantic": {"name": "assertEqual", "arg_names": [], "import_names": [], "rhs_call_name": "assertEqual", "annotation": ""}, "snippet": " self.assertEqual(\"/fred?bar=%E2%98%9A#%E2%98%84\", iri2uri(u\"/fred?bar=\\N{BLACK LEFT POINTING INDEX}#\\N{COMET}\"))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99098:Expr_L105_C12", "label": "assertEqual()", "type": "expression", "loc": [105, 105], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99098:FunctionDef_L98_C8", "vector": [8, 3, 0.9545, 0.0091, 3, 0.98, 0.8571, 299, 3, 2, 0, 0, 0, 0, 3], "semantic": {"name": "assertEqual", "arg_names": [], "import_names": [], "rhs_call_name": "assertEqual", "annotation": ""}, "snippet": " self.assertEqual(\"/fred?bar=%E2%98%9A#%E2%98%84\", iri2uri(iri2uri(u\"/fred?bar=\\N{BLACK LEFT POINTING INDEX}#\\N{COMET}\")))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99098:Expr_L106_C12", "label": "assertNotEqual()", "type": "expression", "loc": [106, 106], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99098:FunctionDef_L98_C8", "vector": [8, 3, 0.9636, 0.0091, 3, 0.98, 1.0, 120, 3, 2, 0, 0, 0, 0, 3], "semantic": {"name": "assertNotEqual", "arg_names": [], "import_names": [], "rhs_call_name": "assertNotEqual", "annotation": ""}, "snippet": " self.assertNotEqual(\"/fred?bar=%E2%98%9A#%E2%98%84\", iri2uri(u\"/fred?bar=\\N{BLACK LEFT POINTING INDEX}#\\N{COMET}\".encode('utf-8')))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99098:Expr_L108_C4", "label": "main()", "type": "expression", "loc": [108, 108], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99098:If_L79_C0", "vector": [8, 1, 0.9818, 0.0091, 1, 0.07, 1.0, 624, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "main", "arg_names": [], "import_names": [], "rhs_call_name": "main", "annotation": ""}, "snippet": " unittest.main()"}]
[{"f": "ajibawa-2023/Python-Code-Large/train/row_99098:FunctionDef_L53_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99098:Assign_L54_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99098:FunctionDef_L53_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99098:Assign_L55_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99098:FunctionDef_L53_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99098:For_L56_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99098:For_L56_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99098:If_L57_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99098:For_L56_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99098:If_L59_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99098:If_L59_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99098:Assign_L60_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99098:FunctionDef_L53_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99098:Return_L62_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99098:FunctionDef_L65_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99098:Expr_L66_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99098:FunctionDef_L65_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99098:If_L69_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99098:If_L69_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99098:Assign_L70_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99098:If_L69_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99098:Assign_L71_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99098:If_L69_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99098:Assign_L75_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99098:If_L69_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99098:Assign_L76_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99098:FunctionDef_L65_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99098:Return_L77_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99098:If_L79_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99098:Import_L80_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99098:If_L79_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99098:ClassDef_L82_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99098:ClassDef_L82_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99098:FunctionDef_L84_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99098:FunctionDef_L84_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99098:Expr_L85_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99098:FunctionDef_L84_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99098:Assign_L86_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99098:FunctionDef_L84_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99098:For_L95_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99098:For_L95_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99098:Expr_L96_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99098:ClassDef_L82_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99098:FunctionDef_L98_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99098:FunctionDef_L98_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99098:Expr_L99_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99098:FunctionDef_L98_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99098:Expr_L100_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99098:FunctionDef_L98_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99098:Expr_L101_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99098:FunctionDef_L98_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99098:Expr_L102_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99098:FunctionDef_L98_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99098:Expr_L103_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99098:FunctionDef_L98_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99098:Expr_L104_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99098:FunctionDef_L98_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99098:Expr_L105_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99098:FunctionDef_L98_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99098:Expr_L106_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99098:If_L79_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99098:Expr_L108_C4"}]
"""SocksiPy - Python SOCKS module. Version 1.00 Copyright 2006 Dan-Haim. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 3. Neither the name of Dan Haim nor the names of his contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY DAN HAIM "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL DAN HAIM OR HIS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMANGE. This module provides a standard socket-like interface for Python for tunneling connections through SOCKS proxies. """ """ Minor modifications made by Christopher Gilbert (http://motomastyle.com/) for use in PyLoris (http://pyloris.sourceforge.net/) Minor modifications made by Mario Vilas (http://breakingcode.wordpress.com/) mainly to merge bug fixes found in Sourceforge """ import base64 import socket import struct import sys if getattr(socket, 'socket', None) is None: raise ImportError('socket.socket missing, proxy support unusable') PROXY_TYPE_SOCKS4 = 1 PROXY_TYPE_SOCKS5 = 2 PROXY_TYPE_HTTP = 3 PROXY_TYPE_HTTP_NO_TUNNEL = 4 _defaultproxy = None _orgsocket = socket.socket class ProxyError(Exception): pass class GeneralProxyError(ProxyError): pass class Socks5AuthError(ProxyError): pass class Socks5Error(ProxyError): pass class Socks4Error(ProxyError): pass class HTTPError(ProxyError): pass _generalerrors = ("success", "invalid data", "not connected", "not available", "bad proxy type", "bad input") _socks5errors = ("succeeded", "general SOCKS server failure", "connection not allowed by ruleset", "Network unreachable", "Host unreachable", "Connection refused", "TTL expired", "Command not supported", "Address type not supported", "Unknown error") _socks5autherrors = ("succeeded", "authentication is required", "all offered authentication methods were rejected", "unknown username or invalid password", "unknown error") _socks4errors = ("request granted", "request rejected or failed", "request rejected because SOCKS server cannot connect to identd on the client", "request rejected because the client program and identd report different user-ids", "unknown error") def setdefaultproxy(proxytype=None, addr=None, port=None, rdns=True, username=None, password=None): """setdefaultproxy(proxytype, addr[, port[, rdns[, username[, password]]]]) Sets a default proxy which all further socksocket objects will use, unless explicitly changed. """ global _defaultproxy _defaultproxy = (proxytype, addr, port, rdns, username, password) def wrapmodule(module): """wrapmodule(module) Attempts to replace a module's socket library with a SOCKS socket. Must set a default proxy using setdefaultproxy(...) first. This will only work on modules that import socket directly into the namespace; most of the Python Standard Library falls into this category. """ if _defaultproxy != None: module.socket.socket = socksocket else: raise GeneralProxyError((4, "no proxy specified")) class socksocket(socket.socket): """socksocket([family[, type[, proto]]]) -> socket object Open a SOCKS enabled socket. The parameters are the same as those of the standard socket init. In order for SOCKS to work, you must specify family=AF_INET, type=SOCK_STREAM and proto=0. """ def __init__(self, family=socket.AF_INET, type=socket.SOCK_STREAM, proto=0, _sock=None): _orgsocket.__init__(self, family, type, proto, _sock) if _defaultproxy != None: self.__proxy = _defaultproxy else: self.__proxy = (None, None, None, None, None, None) self.__proxysockname = None self.__proxypeername = None self.__httptunnel = True def __recvall(self, count): """__recvall(count) -> data Receive EXACTLY the number of bytes requested from the socket. Blocks until the required number of bytes have been received. """ data = self.recv(count) while len(data) < count: d = self.recv(count-len(data)) if not d: raise GeneralProxyError((0, "connection closed unexpectedly")) data = data + d return data def sendall(self, content, *args): """ override socket.socket.sendall method to rewrite the header for non-tunneling proxies if needed """ if not self.__httptunnel: content = self.__rewriteproxy(content) return super(socksocket, self).sendall(content, *args) def __rewriteproxy(self, header): """ rewrite HTTP request headers to support non-tunneling proxies (i.e. those which do not support the CONNECT method). This only works for HTTP (not HTTPS) since HTTPS requires tunneling. """ host, endpt = None, None hdrs = header.split("\r\n") for hdr in hdrs: if hdr.lower().startswith("host:"): host = hdr elif hdr.lower().startswith("get") or hdr.lower().startswith("post"): endpt = hdr if host and endpt: hdrs.remove(host) hdrs.remove(endpt) host = host.split(" ")[1] endpt = endpt.split(" ") if (self.__proxy[4] != None and self.__proxy[5] != None): hdrs.insert(0, self.__getauthheader()) hdrs.insert(0, "Host: %s" % host) hdrs.insert(0, "%s http://%s%s %s" % (endpt[0], host, endpt[1], endpt[2])) return "\r\n".join(hdrs) def __getauthheader(self): auth = self.__proxy[4] + ":" + self.__proxy[5] return "Proxy-Authorization: Basic " + base64.b64encode(auth) def setproxy(self, proxytype=None, addr=None, port=None, rdns=True, username=None, password=None): """setproxy(proxytype, addr[, port[, rdns[, username[, password]]]]) Sets the proxy to be used. proxytype - The type of the proxy to be used. Three types are supported: PROXY_TYPE_SOCKS4 (including socks4a), PROXY_TYPE_SOCKS5 and PROXY_TYPE_HTTP addr - The address of the server (IP or DNS). port - The port of the server. Defaults to 1080 for SOCKS servers and 8080 for HTTP proxy servers. rdns - Should DNS queries be preformed on the remote side (rather than the local side). The default is True. Note: This has no effect with SOCKS4 servers. username - Username to authenticate with to the server. The default is no authentication. password - Password to authenticate with to the server. Only relevant when username is also provided. """ self.__proxy = (proxytype, addr, port, rdns, username, password) def __negotiatesocks5(self, destaddr, destport): """__negotiatesocks5(self,destaddr,destport) Negotiates a connection through a SOCKS5 server. """ # First we'll send the authentication packages we support. if (self.__proxy[4]!=None) and (self.__proxy[5]!=None): # The username/password details were supplied to the # setproxy method so we support the USERNAME/PASSWORD # authentication (in addition to the standard none). self.sendall(struct.pack('BBBB', 0x05, 0x02, 0x00, 0x02)) else: # No username/password were entered, therefore we # only support connections with no authentication. self.sendall(struct.pack('BBB', 0x05, 0x01, 0x00)) # We'll receive the server's response to determine which # method was selected chosenauth = self.__recvall(2) if chosenauth[0:1] != chr(0x05).encode(): self.close() raise GeneralProxyError((1, _generalerrors[1])) # Check the chosen authentication method if chosenauth[1:2] == chr(0x00).encode(): # No authentication is required pass elif chosenauth[1:2] == chr(0x02).encode(): # Okay, we need to perform a basic username/password # authentication. self.sendall(chr(0x01).encode() + chr(len(self.__proxy[4])) + self.__proxy[4] + chr(len(self.__proxy[5])) + self.__proxy[5]) authstat = self.__recvall(2) if authstat[0:1] != chr(0x01).encode(): # Bad response self.close() raise GeneralProxyError((1, _generalerrors[1])) if authstat[1:2] != chr(0x00).encode(): # Authentication failed self.close() raise Socks5AuthError((3, _socks5autherrors[3])) # Authentication succeeded else: # Reaching here is always bad self.close() if chosenauth[1] == chr(0xFF).encode(): raise Socks5AuthError((2, _socks5autherrors[2])) else: raise GeneralProxyError((1, _generalerrors[1])) # Now we can request the actual connection req = struct.pack('BBB', 0x05, 0x01, 0x00) # If the given destination address is an IP address, we'll # use the IPv4 address request even if remote resolving was specified. try: ipaddr = socket.inet_aton(destaddr) req = req + chr(0x01).encode() + ipaddr except socket.error: # Well it's not an IP number, so it's probably a DNS name. if self.__proxy[3]: # Resolve remotely ipaddr = None req = req + chr(0x03).encode() + chr(len(destaddr)).encode() + destaddr else: # Resolve locally ipaddr = socket.inet_aton(socket.gethostbyname(destaddr)) req = req + chr(0x01).encode() + ipaddr req = req + struct.pack(">H", destport) self.sendall(req) # Get the response resp = self.__recvall(4) if resp[0:1] != chr(0x05).encode(): self.close() raise GeneralProxyError((1, _generalerrors[1])) elif resp[1:2] != chr(0x00).encode(): # Connection failed self.close() if ord(resp[1:2])<=8: raise Socks5Error((ord(resp[1:2]), _socks5errors[ord(resp[1:2])])) else: raise Socks5Error((9, _socks5errors[9])) # Get the bound address/port elif resp[3:4] == chr(0x01).encode(): boundaddr = self.__recvall(4) elif resp[3:4] == chr(0x03).encode(): resp = resp + self.recv(1) boundaddr = self.__recvall(ord(resp[4:5])) else: self.close() raise GeneralProxyError((1,_generalerrors[1])) boundport = struct.unpack(">H", self.__recvall(2))[0] self.__proxysockname = (boundaddr, boundport) if ipaddr != None: self.__proxypeername = (socket.inet_ntoa(ipaddr), destport) else: self.__proxypeername = (destaddr, destport) def getproxysockname(self): """getsockname() -> address info Returns the bound IP address and port number at the proxy. """ return self.__proxysockname def getproxypeername(self): """getproxypeername() -> address info Returns the IP and port number of the proxy. """ return _orgsocket.getpeername(self) def getpeername(self): """getpeername() -> address info Returns the IP address and port number of the destination machine (note: getproxypeername returns the proxy) """ return self.__proxypeername def __negotiatesocks4(self,destaddr,destport): """__negotiatesocks4(self,destaddr,destport) Negotiates a connection through a SOCKS4 server. """ # Check if the destination address provided is an IP address rmtrslv = False try: ipaddr = socket.inet_aton(destaddr) except socket.error: # It's a DNS name. Check where it should be resolved. if self.__proxy[3]: ipaddr = struct.pack("BBBB", 0x00, 0x00, 0x00, 0x01) rmtrslv = True else: ipaddr = socket.inet_aton(socket.gethostbyname(destaddr)) # Construct the request packet req = struct.pack(">BBH", 0x04, 0x01, destport) + ipaddr # The username parameter is considered userid for SOCKS4 if self.__proxy[4] != None: req = req + self.__proxy[4] req = req + chr(0x00).encode() # DNS name if remote resolving is required # NOTE: This is actually an extension to the SOCKS4 protocol # called SOCKS4A and may not be supported in all cases. if rmtrslv: req = req + destaddr + chr(0x00).encode() self.sendall(req) # Get the response from the server resp = self.__recvall(8) if resp[0:1] != chr(0x00).encode(): # Bad data self.close() raise GeneralProxyError((1,_generalerrors[1])) if resp[1:2] != chr(0x5A).encode(): # Server returned an error self.close() if ord(resp[1:2]) in (91, 92, 93): self.close() raise Socks4Error((ord(resp[1:2]), _socks4errors[ord(resp[1:2]) - 90])) else: raise Socks4Error((94, _socks4errors[4])) # Get the bound address/port self.__proxysockname = (socket.inet_ntoa(resp[4:]), struct.unpack(">H", resp[2:4])[0]) if rmtrslv != None: self.__proxypeername = (socket.inet_ntoa(ipaddr), destport) else: self.__proxypeername = (destaddr, destport) def __negotiatehttp(self, destaddr, destport): """__negotiatehttp(self,destaddr,destport) Negotiates a connection through an HTTP server. """ # If we need to resolve locally, we do this now if not self.__proxy[3]: addr = socket.gethostbyname(destaddr) else: addr = destaddr headers = ["CONNECT ", addr, ":", str(destport), " HTTP/1.1\r\n"] headers += ["Host: ", destaddr, "\r\n"] if (self.__proxy[4] != None and self.__proxy[5] != None): headers += [self.__getauthheader(), "\r\n"] headers.append("\r\n") self.sendall("".join(headers).encode()) # We read the response until we get the string "\r\n\r\n" resp = self.recv(1) while resp.find("\r\n\r\n".encode()) == -1: resp = resp + self.recv(1) # We just need the first line to check if the connection # was successful statusline = resp.splitlines()[0].split(" ".encode(), 2) if statusline[0] not in ("HTTP/1.0".encode(), "HTTP/1.1".encode()): self.close() raise GeneralProxyError((1, _generalerrors[1])) try: statuscode = int(statusline[1]) except ValueError: self.close() raise GeneralProxyError((1, _generalerrors[1])) if statuscode != 200: self.close() raise HTTPError((statuscode, statusline[2])) self.__proxysockname = ("0.0.0.0", 0) self.__proxypeername = (addr, destport) def connect(self, destpair): """connect(self, despair) Connects to the specified destination through a proxy. destpar - A tuple of the IP/DNS address and the port number. (identical to socket's connect). To select the proxy server use setproxy(). """ # Do a minimal input check first if (not type(destpair) in (list,tuple)) or (len(destpair) < 2) or (type(destpair[0]) != type('')) or (type(destpair[1]) != int): raise GeneralProxyError((5, _generalerrors[5])) if self.__proxy[0] == PROXY_TYPE_SOCKS5: if self.__proxy[2] != None: portnum = self.__proxy[2] else: portnum = 1080 _orgsocket.connect(self, (self.__proxy[1], portnum)) self.__negotiatesocks5(destpair[0], destpair[1]) elif self.__proxy[0] == PROXY_TYPE_SOCKS4: if self.__proxy[2] != None: portnum = self.__proxy[2] else: portnum = 1080 _orgsocket.connect(self,(self.__proxy[1], portnum)) self.__negotiatesocks4(destpair[0], destpair[1]) elif self.__proxy[0] == PROXY_TYPE_HTTP: if self.__proxy[2] != None: portnum = self.__proxy[2] else: portnum = 8080 _orgsocket.connect(self,(self.__proxy[1], portnum)) self.__negotiatehttp(destpair[0], destpair[1]) elif self.__proxy[0] == PROXY_TYPE_HTTP_NO_TUNNEL: if self.__proxy[2] != None: portnum = self.__proxy[2] else: portnum = 8080 _orgsocket.connect(self,(self.__proxy[1],portnum)) if destpair[1] == 443: self.__negotiatehttp(destpair[0],destpair[1]) else: self.__httptunnel = False elif self.__proxy[0] == None: _orgsocket.connect(self, (destpair[0], destpair[1])) else: raise GeneralProxyError((4, _generalerrors[4]))
ajibawa-2023/Python-Code-Large/train/row_99100
213
438
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_99100:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 31], "level": 0, "parent": null, "vector": [8, 0, 0.0365, 0.0708, 0, 0.66, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\"\"\"SocksiPy - Python SOCKS module.\nVersion 1.00\n\nCopyright 2006 Dan-Haim. All rights reserved.\n\nRedistribution and use in source and binary forms, with or without modification,\nare permitted provided that the following conditions are met:\n1. Redistributions of source code must retain the above copyright notice, this"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99100:Expr_L33_C0", "label": "expression", "type": "expression", "loc": [33, 41], "level": 0, "parent": null, "vector": [8, 0, 0.0845, 0.0205, 0, 0.66, 0.04, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\"\"\"\n\nMinor modifications made by Christopher Gilbert (http://motomastyle.com/)\nfor use in PyLoris (http://pyloris.sourceforge.net/)\n\nMinor modifications made by Mario Vilas (http://breakingcode.wordpress.com/)\nmainly to merge bug fixes found in Sourceforge\n"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99100:Import_L43_C0", "label": "base64 import base64", "type": "import", "loc": [43, 43], "level": 0, "parent": null, "vector": [1, 0, 0.0982, 0.0023, 0, 0.66, 0.08, 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_99100:Import_L44_C0", "label": "socket import socket", "type": "import", "loc": [44, 44], "level": 0, "parent": null, "vector": [1, 0, 0.1005, 0.0023, 0, 0.66, 0.12, 687, 0, 1, 0, 0, 687, 0, 0], "semantic": {"name": "socket", "arg_names": [], "import_names": ["socket"], "rhs_call_name": "", "annotation": ""}, "snippet": "import socket"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99100:Import_L45_C0", "label": "struct import struct", "type": "import", "loc": [45, 45], "level": 0, "parent": null, "vector": [1, 0, 0.1027, 0.0023, 0, 0.66, 0.16, 399, 0, 1, 0, 0, 399, 0, 0], "semantic": {"name": "struct", "arg_names": [], "import_names": ["struct"], "rhs_call_name": "", "annotation": ""}, "snippet": "import struct"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99100:Import_L46_C0", "label": "sys import sys", "type": "import", "loc": [46, 46], "level": 0, "parent": null, "vector": [1, 0, 0.105, 0.0023, 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_99100:If_L48_C0", "label": "if", "type": "if", "loc": [48, 49], "level": 0, "parent": null, "vector": [4, 0, 0.1107, 0.0046, 0, 0.66, 0.24, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "if getattr(socket, 'socket', None) is None:\n raise ImportError('socket.socket missing, proxy support unusable')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99100:Assign_L51_C0", "label": "PROXY_TYPE_SOCKS4 =", "type": "assigned_variable", "loc": [51, 51], "level": 0, "parent": null, "vector": [14, 0, 0.1164, 0.0023, 0, 0.66, 0.28, 737, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "PROXY_TYPE_SOCKS4", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "PROXY_TYPE_SOCKS4 = 1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99100:Assign_L52_C0", "label": "PROXY_TYPE_SOCKS5 =", "type": "assigned_variable", "loc": [52, 52], "level": 0, "parent": null, "vector": [14, 0, 0.1187, 0.0023, 0, 0.66, 0.32, 842, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "PROXY_TYPE_SOCKS5", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "PROXY_TYPE_SOCKS5 = 2"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99100:Assign_L53_C0", "label": "PROXY_TYPE_HTTP =", "type": "assigned_variable", "loc": [53, 53], "level": 0, "parent": null, "vector": [14, 0, 0.121, 0.0023, 0, 0.66, 0.36, 9, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "PROXY_TYPE_HTTP", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "PROXY_TYPE_HTTP = 3"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99100:Assign_L54_C0", "label": "PROXY_TYPE_HTTP_NO_TUNNEL =", "type": "assigned_variable", "loc": [54, 54], "level": 0, "parent": null, "vector": [14, 0, 0.1233, 0.0023, 0, 0.66, 0.4, 308, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "PROXY_TYPE_HTTP_NO_TUNNEL", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "PROXY_TYPE_HTTP_NO_TUNNEL = 4"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99100:Assign_L56_C0", "label": "_defaultproxy =", "type": "assigned_variable", "loc": [56, 56], "level": 0, "parent": null, "vector": [14, 0, 0.1279, 0.0023, 0, 0.66, 0.44, 940, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "_defaultproxy", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "_defaultproxy = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99100:Assign_L57_C0", "label": "_orgsocket =", "type": "assigned_variable", "loc": [57, 57], "level": 0, "parent": null, "vector": [14, 0, 0.1301, 0.0023, 0, 0.66, 0.48, 134, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "_orgsocket", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "_orgsocket = socket.socket"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99100:ClassDef_L59_C0", "label": "ProxyError", "type": "class", "loc": [59, 59], "level": 0, "parent": null, "vector": [3, 0, 0.1347, 0.0023, 0, 0.66, 0.52, 576, 0, 0, 0, 0, 645, 0, 0], "semantic": {"name": "ProxyError", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class ProxyError(Exception): pass"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99100:ClassDef_L60_C0", "label": "GeneralProxyError", "type": "class", "loc": [60, 60], "level": 0, "parent": null, "vector": [3, 0, 0.137, 0.0023, 0, 0.66, 0.56, 185, 0, 0, 0, 0, 576, 0, 0], "semantic": {"name": "GeneralProxyError", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class GeneralProxyError(ProxyError): pass"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99100:ClassDef_L61_C0", "label": "Socks5AuthError", "type": "class", "loc": [61, 61], "level": 0, "parent": null, "vector": [3, 0, 0.1393, 0.0023, 0, 0.66, 0.6, 18, 0, 0, 0, 0, 576, 0, 0], "semantic": {"name": "Socks5AuthError", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class Socks5AuthError(ProxyError): pass"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99100:ClassDef_L62_C0", "label": "Socks5Error", "type": "class", "loc": [62, 62], "level": 0, "parent": null, "vector": [3, 0, 0.1416, 0.0023, 0, 0.66, 0.64, 546, 0, 0, 0, 0, 576, 0, 0], "semantic": {"name": "Socks5Error", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class Socks5Error(ProxyError): pass"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99100:ClassDef_L63_C0", "label": "Socks4Error", "type": "class", "loc": [63, 63], "level": 0, "parent": null, "vector": [3, 0, 0.1438, 0.0023, 0, 0.66, 0.68, 446, 0, 0, 0, 0, 576, 0, 0], "semantic": {"name": "Socks4Error", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class Socks4Error(ProxyError): pass"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99100:ClassDef_L64_C0", "label": "HTTPError", "type": "class", "loc": [64, 64], "level": 0, "parent": null, "vector": [3, 0, 0.1461, 0.0023, 0, 0.66, 0.72, 880, 0, 0, 0, 0, 576, 0, 0], "semantic": {"name": "HTTPError", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class HTTPError(ProxyError): pass"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99100:Assign_L66_C0", "label": "_generalerrors =", "type": "assigned_variable", "loc": [66, 71], "level": 0, "parent": null, "vector": [14, 0, 0.1564, 0.0137, 0, 0.66, 0.76, 243, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "_generalerrors", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "_generalerrors = (\"success\",\n \"invalid data\",\n \"not connected\",\n \"not available\",\n \"bad proxy type\",\n \"bad input\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99100:Assign_L73_C0", "label": "_socks5errors =", "type": "assigned_variable", "loc": [73, 82], "level": 0, "parent": null, "vector": [14, 0, 0.1769, 0.0228, 0, 0.66, 0.8, 9, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "_socks5errors", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "_socks5errors = (\"succeeded\",\n \"general SOCKS server failure\",\n \"connection not allowed by ruleset\",\n \"Network unreachable\",\n \"Host unreachable\",\n \"Connection refused\",\n \"TTL expired\",\n \"Command not supported\","}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99100:Assign_L84_C0", "label": "_socks5autherrors =", "type": "assigned_variable", "loc": [84, 88], "level": 0, "parent": null, "vector": [14, 0, 0.1963, 0.0114, 0, 0.66, 0.84, 571, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "_socks5autherrors", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "_socks5autherrors = (\"succeeded\",\n \"authentication is required\",\n \"all offered authentication methods were rejected\",\n \"unknown username or invalid password\",\n \"unknown error\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99100:Assign_L90_C0", "label": "_socks4errors =", "type": "assigned_variable", "loc": [90, 94], "level": 0, "parent": null, "vector": [14, 0, 0.21, 0.0114, 0, 0.66, 0.88, 965, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "_socks4errors", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "_socks4errors = (\"request granted\",\n \"request rejected or failed\",\n \"request rejected because SOCKS server cannot connect to identd on the client\",\n \"request rejected because the client program and identd report different user-ids\",\n \"unknown error\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99100:FunctionDef_L96_C0", "label": "setdefaultproxy", "type": "function", "loc": [96, 102], "level": 0, "parent": null, "vector": [2, 0, 0.226, 0.016, 0, 0.66, 0.92, 203, 0, 6, 0, 0, 0, 0, 0], "semantic": {"name": "setdefaultproxy", "arg_names": ["proxytype", "addr", "port", "rdns", "username", "password"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def setdefaultproxy(proxytype=None, addr=None, port=None, rdns=True, username=None, password=None):\n \"\"\"setdefaultproxy(proxytype, addr[, port[, rdns[, username[, password]]]])\n Sets a default proxy which all further socksocket objects will use,\n unless explicitly changed.\n \"\"\"\n global _defaultproxy\n _defaultproxy = (proxytype, addr, port, rdns, username, password)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99100:Expr_L97_C4", "label": "expression", "type": "expression", "loc": [97, 100], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99100:FunctionDef_L96_C0", "vector": [8, 1, 0.2249, 0.0091, 1, 0.85, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"setdefaultproxy(proxytype, addr[, port[, rdns[, username[, password]]]])\n Sets a default proxy which all further socksocket objects will use,\n unless explicitly changed.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99100:Assign_L102_C4", "label": "_defaultproxy =", "type": "assigned_variable", "loc": [102, 102], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99100:FunctionDef_L96_C0", "vector": [14, 1, 0.2329, 0.0023, 1, 0.85, 1.0, 940, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "_defaultproxy", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " _defaultproxy = (proxytype, addr, port, rdns, username, password)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99100:FunctionDef_L104_C0", "label": "wrapmodule", "type": "function", "loc": [104, 114], "level": 0, "parent": null, "vector": [2, 0, 0.2489, 0.0251, 0, 0.66, 0.96, 174, 0, 1, 0, 0, 0, 0, 1], "semantic": {"name": "wrapmodule", "arg_names": ["module"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def wrapmodule(module):\n \"\"\"wrapmodule(module)\n Attempts to replace a module's socket library with a SOCKS socket. Must set\n a default proxy using setdefaultproxy(...) first.\n This will only work on modules that import socket directly into the namespace;\n most of the Python Standard Library falls into this category.\n \"\"\"\n if _defaultproxy != None:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99100:Expr_L105_C4", "label": "expression", "type": "expression", "loc": [105, 110], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99100:FunctionDef_L104_C0", "vector": [8, 1, 0.2454, 0.0137, 1, 0.55, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"wrapmodule(module)\n Attempts to replace a module's socket library with a SOCKS socket. Must set\n a default proxy using setdefaultproxy(...) first.\n This will only work on modules that import socket directly into the namespace;\n most of the Python Standard Library falls into this category.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99100:If_L111_C4", "label": "if", "type": "if", "loc": [111, 114], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99100:FunctionDef_L104_C0", "vector": [4, 1, 0.2568, 0.0091, 1, 0.55, 1.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if _defaultproxy != None:\n module.socket.socket = socksocket\n else:\n raise GeneralProxyError((4, \"no proxy specified\"))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99100:Assign_L112_C8", "label": "module.socket.socket =", "type": "assigned_variable", "loc": [112, 112], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99100:If_L111_C4", "vector": [14, 2, 0.2557, 0.0023, 2, 0.53, 0.0, 77, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "module.socket.socket", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " module.socket.socket = socksocket"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99100:ClassDef_L116_C0", "label": "socksocket", "type": "class", "loc": [116, 438], "level": 0, "parent": null, "vector": [3, 0, 0.6324, 0.7374, 0, 0.66, 1.0, 28, 0, 13, 0, 0, 986, 0, 99], "semantic": {"name": "socksocket", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class socksocket(socket.socket):\n \"\"\"socksocket([family[, type[, proto]]]) -> socket object\n Open a SOCKS enabled socket. The parameters are the same as\n those of the standard socket init. In order for SOCKS to work,\n you must specify family=AF_INET, type=SOCK_STREAM and proto=0.\n \"\"\"\n\n def __init__(self, family=socket.AF_INET, type=socket.SOCK_STREAM, proto=0, _sock=None):"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99100:Expr_L117_C4", "label": "expression", "type": "expression", "loc": [117, 121], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99100:ClassDef_L116_C0", "vector": [8, 1, 0.2717, 0.0114, 1, 0.88, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"socksocket([family[, type[, proto]]]) -> socket object\n Open a SOCKS enabled socket. The parameters are the same as\n those of the standard socket init. In order for SOCKS to work,\n you must specify family=AF_INET, type=SOCK_STREAM and proto=0.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99100:FunctionDef_L123_C4", "label": "__init__", "type": "function", "loc": [123, 131], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99100:ClassDef_L116_C0", "vector": [2, 1, 0.29, 0.0205, 1, 0.88, 0.0769, 555, 0, 5, 0, 0, 0, 0, 1], "semantic": {"name": "__init__", "arg_names": ["self", "family", "type", "proto", "_sock"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, family=socket.AF_INET, type=socket.SOCK_STREAM, proto=0, _sock=None):\n _orgsocket.__init__(self, family, type, proto, _sock)\n if _defaultproxy != None:\n self.__proxy = _defaultproxy\n else:\n self.__proxy = (None, None, None, None, None, None)\n self.__proxysockname = None\n self.__proxypeername = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99100:Expr_L124_C8", "label": "__init__()", "type": "expression", "loc": [124, 124], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99100:FunctionDef_L123_C4", "vector": [8, 2, 0.2831, 0.0023, 2, 0.65, 0.0, 555, 3, 5, 0, 0, 0, 0, 1], "semantic": {"name": "__init__", "arg_names": [], "import_names": [], "rhs_call_name": "__init__", "annotation": ""}, "snippet": " _orgsocket.__init__(self, family, type, proto, _sock)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99100:If_L125_C8", "label": "if", "type": "if", "loc": [125, 128], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99100:FunctionDef_L123_C4", "vector": [4, 2, 0.2888, 0.0091, 2, 0.65, 0.25, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if _defaultproxy != None:\n self.__proxy = _defaultproxy\n else:\n self.__proxy = (None, None, None, None, None, None)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99100:Assign_L126_C12", "label": "self.__proxy =", "type": "assigned_variable", "loc": [126, 126], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99100:If_L125_C8", "vector": [14, 3, 0.2877, 0.0023, 3, 0.02, 0.0, 322, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.__proxy", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.__proxy = _defaultproxy"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99100:Assign_L128_C12", "label": "self.__proxy =", "type": "assigned_variable", "loc": [128, 128], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99100:If_L125_C8", "vector": [14, 3, 0.2922, 0.0023, 3, 0.02, 1.0, 322, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "self.__proxy", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.__proxy = (None, None, None, None, None, None)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99100:Assign_L129_C8", "label": "self.__proxysockname =", "type": "assigned_variable", "loc": [129, 129], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99100:FunctionDef_L123_C4", "vector": [14, 2, 0.2945, 0.0023, 2, 0.65, 0.5, 335, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "self.__proxysockname", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.__proxysockname = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99100:Assign_L130_C8", "label": "self.__proxypeername =", "type": "assigned_variable", "loc": [130, 130], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99100:FunctionDef_L123_C4", "vector": [14, 2, 0.2968, 0.0023, 2, 0.65, 0.75, 763, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "self.__proxypeername", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.__proxypeername = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99100:Assign_L131_C8", "label": "self.__httptunnel =", "type": "assigned_variable", "loc": [131, 131], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99100:FunctionDef_L123_C4", "vector": [14, 2, 0.2991, 0.0023, 2, 0.65, 1.0, 470, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "self.__httptunnel", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.__httptunnel = True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99100:FunctionDef_L133_C4", "label": "__recvall", "type": "function", "loc": [133, 143], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99100:ClassDef_L116_C0", "vector": [2, 1, 0.3151, 0.0251, 1, 0.88, 0.1538, 782, 0, 2, 1, 0, 0, 0, 5], "semantic": {"name": "__recvall", "arg_names": ["self", "count"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __recvall(self, count):\n \"\"\"__recvall(count) -> data\n Receive EXACTLY the number of bytes requested from the socket.\n Blocks until the required number of bytes have been received.\n \"\"\"\n data = self.recv(count)\n while len(data) < count:\n d = self.recv(count-len(data))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99100:Expr_L134_C8", "label": "expression", "type": "expression", "loc": [134, 137], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99100:FunctionDef_L133_C4", "vector": [8, 2, 0.3094, 0.0091, 2, 0.0, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"__recvall(count) -> data\n Receive EXACTLY the number of bytes requested from the socket.\n Blocks until the required number of bytes have been received.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99100:Assign_L138_C8", "label": "data = recv()", "type": "assigned_variable", "loc": [138, 138], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99100:FunctionDef_L133_C4", "vector": [14, 2, 0.3151, 0.0023, 2, 0.0, 0.3333, 929, 3, 1, 0, 0, 178, 10, 1], "semantic": {"name": "data", "arg_names": [], "import_names": [], "rhs_call_name": "recv", "annotation": ""}, "snippet": " data = self.recv(count)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99100:While_L139_C8", "label": "while", "type": "while", "loc": [139, 142], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99100:FunctionDef_L133_C4", "vector": [5, 2, 0.3208, 0.0091, 2, 0.0, 0.6667, 0, 0, 0, 0, 0, 0, 0, 4], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " while len(data) < count:\n d = self.recv(count-len(data))\n if not d: raise GeneralProxyError((0, \"connection closed unexpectedly\"))\n data = data + d"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99100:Assign_L140_C12", "label": "d = recv()", "type": "assigned_variable", "loc": [140, 140], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99100:While_L139_C8", "vector": [14, 3, 0.3196, 0.0023, 3, 0.51, 0.0, 355, 3, 1, 0, 0, 178, 10, 2], "semantic": {"name": "d", "arg_names": [], "import_names": [], "rhs_call_name": "recv", "annotation": ""}, "snippet": " d = self.recv(count-len(data))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99100:If_L141_C12", "label": "if", "type": "if", "loc": [141, 141], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99100:While_L139_C8", "vector": [4, 3, 0.3219, 0.0023, 3, 0.51, 0.5, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not d: raise GeneralProxyError((0, \"connection closed unexpectedly\"))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99100:Assign_L142_C12", "label": "data =", "type": "assigned_variable", "loc": [142, 142], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99100:While_L139_C8", "vector": [14, 3, 0.3242, 0.0023, 3, 0.51, 1.0, 929, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "data", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " data = data + d"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99100:Return_L143_C8", "label": "return", "type": "return", "loc": [143, 143], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99100:FunctionDef_L133_C4", "vector": [13, 2, 0.3265, 0.0023, 2, 0.0, 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_99100:FunctionDef_L145_C4", "label": "sendall", "type": "function", "loc": [145, 151], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99100:ClassDef_L116_C0", "vector": [2, 1, 0.3379, 0.016, 1, 0.88, 0.2308, 874, 0, 3, 1, 0, 0, 0, 3], "semantic": {"name": "sendall", "arg_names": ["self", "content", "args"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def sendall(self, content, *args):\n \"\"\" override socket.socket.sendall method to rewrite the header \n for non-tunneling proxies if needed \n \"\"\"\n if not self.__httptunnel:\n content = self.__rewriteproxy(content)\n return super(socksocket, self).sendall(content, *args)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99100:Expr_L146_C8", "label": "expression", "type": "expression", "loc": [146, 148], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99100:FunctionDef_L145_C4", "vector": [8, 2, 0.3356, 0.0068, 2, 0.58, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\" override socket.socket.sendall method to rewrite the header \n for non-tunneling proxies if needed \n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99100:If_L149_C8", "label": "if", "type": "if", "loc": [149, 150], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99100:FunctionDef_L145_C4", "vector": [4, 2, 0.3413, 0.0046, 2, 0.58, 0.5, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not self.__httptunnel:\n content = self.__rewriteproxy(content)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99100:Assign_L150_C12", "label": "content = __rewriteproxy()", "type": "assigned_variable", "loc": [150, 150], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99100:If_L149_C8", "vector": [14, 3, 0.3425, 0.0023, 3, 0.32, 0.0, 273, 3, 1, 0, 0, 244, 10, 1], "semantic": {"name": "content", "arg_names": [], "import_names": [], "rhs_call_name": "__rewriteproxy", "annotation": ""}, "snippet": " content = self.__rewriteproxy(content)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99100:Return_L151_C8", "label": "return", "type": "return", "loc": [151, 151], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99100:FunctionDef_L145_C4", "vector": [13, 2, 0.3447, 0.0023, 2, 0.58, 1.0, 0, 3, 0, 0, 0, 0, 10, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return super(socksocket, self).sendall(content, *args)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99100:FunctionDef_L153_C4", "label": "__rewriteproxy", "type": "function", "loc": [153, 174], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99100:ClassDef_L116_C0", "vector": [2, 1, 0.3733, 0.0502, 1, 0.88, 0.3077, 244, 0, 2, 1, 0, 0, 0, 16], "semantic": {"name": "__rewriteproxy", "arg_names": ["self", "header"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __rewriteproxy(self, header):\n \"\"\" rewrite HTTP request headers to support non-tunneling proxies \n (i.e. those which do not support the CONNECT method).\n This only works for HTTP (not HTTPS) since HTTPS requires tunneling.\n \"\"\"\n host, endpt = None, None\n hdrs = header.split(\"\\r\\n\")\n for hdr in hdrs:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99100:Expr_L154_C8", "label": "expression", "type": "expression", "loc": [154, 157], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99100:FunctionDef_L153_C4", "vector": [8, 2, 0.355, 0.0091, 2, 0.14, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\" rewrite HTTP request headers to support non-tunneling proxies \n (i.e. those which do not support the CONNECT method).\n This only works for HTTP (not HTTPS) since HTTPS requires tunneling.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99100:Assign_L158_C8", "label": "host, endpt =", "type": "assigned_variable", "loc": [158, 158], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99100:FunctionDef_L153_C4", "vector": [14, 2, 0.3607, 0.0023, 2, 0.14, 0.2, 281, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "host, endpt", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " host, endpt = None, None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99100:Assign_L159_C8", "label": "hdrs = split()", "type": "assigned_variable", "loc": [159, 159], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99100:FunctionDef_L153_C4", "vector": [14, 2, 0.363, 0.0023, 2, 0.14, 0.4, 36, 3, 1, 0, 0, 908, 10, 1], "semantic": {"name": "hdrs", "arg_names": [], "import_names": [], "rhs_call_name": "split", "annotation": ""}, "snippet": " hdrs = header.split(\"\\r\\n\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99100:For_L160_C8", "label": "for hdr", "type": "for", "loc": [160, 164], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99100:FunctionDef_L153_C4", "vector": [6, 2, 0.3699, 0.0114, 2, 0.14, 0.6, 17, 2, 0, 0, 0, 0, 0, 6], "semantic": {"name": "hdr", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for hdr in hdrs:\n if hdr.lower().startswith(\"host:\"):\n host = hdr\n elif hdr.lower().startswith(\"get\") or hdr.lower().startswith(\"post\"):\n endpt = hdr"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99100:If_L161_C12", "label": "if", "type": "if", "loc": [161, 164], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99100:For_L160_C8", "vector": [4, 3, 0.371, 0.0091, 3, 0.77, 0.0, 0, 3, 0, 0, 0, 0, 0, 6], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if hdr.lower().startswith(\"host:\"):\n host = hdr\n elif hdr.lower().startswith(\"get\") or hdr.lower().startswith(\"post\"):\n endpt = hdr"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99100:Assign_L162_C16", "label": "host =", "type": "assigned_variable", "loc": [162, 162], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99100:If_L161_C12", "vector": [14, 4, 0.3699, 0.0023, 4, 0.5, 0.0, 867, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "host", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " host = hdr"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99100:If_L163_C12", "label": "if", "type": "if", "loc": [163, 164], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99100:If_L161_C12", "vector": [4, 4, 0.3733, 0.0046, 4, 0.5, 1.0, 0, 0, 0, 0, 0, 0, 0, 4], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " elif hdr.lower().startswith(\"get\") or hdr.lower().startswith(\"post\"):\n endpt = hdr"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99100:Assign_L164_C16", "label": "endpt =", "type": "assigned_variable", "loc": [164, 164], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99100:If_L163_C12", "vector": [14, 5, 0.3744, 0.0023, 5, 0.34, 0.0, 391, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "endpt", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " endpt = hdr"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99100:If_L165_C8", "label": "if", "type": "if", "loc": [165, 173], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99100:FunctionDef_L153_C4", "vector": [4, 2, 0.3858, 0.0205, 2, 0.14, 0.8, 0, 0, 0, 0, 0, 0, 0, 8], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if host and endpt: \n hdrs.remove(host)\n hdrs.remove(endpt)\n host = host.split(\" \")[1]\n endpt = endpt.split(\" \")\n if (self.__proxy[4] != None and self.__proxy[5] != None):\n hdrs.insert(0, self.__getauthheader())\n hdrs.insert(0, \"Host: %s\" % host)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99100:Expr_L166_C12", "label": "remove()", "type": "expression", "loc": [166, 166], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99100:If_L165_C8", "vector": [8, 3, 0.379, 0.0023, 3, 0.42, 0.0, 185, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "remove", "arg_names": [], "import_names": [], "rhs_call_name": "remove", "annotation": ""}, "snippet": " hdrs.remove(host)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99100:Expr_L167_C12", "label": "remove()", "type": "expression", "loc": [167, 167], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99100:If_L165_C8", "vector": [8, 3, 0.3813, 0.0023, 3, 0.42, 0.1667, 185, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "remove", "arg_names": [], "import_names": [], "rhs_call_name": "remove", "annotation": ""}, "snippet": " hdrs.remove(endpt)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99100:Assign_L168_C12", "label": "host =", "type": "assigned_variable", "loc": [168, 168], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99100:If_L165_C8", "vector": [14, 3, 0.3836, 0.0023, 3, 0.42, 0.3333, 867, 6, 0, 0, 0, 0, 0, 1], "semantic": {"name": "host", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " host = host.split(\" \")[1]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99100:Assign_L169_C12", "label": "endpt = split()", "type": "assigned_variable", "loc": [169, 169], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99100:If_L165_C8", "vector": [14, 3, 0.3858, 0.0023, 3, 0.42, 0.5, 391, 3, 1, 0, 0, 908, 10, 1], "semantic": {"name": "endpt", "arg_names": [], "import_names": [], "rhs_call_name": "split", "annotation": ""}, "snippet": " endpt = endpt.split(\" \")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99100:If_L170_C12", "label": "if", "type": "if", "loc": [170, 171], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99100:If_L165_C8", "vector": [4, 3, 0.3893, 0.0046, 3, 0.42, 0.6667, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if (self.__proxy[4] != None and self.__proxy[5] != None):\n hdrs.insert(0, self.__getauthheader())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99100:Expr_L171_C16", "label": "insert()", "type": "expression", "loc": [171, 171], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99100:If_L170_C12", "vector": [8, 4, 0.3904, 0.0023, 4, 0.63, 0.0, 368, 3, 2, 0, 0, 0, 0, 2], "semantic": {"name": "insert", "arg_names": [], "import_names": [], "rhs_call_name": "insert", "annotation": ""}, "snippet": " hdrs.insert(0, self.__getauthheader())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99100:Expr_L172_C12", "label": "insert()", "type": "expression", "loc": [172, 172], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99100:If_L165_C8", "vector": [8, 3, 0.3927, 0.0023, 3, 0.42, 0.8333, 368, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "insert", "arg_names": [], "import_names": [], "rhs_call_name": "insert", "annotation": ""}, "snippet": " hdrs.insert(0, \"Host: %s\" % host)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99100:Expr_L173_C12", "label": "insert()", "type": "expression", "loc": [173, 173], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99100:If_L165_C8", "vector": [8, 3, 0.395, 0.0023, 3, 0.42, 1.0, 368, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "insert", "arg_names": [], "import_names": [], "rhs_call_name": "insert", "annotation": ""}, "snippet": " hdrs.insert(0, \"%s http://%s%s %s\" % (endpt[0], host, endpt[1], endpt[2]))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99100:Return_L174_C8", "label": "return", "type": "return", "loc": [174, 174], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99100:FunctionDef_L153_C4", "vector": [13, 2, 0.3973, 0.0023, 2, 0.14, 1.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return \"\\r\\n\".join(hdrs)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99100:FunctionDef_L176_C4", "label": "__getauthheader", "type": "function", "loc": [176, 178], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99100:ClassDef_L116_C0", "vector": [2, 1, 0.4041, 0.0068, 1, 0.88, 0.3846, 626, 0, 1, 1, 0, 0, 0, 1], "semantic": {"name": "__getauthheader", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __getauthheader(self):\n auth = self.__proxy[4] + \":\" + self.__proxy[5]\n return \"Proxy-Authorization: Basic \" + base64.b64encode(auth)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99100:Assign_L177_C8", "label": "auth =", "type": "assigned_variable", "loc": [177, 177], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99100:FunctionDef_L176_C4", "vector": [14, 2, 0.4041, 0.0023, 2, 0.99, 0.0, 280, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "auth", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " auth = self.__proxy[4] + \":\" + self.__proxy[5]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99100:Return_L178_C8", "label": "return", "type": "return", "loc": [178, 178], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99100:FunctionDef_L176_C4", "vector": [13, 2, 0.4064, 0.0023, 2, 0.99, 1.0, 0, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return \"Proxy-Authorization: Basic \" + base64.b64encode(auth)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99100:FunctionDef_L180_C4", "label": "setproxy", "type": "function", "loc": [180, 197], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99100:ClassDef_L116_C0", "vector": [2, 1, 0.4304, 0.0411, 1, 0.88, 0.4615, 19, 0, 7, 0, 0, 0, 0, 0], "semantic": {"name": "setproxy", "arg_names": ["self", "proxytype", "addr", "port", "rdns", "username", "password"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def setproxy(self, proxytype=None, addr=None, port=None, rdns=True, username=None, password=None):\n \"\"\"setproxy(proxytype, addr[, port[, rdns[, username[, password]]]])\n Sets the proxy to be used.\n proxytype - The type of the proxy to be used. Three types\n are supported: PROXY_TYPE_SOCKS4 (including socks4a),\n PROXY_TYPE_SOCKS5 and PROXY_TYPE_HTTP\n addr - The address of the server (IP or DNS).\n port - The port of the server. Defaults to 1080 for SOCKS"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99100:Expr_L181_C8", "label": "expression", "type": "expression", "loc": [181, 196], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99100:FunctionDef_L180_C4", "vector": [8, 2, 0.4304, 0.0365, 2, 0.52, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"setproxy(proxytype, addr[, port[, rdns[, username[, password]]]])\n Sets the proxy to be used.\n proxytype - The type of the proxy to be used. Three types\n are supported: PROXY_TYPE_SOCKS4 (including socks4a),\n PROXY_TYPE_SOCKS5 and PROXY_TYPE_HTTP\n addr - The address of the server (IP or DNS).\n port - The port of the server. Defaults to 1080 for SOCKS\n servers and 8080 for HTTP proxy servers."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99100:Assign_L197_C8", "label": "self.__proxy =", "type": "assigned_variable", "loc": [197, 197], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99100:FunctionDef_L180_C4", "vector": [14, 2, 0.4498, 0.0023, 2, 0.52, 1.0, 322, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "self.__proxy", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.__proxy = (proxytype, addr, port, rdns, username, password)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99100:FunctionDef_L199_C4", "label": "__negotiatesocks5", "type": "function", "loc": [199, 289], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99100:ClassDef_L116_C0", "vector": [2, 1, 0.5571, 0.2078, 1, 0.88, 0.5385, 924, 0, 3, 0, 0, 0, 0, 75], "semantic": {"name": "__negotiatesocks5", "arg_names": ["self", "destaddr", "destport"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __negotiatesocks5(self, destaddr, destport):\n \"\"\"__negotiatesocks5(self,destaddr,destport)\n Negotiates a connection through a SOCKS5 server.\n \"\"\"\n # First we'll send the authentication packages we support.\n if (self.__proxy[4]!=None) and (self.__proxy[5]!=None):\n # The username/password details were supplied to the\n # setproxy method so we support the USERNAME/PASSWORD"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99100:Expr_L200_C8", "label": "expression", "type": "expression", "loc": [200, 202], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99100:FunctionDef_L199_C4", "vector": [8, 2, 0.4589, 0.0068, 2, 0.94, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"__negotiatesocks5(self,destaddr,destport)\n Negotiates a connection through a SOCKS5 server.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99100:If_L204_C8", "label": "if", "type": "if", "loc": [204, 212], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99100:FunctionDef_L199_C4", "vector": [4, 2, 0.4749, 0.0205, 2, 0.94, 0.0769, 0, 0, 0, 0, 0, 0, 0, 4], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if (self.__proxy[4]!=None) and (self.__proxy[5]!=None):\n # The username/password details were supplied to the\n # setproxy method so we support the USERNAME/PASSWORD\n # authentication (in addition to the standard none).\n self.sendall(struct.pack('BBBB', 0x05, 0x02, 0x00, 0x02))\n else:\n # No username/password were entered, therefore we\n # only support connections with no authentication."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99100:Expr_L208_C12", "label": "sendall()", "type": "expression", "loc": [208, 208], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99100:If_L204_C8", "vector": [8, 3, 0.4749, 0.0023, 3, 0.27, 0.0, 874, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "sendall", "arg_names": [], "import_names": [], "rhs_call_name": "sendall", "annotation": ""}, "snippet": " self.sendall(struct.pack('BBBB', 0x05, 0x02, 0x00, 0x02))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99100:Expr_L212_C12", "label": "sendall()", "type": "expression", "loc": [212, 212], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99100:If_L204_C8", "vector": [8, 3, 0.484, 0.0023, 3, 0.27, 1.0, 874, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "sendall", "arg_names": [], "import_names": [], "rhs_call_name": "sendall", "annotation": ""}, "snippet": " self.sendall(struct.pack('BBB', 0x05, 0x01, 0x00))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99100:Assign_L215_C8", "label": "chosenauth = __recvall()", "type": "assigned_variable", "loc": [215, 215], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99100:FunctionDef_L199_C4", "vector": [14, 2, 0.4909, 0.0023, 2, 0.94, 0.1538, 509, 3, 1, 0, 0, 782, 10, 1], "semantic": {"name": "chosenauth", "arg_names": [], "import_names": [], "rhs_call_name": "__recvall", "annotation": ""}, "snippet": " chosenauth = self.__recvall(2)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99100:If_L216_C8", "label": "if", "type": "if", "loc": [216, 218], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99100:FunctionDef_L199_C4", "vector": [4, 2, 0.4954, 0.0068, 2, 0.94, 0.2308, 0, 0, 0, 0, 0, 0, 0, 4], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if chosenauth[0:1] != chr(0x05).encode():\n self.close()\n raise GeneralProxyError((1, _generalerrors[1]))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99100:Expr_L217_C12", "label": "close()", "type": "expression", "loc": [217, 217], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99100:If_L216_C8", "vector": [8, 3, 0.4954, 0.0023, 3, 0.3, 0.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_99100:If_L220_C8", "label": "if", "type": "if", "loc": [220, 243], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99100:FunctionDef_L199_C4", "vector": [4, 2, 0.5285, 0.0548, 2, 0.94, 0.3077, 0, 0, 0, 0, 0, 0, 0, 25], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if chosenauth[1:2] == chr(0x00).encode():\n # No authentication is required\n pass\n elif chosenauth[1:2] == chr(0x02).encode():\n # Okay, we need to perform a basic username/password\n # authentication.\n self.sendall(chr(0x01).encode() + chr(len(self.__proxy[4])) + self.__proxy[4] + chr(len(self.__proxy[5])) + self.__proxy[5])\n authstat = self.__recvall(2)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99100:If_L223_C8", "label": "if", "type": "if", "loc": [223, 243], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99100:If_L220_C8", "vector": [4, 3, 0.532, 0.0479, 3, 0.98, 0.0, 0, 0, 0, 0, 0, 0, 0, 23], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " elif chosenauth[1:2] == chr(0x02).encode():\n # Okay, we need to perform a basic username/password\n # authentication.\n self.sendall(chr(0x01).encode() + chr(len(self.__proxy[4])) + self.__proxy[4] + chr(len(self.__proxy[5])) + self.__proxy[5])\n authstat = self.__recvall(2)\n if authstat[0:1] != chr(0x01).encode():\n # Bad response\n self.close()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99100:Expr_L226_C12", "label": "sendall()", "type": "expression", "loc": [226, 226], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99100:If_L223_C8", "vector": [8, 4, 0.516, 0.0023, 4, 0.03, 0.0, 874, 3, 1, 0, 0, 0, 0, 7], "semantic": {"name": "sendall", "arg_names": [], "import_names": [], "rhs_call_name": "sendall", "annotation": ""}, "snippet": " self.sendall(chr(0x01).encode() + chr(len(self.__proxy[4])) + self.__proxy[4] + chr(len(self.__proxy[5])) + self.__proxy[5])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99100:Assign_L227_C12", "label": "authstat = __recvall()", "type": "assigned_variable", "loc": [227, 227], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99100:If_L223_C8", "vector": [14, 4, 0.5183, 0.0023, 4, 0.03, 0.2, 759, 3, 1, 0, 0, 782, 10, 1], "semantic": {"name": "authstat", "arg_names": [], "import_names": [], "rhs_call_name": "__recvall", "annotation": ""}, "snippet": " authstat = self.__recvall(2)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99100:If_L228_C12", "label": "if", "type": "if", "loc": [228, 231], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99100:If_L223_C8", "vector": [4, 4, 0.524, 0.0091, 4, 0.03, 0.4, 0, 0, 0, 0, 0, 0, 0, 4], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if authstat[0:1] != chr(0x01).encode():\n # Bad response\n self.close()\n raise GeneralProxyError((1, _generalerrors[1]))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99100:Expr_L230_C16", "label": "close()", "type": "expression", "loc": [230, 230], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99100:If_L228_C12", "vector": [8, 5, 0.5251, 0.0023, 5, 0.72, 0.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_99100:If_L232_C12", "label": "if", "type": "if", "loc": [232, 235], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99100:If_L223_C8", "vector": [4, 4, 0.5331, 0.0091, 4, 0.03, 0.6, 0, 0, 0, 0, 0, 0, 0, 4], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if authstat[1:2] != chr(0x00).encode():\n # Authentication failed\n self.close()\n raise Socks5AuthError((3, _socks5autherrors[3]))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99100:Expr_L234_C16", "label": "close()", "type": "expression", "loc": [234, 234], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99100:If_L232_C12", "vector": [8, 5, 0.5342, 0.0023, 5, 0.94, 0.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_99100:Expr_L239_C12", "label": "close()", "type": "expression", "loc": [239, 239], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99100:If_L223_C8", "vector": [8, 4, 0.5457, 0.0023, 4, 0.03, 0.8, 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_99100:If_L240_C12", "label": "if", "type": "if", "loc": [240, 243], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99100:If_L223_C8", "vector": [4, 4, 0.5514, 0.0091, 4, 0.03, 1.0, 0, 0, 0, 0, 0, 0, 0, 4], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if chosenauth[1] == chr(0xFF).encode():\n raise Socks5AuthError((2, _socks5autherrors[2]))\n else:\n raise GeneralProxyError((1, _generalerrors[1]))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99100:Assign_L245_C8", "label": "req = pack()", "type": "assigned_variable", "loc": [245, 245], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99100:FunctionDef_L199_C4", "vector": [14, 2, 0.5594, 0.0023, 2, 0.94, 0.3846, 233, 3, 4, 0, 0, 742, 10, 1], "semantic": {"name": "req", "arg_names": [], "import_names": [], "rhs_call_name": "pack", "annotation": ""}, "snippet": " req = struct.pack('BBB', 0x05, 0x01, 0x00)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99100:Try_L248_C8", "label": "try", "type": "try", "loc": [248, 260], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99100:FunctionDef_L199_C4", "vector": [7, 2, 0.5799, 0.0297, 2, 0.94, 0.4615, 0, 0, 1, 0, 0, 0, 0, 12], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " try:\n ipaddr = socket.inet_aton(destaddr)\n req = req + chr(0x01).encode() + ipaddr\n except socket.error:\n # Well it's not an IP number, so it's probably a DNS name.\n if self.__proxy[3]:\n # Resolve remotely\n ipaddr = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99100:Assign_L249_C12", "label": "ipaddr = inet_aton()", "type": "assigned_variable", "loc": [249, 249], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99100:Try_L248_C8", "vector": [14, 3, 0.5685, 0.0023, 3, 0.03, 0.0, 522, 3, 1, 0, 0, 53, 10, 1], "semantic": {"name": "ipaddr", "arg_names": [], "import_names": [], "rhs_call_name": "inet_aton", "annotation": ""}, "snippet": " ipaddr = socket.inet_aton(destaddr)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99100:Assign_L250_C12", "label": "req =", "type": "assigned_variable", "loc": [250, 250], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99100:Try_L248_C8", "vector": [14, 3, 0.5708, 0.0023, 3, 0.03, 1.0, 233, 4, 0, 0, 0, 0, 0, 2], "semantic": {"name": "req", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " req = req + chr(0x01).encode() + ipaddr"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99100:If_L253_C12", "label": "if", "type": "if", "loc": [253, 260], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99100:Try_L248_C8", "vector": [4, 3, 0.5856, 0.0183, 3, 0.03, 0.0, 0, 6, 0, 0, 0, 0, 0, 9], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self.__proxy[3]:\n # Resolve remotely\n ipaddr = None\n req = req + chr(0x03).encode() + chr(len(destaddr)).encode() + destaddr\n else:\n # Resolve locally\n ipaddr = socket.inet_aton(socket.gethostbyname(destaddr))\n req = req + chr(0x01).encode() + ipaddr"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99100:Assign_L255_C16", "label": "ipaddr =", "type": "assigned_variable", "loc": [255, 255], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99100:If_L253_C12", "vector": [14, 4, 0.5822, 0.0023, 4, 0.05, 0.0, 522, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "ipaddr", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ipaddr = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99100:Assign_L256_C16", "label": "req =", "type": "assigned_variable", "loc": [256, 256], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99100:If_L253_C12", "vector": [14, 4, 0.5845, 0.0023, 4, 0.05, 0.3333, 233, 4, 0, 0, 0, 0, 0, 5], "semantic": {"name": "req", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " req = req + chr(0x03).encode() + chr(len(destaddr)).encode() + destaddr"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99100:Assign_L259_C16", "label": "ipaddr = inet_aton()", "type": "assigned_variable", "loc": [259, 259], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99100:If_L253_C12", "vector": [14, 4, 0.5913, 0.0023, 4, 0.05, 0.6667, 522, 3, 1, 0, 0, 53, 10, 2], "semantic": {"name": "ipaddr", "arg_names": [], "import_names": [], "rhs_call_name": "inet_aton", "annotation": ""}, "snippet": " ipaddr = socket.inet_aton(socket.gethostbyname(destaddr))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99100:Assign_L260_C16", "label": "req =", "type": "assigned_variable", "loc": [260, 260], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99100:If_L253_C12", "vector": [14, 4, 0.5936, 0.0023, 4, 0.05, 1.0, 233, 4, 0, 0, 0, 0, 0, 2], "semantic": {"name": "req", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " req = req + chr(0x01).encode() + ipaddr"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99100:Assign_L261_C8", "label": "req =", "type": "assigned_variable", "loc": [261, 261], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99100:FunctionDef_L199_C4", "vector": [14, 2, 0.5959, 0.0023, 2, 0.94, 0.5385, 233, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "req", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " req = req + struct.pack(\">H\", destport)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99100:Expr_L262_C8", "label": "sendall()", "type": "expression", "loc": [262, 262], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99100:FunctionDef_L199_C4", "vector": [8, 2, 0.5982, 0.0023, 2, 0.94, 0.6154, 874, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "sendall", "arg_names": [], "import_names": [], "rhs_call_name": "sendall", "annotation": ""}, "snippet": " self.sendall(req)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99100:Assign_L264_C8", "label": "resp = __recvall()", "type": "assigned_variable", "loc": [264, 264], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99100:FunctionDef_L199_C4", "vector": [14, 2, 0.6027, 0.0023, 2, 0.94, 0.6923, 48, 3, 1, 0, 0, 782, 10, 1], "semantic": {"name": "resp", "arg_names": [], "import_names": [], "rhs_call_name": "__recvall", "annotation": ""}, "snippet": " resp = self.__recvall(4)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99100:If_L265_C8", "label": "if", "type": "if", "loc": [265, 283], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99100:FunctionDef_L199_C4", "vector": [4, 2, 0.6256, 0.0434, 2, 0.94, 0.7692, 0, 0, 0, 0, 0, 0, 0, 22], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if resp[0:1] != chr(0x05).encode():\n self.close()\n raise GeneralProxyError((1, _generalerrors[1]))\n elif resp[1:2] != chr(0x00).encode():\n # Connection failed\n self.close()\n if ord(resp[1:2])<=8:\n raise Socks5Error((ord(resp[1:2]), _socks5errors[ord(resp[1:2])]))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99100:Expr_L266_C12", "label": "close()", "type": "expression", "loc": [266, 266], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99100:If_L265_C8", "vector": [8, 3, 0.6073, 0.0023, 3, 0.84, 0.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_99100:If_L268_C8", "label": "if", "type": "if", "loc": [268, 283], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99100:If_L265_C8", "vector": [4, 3, 0.629, 0.0365, 3, 0.84, 1.0, 0, 0, 0, 0, 0, 0, 0, 18], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " elif resp[1:2] != chr(0x00).encode():\n # Connection failed\n self.close()\n if ord(resp[1:2])<=8:\n raise Socks5Error((ord(resp[1:2]), _socks5errors[ord(resp[1:2])]))\n else:\n raise Socks5Error((9, _socks5errors[9]))\n # Get the bound address/port"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99100:Expr_L270_C12", "label": "close()", "type": "expression", "loc": [270, 270], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99100:If_L268_C8", "vector": [8, 4, 0.6164, 0.0023, 4, 0.86, 0.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_99100:If_L271_C12", "label": "if", "type": "if", "loc": [271, 274], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99100:If_L268_C8", "vector": [4, 4, 0.6221, 0.0091, 4, 0.86, 0.5, 0, 0, 0, 0, 0, 0, 0, 5], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if ord(resp[1:2])<=8:\n raise Socks5Error((ord(resp[1:2]), _socks5errors[ord(resp[1:2])]))\n else:\n raise Socks5Error((9, _socks5errors[9]))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99100:If_L276_C8", "label": "if", "type": "if", "loc": [276, 283], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99100:If_L268_C8", "vector": [4, 4, 0.6381, 0.0183, 4, 0.86, 1.0, 0, 0, 0, 0, 0, 0, 0, 10], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " elif resp[3:4] == chr(0x01).encode():\n boundaddr = self.__recvall(4)\n elif resp[3:4] == chr(0x03).encode():\n resp = resp + self.recv(1)\n boundaddr = self.__recvall(ord(resp[4:5]))\n else:\n self.close()\n raise GeneralProxyError((1,_generalerrors[1]))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99100:Assign_L277_C12", "label": "boundaddr = __recvall()", "type": "assigned_variable", "loc": [277, 277], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99100:If_L276_C8", "vector": [14, 5, 0.6324, 0.0023, 5, 0.76, 0.0, 523, 3, 1, 0, 0, 782, 10, 1], "semantic": {"name": "boundaddr", "arg_names": [], "import_names": [], "rhs_call_name": "__recvall", "annotation": ""}, "snippet": " boundaddr = self.__recvall(4)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99100:If_L278_C8", "label": "if", "type": "if", "loc": [278, 283], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99100:If_L276_C8", "vector": [4, 5, 0.6404, 0.0137, 5, 0.76, 1.0, 0, 0, 0, 0, 0, 0, 0, 7], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " elif resp[3:4] == chr(0x03).encode():\n resp = resp + self.recv(1)\n boundaddr = self.__recvall(ord(resp[4:5]))\n else:\n self.close()\n raise GeneralProxyError((1,_generalerrors[1]))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99100:Assign_L279_C12", "label": "resp =", "type": "assigned_variable", "loc": [279, 279], "level": 6, "parent": "ajibawa-2023/Python-Code-Large/train/row_99100:If_L278_C8", "vector": [14, 6, 0.637, 0.0023, 6, 0.01, 0.0, 48, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "resp", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " resp = resp + self.recv(1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99100:Assign_L280_C12", "label": "boundaddr = __recvall()", "type": "assigned_variable", "loc": [280, 280], "level": 6, "parent": "ajibawa-2023/Python-Code-Large/train/row_99100:If_L278_C8", "vector": [14, 6, 0.6393, 0.0023, 6, 0.01, 0.5, 523, 3, 1, 0, 0, 782, 10, 2], "semantic": {"name": "boundaddr", "arg_names": [], "import_names": [], "rhs_call_name": "__recvall", "annotation": ""}, "snippet": " boundaddr = self.__recvall(ord(resp[4:5]))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99100:Expr_L282_C12", "label": "close()", "type": "expression", "loc": [282, 282], "level": 6, "parent": "ajibawa-2023/Python-Code-Large/train/row_99100:If_L278_C8", "vector": [8, 6, 0.6438, 0.0023, 6, 0.01, 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_99100:Assign_L284_C8", "label": "boundport =", "type": "assigned_variable", "loc": [284, 284], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99100:FunctionDef_L199_C4", "vector": [14, 2, 0.6484, 0.0023, 2, 0.94, 0.8462, 379, 6, 0, 0, 0, 0, 0, 2], "semantic": {"name": "boundport", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " boundport = struct.unpack(\">H\", self.__recvall(2))[0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99100:Assign_L285_C8", "label": "self.__proxysockname =", "type": "assigned_variable", "loc": [285, 285], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99100:FunctionDef_L199_C4", "vector": [14, 2, 0.6507, 0.0023, 2, 0.94, 0.9231, 335, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "self.__proxysockname", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.__proxysockname = (boundaddr, boundport)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99100:If_L286_C8", "label": "if", "type": "if", "loc": [286, 289], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99100:FunctionDef_L199_C4", "vector": [4, 2, 0.6564, 0.0091, 2, 0.94, 1.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if ipaddr != None:\n self.__proxypeername = (socket.inet_ntoa(ipaddr), destport)\n else:\n self.__proxypeername = (destaddr, destport)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99100:Assign_L287_C12", "label": "self.__proxypeername =", "type": "assigned_variable", "loc": [287, 287], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99100:If_L286_C8", "vector": [14, 3, 0.6553, 0.0023, 3, 0.7, 0.0, 763, 0, 0, 0, 0, 0, 8, 1], "semantic": {"name": "self.__proxypeername", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.__proxypeername = (socket.inet_ntoa(ipaddr), destport)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99100:Assign_L289_C12", "label": "self.__proxypeername =", "type": "assigned_variable", "loc": [289, 289], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99100:If_L286_C8", "vector": [14, 3, 0.6598, 0.0023, 3, 0.7, 1.0, 763, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "self.__proxypeername", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.__proxypeername = (destaddr, destport)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99100:FunctionDef_L291_C4", "label": "getproxysockname", "type": "function", "loc": [291, 295], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99100:ClassDef_L116_C0", "vector": [2, 1, 0.6689, 0.0114, 1, 0.88, 0.6154, 977, 0, 1, 1, 0, 0, 0, 0], "semantic": {"name": "getproxysockname", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def getproxysockname(self):\n \"\"\"getsockname() -> address info\n Returns the bound IP address and port number at the proxy.\n \"\"\"\n return self.__proxysockname"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99100:Expr_L292_C8", "label": "expression", "type": "expression", "loc": [292, 294], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99100:FunctionDef_L291_C4", "vector": [8, 2, 0.6689, 0.0068, 2, 0.35, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"getsockname() -> address info\n Returns the bound IP address and port number at the proxy.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99100:Return_L295_C8", "label": "return", "type": "return", "loc": [295, 295], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99100:FunctionDef_L291_C4", "vector": [13, 2, 0.6735, 0.0023, 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.__proxysockname"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99100:FunctionDef_L297_C4", "label": "getproxypeername", "type": "function", "loc": [297, 301], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99100:ClassDef_L116_C0", "vector": [2, 1, 0.6826, 0.0114, 1, 0.88, 0.6923, 476, 0, 1, 1, 0, 0, 0, 1], "semantic": {"name": "getproxypeername", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def getproxypeername(self):\n \"\"\"getproxypeername() -> address info\n Returns the IP and port number of the proxy.\n \"\"\"\n return _orgsocket.getpeername(self)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99100:Expr_L298_C8", "label": "expression", "type": "expression", "loc": [298, 300], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99100:FunctionDef_L297_C4", "vector": [8, 2, 0.6826, 0.0068, 2, 0.79, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"getproxypeername() -> address info\n Returns the IP and port number of the proxy.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99100:Return_L301_C8", "label": "return", "type": "return", "loc": [301, 301], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99100:FunctionDef_L297_C4", "vector": [13, 2, 0.6872, 0.0023, 2, 0.79, 1.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return _orgsocket.getpeername(self)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99100:FunctionDef_L303_C4", "label": "getpeername", "type": "function", "loc": [303, 308], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99100:ClassDef_L116_C0", "vector": [2, 1, 0.6975, 0.0137, 1, 0.88, 0.7692, 468, 0, 1, 1, 0, 0, 0, 0], "semantic": {"name": "getpeername", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def getpeername(self):\n \"\"\"getpeername() -> address info\n Returns the IP address and port number of the destination\n machine (note: getproxypeername returns the proxy)\n \"\"\"\n return self.__proxypeername"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99100:Expr_L304_C8", "label": "expression", "type": "expression", "loc": [304, 307], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99100:FunctionDef_L303_C4", "vector": [8, 2, 0.6975, 0.0091, 2, 0.86, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"getpeername() -> address info\n Returns the IP address and port number of the destination\n machine (note: getproxypeername returns the proxy)\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99100:Return_L308_C8", "label": "return", "type": "return", "loc": [308, 308], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99100:FunctionDef_L303_C4", "vector": [13, 2, 0.7032, 0.0023, 2, 0.86, 1.0, 0, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self.__proxypeername"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99100:FunctionDef_L310_C4", "label": "__negotiatesocks4", "type": "function", "loc": [310, 356], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99100:ClassDef_L116_C0", "vector": [2, 1, 0.7603, 0.1073, 1, 0.88, 0.8462, 972, 0, 3, 0, 0, 0, 0, 27], "semantic": {"name": "__negotiatesocks4", "arg_names": ["self", "destaddr", "destport"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __negotiatesocks4(self,destaddr,destport):\n \"\"\"__negotiatesocks4(self,destaddr,destport)\n Negotiates a connection through a SOCKS4 server.\n \"\"\"\n # Check if the destination address provided is an IP address\n rmtrslv = False\n try:\n ipaddr = socket.inet_aton(destaddr)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99100:Expr_L311_C8", "label": "expression", "type": "expression", "loc": [311, 313], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99100:FunctionDef_L310_C4", "vector": [8, 2, 0.7123, 0.0068, 2, 0.5, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"__negotiatesocks4(self,destaddr,destport)\n Negotiates a connection through a SOCKS4 server.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99100:Assign_L315_C8", "label": "rmtrslv =", "type": "assigned_variable", "loc": [315, 315], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99100:FunctionDef_L310_C4", "vector": [14, 2, 0.7192, 0.0023, 2, 0.5, 0.0833, 127, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "rmtrslv", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " rmtrslv = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99100:Try_L316_C8", "label": "try", "type": "try", "loc": [316, 324], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99100:FunctionDef_L310_C4", "vector": [7, 2, 0.7306, 0.0205, 2, 0.5, 0.1667, 0, 0, 1, 0, 0, 0, 0, 4], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " try:\n ipaddr = socket.inet_aton(destaddr)\n except socket.error:\n # It's a DNS name. Check where it should be resolved.\n if self.__proxy[3]:\n ipaddr = struct.pack(\"BBBB\", 0x00, 0x00, 0x00, 0x01)\n rmtrslv = True\n else:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99100:Assign_L317_C12", "label": "ipaddr = inet_aton()", "type": "assigned_variable", "loc": [317, 317], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99100:Try_L316_C8", "vector": [14, 3, 0.7237, 0.0023, 3, 0.42, 0.0, 522, 3, 1, 0, 0, 53, 10, 1], "semantic": {"name": "ipaddr", "arg_names": [], "import_names": [], "rhs_call_name": "inet_aton", "annotation": ""}, "snippet": " ipaddr = socket.inet_aton(destaddr)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99100:If_L320_C12", "label": "if", "type": "if", "loc": [320, 324], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99100:Try_L316_C8", "vector": [4, 3, 0.7352, 0.0114, 3, 0.42, 0.0, 0, 6, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self.__proxy[3]:\n ipaddr = struct.pack(\"BBBB\", 0x00, 0x00, 0x00, 0x01)\n rmtrslv = True\n else:\n ipaddr = socket.inet_aton(socket.gethostbyname(destaddr))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99100:Assign_L321_C16", "label": "ipaddr = pack()", "type": "assigned_variable", "loc": [321, 321], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99100:If_L320_C12", "vector": [14, 4, 0.7329, 0.0023, 4, 0.73, 0.0, 522, 3, 5, 0, 0, 742, 10, 1], "semantic": {"name": "ipaddr", "arg_names": [], "import_names": [], "rhs_call_name": "pack", "annotation": ""}, "snippet": " ipaddr = struct.pack(\"BBBB\", 0x00, 0x00, 0x00, 0x01)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99100:Assign_L322_C16", "label": "rmtrslv =", "type": "assigned_variable", "loc": [322, 322], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99100:If_L320_C12", "vector": [14, 4, 0.7352, 0.0023, 4, 0.73, 0.5, 127, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "rmtrslv", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " rmtrslv = True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99100:Assign_L324_C16", "label": "ipaddr = inet_aton()", "type": "assigned_variable", "loc": [324, 324], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99100:If_L320_C12", "vector": [14, 4, 0.7397, 0.0023, 4, 0.73, 1.0, 522, 3, 1, 0, 0, 53, 10, 2], "semantic": {"name": "ipaddr", "arg_names": [], "import_names": [], "rhs_call_name": "inet_aton", "annotation": ""}, "snippet": " ipaddr = socket.inet_aton(socket.gethostbyname(destaddr))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99100:Assign_L326_C8", "label": "req =", "type": "assigned_variable", "loc": [326, 326], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99100:FunctionDef_L310_C4", "vector": [14, 2, 0.7443, 0.0023, 2, 0.5, 0.25, 233, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "req", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " req = struct.pack(\">BBH\", 0x04, 0x01, destport) + ipaddr"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99100:If_L328_C8", "label": "if", "type": "if", "loc": [328, 329], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99100:FunctionDef_L310_C4", "vector": [4, 2, 0.75, 0.0046, 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 self.__proxy[4] != None:\n req = req + self.__proxy[4]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99100:Assign_L329_C12", "label": "req =", "type": "assigned_variable", "loc": [329, 329], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99100:If_L328_C8", "vector": [14, 3, 0.7511, 0.0023, 3, 0.18, 0.0, 233, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "req", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " req = req + self.__proxy[4]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99100:Assign_L330_C8", "label": "req =", "type": "assigned_variable", "loc": [330, 330], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99100:FunctionDef_L310_C4", "vector": [14, 2, 0.7534, 0.0023, 2, 0.5, 0.4167, 233, 4, 0, 0, 0, 0, 0, 2], "semantic": {"name": "req", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " req = req + chr(0x00).encode()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99100:If_L334_C8", "label": "if", "type": "if", "loc": [334, 335], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99100:FunctionDef_L310_C4", "vector": [4, 2, 0.7637, 0.0046, 2, 0.5, 0.5, 0, 2, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if rmtrslv:\n req = req + destaddr + chr(0x00).encode()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99100:Assign_L335_C12", "label": "req =", "type": "assigned_variable", "loc": [335, 335], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99100:If_L334_C8", "vector": [14, 3, 0.7648, 0.0023, 3, 0.9, 0.0, 233, 4, 0, 0, 0, 0, 0, 2], "semantic": {"name": "req", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " req = req + destaddr + chr(0x00).encode()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99100:Expr_L336_C8", "label": "sendall()", "type": "expression", "loc": [336, 336], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99100:FunctionDef_L310_C4", "vector": [8, 2, 0.7671, 0.0023, 2, 0.5, 0.5833, 874, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "sendall", "arg_names": [], "import_names": [], "rhs_call_name": "sendall", "annotation": ""}, "snippet": " self.sendall(req)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99100:Assign_L338_C8", "label": "resp = __recvall()", "type": "assigned_variable", "loc": [338, 338], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99100:FunctionDef_L310_C4", "vector": [14, 2, 0.7717, 0.0023, 2, 0.5, 0.6667, 48, 3, 1, 0, 0, 782, 10, 1], "semantic": {"name": "resp", "arg_names": [], "import_names": [], "rhs_call_name": "__recvall", "annotation": ""}, "snippet": " resp = self.__recvall(8)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99100:If_L339_C8", "label": "if", "type": "if", "loc": [339, 342], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99100:FunctionDef_L310_C4", "vector": [4, 2, 0.7774, 0.0091, 2, 0.5, 0.75, 0, 0, 0, 0, 0, 0, 0, 4], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if resp[0:1] != chr(0x00).encode():\n # Bad data\n self.close()\n raise GeneralProxyError((1,_generalerrors[1]))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99100:Expr_L341_C12", "label": "close()", "type": "expression", "loc": [341, 341], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99100:If_L339_C8", "vector": [8, 3, 0.7785, 0.0023, 3, 0.5, 0.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_99100:If_L343_C8", "label": "if", "type": "if", "loc": [343, 350], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99100:FunctionDef_L310_C4", "vector": [4, 2, 0.7911, 0.0183, 2, 0.5, 0.8333, 0, 0, 0, 0, 0, 0, 0, 9], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if resp[1:2] != chr(0x5A).encode():\n # Server returned an error\n self.close()\n if ord(resp[1:2]) in (91, 92, 93):\n self.close()\n raise Socks4Error((ord(resp[1:2]), _socks4errors[ord(resp[1:2]) - 90]))\n else:\n raise Socks4Error((94, _socks4errors[4]))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99100:Expr_L345_C12", "label": "close()", "type": "expression", "loc": [345, 345], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99100:If_L343_C8", "vector": [8, 3, 0.7877, 0.0023, 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.close()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99100:If_L346_C12", "label": "if", "type": "if", "loc": [346, 350], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99100:If_L343_C8", "vector": [4, 3, 0.7945, 0.0114, 3, 0.71, 1.0, 0, 0, 0, 0, 0, 0, 0, 6], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if ord(resp[1:2]) in (91, 92, 93):\n self.close()\n raise Socks4Error((ord(resp[1:2]), _socks4errors[ord(resp[1:2]) - 90]))\n else:\n raise Socks4Error((94, _socks4errors[4]))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99100:Expr_L347_C16", "label": "close()", "type": "expression", "loc": [347, 347], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99100:If_L346_C12", "vector": [8, 4, 0.7922, 0.0023, 4, 0.51, 0.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_99100:Assign_L352_C8", "label": "self.__proxysockname =", "type": "assigned_variable", "loc": [352, 352], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99100:FunctionDef_L310_C4", "vector": [14, 2, 0.8037, 0.0023, 2, 0.5, 0.9167, 335, 0, 0, 0, 0, 0, 8, 2], "semantic": {"name": "self.__proxysockname", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.__proxysockname = (socket.inet_ntoa(resp[4:]), struct.unpack(\">H\", resp[2:4])[0])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99100:If_L353_C8", "label": "if", "type": "if", "loc": [353, 356], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99100:FunctionDef_L310_C4", "vector": [4, 2, 0.8094, 0.0091, 2, 0.5, 1.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if rmtrslv != None:\n self.__proxypeername = (socket.inet_ntoa(ipaddr), destport)\n else:\n self.__proxypeername = (destaddr, destport)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99100:Assign_L354_C12", "label": "self.__proxypeername =", "type": "assigned_variable", "loc": [354, 354], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99100:If_L353_C8", "vector": [14, 3, 0.8082, 0.0023, 3, 0.18, 0.0, 763, 0, 0, 0, 0, 0, 8, 1], "semantic": {"name": "self.__proxypeername", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.__proxypeername = (socket.inet_ntoa(ipaddr), destport)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99100:Assign_L356_C12", "label": "self.__proxypeername =", "type": "assigned_variable", "loc": [356, 356], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99100:If_L353_C8", "vector": [14, 3, 0.8128, 0.0023, 3, 0.18, 1.0, 763, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "self.__proxypeername", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.__proxypeername = (destaddr, destport)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99100:FunctionDef_L358_C4", "label": "__negotiatehttp", "type": "function", "loc": [358, 392], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99100:ClassDef_L116_C0", "vector": [2, 1, 0.8562, 0.0799, 1, 0.88, 0.9231, 893, 0, 3, 0, 0, 0, 0, 23], "semantic": {"name": "__negotiatehttp", "arg_names": ["self", "destaddr", "destport"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __negotiatehttp(self, destaddr, destport):\n \"\"\"__negotiatehttp(self,destaddr,destport)\n Negotiates a connection through an HTTP server.\n \"\"\"\n # If we need to resolve locally, we do this now\n if not self.__proxy[3]:\n addr = socket.gethostbyname(destaddr)\n else:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99100:Expr_L359_C8", "label": "expression", "type": "expression", "loc": [359, 361], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99100:FunctionDef_L358_C4", "vector": [8, 2, 0.8219, 0.0068, 2, 0.33, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"__negotiatehttp(self,destaddr,destport)\n Negotiates a connection through an HTTP server.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99100:If_L363_C8", "label": "if", "type": "if", "loc": [363, 366], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99100:FunctionDef_L358_C4", "vector": [4, 2, 0.8322, 0.0091, 2, 0.33, 0.0769, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not self.__proxy[3]:\n addr = socket.gethostbyname(destaddr)\n else:\n addr = destaddr"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99100:Assign_L364_C12", "label": "addr = gethostbyname()", "type": "assigned_variable", "loc": [364, 364], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99100:If_L363_C8", "vector": [14, 3, 0.8311, 0.0023, 3, 0.89, 0.0, 526, 3, 1, 0, 0, 61, 10, 1], "semantic": {"name": "addr", "arg_names": [], "import_names": [], "rhs_call_name": "gethostbyname", "annotation": ""}, "snippet": " addr = socket.gethostbyname(destaddr)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99100:Assign_L366_C12", "label": "addr =", "type": "assigned_variable", "loc": [366, 366], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99100:If_L363_C8", "vector": [14, 3, 0.8356, 0.0023, 3, 0.89, 1.0, 526, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "addr", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " addr = destaddr"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99100:Assign_L367_C8", "label": "headers =", "type": "assigned_variable", "loc": [367, 367], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99100:FunctionDef_L358_C4", "vector": [14, 2, 0.8379, 0.0023, 2, 0.33, 0.1538, 950, 0, 0, 0, 0, 0, 5, 1], "semantic": {"name": "headers", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " headers = [\"CONNECT \", addr, \":\", str(destport), \" HTTP/1.1\\r\\n\"]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99100:If_L369_C8", "label": "if", "type": "if", "loc": [369, 370], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99100:FunctionDef_L358_C4", "vector": [4, 2, 0.8436, 0.0046, 2, 0.33, 0.2308, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if (self.__proxy[4] != None and self.__proxy[5] != None):\n headers += [self.__getauthheader(), \"\\r\\n\"]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99100:Expr_L371_C8", "label": "append()", "type": "expression", "loc": [371, 371], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99100:FunctionDef_L358_C4", "vector": [8, 2, 0.847, 0.0023, 2, 0.33, 0.3077, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " headers.append(\"\\r\\n\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99100:Expr_L372_C8", "label": "sendall()", "type": "expression", "loc": [372, 372], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99100:FunctionDef_L358_C4", "vector": [8, 2, 0.8493, 0.0023, 2, 0.33, 0.3846, 874, 3, 1, 0, 0, 0, 0, 3], "semantic": {"name": "sendall", "arg_names": [], "import_names": [], "rhs_call_name": "sendall", "annotation": ""}, "snippet": " self.sendall(\"\".join(headers).encode())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99100:Assign_L374_C8", "label": "resp = recv()", "type": "assigned_variable", "loc": [374, 374], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99100:FunctionDef_L358_C4", "vector": [14, 2, 0.8539, 0.0023, 2, 0.33, 0.4615, 48, 3, 1, 0, 0, 178, 10, 1], "semantic": {"name": "resp", "arg_names": [], "import_names": [], "rhs_call_name": "recv", "annotation": ""}, "snippet": " resp = self.recv(1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99100:While_L375_C8", "label": "while", "type": "while", "loc": [375, 376], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99100:FunctionDef_L358_C4", "vector": [5, 2, 0.8573, 0.0046, 2, 0.33, 0.5385, 0, 0, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " while resp.find(\"\\r\\n\\r\\n\".encode()) == -1:\n resp = resp + self.recv(1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99100:Assign_L376_C12", "label": "resp =", "type": "assigned_variable", "loc": [376, 376], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99100:While_L375_C8", "vector": [14, 3, 0.8584, 0.0023, 3, 0.8, 0.0, 48, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "resp", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " resp = resp + self.recv(1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99100:Assign_L379_C8", "label": "statusline = split()", "type": "assigned_variable", "loc": [379, 379], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99100:FunctionDef_L358_C4", "vector": [14, 2, 0.8653, 0.0023, 2, 0.33, 0.6154, 680, 3, 2, 0, 0, 908, 10, 3], "semantic": {"name": "statusline", "arg_names": [], "import_names": [], "rhs_call_name": "split", "annotation": ""}, "snippet": " statusline = resp.splitlines()[0].split(\" \".encode(), 2)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99100:If_L380_C8", "label": "if", "type": "if", "loc": [380, 382], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99100:FunctionDef_L358_C4", "vector": [4, 2, 0.8699, 0.0068, 2, 0.33, 0.6923, 0, 0, 0, 0, 0, 0, 0, 4], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if statusline[0] not in (\"HTTP/1.0\".encode(), \"HTTP/1.1\".encode()):\n self.close()\n raise GeneralProxyError((1, _generalerrors[1]))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99100:Expr_L381_C12", "label": "close()", "type": "expression", "loc": [381, 381], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99100:If_L380_C8", "vector": [8, 3, 0.8699, 0.0023, 3, 0.83, 0.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_99100:Try_L383_C8", "label": "try", "type": "try", "loc": [383, 387], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99100:FunctionDef_L358_C4", "vector": [7, 2, 0.879, 0.0114, 2, 0.33, 0.7692, 0, 0, 1, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " try:\n statuscode = int(statusline[1])\n except ValueError:\n self.close()\n raise GeneralProxyError((1, _generalerrors[1]))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99100:Assign_L384_C12", "label": "statuscode = int()", "type": "assigned_variable", "loc": [384, 384], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99100:Try_L383_C8", "vector": [14, 3, 0.8767, 0.0023, 3, 0.56, 0.0, 958, 3, 1, 0, 0, 901, 10, 1], "semantic": {"name": "statuscode", "arg_names": [], "import_names": [], "rhs_call_name": "int", "annotation": ""}, "snippet": " statuscode = int(statusline[1])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99100:Expr_L386_C12", "label": "close()", "type": "expression", "loc": [386, 386], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99100:Try_L383_C8", "vector": [8, 3, 0.8813, 0.0023, 3, 0.56, 0.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_99100:If_L388_C8", "label": "if", "type": "if", "loc": [388, 390], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99100:FunctionDef_L358_C4", "vector": [4, 2, 0.8881, 0.0068, 2, 0.33, 0.8462, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if statuscode != 200:\n self.close()\n raise HTTPError((statuscode, statusline[2]))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99100:Expr_L389_C12", "label": "close()", "type": "expression", "loc": [389, 389], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99100:If_L388_C8", "vector": [8, 3, 0.8881, 0.0023, 3, 0.37, 0.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_99100:Assign_L391_C8", "label": "self.__proxysockname =", "type": "assigned_variable", "loc": [391, 391], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99100:FunctionDef_L358_C4", "vector": [14, 2, 0.8927, 0.0023, 2, 0.33, 0.9231, 335, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "self.__proxysockname", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.__proxysockname = (\"0.0.0.0\", 0)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99100:Assign_L392_C8", "label": "self.__proxypeername =", "type": "assigned_variable", "loc": [392, 392], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99100:FunctionDef_L358_C4", "vector": [14, 2, 0.895, 0.0023, 2, 0.33, 1.0, 763, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "self.__proxypeername", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.__proxypeername = (addr, destport)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99100:FunctionDef_L394_C4", "label": "connect", "type": "function", "loc": [394, 438], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99100:ClassDef_L116_C0", "vector": [2, 1, 0.9498, 0.1027, 1, 0.88, 1.0, 242, 0, 2, 0, 0, 0, 0, 16], "semantic": {"name": "connect", "arg_names": ["self", "destpair"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def connect(self, destpair):\n \"\"\"connect(self, despair)\n Connects to the specified destination through a proxy.\n destpar - A tuple of the IP/DNS address and the port number.\n (identical to socket's connect).\n To select the proxy server use setproxy().\n \"\"\"\n # Do a minimal input check first"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99100:Expr_L395_C8", "label": "expression", "type": "expression", "loc": [395, 400], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99100:FunctionDef_L394_C4", "vector": [8, 2, 0.9075, 0.0137, 2, 0.16, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"connect(self, despair)\n Connects to the specified destination through a proxy.\n destpar - A tuple of the IP/DNS address and the port number.\n (identical to socket's connect).\n To select the proxy server use setproxy().\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99100:If_L402_C8", "label": "if", "type": "if", "loc": [402, 403], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99100:FunctionDef_L394_C4", "vector": [4, 2, 0.9189, 0.0046, 2, 0.16, 0.5, 0, 0, 0, 0, 0, 0, 0, 6], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if (not type(destpair) in (list,tuple)) or (len(destpair) < 2) or (type(destpair[0]) != type('')) or (type(destpair[1]) != int):\n raise GeneralProxyError((5, _generalerrors[5]))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99100:If_L404_C8", "label": "if", "type": "if", "loc": [404, 438], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99100:FunctionDef_L394_C4", "vector": [4, 2, 0.9612, 0.0799, 2, 0.16, 1.0, 0, 0, 0, 0, 0, 0, 0, 10], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self.__proxy[0] == PROXY_TYPE_SOCKS5:\n if self.__proxy[2] != None:\n portnum = self.__proxy[2]\n else:\n portnum = 1080\n _orgsocket.connect(self, (self.__proxy[1], portnum))\n self.__negotiatesocks5(destpair[0], destpair[1])\n elif self.__proxy[0] == PROXY_TYPE_SOCKS4:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99100:If_L405_C12", "label": "if", "type": "if", "loc": [405, 408], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99100:If_L404_C8", "vector": [4, 3, 0.9281, 0.0091, 3, 0.24, 0.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self.__proxy[2] != None:\n portnum = self.__proxy[2]\n else:\n portnum = 1080"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99100:Assign_L406_C16", "label": "portnum =", "type": "assigned_variable", "loc": [406, 406], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99100:If_L405_C12", "vector": [14, 4, 0.9269, 0.0023, 4, 0.03, 0.0, 733, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "portnum", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " portnum = self.__proxy[2]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99100:Assign_L408_C16", "label": "portnum =", "type": "assigned_variable", "loc": [408, 408], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99100:If_L405_C12", "vector": [14, 4, 0.9315, 0.0023, 4, 0.03, 1.0, 733, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "portnum", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " portnum = 1080"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99100:Expr_L409_C12", "label": "connect()", "type": "expression", "loc": [409, 409], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99100:If_L404_C8", "vector": [8, 3, 0.9338, 0.0023, 3, 0.24, 0.3333, 242, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "connect", "arg_names": [], "import_names": [], "rhs_call_name": "connect", "annotation": ""}, "snippet": " _orgsocket.connect(self, (self.__proxy[1], portnum))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99100:Expr_L410_C12", "label": "__negotiatesocks5()", "type": "expression", "loc": [410, 410], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99100:If_L404_C8", "vector": [8, 3, 0.9361, 0.0023, 3, 0.24, 0.6667, 924, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "__negotiatesocks5", "arg_names": [], "import_names": [], "rhs_call_name": "__negotiatesocks5", "annotation": ""}, "snippet": " self.__negotiatesocks5(destpair[0], destpair[1])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99100:If_L411_C8", "label": "if", "type": "if", "loc": [411, 438], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99100:If_L404_C8", "vector": [4, 3, 0.9692, 0.0639, 3, 0.24, 1.0, 0, 0, 0, 0, 0, 0, 0, 8], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " elif self.__proxy[0] == PROXY_TYPE_SOCKS4:\n if self.__proxy[2] != None:\n portnum = self.__proxy[2]\n else:\n portnum = 1080\n _orgsocket.connect(self,(self.__proxy[1], portnum))\n self.__negotiatesocks4(destpair[0], destpair[1])\n elif self.__proxy[0] == PROXY_TYPE_HTTP:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99100:If_L412_C12", "label": "if", "type": "if", "loc": [412, 415], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99100:If_L411_C8", "vector": [4, 4, 0.9441, 0.0091, 4, 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.__proxy[2] != None:\n portnum = self.__proxy[2]\n else:\n portnum = 1080"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99100:Assign_L413_C16", "label": "portnum =", "type": "assigned_variable", "loc": [413, 413], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99100:If_L412_C12", "vector": [14, 5, 0.9429, 0.0023, 5, 0.62, 0.0, 733, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "portnum", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " portnum = self.__proxy[2]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99100:Assign_L415_C16", "label": "portnum =", "type": "assigned_variable", "loc": [415, 415], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99100:If_L412_C12", "vector": [14, 5, 0.9475, 0.0023, 5, 0.62, 1.0, 733, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "portnum", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " portnum = 1080"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99100:Expr_L416_C12", "label": "connect()", "type": "expression", "loc": [416, 416], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99100:If_L411_C8", "vector": [8, 4, 0.9498, 0.0023, 4, 0.87, 0.3333, 242, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "connect", "arg_names": [], "import_names": [], "rhs_call_name": "connect", "annotation": ""}, "snippet": " _orgsocket.connect(self,(self.__proxy[1], portnum))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99100:Expr_L417_C12", "label": "__negotiatesocks4()", "type": "expression", "loc": [417, 417], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99100:If_L411_C8", "vector": [8, 4, 0.9521, 0.0023, 4, 0.87, 0.6667, 972, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "__negotiatesocks4", "arg_names": [], "import_names": [], "rhs_call_name": "__negotiatesocks4", "annotation": ""}, "snippet": " self.__negotiatesocks4(destpair[0], destpair[1])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99100:If_L418_C8", "label": "if", "type": "if", "loc": [418, 438], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99100:If_L411_C8", "vector": [4, 4, 0.9772, 0.0479, 4, 0.87, 1.0, 0, 0, 0, 0, 0, 0, 0, 6], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " elif self.__proxy[0] == PROXY_TYPE_HTTP:\n if self.__proxy[2] != None:\n portnum = self.__proxy[2]\n else:\n portnum = 8080\n _orgsocket.connect(self,(self.__proxy[1], portnum))\n self.__negotiatehttp(destpair[0], destpair[1])\n elif self.__proxy[0] == PROXY_TYPE_HTTP_NO_TUNNEL:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99100:If_L419_C12", "label": "if", "type": "if", "loc": [419, 422], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99100:If_L418_C8", "vector": [4, 5, 0.96, 0.0091, 5, 0.84, 0.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self.__proxy[2] != None:\n portnum = self.__proxy[2]\n else:\n portnum = 8080"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99100:Assign_L420_C16", "label": "portnum =", "type": "assigned_variable", "loc": [420, 420], "level": 6, "parent": "ajibawa-2023/Python-Code-Large/train/row_99100:If_L419_C12", "vector": [14, 6, 0.9589, 0.0023, 6, 0.17, 0.0, 733, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "portnum", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " portnum = self.__proxy[2]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99100:Assign_L422_C16", "label": "portnum =", "type": "assigned_variable", "loc": [422, 422], "level": 6, "parent": "ajibawa-2023/Python-Code-Large/train/row_99100:If_L419_C12", "vector": [14, 6, 0.9635, 0.0023, 6, 0.17, 1.0, 733, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "portnum", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " portnum = 8080"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99100:Expr_L423_C12", "label": "connect()", "type": "expression", "loc": [423, 423], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99100:If_L418_C8", "vector": [8, 5, 0.9658, 0.0023, 5, 0.84, 0.3333, 242, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "connect", "arg_names": [], "import_names": [], "rhs_call_name": "connect", "annotation": ""}, "snippet": " _orgsocket.connect(self,(self.__proxy[1], portnum))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99100:Expr_L424_C12", "label": "__negotiatehttp()", "type": "expression", "loc": [424, 424], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99100:If_L418_C8", "vector": [8, 5, 0.968, 0.0023, 5, 0.84, 0.6667, 893, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "__negotiatehttp", "arg_names": [], "import_names": [], "rhs_call_name": "__negotiatehttp", "annotation": ""}, "snippet": " self.__negotiatehttp(destpair[0], destpair[1])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99100:If_L425_C8", "label": "if", "type": "if", "loc": [425, 438], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99100:If_L418_C8", "vector": [4, 5, 0.9852, 0.032, 5, 0.84, 1.0, 0, 0, 0, 0, 0, 0, 0, 4], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " elif self.__proxy[0] == PROXY_TYPE_HTTP_NO_TUNNEL:\n if self.__proxy[2] != None:\n portnum = self.__proxy[2]\n else:\n portnum = 8080\n _orgsocket.connect(self,(self.__proxy[1],portnum))\n if destpair[1] == 443:\n self.__negotiatehttp(destpair[0],destpair[1])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99100:If_L426_C12", "label": "if", "type": "if", "loc": [426, 429], "level": 6, "parent": "ajibawa-2023/Python-Code-Large/train/row_99100:If_L425_C8", "vector": [4, 6, 0.976, 0.0091, 6, 0.18, 0.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self.__proxy[2] != None:\n portnum = self.__proxy[2]\n else:\n portnum = 8080"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99100:Assign_L427_C16", "label": "portnum =", "type": "assigned_variable", "loc": [427, 427], "level": 7, "parent": "ajibawa-2023/Python-Code-Large/train/row_99100:If_L426_C12", "vector": [14, 7, 0.9749, 0.0023, 7, 0.24, 0.0, 733, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "portnum", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " portnum = self.__proxy[2]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99100:Assign_L429_C16", "label": "portnum =", "type": "assigned_variable", "loc": [429, 429], "level": 7, "parent": "ajibawa-2023/Python-Code-Large/train/row_99100:If_L426_C12", "vector": [14, 7, 0.9795, 0.0023, 7, 0.24, 1.0, 733, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "portnum", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " portnum = 8080"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99100:Expr_L430_C12", "label": "connect()", "type": "expression", "loc": [430, 430], "level": 6, "parent": "ajibawa-2023/Python-Code-Large/train/row_99100:If_L425_C8", "vector": [8, 6, 0.9817, 0.0023, 6, 0.18, 0.3333, 242, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "connect", "arg_names": [], "import_names": [], "rhs_call_name": "connect", "annotation": ""}, "snippet": " _orgsocket.connect(self,(self.__proxy[1],portnum))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99100:If_L431_C12", "label": "if", "type": "if", "loc": [431, 434], "level": 6, "parent": "ajibawa-2023/Python-Code-Large/train/row_99100:If_L425_C8", "vector": [4, 6, 0.9874, 0.0091, 6, 0.18, 0.6667, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if destpair[1] == 443:\n self.__negotiatehttp(destpair[0],destpair[1])\n else:\n self.__httptunnel = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99100:Expr_L432_C16", "label": "__negotiatehttp()", "type": "expression", "loc": [432, 432], "level": 7, "parent": "ajibawa-2023/Python-Code-Large/train/row_99100:If_L431_C12", "vector": [8, 7, 0.9863, 0.0023, 7, 0.77, 0.0, 893, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "__negotiatehttp", "arg_names": [], "import_names": [], "rhs_call_name": "__negotiatehttp", "annotation": ""}, "snippet": " self.__negotiatehttp(destpair[0],destpair[1])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99100:Assign_L434_C16", "label": "self.__httptunnel =", "type": "assigned_variable", "loc": [434, 434], "level": 7, "parent": "ajibawa-2023/Python-Code-Large/train/row_99100:If_L431_C12", "vector": [14, 7, 0.9909, 0.0023, 7, 0.77, 1.0, 470, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "self.__httptunnel", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.__httptunnel = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99100:If_L435_C8", "label": "if", "type": "if", "loc": [435, 438], "level": 6, "parent": "ajibawa-2023/Python-Code-Large/train/row_99100:If_L425_C8", "vector": [4, 6, 0.9966, 0.0091, 6, 0.18, 1.0, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " elif self.__proxy[0] == None:\n _orgsocket.connect(self, (destpair[0], destpair[1]))\n else:\n raise GeneralProxyError((4, _generalerrors[4]))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99100:Expr_L436_C12", "label": "connect()", "type": "expression", "loc": [436, 436], "level": 7, "parent": "ajibawa-2023/Python-Code-Large/train/row_99100:If_L435_C8", "vector": [8, 7, 0.9954, 0.0023, 7, 0.13, 0.0, 242, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "connect", "arg_names": [], "import_names": [], "rhs_call_name": "connect", "annotation": ""}, "snippet": " _orgsocket.connect(self, (destpair[0], destpair[1]))"}]
[{"f": "ajibawa-2023/Python-Code-Large/train/row_99100:FunctionDef_L96_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99100:Expr_L97_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99100:FunctionDef_L96_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99100:Assign_L102_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99100:FunctionDef_L104_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99100:Expr_L105_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99100:FunctionDef_L104_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99100:If_L111_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99100:If_L111_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99100:Assign_L112_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99100:ClassDef_L116_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99100:Expr_L117_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99100:ClassDef_L116_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99100:FunctionDef_L123_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99100:FunctionDef_L123_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99100:Expr_L124_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99100:FunctionDef_L123_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99100:If_L125_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99100:If_L125_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99100:Assign_L126_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99100:If_L125_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99100:Assign_L128_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99100:FunctionDef_L123_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99100:Assign_L129_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99100:FunctionDef_L123_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99100:Assign_L130_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99100:FunctionDef_L123_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99100:Assign_L131_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99100:ClassDef_L116_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99100:FunctionDef_L133_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99100:FunctionDef_L133_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99100:Expr_L134_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99100:FunctionDef_L133_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99100:Assign_L138_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99100:FunctionDef_L133_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99100:While_L139_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99100:While_L139_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99100:Assign_L140_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99100:While_L139_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99100:If_L141_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99100:While_L139_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99100:Assign_L142_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99100:FunctionDef_L133_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99100:Return_L143_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99100:ClassDef_L116_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99100:FunctionDef_L145_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99100:FunctionDef_L145_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99100:Expr_L146_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99100:FunctionDef_L145_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99100:If_L149_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99100:If_L149_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99100:Assign_L150_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99100:FunctionDef_L145_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99100:Return_L151_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99100:ClassDef_L116_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99100:FunctionDef_L153_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99100:FunctionDef_L153_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99100:Expr_L154_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99100:FunctionDef_L153_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99100:Assign_L158_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99100:FunctionDef_L153_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99100:Assign_L159_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99100:FunctionDef_L153_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99100:For_L160_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99100:For_L160_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99100:If_L161_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99100:If_L161_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99100:Assign_L162_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99100:If_L161_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99100:If_L163_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99100:If_L163_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99100:Assign_L164_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99100:FunctionDef_L153_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99100:If_L165_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99100:If_L165_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99100:Expr_L166_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99100:If_L165_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99100:Expr_L167_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99100:If_L165_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99100:Assign_L168_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99100:If_L165_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99100:Assign_L169_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99100:If_L165_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99100:If_L170_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99100:If_L170_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99100:Expr_L171_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99100:If_L165_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99100:Expr_L172_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99100:If_L165_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99100:Expr_L173_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99100:FunctionDef_L153_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99100:Return_L174_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99100:ClassDef_L116_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99100:FunctionDef_L176_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99100:FunctionDef_L176_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99100:Assign_L177_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99100:FunctionDef_L176_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99100:Return_L178_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99100:ClassDef_L116_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99100:FunctionDef_L180_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99100:FunctionDef_L180_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99100:Expr_L181_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99100:FunctionDef_L180_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99100:Assign_L197_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99100:ClassDef_L116_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99100:FunctionDef_L199_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99100:FunctionDef_L199_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99100:Expr_L200_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99100:FunctionDef_L199_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99100:If_L204_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99100:If_L204_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99100:Expr_L208_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99100:If_L204_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99100:Expr_L212_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99100:FunctionDef_L199_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99100:Assign_L215_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99100:FunctionDef_L199_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99100:If_L216_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99100:If_L216_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99100:Expr_L217_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99100:FunctionDef_L199_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99100:If_L220_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99100:If_L220_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99100:If_L223_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99100:If_L223_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99100:Expr_L226_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99100:If_L223_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99100:Assign_L227_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99100:If_L223_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99100:If_L228_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99100:If_L228_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99100:Expr_L230_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99100:If_L223_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99100:If_L232_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99100:If_L232_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99100:Expr_L234_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99100:If_L223_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99100:Expr_L239_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99100:If_L223_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99100:If_L240_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99100:FunctionDef_L199_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99100:Assign_L245_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99100:FunctionDef_L199_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99100:Try_L248_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99100:Try_L248_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99100:Assign_L249_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99100:Try_L248_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99100:Assign_L250_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99100:Try_L248_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99100:If_L253_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99100:If_L253_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99100:Assign_L255_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99100:If_L253_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99100:Assign_L256_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99100:If_L253_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99100:Assign_L259_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99100:If_L253_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99100:Assign_L260_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99100:FunctionDef_L199_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99100:Assign_L261_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99100:FunctionDef_L199_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99100:Expr_L262_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99100:FunctionDef_L199_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99100:Assign_L264_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99100:FunctionDef_L199_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99100:If_L265_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99100:If_L265_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99100:Expr_L266_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99100:If_L265_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99100:If_L268_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99100:If_L268_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99100:Expr_L270_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99100:If_L268_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99100:If_L271_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99100:If_L268_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99100:If_L276_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99100:If_L276_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99100:Assign_L277_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99100:If_L276_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99100:If_L278_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99100:If_L278_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99100:Assign_L279_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99100:If_L278_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99100:Assign_L280_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99100:If_L278_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99100:Expr_L282_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99100:FunctionDef_L199_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99100:Assign_L284_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99100:FunctionDef_L199_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99100:Assign_L285_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99100:FunctionDef_L199_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99100:If_L286_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99100:If_L286_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99100:Assign_L287_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99100:If_L286_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99100:Assign_L289_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99100:ClassDef_L116_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99100:FunctionDef_L291_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99100:FunctionDef_L291_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99100:Expr_L292_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99100:FunctionDef_L291_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99100:Return_L295_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99100:ClassDef_L116_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99100:FunctionDef_L297_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99100:FunctionDef_L297_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99100:Expr_L298_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99100:FunctionDef_L297_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99100:Return_L301_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99100:ClassDef_L116_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99100:FunctionDef_L303_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99100:FunctionDef_L303_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99100:Expr_L304_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99100:FunctionDef_L303_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99100:Return_L308_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99100:ClassDef_L116_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99100:FunctionDef_L310_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99100:FunctionDef_L310_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99100:Expr_L311_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99100:FunctionDef_L310_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99100:Assign_L315_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99100:FunctionDef_L310_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99100:Try_L316_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99100:Try_L316_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99100:Assign_L317_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99100:Try_L316_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99100:If_L320_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99100:If_L320_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99100:Assign_L321_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99100:If_L320_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99100:Assign_L322_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99100:If_L320_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99100:Assign_L324_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99100:FunctionDef_L310_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99100:Assign_L326_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99100:FunctionDef_L310_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99100:If_L328_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99100:If_L328_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99100:Assign_L329_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99100:FunctionDef_L310_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99100:Assign_L330_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99100:FunctionDef_L310_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99100:If_L334_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99100:If_L334_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99100:Assign_L335_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99100:FunctionDef_L310_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99100:Expr_L336_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99100:FunctionDef_L310_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99100:Assign_L338_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99100:FunctionDef_L310_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99100:If_L339_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99100:If_L339_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99100:Expr_L341_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99100:FunctionDef_L310_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99100:If_L343_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99100:If_L343_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99100:Expr_L345_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99100:If_L343_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99100:If_L346_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99100:If_L346_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99100:Expr_L347_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99100:FunctionDef_L310_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99100:Assign_L352_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99100:FunctionDef_L310_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99100:If_L353_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99100:If_L353_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99100:Assign_L354_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99100:If_L353_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99100:Assign_L356_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99100:ClassDef_L116_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99100:FunctionDef_L358_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99100:FunctionDef_L358_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99100:Expr_L359_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99100:FunctionDef_L358_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99100:If_L363_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99100:If_L363_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99100:Assign_L364_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99100:If_L363_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99100:Assign_L366_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99100:FunctionDef_L358_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99100:Assign_L367_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99100:FunctionDef_L358_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99100:If_L369_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99100:FunctionDef_L358_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99100:Expr_L371_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99100:FunctionDef_L358_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99100:Expr_L372_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99100:FunctionDef_L358_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99100:Assign_L374_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99100:FunctionDef_L358_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99100:While_L375_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99100:While_L375_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99100:Assign_L376_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99100:FunctionDef_L358_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99100:Assign_L379_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99100:FunctionDef_L358_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99100:If_L380_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99100:If_L380_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99100:Expr_L381_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99100:FunctionDef_L358_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99100:Try_L383_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99100:Try_L383_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99100:Assign_L384_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99100:Try_L383_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99100:Expr_L386_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99100:FunctionDef_L358_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99100:If_L388_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99100:If_L388_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99100:Expr_L389_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99100:FunctionDef_L358_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99100:Assign_L391_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99100:FunctionDef_L358_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99100:Assign_L392_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99100:ClassDef_L116_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99100:FunctionDef_L394_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99100:FunctionDef_L394_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99100:Expr_L395_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99100:FunctionDef_L394_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99100:If_L402_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99100:FunctionDef_L394_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99100:If_L404_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99100:If_L404_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99100:If_L405_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99100:If_L405_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99100:Assign_L406_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99100:If_L405_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99100:Assign_L408_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99100:If_L404_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99100:Expr_L409_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99100:If_L404_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99100:Expr_L410_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99100:If_L404_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99100:If_L411_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99100:If_L411_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99100:If_L412_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99100:If_L412_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99100:Assign_L413_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99100:If_L412_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99100:Assign_L415_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99100:If_L411_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99100:Expr_L416_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99100:If_L411_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99100:Expr_L417_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99100:If_L411_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99100:If_L418_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99100:If_L418_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99100:If_L419_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99100:If_L419_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99100:Assign_L420_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99100:If_L419_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99100:Assign_L422_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99100:If_L418_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99100:Expr_L423_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99100:If_L418_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99100:Expr_L424_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99100:If_L418_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99100:If_L425_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99100:If_L425_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99100:If_L426_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99100:If_L426_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99100:Assign_L427_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99100:If_L426_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99100:Assign_L429_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99100:If_L425_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99100:Expr_L430_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99100:If_L425_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99100:If_L431_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99100:If_L431_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99100:Expr_L432_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99100:If_L431_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99100:Assign_L434_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99100:If_L425_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99100:If_L435_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99100:If_L435_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99100:Expr_L436_C12"}]
import Cookie import datetime import time import email.utils import calendar import base64 import hashlib import hmac import re import logging # Ripped from the Tornado Framework's web.py # http://github.com/facebook/tornado/commit/39ac6d169a36a54bb1f6b9bf1fdebb5c9da96e09 # # Tornado is licensed under the Apache Licence, Version 2.0 # (http://www.apache.org/licenses/LICENSE-2.0.html). # # Example: # from vendor.prayls.lilcookies import LilCookies # cookieutil = LilCookies(self, application_settings['cookie_secret']) # cookieutil.set_secure_cookie(name = 'mykey', value = 'myvalue', expires_days= 365*100) # cookieutil.get_secure_cookie(name = 'mykey') class LilCookies: @staticmethod def _utf8(s): if isinstance(s, unicode): return s.encode("utf-8") assert isinstance(s, str) return s @staticmethod def _time_independent_equals(a, b): if len(a) != len(b): return False result = 0 for x, y in zip(a, b): result |= ord(x) ^ ord(y) return result == 0 @staticmethod def _signature_from_secret(cookie_secret, *parts): """ Takes a secret salt value to create a signature for values in the `parts` param.""" hash = hmac.new(cookie_secret, digestmod=hashlib.sha1) for part in parts: hash.update(part) return hash.hexdigest() @staticmethod def _signed_cookie_value(cookie_secret, name, value): """ Returns a signed value for use in a cookie. This is helpful to have in its own method if you need to re-use this function for other needs. """ timestamp = str(int(time.time())) value = base64.b64encode(value) signature = LilCookies._signature_from_secret(cookie_secret, name, value, timestamp) return "|".join([value, timestamp, signature]) @staticmethod def _verified_cookie_value(cookie_secret, name, signed_value): """Returns the un-encrypted value given the signed value if it validates, or None.""" value = signed_value if not value: return None parts = value.split("|") if len(parts) != 3: return None signature = LilCookies._signature_from_secret(cookie_secret, name, parts[0], parts[1]) if not LilCookies._time_independent_equals(parts[2], signature): logging.warning("Invalid cookie signature %r", value) return None timestamp = int(parts[1]) if timestamp < time.time() - 31 * 86400: logging.warning("Expired cookie %r", value) return None try: return base64.b64decode(parts[0]) except: return None def __init__(self, handler, cookie_secret): """You must specify the cookie_secret to use any of the secure methods. It should be a long, random sequence of bytes to be used as the HMAC secret for the signature. """ if len(cookie_secret) < 45: raise ValueError("LilCookies cookie_secret should at least be 45 characters long, but got `%s`" % cookie_secret) self.handler = handler self.request = handler.request self.response = handler.response self.cookie_secret = cookie_secret def cookies(self): """A dictionary of Cookie.Morsel objects.""" if not hasattr(self, "_cookies"): self._cookies = Cookie.BaseCookie() if "Cookie" in self.request.headers: try: self._cookies.load(self.request.headers["Cookie"]) except: self.clear_all_cookies() return self._cookies def get_cookie(self, name, default=None): """Gets the value of the cookie with the given name, else default.""" if name in self.cookies(): return self._cookies[name].value return default def set_cookie(self, name, value, domain=None, expires=None, path="/", expires_days=None, **kwargs): """Sets the given cookie name/value with the given options. Additional keyword arguments are set on the Cookie.Morsel directly. See http://docs.python.org/library/cookie.html#morsel-objects for available attributes. """ name = LilCookies._utf8(name) value = LilCookies._utf8(value) if re.search(r"[\x00-\x20]", name + value): # Don't let us accidentally inject bad stuff raise ValueError("Invalid cookie %r: %r" % (name, value)) if not hasattr(self, "_new_cookies"): self._new_cookies = [] new_cookie = Cookie.BaseCookie() self._new_cookies.append(new_cookie) new_cookie[name] = value if domain: new_cookie[name]["domain"] = domain if expires_days is not None and not expires: expires = datetime.datetime.utcnow() + datetime.timedelta(days=expires_days) if expires: timestamp = calendar.timegm(expires.utctimetuple()) new_cookie[name]["expires"] = email.utils.formatdate( timestamp, localtime=False, usegmt=True) if path: new_cookie[name]["path"] = path for k, v in kwargs.iteritems(): new_cookie[name][k] = v # The 2 lines below were not in Tornado. Instead, they output all their cookies to the headers at once before a response flush. for vals in new_cookie.values(): self.response.headers._headers.append(('Set-Cookie', vals.OutputString(None))) def clear_cookie(self, name, path="/", domain=None): """Deletes the cookie with the given name.""" expires = datetime.datetime.utcnow() - datetime.timedelta(days=365) self.set_cookie(name, value="", path=path, expires=expires, domain=domain) def clear_all_cookies(self): """Deletes all the cookies the user sent with this request.""" for name in self.cookies().iterkeys(): self.clear_cookie(name) def set_secure_cookie(self, name, value, expires_days=30, **kwargs): """Signs and timestamps a cookie so it cannot be forged. To read a cookie set with this method, use get_secure_cookie(). """ value = LilCookies._signed_cookie_value(self.cookie_secret, name, value) self.set_cookie(name, value, expires_days=expires_days, **kwargs) def get_secure_cookie(self, name, value=None): """Returns the given signed cookie if it validates, or None.""" if value is None: value = self.get_cookie(name) return LilCookies._verified_cookie_value(self.cookie_secret, name, value) def _cookie_signature(self, *parts): return LilCookies._signature_from_secret(self.cookie_secret)
ajibawa-2023/Python-Code-Large/train/row_99101
115
168
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_99101:Import_L1_C0", "label": "Cookie import Cookie", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.006, 0.006, 0, 0.66, 0.0, 32, 0, 1, 0, 0, 32, 0, 0], "semantic": {"name": "Cookie", "arg_names": [], "import_names": ["Cookie"], "rhs_call_name": "", "annotation": ""}, "snippet": "import Cookie"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99101:Import_L2_C0", "label": "datetime import datetime", "type": "import", "loc": [2, 2], "level": 0, "parent": null, "vector": [1, 0, 0.0119, 0.006, 0, 0.66, 0.1, 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_99101:Import_L3_C0", "label": "time import time", "type": "import", "loc": [3, 3], "level": 0, "parent": null, "vector": [1, 0, 0.0179, 0.006, 0, 0.66, 0.2, 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_99101:Import_L4_C0", "label": "email.utils import email.utils", "type": "import", "loc": [4, 4], "level": 0, "parent": null, "vector": [1, 0, 0.0238, 0.006, 0, 0.66, 0.3, 88, 0, 1, 0, 0, 88, 0, 0], "semantic": {"name": "email.utils", "arg_names": [], "import_names": ["email.utils"], "rhs_call_name": "", "annotation": ""}, "snippet": "import email.utils"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99101:Import_L5_C0", "label": "calendar import calendar", "type": "import", "loc": [5, 5], "level": 0, "parent": null, "vector": [1, 0, 0.0298, 0.006, 0, 0.66, 0.4, 917, 0, 1, 0, 0, 917, 0, 0], "semantic": {"name": "calendar", "arg_names": [], "import_names": ["calendar"], "rhs_call_name": "", "annotation": ""}, "snippet": "import calendar"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99101:Import_L6_C0", "label": "base64 import base64", "type": "import", "loc": [6, 6], "level": 0, "parent": null, "vector": [1, 0, 0.0357, 0.006, 0, 0.66, 0.5, 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_99101:Import_L7_C0", "label": "hashlib import hashlib", "type": "import", "loc": [7, 7], "level": 0, "parent": null, "vector": [1, 0, 0.0417, 0.006, 0, 0.66, 0.6, 154, 0, 1, 0, 0, 154, 0, 0], "semantic": {"name": "hashlib", "arg_names": [], "import_names": ["hashlib"], "rhs_call_name": "", "annotation": ""}, "snippet": "import hashlib"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99101:Import_L8_C0", "label": "hmac import hmac", "type": "import", "loc": [8, 8], "level": 0, "parent": null, "vector": [1, 0, 0.0476, 0.006, 0, 0.66, 0.7, 993, 0, 1, 0, 0, 993, 0, 0], "semantic": {"name": "hmac", "arg_names": [], "import_names": ["hmac"], "rhs_call_name": "", "annotation": ""}, "snippet": "import hmac"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99101:Import_L9_C0", "label": "re import re", "type": "import", "loc": [9, 9], "level": 0, "parent": null, "vector": [1, 0, 0.0536, 0.006, 0, 0.66, 0.8, 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_99101:Import_L10_C0", "label": "logging import logging", "type": "import", "loc": [10, 10], "level": 0, "parent": null, "vector": [1, 0, 0.0595, 0.006, 0, 0.66, 0.9, 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_99101:ClassDef_L23_C0", "label": "LilCookies", "type": "class", "loc": [23, 168], "level": 0, "parent": null, "vector": [3, 0, 0.5685, 0.869, 0, 0.66, 1.0, 220, 0, 14, 0, 0, 0, 0, 60], "semantic": {"name": "LilCookies", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class LilCookies:\n\n @staticmethod\n def _utf8(s):\n if isinstance(s, unicode):\n return s.encode(\"utf-8\")\n assert isinstance(s, str)\n return s"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99101:FunctionDef_L26_C2", "label": "_utf8", "type": "function", "loc": [26, 30], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99101:ClassDef_L23_C0", "vector": [2, 1, 0.1667, 0.0298, 1, 0.27, 0.0, 587, 0, 1, 1, 0, 0, 0, 3], "semantic": {"name": "_utf8", "arg_names": ["s"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _utf8(s):\n if isinstance(s, unicode):\n return s.encode(\"utf-8\")\n assert isinstance(s, str)\n return s"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99101:If_L27_C4", "label": "if", "type": "if", "loc": [27, 28], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99101:FunctionDef_L26_C2", "vector": [4, 2, 0.1637, 0.0119, 2, 0.66, 0.0, 0, 3, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if isinstance(s, unicode):\n return s.encode(\"utf-8\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99101:Return_L28_C6", "label": "return", "type": "return", "loc": [28, 28], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99101:If_L27_C4", "vector": [13, 3, 0.1667, 0.006, 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 s.encode(\"utf-8\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99101:Return_L30_C4", "label": "return", "type": "return", "loc": [30, 30], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99101:FunctionDef_L26_C2", "vector": [13, 2, 0.1786, 0.006, 2, 0.66, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return s"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99101:FunctionDef_L33_C2", "label": "_time_independent_equals", "type": "function", "loc": [33, 39], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99101:ClassDef_L23_C0", "vector": [2, 1, 0.2143, 0.0417, 1, 0.27, 0.0769, 816, 0, 2, 1, 0, 0, 0, 5], "semantic": {"name": "_time_independent_equals", "arg_names": ["a", "b"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _time_independent_equals(a, b):\n if len(a) != len(b):\n return False\n result = 0\n for x, y in zip(a, b):\n result |= ord(x) ^ ord(y)\n return result == 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99101:If_L34_C4", "label": "if", "type": "if", "loc": [34, 35], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99101:FunctionDef_L33_C2", "vector": [4, 2, 0.2054, 0.0119, 2, 0.43, 0.0, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if len(a) != len(b):\n return False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99101:Return_L35_C6", "label": "return", "type": "return", "loc": [35, 35], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99101:If_L34_C4", "vector": [13, 3, 0.2083, 0.006, 3, 0.94, 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_99101:Assign_L36_C4", "label": "result =", "type": "assigned_variable", "loc": [36, 36], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99101:FunctionDef_L33_C2", "vector": [14, 2, 0.2143, 0.006, 2, 0.43, 0.3333, 51, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "result", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " result = 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99101:For_L37_C4", "label": "for x, y", "type": "for", "loc": [37, 38], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99101:FunctionDef_L33_C2", "vector": [6, 2, 0.2232, 0.0119, 2, 0.43, 0.6667, 855, 3, 0, 0, 0, 0, 0, 3], "semantic": {"name": "x, y", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for x, y in zip(a, b):\n result |= ord(x) ^ ord(y)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99101:Return_L39_C4", "label": "return", "type": "return", "loc": [39, 39], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99101:FunctionDef_L33_C2", "vector": [13, 2, 0.2321, 0.006, 2, 0.43, 1.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return result == 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99101:FunctionDef_L42_C2", "label": "_signature_from_secret", "type": "function", "loc": [42, 46], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99101:ClassDef_L23_C0", "vector": [2, 1, 0.2619, 0.0298, 1, 0.27, 0.1538, 916, 0, 2, 1, 0, 0, 0, 3], "semantic": {"name": "_signature_from_secret", "arg_names": ["cookie_secret", "parts"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _signature_from_secret(cookie_secret, *parts):\n \"\"\" Takes a secret salt value to create a signature for values in the `parts` param.\"\"\"\n hash = hmac.new(cookie_secret, digestmod=hashlib.sha1)\n for part in parts: hash.update(part)\n return hash.hexdigest()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99101:Expr_L43_C4", "label": "expression", "type": "expression", "loc": [43, 43], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99101:FunctionDef_L42_C2", "vector": [8, 2, 0.256, 0.006, 2, 0.92, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\" Takes a secret salt value to create a signature for values in the `parts` param.\"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99101:Assign_L44_C4", "label": "hash = new()", "type": "assigned_variable", "loc": [44, 44], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99101:FunctionDef_L42_C2", "vector": [14, 2, 0.2619, 0.006, 2, 0.92, 0.3333, 58, 3, 2, 0, 0, 145, 10, 1], "semantic": {"name": "hash", "arg_names": [], "import_names": [], "rhs_call_name": "new", "annotation": ""}, "snippet": " hash = hmac.new(cookie_secret, digestmod=hashlib.sha1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99101:For_L45_C4", "label": "for part", "type": "for", "loc": [45, 45], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99101:FunctionDef_L42_C2", "vector": [6, 2, 0.2679, 0.006, 2, 0.92, 0.6667, 374, 2, 0, 0, 0, 0, 0, 1], "semantic": {"name": "part", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for part in parts: hash.update(part)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99101:Expr_L45_C23", "label": "update()", "type": "expression", "loc": [45, 45], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99101:For_L45_C4", "vector": [8, 3, 0.2679, 0.006, 3, 0.72, 0.0, 637, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "update", "arg_names": [], "import_names": [], "rhs_call_name": "update", "annotation": ""}, "snippet": " for part in parts: hash.update(part)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99101:Return_L46_C4", "label": "return", "type": "return", "loc": [46, 46], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99101:FunctionDef_L42_C2", "vector": [13, 2, 0.2738, 0.006, 2, 0.92, 1.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return hash.hexdigest()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99101:FunctionDef_L49_C2", "label": "_signed_cookie_value", "type": "function", "loc": [49, 56], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99101:ClassDef_L23_C0", "vector": [2, 1, 0.3125, 0.0476, 1, 0.27, 0.2308, 862, 0, 3, 1, 0, 0, 0, 6], "semantic": {"name": "_signed_cookie_value", "arg_names": ["cookie_secret", "name", "value"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _signed_cookie_value(cookie_secret, name, value):\n \"\"\" Returns a signed value for use in a cookie.\n\n This is helpful to have in its own method if you need to re-use this function for other needs. \"\"\"\n timestamp = str(int(time.time()))\n value = base64.b64encode(value)\n signature = LilCookies._signature_from_secret(cookie_secret, name, value, timestamp)\n return \"|\".join([value, timestamp, signature])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99101:Expr_L50_C4", "label": "expression", "type": "expression", "loc": [50, 52], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99101:FunctionDef_L49_C2", "vector": [8, 2, 0.3036, 0.0179, 2, 0.47, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\" Returns a signed value for use in a cookie.\n\n This is helpful to have in its own method if you need to re-use this function for other needs. \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99101:Assign_L53_C4", "label": "timestamp = str()", "type": "assigned_variable", "loc": [53, 53], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99101:FunctionDef_L49_C2", "vector": [14, 2, 0.3155, 0.006, 2, 0.47, 0.25, 834, 3, 1, 0, 0, 52, 10, 3], "semantic": {"name": "timestamp", "arg_names": [], "import_names": [], "rhs_call_name": "str", "annotation": ""}, "snippet": " timestamp = str(int(time.time()))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99101:Assign_L54_C4", "label": "value = b64encode()", "type": "assigned_variable", "loc": [54, 54], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99101:FunctionDef_L49_C2", "vector": [14, 2, 0.3214, 0.006, 2, 0.47, 0.5, 441, 3, 1, 0, 0, 11, 10, 1], "semantic": {"name": "value", "arg_names": [], "import_names": [], "rhs_call_name": "b64encode", "annotation": ""}, "snippet": " value = base64.b64encode(value)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99101:Assign_L55_C4", "label": "signature = _signature_from_secret()", "type": "assigned_variable", "loc": [55, 55], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99101:FunctionDef_L49_C2", "vector": [14, 2, 0.3274, 0.006, 2, 0.47, 0.75, 932, 3, 4, 0, 0, 916, 10, 1], "semantic": {"name": "signature", "arg_names": [], "import_names": [], "rhs_call_name": "_signature_from_secret", "annotation": ""}, "snippet": " signature = LilCookies._signature_from_secret(cookie_secret, name, value, timestamp)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99101:Return_L56_C4", "label": "return", "type": "return", "loc": [56, 56], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99101:FunctionDef_L49_C2", "vector": [13, 2, 0.3333, 0.006, 2, 0.47, 1.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return \"|\".join([value, timestamp, signature])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99101:FunctionDef_L59_C2", "label": "_verified_cookie_value", "type": "function", "loc": [59, 76], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99101:ClassDef_L23_C0", "vector": [2, 1, 0.4018, 0.1071, 1, 0.27, 0.3077, 276, 0, 3, 1, 0, 0, 0, 9], "semantic": {"name": "_verified_cookie_value", "arg_names": ["cookie_secret", "name", "signed_value"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _verified_cookie_value(cookie_secret, name, signed_value):\n \"\"\"Returns the un-encrypted value given the signed value if it validates, or None.\"\"\"\n value = signed_value\n if not value: return None\n parts = value.split(\"|\")\n if len(parts) != 3: return None\n signature = LilCookies._signature_from_secret(cookie_secret, name, parts[0], parts[1])\n if not LilCookies._time_independent_equals(parts[2], signature):"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99101:Expr_L60_C4", "label": "expression", "type": "expression", "loc": [60, 60], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99101:FunctionDef_L59_C2", "vector": [8, 2, 0.3571, 0.006, 2, 0.97, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Returns the un-encrypted value given the signed value if it validates, or None.\"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99101:Assign_L61_C4", "label": "value =", "type": "assigned_variable", "loc": [61, 61], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99101:FunctionDef_L59_C2", "vector": [14, 2, 0.3631, 0.006, 2, 0.97, 0.1111, 441, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "value", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " value = signed_value"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99101:If_L62_C4", "label": "if", "type": "if", "loc": [62, 62], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99101:FunctionDef_L59_C2", "vector": [4, 2, 0.369, 0.006, 2, 0.97, 0.2222, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not value: return None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99101:Return_L62_C18", "label": "return", "type": "return", "loc": [62, 62], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99101:If_L62_C4", "vector": [13, 3, 0.369, 0.006, 3, 0.83, 0.0, 0, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not value: return None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99101:Assign_L63_C4", "label": "parts = split()", "type": "assigned_variable", "loc": [63, 63], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99101:FunctionDef_L59_C2", "vector": [14, 2, 0.375, 0.006, 2, 0.97, 0.3333, 13, 3, 1, 0, 0, 908, 10, 1], "semantic": {"name": "parts", "arg_names": [], "import_names": [], "rhs_call_name": "split", "annotation": ""}, "snippet": " parts = value.split(\"|\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99101:If_L64_C4", "label": "if", "type": "if", "loc": [64, 64], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99101:FunctionDef_L59_C2", "vector": [4, 2, 0.381, 0.006, 2, 0.97, 0.4444, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if len(parts) != 3: return None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99101:Return_L64_C24", "label": "return", "type": "return", "loc": [64, 64], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99101:If_L64_C4", "vector": [13, 3, 0.381, 0.006, 3, 0.5, 0.0, 0, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if len(parts) != 3: return None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99101:Assign_L65_C4", "label": "signature = _signature_from_secret()", "type": "assigned_variable", "loc": [65, 65], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99101:FunctionDef_L59_C2", "vector": [14, 2, 0.3869, 0.006, 2, 0.97, 0.5556, 932, 3, 4, 0, 0, 916, 10, 1], "semantic": {"name": "signature", "arg_names": [], "import_names": [], "rhs_call_name": "_signature_from_secret", "annotation": ""}, "snippet": " signature = LilCookies._signature_from_secret(cookie_secret, name, parts[0], parts[1])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99101:If_L66_C4", "label": "if", "type": "if", "loc": [66, 68], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99101:FunctionDef_L59_C2", "vector": [4, 2, 0.3988, 0.0179, 2, 0.97, 0.6667, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not LilCookies._time_independent_equals(parts[2], signature):\n logging.warning(\"Invalid cookie signature %r\", value)\n return None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99101:Expr_L67_C6", "label": "warning()", "type": "expression", "loc": [67, 67], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99101:If_L66_C4", "vector": [8, 3, 0.3988, 0.006, 3, 0.07, 0.0, 320, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "warning", "arg_names": [], "import_names": [], "rhs_call_name": "warning", "annotation": ""}, "snippet": " logging.warning(\"Invalid cookie signature %r\", value)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99101:Return_L68_C6", "label": "return", "type": "return", "loc": [68, 68], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99101:If_L66_C4", "vector": [13, 3, 0.4048, 0.006, 3, 0.07, 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_99101:Assign_L69_C4", "label": "timestamp = int()", "type": "assigned_variable", "loc": [69, 69], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99101:FunctionDef_L59_C2", "vector": [14, 2, 0.4107, 0.006, 2, 0.97, 0.7778, 834, 3, 1, 0, 0, 901, 10, 1], "semantic": {"name": "timestamp", "arg_names": [], "import_names": [], "rhs_call_name": "int", "annotation": ""}, "snippet": " timestamp = int(parts[1])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99101:If_L70_C4", "label": "if", "type": "if", "loc": [70, 72], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99101:FunctionDef_L59_C2", "vector": [4, 2, 0.4226, 0.0179, 2, 0.97, 0.8889, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if timestamp < time.time() - 31 * 86400:\n logging.warning(\"Expired cookie %r\", value)\n return None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99101:Expr_L71_C6", "label": "warning()", "type": "expression", "loc": [71, 71], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99101:If_L70_C4", "vector": [8, 3, 0.4226, 0.006, 3, 0.99, 0.0, 320, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "warning", "arg_names": [], "import_names": [], "rhs_call_name": "warning", "annotation": ""}, "snippet": " logging.warning(\"Expired cookie %r\", value)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99101:Return_L72_C6", "label": "return", "type": "return", "loc": [72, 72], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99101:If_L70_C4", "vector": [13, 3, 0.4286, 0.006, 3, 0.99, 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_99101:Try_L73_C4", "label": "try", "type": "try", "loc": [73, 76], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99101:FunctionDef_L59_C2", "vector": [7, 2, 0.4435, 0.0238, 2, 0.97, 1.0, 0, 0, 1, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " try:\n return base64.b64decode(parts[0])\n except:\n return None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99101:Return_L74_C6", "label": "return", "type": "return", "loc": [74, 74], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99101:Try_L73_C4", "vector": [13, 3, 0.4405, 0.006, 3, 0.68, 0.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return base64.b64decode(parts[0])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99101:Return_L76_C6", "label": "return", "type": "return", "loc": [76, 76], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99101:Try_L73_C4", "vector": [13, 3, 0.4524, 0.006, 3, 0.68, 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_99101:FunctionDef_L78_C2", "label": "__init__", "type": "function", "loc": [78, 88], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99101:ClassDef_L23_C0", "vector": [2, 1, 0.494, 0.0655, 1, 0.27, 0.3846, 555, 0, 3, 0, 0, 0, 0, 2], "semantic": {"name": "__init__", "arg_names": ["self", "handler", "cookie_secret"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, handler, cookie_secret):\n \"\"\"You must specify the cookie_secret to use any of the secure methods.\n It should be a long, random sequence of bytes to be used as the HMAC\n secret for the signature.\n \"\"\"\n if len(cookie_secret) < 45:\n raise ValueError(\"LilCookies cookie_secret should at least be 45 characters long, but got `%s`\" % cookie_secret)\n self.handler = handler"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99101:Expr_L79_C4", "label": "expression", "type": "expression", "loc": [79, 82], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99101:FunctionDef_L78_C2", "vector": [8, 2, 0.4792, 0.0238, 2, 0.46, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"You must specify the cookie_secret to use any of the secure methods.\n It should be a long, random sequence of bytes to be used as the HMAC\n secret for the signature.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99101:If_L83_C4", "label": "if", "type": "if", "loc": [83, 84], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99101:FunctionDef_L78_C2", "vector": [4, 2, 0.497, 0.0119, 2, 0.46, 0.2, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if len(cookie_secret) < 45:\n raise ValueError(\"LilCookies cookie_secret should at least be 45 characters long, but got `%s`\" % cookie_secret)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99101:Assign_L85_C4", "label": "self.handler =", "type": "assigned_variable", "loc": [85, 85], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99101:FunctionDef_L78_C2", "vector": [14, 2, 0.506, 0.006, 2, 0.46, 0.4, 668, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.handler", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.handler = handler"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99101:Assign_L86_C4", "label": "self.request =", "type": "assigned_variable", "loc": [86, 86], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99101:FunctionDef_L78_C2", "vector": [14, 2, 0.5119, 0.006, 2, 0.46, 0.6, 952, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.request", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.request = handler.request"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99101:Assign_L87_C4", "label": "self.response =", "type": "assigned_variable", "loc": [87, 87], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99101:FunctionDef_L78_C2", "vector": [14, 2, 0.5179, 0.006, 2, 0.46, 0.8, 498, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.response", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.response = handler.response"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99101:Assign_L88_C4", "label": "self.cookie_secret =", "type": "assigned_variable", "loc": [88, 88], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99101:FunctionDef_L78_C2", "vector": [14, 2, 0.5238, 0.006, 2, 0.46, 1.0, 852, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.cookie_secret", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.cookie_secret = cookie_secret"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99101:FunctionDef_L90_C2", "label": "cookies", "type": "function", "loc": [90, 99], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99101:ClassDef_L23_C0", "vector": [2, 1, 0.5625, 0.0595, 1, 0.27, 0.4615, 711, 0, 1, 1, 0, 0, 0, 4], "semantic": {"name": "cookies", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def cookies(self):\n \"\"\"A dictionary of Cookie.Morsel objects.\"\"\"\n if not hasattr(self, \"_cookies\"):\n self._cookies = Cookie.BaseCookie()\n if \"Cookie\" in self.request.headers:\n try:\n self._cookies.load(self.request.headers[\"Cookie\"])\n except:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99101:Expr_L91_C4", "label": "expression", "type": "expression", "loc": [91, 91], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99101:FunctionDef_L90_C2", "vector": [8, 2, 0.5417, 0.006, 2, 0.88, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"A dictionary of Cookie.Morsel objects.\"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99101:If_L92_C4", "label": "if", "type": "if", "loc": [92, 98], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99101:FunctionDef_L90_C2", "vector": [4, 2, 0.5655, 0.0417, 2, 0.88, 0.5, 0, 0, 0, 0, 0, 0, 0, 4], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not hasattr(self, \"_cookies\"):\n self._cookies = Cookie.BaseCookie()\n if \"Cookie\" in self.request.headers:\n try:\n self._cookies.load(self.request.headers[\"Cookie\"])\n except:\n self.clear_all_cookies()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99101:Assign_L93_C6", "label": "self._cookies = BaseCookie()", "type": "assigned_variable", "loc": [93, 93], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99101:If_L92_C4", "vector": [14, 3, 0.5536, 0.006, 3, 0.77, 0.0, 598, 3, 0, 0, 0, 884, 10, 1], "semantic": {"name": "self._cookies", "arg_names": [], "import_names": [], "rhs_call_name": "BaseCookie", "annotation": ""}, "snippet": " self._cookies = Cookie.BaseCookie()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99101:If_L94_C6", "label": "if", "type": "if", "loc": [94, 98], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99101:If_L92_C4", "vector": [4, 3, 0.5714, 0.0298, 3, 0.77, 1.0, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if \"Cookie\" in self.request.headers:\n try:\n self._cookies.load(self.request.headers[\"Cookie\"])\n except:\n self.clear_all_cookies()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99101:Try_L95_C8", "label": "try", "type": "try", "loc": [95, 98], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99101:If_L94_C6", "vector": [7, 4, 0.5744, 0.0238, 4, 0.0, 0.0, 0, 0, 1, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " try:\n self._cookies.load(self.request.headers[\"Cookie\"])\n except:\n self.clear_all_cookies()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99101:Expr_L96_C10", "label": "load()", "type": "expression", "loc": [96, 96], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99101:Try_L95_C8", "vector": [8, 5, 0.5714, 0.006, 5, 0.24, 0.0, 37, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "load", "arg_names": [], "import_names": [], "rhs_call_name": "load", "annotation": ""}, "snippet": " self._cookies.load(self.request.headers[\"Cookie\"])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99101:Expr_L98_C10", "label": "clear_all_cookies()", "type": "expression", "loc": [98, 98], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99101:Try_L95_C8", "vector": [8, 5, 0.5833, 0.006, 5, 0.24, 0.0, 342, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "clear_all_cookies", "arg_names": [], "import_names": [], "rhs_call_name": "clear_all_cookies", "annotation": ""}, "snippet": " self.clear_all_cookies()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99101:Return_L99_C4", "label": "return", "type": "return", "loc": [99, 99], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99101:FunctionDef_L90_C2", "vector": [13, 2, 0.5893, 0.006, 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._cookies"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99101:FunctionDef_L101_C2", "label": "get_cookie", "type": "function", "loc": [101, 105], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99101:ClassDef_L23_C0", "vector": [2, 1, 0.6131, 0.0298, 1, 0.27, 0.5385, 678, 0, 3, 1, 0, 0, 0, 1], "semantic": {"name": "get_cookie", "arg_names": ["self", "name", "default"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def get_cookie(self, name, default=None):\n \"\"\"Gets the value of the cookie with the given name, else default.\"\"\"\n if name in self.cookies():\n return self._cookies[name].value\n return default"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99101:Expr_L102_C4", "label": "expression", "type": "expression", "loc": [102, 102], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99101:FunctionDef_L101_C2", "vector": [8, 2, 0.6071, 0.006, 2, 0.88, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Gets the value of the cookie with the given name, else default.\"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99101:If_L103_C4", "label": "if", "type": "if", "loc": [103, 104], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99101:FunctionDef_L101_C2", "vector": [4, 2, 0.6161, 0.0119, 2, 0.88, 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.cookies():\n return self._cookies[name].value"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99101:Return_L104_C6", "label": "return", "type": "return", "loc": [104, 104], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99101:If_L103_C4", "vector": [13, 3, 0.619, 0.006, 3, 0.05, 0.0, 0, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self._cookies[name].value"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99101:Return_L105_C4", "label": "return", "type": "return", "loc": [105, 105], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99101:FunctionDef_L101_C2", "vector": [13, 2, 0.625, 0.006, 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 default"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99101:FunctionDef_L107_C2", "label": "set_cookie", "type": "function", "loc": [107, 141], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99101:ClassDef_L23_C0", "vector": [2, 1, 0.7381, 0.2083, 1, 0.27, 0.6154, 146, 0, 8, 0, 0, 0, 0, 16], "semantic": {"name": "set_cookie", "arg_names": ["self", "name", "value", "domain", "expires", "path", "expires_days", "kwargs"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def set_cookie(self, name, value, domain=None, expires=None, path=\"/\",\n expires_days=None, **kwargs):\n \"\"\"Sets the given cookie name/value with the given options.\n\n Additional keyword arguments are set on the Cookie.Morsel\n directly.\n See http://docs.python.org/library/cookie.html#morsel-objects\n for available attributes."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99101:Expr_L109_C4", "label": "expression", "type": "expression", "loc": [109, 115], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99101:FunctionDef_L107_C2", "vector": [8, 2, 0.6667, 0.0417, 2, 0.6, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Sets the given cookie name/value with the given options.\n\n Additional keyword arguments are set on the Cookie.Morsel\n directly.\n See http://docs.python.org/library/cookie.html#morsel-objects\n for available attributes.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99101:Assign_L116_C4", "label": "name = _utf8()", "type": "assigned_variable", "loc": [116, 116], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99101:FunctionDef_L107_C2", "vector": [14, 2, 0.6905, 0.006, 2, 0.6, 0.0769, 57, 3, 1, 0, 0, 587, 10, 1], "semantic": {"name": "name", "arg_names": [], "import_names": [], "rhs_call_name": "_utf8", "annotation": ""}, "snippet": " name = LilCookies._utf8(name)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99101:Assign_L117_C4", "label": "value = _utf8()", "type": "assigned_variable", "loc": [117, 117], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99101:FunctionDef_L107_C2", "vector": [14, 2, 0.6964, 0.006, 2, 0.6, 0.1538, 441, 3, 1, 0, 0, 587, 10, 1], "semantic": {"name": "value", "arg_names": [], "import_names": [], "rhs_call_name": "_utf8", "annotation": ""}, "snippet": " value = LilCookies._utf8(value)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99101:If_L118_C4", "label": "if", "type": "if", "loc": [118, 120], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99101:FunctionDef_L107_C2", "vector": [4, 2, 0.7083, 0.0179, 2, 0.6, 0.2308, 0, 3, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if re.search(r\"[\\x00-\\x20]\", name + value):\n # Don't let us accidentally inject bad stuff\n raise ValueError(\"Invalid cookie %r: %r\" % (name, value))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99101:If_L121_C4", "label": "if", "type": "if", "loc": [121, 122], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99101:FunctionDef_L107_C2", "vector": [4, 2, 0.7232, 0.0119, 2, 0.6, 0.3077, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not hasattr(self, \"_new_cookies\"):\n self._new_cookies = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99101:Assign_L122_C6", "label": "self._new_cookies =", "type": "assigned_variable", "loc": [122, 122], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99101:If_L121_C4", "vector": [14, 3, 0.7262, 0.006, 3, 0.6, 0.0, 20, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "self._new_cookies", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self._new_cookies = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99101:Assign_L123_C4", "label": "new_cookie = BaseCookie()", "type": "assigned_variable", "loc": [123, 123], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99101:FunctionDef_L107_C2", "vector": [14, 2, 0.7321, 0.006, 2, 0.6, 0.3846, 512, 3, 0, 0, 0, 884, 10, 1], "semantic": {"name": "new_cookie", "arg_names": [], "import_names": [], "rhs_call_name": "BaseCookie", "annotation": ""}, "snippet": " new_cookie = Cookie.BaseCookie()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99101:Expr_L124_C4", "label": "append()", "type": "expression", "loc": [124, 124], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99101:FunctionDef_L107_C2", "vector": [8, 2, 0.7381, 0.006, 2, 0.6, 0.4615, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " self._new_cookies.append(new_cookie)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99101:Assign_L125_C4", "label": "assign", "type": "assigned_variable", "loc": [125, 125], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99101:FunctionDef_L107_C2", "vector": [14, 2, 0.744, 0.006, 2, 0.6, 0.5385, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " new_cookie[name] = value"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99101:If_L126_C4", "label": "if", "type": "if", "loc": [126, 127], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99101:FunctionDef_L107_C2", "vector": [4, 2, 0.753, 0.0119, 2, 0.6, 0.6154, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if domain:\n new_cookie[name][\"domain\"] = domain"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99101:Assign_L127_C6", "label": "assign", "type": "assigned_variable", "loc": [127, 127], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99101:If_L126_C4", "vector": [14, 3, 0.756, 0.006, 3, 0.59, 0.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " new_cookie[name][\"domain\"] = domain"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99101:If_L128_C4", "label": "if", "type": "if", "loc": [128, 129], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99101:FunctionDef_L107_C2", "vector": [4, 2, 0.7649, 0.0119, 2, 0.6, 0.6923, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if expires_days is not None and not expires:\n expires = datetime.datetime.utcnow() + datetime.timedelta(days=expires_days)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99101:Assign_L129_C6", "label": "expires =", "type": "assigned_variable", "loc": [129, 129], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99101:If_L128_C4", "vector": [14, 3, 0.7679, 0.006, 3, 0.77, 0.0, 741, 4, 0, 0, 0, 0, 0, 2], "semantic": {"name": "expires", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " expires = datetime.datetime.utcnow() + datetime.timedelta(days=expires_days)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99101:If_L130_C4", "label": "if", "type": "if", "loc": [130, 133], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99101:FunctionDef_L107_C2", "vector": [4, 2, 0.7827, 0.0238, 2, 0.6, 0.7692, 0, 2, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if expires:\n timestamp = calendar.timegm(expires.utctimetuple())\n new_cookie[name][\"expires\"] = email.utils.formatdate(\n timestamp, localtime=False, usegmt=True)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99101:Assign_L131_C6", "label": "timestamp = timegm()", "type": "assigned_variable", "loc": [131, 131], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99101:If_L130_C4", "vector": [14, 3, 0.7798, 0.006, 3, 0.19, 0.0, 834, 3, 1, 0, 0, 109, 10, 2], "semantic": {"name": "timestamp", "arg_names": [], "import_names": [], "rhs_call_name": "timegm", "annotation": ""}, "snippet": " timestamp = calendar.timegm(expires.utctimetuple())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99101:Assign_L132_C6", "label": " = formatdate()", "type": "assigned_variable", "loc": [132, 133], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99101:If_L130_C4", "vector": [14, 3, 0.7887, 0.0119, 3, 0.19, 1.0, 0, 3, 3, 0, 0, 722, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "formatdate", "annotation": ""}, "snippet": " new_cookie[name][\"expires\"] = email.utils.formatdate(\n timestamp, localtime=False, usegmt=True)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99101:If_L134_C4", "label": "if", "type": "if", "loc": [134, 135], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99101:FunctionDef_L107_C2", "vector": [4, 2, 0.8006, 0.0119, 2, 0.6, 0.8462, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if path:\n new_cookie[name][\"path\"] = path"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99101:Assign_L135_C6", "label": "assign", "type": "assigned_variable", "loc": [135, 135], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99101:If_L134_C4", "vector": [14, 3, 0.8036, 0.006, 3, 0.84, 0.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " new_cookie[name][\"path\"] = path"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99101:For_L136_C4", "label": "for k, v", "type": "for", "loc": [136, 137], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99101:FunctionDef_L107_C2", "vector": [6, 2, 0.8125, 0.0119, 2, 0.6, 0.9231, 867, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "k, v", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for k, v in kwargs.iteritems():\n new_cookie[name][k] = v"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99101:Assign_L137_C6", "label": "assign", "type": "assigned_variable", "loc": [137, 137], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99101:For_L136_C4", "vector": [14, 3, 0.8155, 0.006, 3, 0.31, 0.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " new_cookie[name][k] = v"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99101:For_L140_C4", "label": "for vals", "type": "for", "loc": [140, 141], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99101:FunctionDef_L107_C2", "vector": [6, 2, 0.8363, 0.0119, 2, 0.6, 1.0, 17, 3, 0, 0, 0, 0, 0, 3], "semantic": {"name": "vals", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for vals in new_cookie.values():\n self.response.headers._headers.append(('Set-Cookie', vals.OutputString(None)))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99101:Expr_L141_C6", "label": "append()", "type": "expression", "loc": [141, 141], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99101:For_L140_C4", "vector": [8, 3, 0.8393, 0.006, 3, 0.4, 0.0, 243, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " self.response.headers._headers.append(('Set-Cookie', vals.OutputString(None)))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99101:FunctionDef_L143_C2", "label": "clear_cookie", "type": "function", "loc": [143, 147], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99101:ClassDef_L23_C0", "vector": [2, 1, 0.8631, 0.0298, 1, 0.27, 0.6923, 145, 0, 4, 0, 0, 0, 0, 3], "semantic": {"name": "clear_cookie", "arg_names": ["self", "name", "path", "domain"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def clear_cookie(self, name, path=\"/\", domain=None):\n \"\"\"Deletes the cookie with the given name.\"\"\"\n expires = datetime.datetime.utcnow() - datetime.timedelta(days=365)\n self.set_cookie(name, value=\"\", path=path, expires=expires,\n domain=domain)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99101:Expr_L144_C4", "label": "expression", "type": "expression", "loc": [144, 144], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99101:FunctionDef_L143_C2", "vector": [8, 2, 0.8571, 0.006, 2, 0.72, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Deletes the cookie with the given name.\"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99101:Assign_L145_C4", "label": "expires =", "type": "assigned_variable", "loc": [145, 145], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99101:FunctionDef_L143_C2", "vector": [14, 2, 0.8631, 0.006, 2, 0.72, 0.5, 741, 4, 0, 0, 0, 0, 0, 2], "semantic": {"name": "expires", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " expires = datetime.datetime.utcnow() - datetime.timedelta(days=365)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99101:Expr_L146_C4", "label": "set_cookie()", "type": "expression", "loc": [146, 147], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99101:FunctionDef_L143_C2", "vector": [8, 2, 0.872, 0.0119, 2, 0.72, 1.0, 146, 3, 5, 0, 0, 0, 0, 1], "semantic": {"name": "set_cookie", "arg_names": [], "import_names": [], "rhs_call_name": "set_cookie", "annotation": ""}, "snippet": " self.set_cookie(name, value=\"\", path=path, expires=expires,\n domain=domain)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99101:FunctionDef_L149_C2", "label": "clear_all_cookies", "type": "function", "loc": [149, 152], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99101:ClassDef_L23_C0", "vector": [2, 1, 0.8958, 0.0238, 1, 0.27, 0.7692, 342, 0, 1, 0, 0, 0, 0, 3], "semantic": {"name": "clear_all_cookies", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def clear_all_cookies(self):\n \"\"\"Deletes all the cookies the user sent with this request.\"\"\"\n for name in self.cookies().iterkeys():\n self.clear_cookie(name)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99101:Expr_L150_C4", "label": "expression", "type": "expression", "loc": [150, 150], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99101:FunctionDef_L149_C2", "vector": [8, 2, 0.8929, 0.006, 2, 0.88, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Deletes all the cookies the user sent with this request.\"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99101:For_L151_C4", "label": "for name", "type": "for", "loc": [151, 152], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99101:FunctionDef_L149_C2", "vector": [6, 2, 0.9018, 0.0119, 2, 0.88, 1.0, 57, 3, 0, 0, 0, 0, 0, 3], "semantic": {"name": "name", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for name in self.cookies().iterkeys():\n self.clear_cookie(name)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99101:Expr_L152_C6", "label": "clear_cookie()", "type": "expression", "loc": [152, 152], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99101:For_L151_C4", "vector": [8, 3, 0.9048, 0.006, 3, 0.73, 0.0, 145, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "clear_cookie", "arg_names": [], "import_names": [], "rhs_call_name": "clear_cookie", "annotation": ""}, "snippet": " self.clear_cookie(name)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99101:FunctionDef_L154_C2", "label": "set_secure_cookie", "type": "function", "loc": [154, 160], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99101:ClassDef_L23_C0", "vector": [2, 1, 0.9345, 0.0417, 1, 0.27, 0.8462, 330, 0, 5, 0, 0, 0, 0, 2], "semantic": {"name": "set_secure_cookie", "arg_names": ["self", "name", "value", "expires_days", "kwargs"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def set_secure_cookie(self, name, value, expires_days=30, **kwargs):\n \"\"\"Signs and timestamps a cookie so it cannot be forged.\n\n To read a cookie set with this method, use get_secure_cookie().\n \"\"\"\n value = LilCookies._signed_cookie_value(self.cookie_secret, name, value)\n self.set_cookie(name, value, expires_days=expires_days, **kwargs)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99101:Expr_L155_C4", "label": "expression", "type": "expression", "loc": [155, 158], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99101:FunctionDef_L154_C2", "vector": [8, 2, 0.9315, 0.0238, 2, 0.43, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Signs and timestamps a cookie so it cannot be forged.\n\n To read a cookie set with this method, use get_secure_cookie().\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99101:Assign_L159_C4", "label": "value = _signed_cookie_value()", "type": "assigned_variable", "loc": [159, 159], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99101:FunctionDef_L154_C2", "vector": [14, 2, 0.9464, 0.006, 2, 0.43, 0.5, 441, 3, 3, 0, 0, 862, 10, 1], "semantic": {"name": "value", "arg_names": [], "import_names": [], "rhs_call_name": "_signed_cookie_value", "annotation": ""}, "snippet": " value = LilCookies._signed_cookie_value(self.cookie_secret, name, value)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99101:Expr_L160_C4", "label": "set_cookie()", "type": "expression", "loc": [160, 160], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99101:FunctionDef_L154_C2", "vector": [8, 2, 0.9524, 0.006, 2, 0.43, 1.0, 146, 3, 4, 0, 0, 0, 0, 1], "semantic": {"name": "set_cookie", "arg_names": [], "import_names": [], "rhs_call_name": "set_cookie", "annotation": ""}, "snippet": " self.set_cookie(name, value, expires_days=expires_days, **kwargs)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99101:FunctionDef_L162_C2", "label": "get_secure_cookie", "type": "function", "loc": [162, 165], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99101:ClassDef_L23_C0", "vector": [2, 1, 0.9732, 0.0238, 1, 0.27, 0.9231, 71, 0, 3, 1, 0, 0, 0, 2], "semantic": {"name": "get_secure_cookie", "arg_names": ["self", "name", "value"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def get_secure_cookie(self, name, value=None):\n \"\"\"Returns the given signed cookie if it validates, or None.\"\"\"\n if value is None: value = self.get_cookie(name)\n return LilCookies._verified_cookie_value(self.cookie_secret, name, value)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99101:Expr_L163_C4", "label": "expression", "type": "expression", "loc": [163, 163], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99101:FunctionDef_L162_C2", "vector": [8, 2, 0.9702, 0.006, 2, 0.36, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Returns the given signed cookie if it validates, or None.\"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99101:If_L164_C4", "label": "if", "type": "if", "loc": [164, 164], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99101:FunctionDef_L162_C2", "vector": [4, 2, 0.9762, 0.006, 2, 0.36, 0.5, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if value is None: value = self.get_cookie(name)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99101:Assign_L164_C22", "label": "value = get_cookie()", "type": "assigned_variable", "loc": [164, 164], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99101:If_L164_C4", "vector": [14, 3, 0.9762, 0.006, 3, 0.71, 0.0, 441, 3, 1, 0, 0, 678, 10, 1], "semantic": {"name": "value", "arg_names": [], "import_names": [], "rhs_call_name": "get_cookie", "annotation": ""}, "snippet": " if value is None: value = self.get_cookie(name)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99101:Return_L165_C4", "label": "return", "type": "return", "loc": [165, 165], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99101:FunctionDef_L162_C2", "vector": [13, 2, 0.9821, 0.006, 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 LilCookies._verified_cookie_value(self.cookie_secret, name, value)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99101:FunctionDef_L167_C2", "label": "_cookie_signature", "type": "function", "loc": [167, 168], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99101:ClassDef_L23_C0", "vector": [2, 1, 0.997, 0.0119, 1, 0.27, 1.0, 847, 0, 2, 1, 0, 0, 0, 1], "semantic": {"name": "_cookie_signature", "arg_names": ["self", "parts"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _cookie_signature(self, *parts):\n return LilCookies._signature_from_secret(self.cookie_secret)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99101:Return_L168_C4", "label": "return", "type": "return", "loc": [168, 168], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99101:FunctionDef_L167_C2", "vector": [13, 2, 1.0, 0.006, 2, 0.5, 0.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return LilCookies._signature_from_secret(self.cookie_secret)"}]
[{"f": "ajibawa-2023/Python-Code-Large/train/row_99101:ClassDef_L23_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99101:FunctionDef_L26_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99101:FunctionDef_L26_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99101:If_L27_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99101:If_L27_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99101:Return_L28_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99101:FunctionDef_L26_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99101:Return_L30_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99101:ClassDef_L23_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99101:FunctionDef_L33_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99101:FunctionDef_L33_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99101:If_L34_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99101:If_L34_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99101:Return_L35_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99101:FunctionDef_L33_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99101:Assign_L36_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99101:FunctionDef_L33_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99101:For_L37_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99101:FunctionDef_L33_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99101:Return_L39_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99101:ClassDef_L23_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99101:FunctionDef_L42_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99101:FunctionDef_L42_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99101:Expr_L43_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99101:FunctionDef_L42_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99101:Assign_L44_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99101:FunctionDef_L42_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99101:For_L45_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99101:For_L45_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99101:Expr_L45_C23"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99101:FunctionDef_L42_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99101:Return_L46_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99101:ClassDef_L23_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99101:FunctionDef_L49_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99101:FunctionDef_L49_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99101:Expr_L50_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99101:FunctionDef_L49_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99101:Assign_L53_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99101:FunctionDef_L49_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99101:Assign_L54_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99101:FunctionDef_L49_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99101:Assign_L55_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99101:FunctionDef_L49_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99101:Return_L56_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99101:ClassDef_L23_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99101:FunctionDef_L59_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99101:FunctionDef_L59_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99101:Expr_L60_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99101:FunctionDef_L59_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99101:Assign_L61_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99101:FunctionDef_L59_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99101:If_L62_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99101:If_L62_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99101:Return_L62_C18"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99101:FunctionDef_L59_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99101:Assign_L63_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99101:FunctionDef_L59_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99101:If_L64_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99101:If_L64_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99101:Return_L64_C24"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99101:FunctionDef_L59_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99101:Assign_L65_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99101:FunctionDef_L59_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99101:If_L66_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99101:If_L66_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99101:Expr_L67_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99101:If_L66_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99101:Return_L68_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99101:FunctionDef_L59_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99101:Assign_L69_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99101:FunctionDef_L59_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99101:If_L70_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99101:If_L70_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99101:Expr_L71_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99101:If_L70_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99101:Return_L72_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99101:FunctionDef_L59_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99101:Try_L73_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99101:Try_L73_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99101:Return_L74_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99101:Try_L73_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99101:Return_L76_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99101:ClassDef_L23_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99101:FunctionDef_L78_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99101:FunctionDef_L78_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99101:Expr_L79_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99101:FunctionDef_L78_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99101:If_L83_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99101:FunctionDef_L78_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99101:Assign_L85_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99101:FunctionDef_L78_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99101:Assign_L86_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99101:FunctionDef_L78_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99101:Assign_L87_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99101:FunctionDef_L78_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99101:Assign_L88_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99101:ClassDef_L23_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99101:FunctionDef_L90_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99101:FunctionDef_L90_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99101:Expr_L91_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99101:FunctionDef_L90_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99101:If_L92_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99101:If_L92_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99101:Assign_L93_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99101:If_L92_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99101:If_L94_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99101:If_L94_C6", "t": "ajibawa-2023/Python-Code-Large/train/row_99101:Try_L95_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99101:Try_L95_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99101:Expr_L96_C10"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99101:Try_L95_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99101:Expr_L98_C10"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99101:FunctionDef_L90_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99101:Return_L99_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99101:ClassDef_L23_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99101:FunctionDef_L101_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99101:FunctionDef_L101_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99101:Expr_L102_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99101:FunctionDef_L101_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99101:If_L103_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99101:If_L103_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99101:Return_L104_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99101:FunctionDef_L101_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99101:Return_L105_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99101:ClassDef_L23_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99101:FunctionDef_L107_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99101:FunctionDef_L107_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99101:Expr_L109_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99101:FunctionDef_L107_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99101:Assign_L116_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99101:FunctionDef_L107_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99101:Assign_L117_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99101:FunctionDef_L107_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99101:If_L118_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99101:FunctionDef_L107_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99101:If_L121_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99101:If_L121_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99101:Assign_L122_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99101:FunctionDef_L107_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99101:Assign_L123_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99101:FunctionDef_L107_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99101:Expr_L124_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99101:FunctionDef_L107_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99101:Assign_L125_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99101:FunctionDef_L107_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99101:If_L126_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99101:If_L126_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99101:Assign_L127_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99101:FunctionDef_L107_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99101:If_L128_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99101:If_L128_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99101:Assign_L129_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99101:FunctionDef_L107_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99101:If_L130_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99101:If_L130_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99101:Assign_L131_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99101:If_L130_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99101:Assign_L132_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99101:FunctionDef_L107_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99101:If_L134_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99101:If_L134_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99101:Assign_L135_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99101:FunctionDef_L107_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99101:For_L136_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99101:For_L136_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99101:Assign_L137_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99101:FunctionDef_L107_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99101:For_L140_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99101:For_L140_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99101:Expr_L141_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99101:ClassDef_L23_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99101:FunctionDef_L143_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99101:FunctionDef_L143_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99101:Expr_L144_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99101:FunctionDef_L143_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99101:Assign_L145_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99101:FunctionDef_L143_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99101:Expr_L146_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99101:ClassDef_L23_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99101:FunctionDef_L149_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99101:FunctionDef_L149_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99101:Expr_L150_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99101:FunctionDef_L149_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99101:For_L151_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99101:For_L151_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99101:Expr_L152_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99101:ClassDef_L23_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99101:FunctionDef_L154_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99101:FunctionDef_L154_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99101:Expr_L155_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99101:FunctionDef_L154_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99101:Assign_L159_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99101:FunctionDef_L154_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99101:Expr_L160_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99101:ClassDef_L23_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99101:FunctionDef_L162_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99101:FunctionDef_L162_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99101:Expr_L163_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99101:FunctionDef_L162_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99101:If_L164_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99101:If_L164_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99101:Assign_L164_C22"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99101:FunctionDef_L162_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99101:Return_L165_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99101:ClassDef_L23_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99101:FunctionDef_L167_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99101:FunctionDef_L167_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99101:Return_L168_C4"}]
# This is the version of this source code. manual_verstr = "1.5" auto_build_num = "211" verstr = manual_verstr + "." + auto_build_num try: from pyutil.version_class import Version as pyutil_Version __version__ = pyutil_Version(verstr) except (ImportError, ValueError): # Maybe there is no pyutil installed. from distutils.version import LooseVersion as distutils_Version __version__ = distutils_Version(verstr)
ajibawa-2023/Python-Code-Large/train/row_99102
8
18
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_99102:Assign_L3_C0", "label": "manual_verstr =", "type": "assigned_variable", "loc": [3, 3], "level": 0, "parent": null, "vector": [14, 0, 0.1667, 0.0556, 0, 0.66, 0.0, 189, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "manual_verstr", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "manual_verstr = \"1.5\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99102:Assign_L7_C0", "label": "auto_build_num =", "type": "assigned_variable", "loc": [7, 7], "level": 0, "parent": null, "vector": [14, 0, 0.3889, 0.0556, 0, 0.66, 0.3333, 295, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "auto_build_num", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "auto_build_num = \"211\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99102:Assign_L11_C0", "label": "verstr =", "type": "assigned_variable", "loc": [11, 11], "level": 0, "parent": null, "vector": [14, 0, 0.6111, 0.0556, 0, 0.66, 0.6667, 565, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "verstr", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "verstr = manual_verstr + \".\" + auto_build_num"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99102:Try_L12_C0", "label": "try", "type": "try", "loc": [12, 18], "level": 0, "parent": null, "vector": [7, 0, 0.8333, 0.3889, 0, 0.66, 1.0, 0, 0, 1, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "try:\n from pyutil.version_class import Version as pyutil_Version\n __version__ = pyutil_Version(verstr)\nexcept (ImportError, ValueError):\n # Maybe there is no pyutil installed.\n from distutils.version import LooseVersion as distutils_Version\n __version__ = distutils_Version(verstr)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99102:ImportFrom_L13_C4", "label": "from pyutil.version_class import pyutil_Version", "type": "import", "loc": [13, 13], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99102:Try_L12_C0", "vector": [1, 1, 0.7222, 0.0556, 1, 0.83, 0.0, 483, 0, 1, 0, 0, 483, 0, 0], "semantic": {"name": "pyutil.version_class", "arg_names": [], "import_names": ["pyutil_Version"], "rhs_call_name": "", "annotation": ""}, "snippet": " from pyutil.version_class import Version as pyutil_Version"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99102:Assign_L14_C4", "label": "__version__ = pyutil_Version()", "type": "assigned_variable", "loc": [14, 14], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99102:Try_L12_C0", "vector": [14, 1, 0.7778, 0.0556, 1, 0.83, 1.0, 162, 3, 1, 0, 0, 996, 10, 1], "semantic": {"name": "__version__", "arg_names": [], "import_names": [], "rhs_call_name": "pyutil_Version", "annotation": ""}, "snippet": " __version__ = pyutil_Version(verstr)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99102:ImportFrom_L17_C4", "label": "from distutils.version import distutils_Version", "type": "import", "loc": [17, 17], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99102:Try_L12_C0", "vector": [1, 1, 0.9444, 0.0556, 1, 0.83, 0.0, 42, 0, 1, 0, 0, 42, 0, 0], "semantic": {"name": "distutils.version", "arg_names": [], "import_names": ["distutils_Version"], "rhs_call_name": "", "annotation": ""}, "snippet": " from distutils.version import LooseVersion as distutils_Version"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99102:Assign_L18_C4", "label": "__version__ = distutils_Version()", "type": "assigned_variable", "loc": [18, 18], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99102:Try_L12_C0", "vector": [14, 1, 1.0, 0.0556, 1, 0.83, 1.0, 162, 3, 1, 0, 0, 884, 10, 1], "semantic": {"name": "__version__", "arg_names": [], "import_names": [], "rhs_call_name": "distutils_Version", "annotation": ""}, "snippet": " __version__ = distutils_Version(verstr)"}]
[{"f": "ajibawa-2023/Python-Code-Large/train/row_99102:Try_L12_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99102:ImportFrom_L13_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99102:Try_L12_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99102:Assign_L14_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99102:Try_L12_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99102:ImportFrom_L17_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99102:Try_L12_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99102:Assign_L18_C4"}]
""" The MIT License Copyright (c) 2007-2010 Leah Culver, Joe Stump, Mark Paschal, Vic Fryzel Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. """ import oauth2 import smtplib import base64 class SMTP(smtplib.SMTP): """SMTP wrapper for smtplib.SMTP that implements XOAUTH.""" def authenticate(self, url, consumer, token): if consumer is not None and not isinstance(consumer, oauth2.Consumer): raise ValueError("Invalid consumer.") if token is not None and not isinstance(token, oauth2.Token): raise ValueError("Invalid token.") self.docmd('AUTH', 'XOAUTH %s' % \ base64.b64encode(oauth2.build_xoauth_string(url, consumer, token)))
ajibawa-2023/Python-Code-Large/train/row_99103
10
41
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_99103:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 23], "level": 0, "parent": null, "vector": [8, 0, 0.2927, 0.561, 0, 0.66, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\"\"\"\nThe MIT License\n\nCopyright (c) 2007-2010 Leah Culver, Joe Stump, Mark Paschal, Vic Fryzel\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99103:Import_L25_C0", "label": "oauth2 import oauth2", "type": "import", "loc": [25, 25], "level": 0, "parent": null, "vector": [1, 0, 0.6098, 0.0244, 0, 0.66, 0.25, 311, 0, 1, 0, 0, 311, 0, 0], "semantic": {"name": "oauth2", "arg_names": [], "import_names": ["oauth2"], "rhs_call_name": "", "annotation": ""}, "snippet": "import oauth2"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99103:Import_L26_C0", "label": "smtplib import smtplib", "type": "import", "loc": [26, 26], "level": 0, "parent": null, "vector": [1, 0, 0.6341, 0.0244, 0, 0.66, 0.5, 389, 0, 1, 0, 0, 389, 0, 0], "semantic": {"name": "smtplib", "arg_names": [], "import_names": ["smtplib"], "rhs_call_name": "", "annotation": ""}, "snippet": "import smtplib"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99103:Import_L27_C0", "label": "base64 import base64", "type": "import", "loc": [27, 27], "level": 0, "parent": null, "vector": [1, 0, 0.6585, 0.0244, 0, 0.66, 0.75, 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_99103:ClassDef_L30_C0", "label": "SMTP", "type": "class", "loc": [30, 41], "level": 0, "parent": null, "vector": [3, 0, 0.8659, 0.2927, 0, 0.66, 1.0, 709, 0, 1, 0, 0, 243, 0, 7], "semantic": {"name": "SMTP", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class SMTP(smtplib.SMTP):\n \"\"\"SMTP wrapper for smtplib.SMTP that implements XOAUTH.\"\"\"\n\n def authenticate(self, url, consumer, token):\n if consumer is not None and not isinstance(consumer, oauth2.Consumer):\n raise ValueError(\"Invalid consumer.\")\n\n if token is not None and not isinstance(token, oauth2.Token):"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99103:Expr_L31_C4", "label": "expression", "type": "expression", "loc": [31, 31], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99103:ClassDef_L30_C0", "vector": [8, 1, 0.7561, 0.0244, 1, 0.79, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"SMTP wrapper for smtplib.SMTP that implements XOAUTH.\"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99103:FunctionDef_L33_C4", "label": "authenticate", "type": "function", "loc": [33, 41], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99103:ClassDef_L30_C0", "vector": [2, 1, 0.9024, 0.2195, 1, 0.79, 1.0, 751, 0, 4, 0, 0, 0, 0, 7], "semantic": {"name": "authenticate", "arg_names": ["self", "url", "consumer", "token"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def authenticate(self, url, consumer, token):\n if consumer is not None and not isinstance(consumer, oauth2.Consumer):\n raise ValueError(\"Invalid consumer.\")\n\n if token is not None and not isinstance(token, oauth2.Token):\n raise ValueError(\"Invalid token.\")\n\n self.docmd('AUTH', 'XOAUTH %s' % \\"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99103:If_L34_C8", "label": "if", "type": "if", "loc": [34, 35], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99103:FunctionDef_L33_C4", "vector": [4, 2, 0.8415, 0.0488, 2, 0.41, 0.0, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if consumer is not None and not isinstance(consumer, oauth2.Consumer):\n raise ValueError(\"Invalid consumer.\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99103:If_L37_C8", "label": "if", "type": "if", "loc": [37, 38], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99103:FunctionDef_L33_C4", "vector": [4, 2, 0.9146, 0.0488, 2, 0.41, 0.5, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if token is not None and not isinstance(token, oauth2.Token):\n raise ValueError(\"Invalid token.\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99103:Expr_L40_C8", "label": "docmd()", "type": "expression", "loc": [40, 41], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99103:FunctionDef_L33_C4", "vector": [8, 2, 0.9878, 0.0488, 2, 0.41, 1.0, 540, 3, 2, 0, 0, 0, 0, 3], "semantic": {"name": "docmd", "arg_names": [], "import_names": [], "rhs_call_name": "docmd", "annotation": ""}, "snippet": " self.docmd('AUTH', 'XOAUTH %s' % \\\n base64.b64encode(oauth2.build_xoauth_string(url, consumer, token)))"}]
[{"f": "ajibawa-2023/Python-Code-Large/train/row_99103:ClassDef_L30_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99103:Expr_L31_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99103:ClassDef_L30_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99103:FunctionDef_L33_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99103:FunctionDef_L33_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99103:If_L34_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99103:FunctionDef_L33_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99103:If_L37_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99103:FunctionDef_L33_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99103:Expr_L40_C8"}]
""" The MIT License Copyright (c) 2007-2010 Leah Culver, Joe Stump, Mark Paschal, Vic Fryzel Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. """ import oauth2 import imaplib class IMAP4_SSL(imaplib.IMAP4_SSL): """IMAP wrapper for imaplib.IMAP4_SSL that implements XOAUTH.""" def authenticate(self, url, consumer, token): if consumer is not None and not isinstance(consumer, oauth2.Consumer): raise ValueError("Invalid consumer.") if token is not None and not isinstance(token, oauth2.Token): raise ValueError("Invalid token.") imaplib.IMAP4_SSL.authenticate(self, 'XOAUTH', lambda x: oauth2.build_xoauth_string(url, consumer, token))
ajibawa-2023/Python-Code-Large/train/row_99104
9
40
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_99104:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 23], "level": 0, "parent": null, "vector": [8, 0, 0.3, 0.575, 0, 0.66, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\"\"\"\nThe MIT License\n\nCopyright (c) 2007-2010 Leah Culver, Joe Stump, Mark Paschal, Vic Fryzel\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99104:Import_L25_C0", "label": "oauth2 import oauth2", "type": "import", "loc": [25, 25], "level": 0, "parent": null, "vector": [1, 0, 0.625, 0.025, 0, 0.66, 0.3333, 311, 0, 1, 0, 0, 311, 0, 0], "semantic": {"name": "oauth2", "arg_names": [], "import_names": ["oauth2"], "rhs_call_name": "", "annotation": ""}, "snippet": "import oauth2"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99104:Import_L26_C0", "label": "imaplib import imaplib", "type": "import", "loc": [26, 26], "level": 0, "parent": null, "vector": [1, 0, 0.65, 0.025, 0, 0.66, 0.6667, 129, 0, 1, 0, 0, 129, 0, 0], "semantic": {"name": "imaplib", "arg_names": [], "import_names": ["imaplib"], "rhs_call_name": "", "annotation": ""}, "snippet": "import imaplib"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99104:ClassDef_L29_C0", "label": "IMAP4_SSL", "type": "class", "loc": [29, 40], "level": 0, "parent": null, "vector": [3, 0, 0.8625, 0.3, 0, 0.66, 1.0, 215, 0, 1, 0, 0, 962, 0, 6], "semantic": {"name": "IMAP4_SSL", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class IMAP4_SSL(imaplib.IMAP4_SSL):\n \"\"\"IMAP wrapper for imaplib.IMAP4_SSL that implements XOAUTH.\"\"\"\n\n def authenticate(self, url, consumer, token):\n if consumer is not None and not isinstance(consumer, oauth2.Consumer):\n raise ValueError(\"Invalid consumer.\")\n\n if token is not None and not isinstance(token, oauth2.Token):"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99104:Expr_L30_C4", "label": "expression", "type": "expression", "loc": [30, 30], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99104:ClassDef_L29_C0", "vector": [8, 1, 0.75, 0.025, 1, 0.74, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"IMAP wrapper for imaplib.IMAP4_SSL that implements XOAUTH.\"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99104:FunctionDef_L32_C4", "label": "authenticate", "type": "function", "loc": [32, 40], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99104:ClassDef_L29_C0", "vector": [2, 1, 0.9, 0.225, 1, 0.74, 1.0, 751, 0, 4, 0, 0, 0, 0, 6], "semantic": {"name": "authenticate", "arg_names": ["self", "url", "consumer", "token"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def authenticate(self, url, consumer, token):\n if consumer is not None and not isinstance(consumer, oauth2.Consumer):\n raise ValueError(\"Invalid consumer.\")\n\n if token is not None and not isinstance(token, oauth2.Token):\n raise ValueError(\"Invalid token.\")\n\n imaplib.IMAP4_SSL.authenticate(self, 'XOAUTH',"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99104:If_L33_C8", "label": "if", "type": "if", "loc": [33, 34], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99104:FunctionDef_L32_C4", "vector": [4, 2, 0.8375, 0.05, 2, 0.08, 0.0, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if consumer is not None and not isinstance(consumer, oauth2.Consumer):\n raise ValueError(\"Invalid consumer.\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99104:If_L36_C8", "label": "if", "type": "if", "loc": [36, 37], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99104:FunctionDef_L32_C4", "vector": [4, 2, 0.9125, 0.05, 2, 0.08, 0.5, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if token is not None and not isinstance(token, oauth2.Token):\n raise ValueError(\"Invalid token.\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99104:Expr_L39_C8", "label": "authenticate()", "type": "expression", "loc": [39, 40], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99104:FunctionDef_L32_C4", "vector": [8, 2, 0.9875, 0.05, 2, 0.08, 1.0, 751, 3, 3, 0, 0, 0, 0, 2], "semantic": {"name": "authenticate", "arg_names": [], "import_names": [], "rhs_call_name": "authenticate", "annotation": ""}, "snippet": " imaplib.IMAP4_SSL.authenticate(self, 'XOAUTH',\n lambda x: oauth2.build_xoauth_string(url, consumer, token))"}]
[{"f": "ajibawa-2023/Python-Code-Large/train/row_99104:ClassDef_L29_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99104:Expr_L30_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99104:ClassDef_L29_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99104:FunctionDef_L32_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99104:FunctionDef_L32_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99104:If_L33_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99104:FunctionDef_L32_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99104:If_L36_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99104:FunctionDef_L32_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99104:Expr_L39_C8"}]
# Early, and incomplete implementation of -04. # import re import urllib RESERVED = ":/?#[]@!$&'()*+,;=" OPERATOR = "+./;?|!@" EXPLODE = "*+" MODIFIER = ":^" TEMPLATE = re.compile(r"{(?P<operator>[\+\./;\?|!@])?(?P<varlist>[^}]+)}", re.UNICODE) VAR = re.compile(r"^(?P<varname>[^=\+\*:\^]+)((?P<explode>[\+\*])|(?P<partial>[:\^]-?[0-9]+))?(=(?P<default>.*))?$", re.UNICODE) def _tostring(varname, value, explode, operator, safe=""): if type(value) == type([]): if explode == "+": return ",".join([varname + "." + urllib.quote(x, safe) for x in value]) else: return ",".join([urllib.quote(x, safe) for x in value]) if type(value) == type({}): keys = value.keys() keys.sort() if explode == "+": return ",".join([varname + "." + urllib.quote(key, safe) + "," + urllib.quote(value[key], safe) for key in keys]) else: return ",".join([urllib.quote(key, safe) + "," + urllib.quote(value[key], safe) for key in keys]) else: return urllib.quote(value, safe) def _tostring_path(varname, value, explode, operator, safe=""): joiner = operator if type(value) == type([]): if explode == "+": return joiner.join([varname + "." + urllib.quote(x, safe) for x in value]) elif explode == "*": return joiner.join([urllib.quote(x, safe) for x in value]) else: return ",".join([urllib.quote(x, safe) for x in value]) elif type(value) == type({}): keys = value.keys() keys.sort() if explode == "+": return joiner.join([varname + "." + urllib.quote(key, safe) + joiner + urllib.quote(value[key], safe) for key in keys]) elif explode == "*": return joiner.join([urllib.quote(key, safe) + joiner + urllib.quote(value[key], safe) for key in keys]) else: return ",".join([urllib.quote(key, safe) + "," + urllib.quote(value[key], safe) for key in keys]) else: if value: return urllib.quote(value, safe) else: return "" def _tostring_query(varname, value, explode, operator, safe=""): joiner = operator varprefix = "" if operator == "?": joiner = "&" varprefix = varname + "=" if type(value) == type([]): if 0 == len(value): return "" if explode == "+": return joiner.join([varname + "=" + urllib.quote(x, safe) for x in value]) elif explode == "*": return joiner.join([urllib.quote(x, safe) for x in value]) else: return varprefix + ",".join([urllib.quote(x, safe) for x in value]) elif type(value) == type({}): if 0 == len(value): return "" keys = value.keys() keys.sort() if explode == "+": return joiner.join([varname + "." + urllib.quote(key, safe) + "=" + urllib.quote(value[key], safe) for key in keys]) elif explode == "*": return joiner.join([urllib.quote(key, safe) + "=" + urllib.quote(value[key], safe) for key in keys]) else: return varprefix + ",".join([urllib.quote(key, safe) + "," + urllib.quote(value[key], safe) for key in keys]) else: if value: return varname + "=" + urllib.quote(value, safe) else: return varname TOSTRING = { "" : _tostring, "+": _tostring, ";": _tostring_query, "?": _tostring_query, "/": _tostring_path, ".": _tostring_path, } def expand(template, vars): def _sub(match): groupdict = match.groupdict() operator = groupdict.get('operator') if operator is None: operator = '' varlist = groupdict.get('varlist') safe = "@" if operator == '+': safe = RESERVED varspecs = varlist.split(",") varnames = [] defaults = {} for varspec in varspecs: m = VAR.search(varspec) groupdict = m.groupdict() varname = groupdict.get('varname') explode = groupdict.get('explode') partial = groupdict.get('partial') default = groupdict.get('default') if default: defaults[varname] = default varnames.append((varname, explode, partial)) retval = [] joiner = operator prefix = operator if operator == "+": prefix = "" joiner = "," if operator == "?": joiner = "&" if operator == "": joiner = "," for varname, explode, partial in varnames: if varname in vars: value = vars[varname] #if not value and (type(value) == type({}) or type(value) == type([])) and varname in defaults: if not value and value != "" and varname in defaults: value = defaults[varname] elif varname in defaults: value = defaults[varname] else: continue retval.append(TOSTRING[operator](varname, value, explode, operator, safe=safe)) if "".join(retval): return prefix + joiner.join(retval) else: return "" return TEMPLATE.sub(_sub, template)
ajibawa-2023/Python-Code-Large/train/row_99106
112
147
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_99106:Import_L3_C0", "label": "re import re", "type": "import", "loc": [3, 3], "level": 0, "parent": null, "vector": [1, 0, 0.0204, 0.0068, 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_99106:Import_L4_C0", "label": "urllib import urllib", "type": "import", "loc": [4, 4], "level": 0, "parent": null, "vector": [1, 0, 0.0272, 0.0068, 0, 0.66, 0.0833, 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_99106:Assign_L6_C0", "label": "RESERVED =", "type": "assigned_variable", "loc": [6, 6], "level": 0, "parent": null, "vector": [14, 0, 0.0408, 0.0068, 0, 0.66, 0.1667, 137, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "RESERVED", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "RESERVED = \":/?#[]@!$&'()*+,;=\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99106:Assign_L7_C0", "label": "OPERATOR =", "type": "assigned_variable", "loc": [7, 7], "level": 0, "parent": null, "vector": [14, 0, 0.0476, 0.0068, 0, 0.66, 0.25, 758, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "OPERATOR", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "OPERATOR = \"+./;?|!@\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99106:Assign_L8_C0", "label": "EXPLODE =", "type": "assigned_variable", "loc": [8, 8], "level": 0, "parent": null, "vector": [14, 0, 0.0544, 0.0068, 0, 0.66, 0.3333, 695, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "EXPLODE", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "EXPLODE = \"*+\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99106:Assign_L9_C0", "label": "MODIFIER =", "type": "assigned_variable", "loc": [9, 9], "level": 0, "parent": null, "vector": [14, 0, 0.0612, 0.0068, 0, 0.66, 0.4167, 533, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "MODIFIER", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "MODIFIER = \":^\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99106:Assign_L10_C0", "label": "TEMPLATE = compile()", "type": "assigned_variable", "loc": [10, 10], "level": 0, "parent": null, "vector": [14, 0, 0.068, 0.0068, 0, 0.66, 0.5, 762, 3, 2, 0, 0, 821, 10, 1], "semantic": {"name": "TEMPLATE", "arg_names": [], "import_names": [], "rhs_call_name": "compile", "annotation": ""}, "snippet": "TEMPLATE = re.compile(r\"{(?P<operator>[\\+\\./;\\?|!@])?(?P<varlist>[^}]+)}\", re.UNICODE)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99106:Assign_L11_C0", "label": "VAR = compile()", "type": "assigned_variable", "loc": [11, 11], "level": 0, "parent": null, "vector": [14, 0, 0.0748, 0.0068, 0, 0.66, 0.5833, 829, 3, 2, 0, 0, 821, 10, 1], "semantic": {"name": "VAR", "arg_names": [], "import_names": [], "rhs_call_name": "compile", "annotation": ""}, "snippet": "VAR = re.compile(r\"^(?P<varname>[^=\\+\\*:\\^]+)((?P<explode>[\\+\\*])|(?P<partial>[:\\^]-?[0-9]+))?(=(?P<default>.*))?$\", re.UNICODE)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99106:FunctionDef_L13_C0", "label": "_tostring", "type": "function", "loc": [13, 27], "level": 0, "parent": null, "vector": [2, 0, 0.1361, 0.102, 0, 0.66, 0.6667, 60, 0, 5, 1, 0, 0, 0, 17], "semantic": {"name": "_tostring", "arg_names": ["varname", "value", "explode", "operator", "safe"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def _tostring(varname, value, explode, operator, safe=\"\"):\n if type(value) == type([]):\n if explode == \"+\":\n return \",\".join([varname + \".\" + urllib.quote(x, safe) for x in value])\n else:\n return \",\".join([urllib.quote(x, safe) for x in value])\n if type(value) == type({}):\n keys = value.keys()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99106:If_L14_C2", "label": "if", "type": "if", "loc": [14, 18], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99106:FunctionDef_L13_C0", "vector": [4, 1, 0.1088, 0.034, 1, 0.19, 0.0, 0, 0, 0, 0, 0, 0, 0, 6], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if type(value) == type([]):\n if explode == \"+\":\n return \",\".join([varname + \".\" + urllib.quote(x, safe) for x in value])\n else:\n return \",\".join([urllib.quote(x, safe) for x in value])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99106:If_L15_C4", "label": "if", "type": "if", "loc": [15, 18], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99106:If_L14_C2", "vector": [4, 2, 0.1122, 0.0272, 2, 0.28, 0.0, 0, 0, 0, 0, 0, 0, 0, 4], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if explode == \"+\":\n return \",\".join([varname + \".\" + urllib.quote(x, safe) for x in value])\n else:\n return \",\".join([urllib.quote(x, safe) for x in value])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99106:Return_L16_C6", "label": "return", "type": "return", "loc": [16, 16], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99106:If_L15_C4", "vector": [13, 3, 0.1088, 0.0068, 3, 0.19, 0.0, 0, 3, 0, 0, 0, 0, 10, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return \",\".join([varname + \".\" + urllib.quote(x, safe) for x in value])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99106:Return_L18_C6", "label": "return", "type": "return", "loc": [18, 18], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99106:If_L15_C4", "vector": [13, 3, 0.1224, 0.0068, 3, 0.19, 1.0, 0, 3, 0, 0, 0, 0, 10, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return \",\".join([urllib.quote(x, safe) for x in value])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99106:If_L19_C2", "label": "if", "type": "if", "loc": [19, 27], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99106:FunctionDef_L13_C0", "vector": [4, 1, 0.1565, 0.0612, 1, 0.19, 1.0, 0, 0, 0, 0, 0, 0, 0, 11], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if type(value) == type({}):\n keys = value.keys()\n keys.sort()\n if explode == \"+\":\n return \",\".join([varname + \".\" + urllib.quote(key, safe) + \",\" + urllib.quote(value[key], safe) for key in keys])\n else:\n return \",\".join([urllib.quote(key, safe) + \",\" + urllib.quote(value[key], safe) for key in keys])\n else:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99106:Assign_L20_C4", "label": "keys = keys()", "type": "assigned_variable", "loc": [20, 20], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99106:If_L19_C2", "vector": [14, 2, 0.1361, 0.0068, 2, 0.56, 0.0, 204, 3, 0, 0, 0, 204, 10, 1], "semantic": {"name": "keys", "arg_names": [], "import_names": [], "rhs_call_name": "keys", "annotation": ""}, "snippet": " keys = value.keys()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99106:Expr_L21_C4", "label": "sort()", "type": "expression", "loc": [21, 21], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99106:If_L19_C2", "vector": [8, 2, 0.1429, 0.0068, 2, 0.56, 0.3333, 489, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "sort", "arg_names": [], "import_names": [], "rhs_call_name": "sort", "annotation": ""}, "snippet": " keys.sort()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99106:If_L22_C4", "label": "if", "type": "if", "loc": [22, 25], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99106:If_L19_C2", "vector": [4, 2, 0.1599, 0.0272, 2, 0.56, 0.6667, 0, 0, 0, 0, 0, 0, 0, 6], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if explode == \"+\":\n return \",\".join([varname + \".\" + urllib.quote(key, safe) + \",\" + urllib.quote(value[key], safe) for key in keys])\n else:\n return \",\".join([urllib.quote(key, safe) + \",\" + urllib.quote(value[key], safe) for key in keys])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99106:Return_L23_C6", "label": "return", "type": "return", "loc": [23, 23], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99106:If_L22_C4", "vector": [13, 3, 0.1565, 0.0068, 3, 0.61, 0.0, 0, 3, 0, 0, 0, 0, 10, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return \",\".join([varname + \".\" + urllib.quote(key, safe) + \",\" + urllib.quote(value[key], safe) for key in keys])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99106:Return_L25_C6", "label": "return", "type": "return", "loc": [25, 25], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99106:If_L22_C4", "vector": [13, 3, 0.1701, 0.0068, 3, 0.61, 1.0, 0, 3, 0, 0, 0, 0, 10, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return \",\".join([urllib.quote(key, safe) + \",\" + urllib.quote(value[key], safe) for key in keys])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99106:Return_L27_C4", "label": "return", "type": "return", "loc": [27, 27], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99106:If_L19_C2", "vector": [13, 2, 0.1837, 0.0068, 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 urllib.quote(value, safe)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99106:FunctionDef_L30_C0", "label": "_tostring_path", "type": "function", "loc": [30, 52], "level": 0, "parent": null, "vector": [2, 0, 0.2789, 0.1565, 0, 0.66, 0.75, 860, 0, 5, 1, 0, 0, 0, 22], "semantic": {"name": "_tostring_path", "arg_names": ["varname", "value", "explode", "operator", "safe"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def _tostring_path(varname, value, explode, operator, safe=\"\"):\n joiner = operator\n if type(value) == type([]):\n if explode == \"+\":\n return joiner.join([varname + \".\" + urllib.quote(x, safe) for x in value])\n elif explode == \"*\":\n return joiner.join([urllib.quote(x, safe) for x in value])\n else:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99106:Assign_L31_C2", "label": "joiner =", "type": "assigned_variable", "loc": [31, 31], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99106:FunctionDef_L30_C0", "vector": [14, 1, 0.2109, 0.0068, 1, 0.19, 0.0, 555, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "joiner", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " joiner = operator"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99106:If_L32_C2", "label": "if", "type": "if", "loc": [32, 52], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99106:FunctionDef_L30_C0", "vector": [4, 1, 0.2857, 0.1429, 1, 0.19, 1.0, 0, 0, 0, 0, 0, 0, 0, 22], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if type(value) == type([]):\n if explode == \"+\":\n return joiner.join([varname + \".\" + urllib.quote(x, safe) for x in value])\n elif explode == \"*\":\n return joiner.join([urllib.quote(x, safe) for x in value])\n else:\n return \",\".join([urllib.quote(x, safe) for x in value])\n elif type(value) == type({}):"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99106:If_L33_C4", "label": "if", "type": "if", "loc": [33, 38], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99106:If_L32_C2", "vector": [4, 2, 0.2415, 0.0408, 2, 0.43, 0.0, 0, 0, 0, 0, 0, 0, 0, 6], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if explode == \"+\":\n return joiner.join([varname + \".\" + urllib.quote(x, safe) for x in value])\n elif explode == \"*\":\n return joiner.join([urllib.quote(x, safe) for x in value])\n else:\n return \",\".join([urllib.quote(x, safe) for x in value])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99106:Return_L34_C6", "label": "return", "type": "return", "loc": [34, 34], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99106:If_L33_C4", "vector": [13, 3, 0.2313, 0.0068, 3, 0.7, 0.0, 0, 3, 0, 0, 0, 0, 10, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return joiner.join([varname + \".\" + urllib.quote(x, safe) for x in value])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99106:If_L35_C4", "label": "if", "type": "if", "loc": [35, 38], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99106:If_L33_C4", "vector": [4, 3, 0.2483, 0.0272, 3, 0.7, 1.0, 0, 0, 0, 0, 0, 0, 0, 4], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " elif explode == \"*\":\n return joiner.join([urllib.quote(x, safe) for x in value])\n else:\n return \",\".join([urllib.quote(x, safe) for x in value])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99106:Return_L36_C6", "label": "return", "type": "return", "loc": [36, 36], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99106:If_L35_C4", "vector": [13, 4, 0.2449, 0.0068, 4, 0.89, 0.0, 0, 3, 0, 0, 0, 0, 10, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return joiner.join([urllib.quote(x, safe) for x in value])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99106:Return_L38_C6", "label": "return", "type": "return", "loc": [38, 38], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99106:If_L35_C4", "vector": [13, 4, 0.2585, 0.0068, 4, 0.89, 1.0, 0, 3, 0, 0, 0, 0, 10, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return \",\".join([urllib.quote(x, safe) for x in value])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99106:If_L39_C2", "label": "if", "type": "if", "loc": [39, 52], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99106:If_L32_C2", "vector": [4, 2, 0.3095, 0.0952, 2, 0.43, 1.0, 0, 0, 0, 0, 0, 0, 0, 14], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " elif type(value) == type({}):\n keys = value.keys()\n keys.sort()\n if explode == \"+\":\n return joiner.join([varname + \".\" + urllib.quote(key, safe) + joiner + urllib.quote(value[key], safe) for key in keys])\n elif explode == \"*\":\n return joiner.join([urllib.quote(key, safe) + joiner + urllib.quote(value[key], safe) for key in keys])\n else:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99106:Assign_L40_C4", "label": "keys = keys()", "type": "assigned_variable", "loc": [40, 40], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99106:If_L39_C2", "vector": [14, 3, 0.2721, 0.0068, 3, 0.31, 0.0, 204, 3, 0, 0, 0, 204, 10, 1], "semantic": {"name": "keys", "arg_names": [], "import_names": [], "rhs_call_name": "keys", "annotation": ""}, "snippet": " keys = value.keys()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99106:Expr_L41_C4", "label": "sort()", "type": "expression", "loc": [41, 41], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99106:If_L39_C2", "vector": [8, 3, 0.2789, 0.0068, 3, 0.31, 0.3333, 489, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "sort", "arg_names": [], "import_names": [], "rhs_call_name": "sort", "annotation": ""}, "snippet": " keys.sort()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99106:If_L42_C4", "label": "if", "type": "if", "loc": [42, 47], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99106:If_L39_C2", "vector": [4, 3, 0.3027, 0.0408, 3, 0.31, 0.6667, 0, 0, 0, 0, 0, 0, 0, 9], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if explode == \"+\":\n return joiner.join([varname + \".\" + urllib.quote(key, safe) + joiner + urllib.quote(value[key], safe) for key in keys])\n elif explode == \"*\":\n return joiner.join([urllib.quote(key, safe) + joiner + urllib.quote(value[key], safe) for key in keys])\n else:\n return \",\".join([urllib.quote(key, safe) + \",\" + urllib.quote(value[key], safe) for key in keys])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99106:Return_L43_C6", "label": "return", "type": "return", "loc": [43, 43], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99106:If_L42_C4", "vector": [13, 4, 0.2925, 0.0068, 4, 0.63, 0.0, 0, 3, 0, 0, 0, 0, 10, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return joiner.join([varname + \".\" + urllib.quote(key, safe) + joiner + urllib.quote(value[key], safe) for key in keys])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99106:If_L44_C4", "label": "if", "type": "if", "loc": [44, 47], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99106:If_L42_C4", "vector": [4, 4, 0.3095, 0.0272, 4, 0.63, 1.0, 0, 0, 0, 0, 0, 0, 0, 6], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " elif explode == \"*\":\n return joiner.join([urllib.quote(key, safe) + joiner + urllib.quote(value[key], safe) for key in keys])\n else:\n return \",\".join([urllib.quote(key, safe) + \",\" + urllib.quote(value[key], safe) for key in keys])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99106:Return_L45_C6", "label": "return", "type": "return", "loc": [45, 45], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99106:If_L44_C4", "vector": [13, 5, 0.3061, 0.0068, 5, 0.67, 0.0, 0, 3, 0, 0, 0, 0, 10, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return joiner.join([urllib.quote(key, safe) + joiner + urllib.quote(value[key], safe) for key in keys])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99106:Return_L47_C6", "label": "return", "type": "return", "loc": [47, 47], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99106:If_L44_C4", "vector": [13, 5, 0.3197, 0.0068, 5, 0.67, 1.0, 0, 3, 0, 0, 0, 0, 10, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return \",\".join([urllib.quote(key, safe) + \",\" + urllib.quote(value[key], safe) for key in keys])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99106:If_L49_C4", "label": "if", "type": "if", "loc": [49, 52], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99106:If_L39_C2", "vector": [4, 3, 0.3435, 0.0272, 3, 0.31, 1.0, 0, 2, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if value:\n return urllib.quote(value, safe)\n else:\n return \"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99106:Return_L50_C6", "label": "return", "type": "return", "loc": [50, 50], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99106:If_L49_C4", "vector": [13, 4, 0.3401, 0.0068, 4, 0.84, 0.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return urllib.quote(value, safe)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99106:Return_L52_C6", "label": "return", "type": "return", "loc": [52, 52], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99106:If_L49_C4", "vector": [13, 4, 0.3537, 0.0068, 4, 0.84, 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_99106:FunctionDef_L54_C0", "label": "_tostring_query", "type": "function", "loc": [54, 84], "level": 0, "parent": null, "vector": [2, 0, 0.4694, 0.2109, 0, 0.66, 0.8333, 588, 0, 5, 1, 0, 0, 0, 24], "semantic": {"name": "_tostring_query", "arg_names": ["varname", "value", "explode", "operator", "safe"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def _tostring_query(varname, value, explode, operator, safe=\"\"):\n joiner = operator\n varprefix = \"\"\n if operator == \"?\":\n joiner = \"&\"\n varprefix = varname + \"=\"\n if type(value) == type([]):\n if 0 == len(value):"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99106:Assign_L55_C2", "label": "joiner =", "type": "assigned_variable", "loc": [55, 55], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99106:FunctionDef_L54_C0", "vector": [14, 1, 0.3741, 0.0068, 1, 0.86, 0.0, 555, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "joiner", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " joiner = operator"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99106:Assign_L56_C2", "label": "varprefix =", "type": "assigned_variable", "loc": [56, 56], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99106:FunctionDef_L54_C0", "vector": [14, 1, 0.381, 0.0068, 1, 0.86, 0.3333, 596, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "varprefix", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " varprefix = \"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99106:If_L57_C2", "label": "if", "type": "if", "loc": [57, 59], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99106:FunctionDef_L54_C0", "vector": [4, 1, 0.3946, 0.0204, 1, 0.86, 0.6667, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if operator == \"?\":\n joiner = \"&\"\n varprefix = varname + \"=\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99106:Assign_L58_C4", "label": "joiner =", "type": "assigned_variable", "loc": [58, 58], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99106:If_L57_C2", "vector": [14, 2, 0.3946, 0.0068, 2, 0.21, 0.0, 555, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "joiner", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " joiner = \"&\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99106:Assign_L59_C4", "label": "varprefix =", "type": "assigned_variable", "loc": [59, 59], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99106:If_L57_C2", "vector": [14, 2, 0.4014, 0.0068, 2, 0.21, 1.0, 596, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "varprefix", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " varprefix = varname + \"=\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99106:If_L60_C2", "label": "if", "type": "if", "loc": [60, 84], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99106:FunctionDef_L54_C0", "vector": [4, 1, 0.4898, 0.1701, 1, 0.86, 1.0, 0, 0, 0, 0, 0, 0, 0, 24], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if type(value) == type([]):\n if 0 == len(value):\n return \"\"\n if explode == \"+\":\n return joiner.join([varname + \"=\" + urllib.quote(x, safe) for x in value])\n elif explode == \"*\":\n return joiner.join([urllib.quote(x, safe) for x in value])\n else:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99106:If_L61_C4", "label": "if", "type": "if", "loc": [61, 62], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99106:If_L60_C2", "vector": [4, 2, 0.4184, 0.0136, 2, 0.62, 0.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if 0 == len(value):\n return \"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99106:Return_L62_C6", "label": "return", "type": "return", "loc": [62, 62], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99106:If_L61_C4", "vector": [13, 3, 0.4218, 0.0068, 3, 0.93, 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_99106:If_L63_C4", "label": "if", "type": "if", "loc": [63, 68], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99106:If_L60_C2", "vector": [4, 2, 0.4456, 0.0408, 2, 0.62, 0.5, 0, 0, 0, 0, 0, 0, 0, 6], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if explode == \"+\":\n return joiner.join([varname + \"=\" + urllib.quote(x, safe) for x in value])\n elif explode == \"*\":\n return joiner.join([urllib.quote(x, safe) for x in value])\n else:\n return varprefix + \",\".join([urllib.quote(x, safe) for x in value])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99106:Return_L64_C6", "label": "return", "type": "return", "loc": [64, 64], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99106:If_L63_C4", "vector": [13, 3, 0.4354, 0.0068, 3, 0.85, 0.0, 0, 3, 0, 0, 0, 0, 10, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return joiner.join([varname + \"=\" + urllib.quote(x, safe) for x in value])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99106:If_L65_C4", "label": "if", "type": "if", "loc": [65, 68], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99106:If_L63_C4", "vector": [4, 3, 0.4524, 0.0272, 3, 0.85, 1.0, 0, 0, 0, 0, 0, 0, 0, 4], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " elif explode == \"*\":\n return joiner.join([urllib.quote(x, safe) for x in value])\n else:\n return varprefix + \",\".join([urllib.quote(x, safe) for x in value])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99106:Return_L66_C6", "label": "return", "type": "return", "loc": [66, 66], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99106:If_L65_C4", "vector": [13, 4, 0.449, 0.0068, 4, 0.42, 0.0, 0, 3, 0, 0, 0, 0, 10, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return joiner.join([urllib.quote(x, safe) for x in value])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99106:Return_L68_C6", "label": "return", "type": "return", "loc": [68, 68], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99106:If_L65_C4", "vector": [13, 4, 0.4626, 0.0068, 4, 0.42, 1.0, 0, 4, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return varprefix + \",\".join([urllib.quote(x, safe) for x in value])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99106:If_L69_C2", "label": "if", "type": "if", "loc": [69, 84], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99106:If_L60_C2", "vector": [4, 2, 0.5204, 0.1088, 2, 0.62, 1.0, 0, 0, 0, 0, 0, 0, 0, 15], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " elif type(value) == type({}):\n if 0 == len(value):\n return \"\"\n keys = value.keys()\n keys.sort()\n if explode == \"+\":\n return joiner.join([varname + \".\" + urllib.quote(key, safe) + \"=\" + urllib.quote(value[key], safe) for key in keys])\n elif explode == \"*\":"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99106:If_L70_C4", "label": "if", "type": "if", "loc": [70, 71], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99106:If_L69_C2", "vector": [4, 3, 0.4796, 0.0136, 3, 0.73, 0.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if 0 == len(value):\n return \"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99106:Return_L71_C6", "label": "return", "type": "return", "loc": [71, 71], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99106:If_L70_C4", "vector": [13, 4, 0.483, 0.0068, 4, 0.24, 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_99106:Assign_L72_C4", "label": "keys = keys()", "type": "assigned_variable", "loc": [72, 72], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99106:If_L69_C2", "vector": [14, 3, 0.4898, 0.0068, 3, 0.73, 0.25, 204, 3, 0, 0, 0, 204, 10, 1], "semantic": {"name": "keys", "arg_names": [], "import_names": [], "rhs_call_name": "keys", "annotation": ""}, "snippet": " keys = value.keys()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99106:Expr_L73_C4", "label": "sort()", "type": "expression", "loc": [73, 73], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99106:If_L69_C2", "vector": [8, 3, 0.4966, 0.0068, 3, 0.73, 0.5, 489, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "sort", "arg_names": [], "import_names": [], "rhs_call_name": "sort", "annotation": ""}, "snippet": " keys.sort()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99106:If_L74_C4", "label": "if", "type": "if", "loc": [74, 79], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99106:If_L69_C2", "vector": [4, 3, 0.5204, 0.0408, 3, 0.73, 0.75, 0, 0, 0, 0, 0, 0, 0, 9], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if explode == \"+\":\n return joiner.join([varname + \".\" + urllib.quote(key, safe) + \"=\" + urllib.quote(value[key], safe) for key in keys])\n elif explode == \"*\":\n return joiner.join([urllib.quote(key, safe) + \"=\" + urllib.quote(value[key], safe) for key in keys])\n else:\n return varprefix + \",\".join([urllib.quote(key, safe) + \",\" + urllib.quote(value[key], safe) for key in keys])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99106:Return_L75_C6", "label": "return", "type": "return", "loc": [75, 75], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99106:If_L74_C4", "vector": [13, 4, 0.5102, 0.0068, 4, 0.11, 0.0, 0, 3, 0, 0, 0, 0, 10, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return joiner.join([varname + \".\" + urllib.quote(key, safe) + \"=\" + urllib.quote(value[key], safe) for key in keys])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99106:If_L76_C4", "label": "if", "type": "if", "loc": [76, 79], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99106:If_L74_C4", "vector": [4, 4, 0.5272, 0.0272, 4, 0.11, 1.0, 0, 0, 0, 0, 0, 0, 0, 6], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " elif explode == \"*\":\n return joiner.join([urllib.quote(key, safe) + \"=\" + urllib.quote(value[key], safe) for key in keys])\n else:\n return varprefix + \",\".join([urllib.quote(key, safe) + \",\" + urllib.quote(value[key], safe) for key in keys])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99106:Return_L77_C6", "label": "return", "type": "return", "loc": [77, 77], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99106:If_L76_C4", "vector": [13, 5, 0.5238, 0.0068, 5, 0.95, 0.0, 0, 3, 0, 0, 0, 0, 10, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return joiner.join([urllib.quote(key, safe) + \"=\" + urllib.quote(value[key], safe) for key in keys])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99106:Return_L79_C6", "label": "return", "type": "return", "loc": [79, 79], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99106:If_L76_C4", "vector": [13, 5, 0.5374, 0.0068, 5, 0.95, 1.0, 0, 4, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return varprefix + \",\".join([urllib.quote(key, safe) + \",\" + urllib.quote(value[key], safe) for key in keys])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99106:If_L81_C4", "label": "if", "type": "if", "loc": [81, 84], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99106:If_L69_C2", "vector": [4, 3, 0.5612, 0.0272, 3, 0.73, 1.0, 0, 2, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if value:\n return varname + \"=\" + urllib.quote(value, safe)\n else:\n return varname "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99106:Return_L82_C6", "label": "return", "type": "return", "loc": [82, 82], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99106:If_L81_C4", "vector": [13, 4, 0.5578, 0.0068, 4, 0.77, 0.0, 0, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return varname + \"=\" + urllib.quote(value, safe)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99106:Return_L84_C6", "label": "return", "type": "return", "loc": [84, 84], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99106:If_L81_C4", "vector": [13, 4, 0.5714, 0.0068, 4, 0.77, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return varname "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99106:Assign_L86_C0", "label": "TOSTRING =", "type": "assigned_variable", "loc": [86, 93], "level": 0, "parent": null, "vector": [14, 0, 0.6088, 0.0544, 0, 0.66, 0.9167, 381, 0, 0, 0, 0, 0, 6, 0], "semantic": {"name": "TOSTRING", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "TOSTRING = {\n \"\" : _tostring,\n \"+\": _tostring,\n \";\": _tostring_query,\n \"?\": _tostring_query,\n \"/\": _tostring_path,\n \".\": _tostring_path,\n }"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99106:FunctionDef_L96_C0", "label": "expand", "type": "function", "loc": [96, 147], "level": 0, "parent": null, "vector": [2, 0, 0.8265, 0.3537, 0, 0.66, 1.0, 174, 0, 2, 1, 0, 0, 0, 16], "semantic": {"name": "expand", "arg_names": ["template", "vars"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def expand(template, vars):\n def _sub(match):\n groupdict = match.groupdict()\n operator = groupdict.get('operator')\n if operator is None:\n operator = ''\n varlist = groupdict.get('varlist')\n"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99106:FunctionDef_L97_C2", "label": "_sub", "type": "function", "loc": [97, 145], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99106:FunctionDef_L96_C0", "vector": [2, 1, 0.8231, 0.3333, 1, 0.05, 0.0, 173, 0, 1, 1, 0, 0, 0, 15], "semantic": {"name": "_sub", "arg_names": ["match"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _sub(match):\n groupdict = match.groupdict()\n operator = groupdict.get('operator')\n if operator is None:\n operator = ''\n varlist = groupdict.get('varlist')\n\n safe = \"@\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99106:Assign_L98_C4", "label": "groupdict = groupdict()", "type": "assigned_variable", "loc": [98, 98], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99106:FunctionDef_L97_C2", "vector": [14, 2, 0.6667, 0.0068, 2, 0.91, 0.0, 572, 3, 0, 0, 0, 572, 10, 1], "semantic": {"name": "groupdict", "arg_names": [], "import_names": [], "rhs_call_name": "groupdict", "annotation": ""}, "snippet": " groupdict = match.groupdict()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99106:Assign_L99_C4", "label": "operator = get()", "type": "assigned_variable", "loc": [99, 99], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99106:FunctionDef_L97_C2", "vector": [14, 2, 0.6735, 0.0068, 2, 0.91, 0.0588, 616, 3, 1, 0, 0, 607, 10, 1], "semantic": {"name": "operator", "arg_names": [], "import_names": [], "rhs_call_name": "get", "annotation": ""}, "snippet": " operator = groupdict.get('operator')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99106:If_L100_C4", "label": "if", "type": "if", "loc": [100, 101], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99106:FunctionDef_L97_C2", "vector": [4, 2, 0.6837, 0.0136, 2, 0.91, 0.1176, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if operator is None:\n operator = ''"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99106:Assign_L101_C6", "label": "operator =", "type": "assigned_variable", "loc": [101, 101], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99106:If_L100_C4", "vector": [14, 3, 0.6871, 0.0068, 3, 0.84, 0.0, 616, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "operator", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " operator = ''"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99106:Assign_L102_C4", "label": "varlist = get()", "type": "assigned_variable", "loc": [102, 102], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99106:FunctionDef_L97_C2", "vector": [14, 2, 0.6939, 0.0068, 2, 0.91, 0.1765, 552, 3, 1, 0, 0, 607, 10, 1], "semantic": {"name": "varlist", "arg_names": [], "import_names": [], "rhs_call_name": "get", "annotation": ""}, "snippet": " varlist = groupdict.get('varlist')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99106:Assign_L104_C4", "label": "safe =", "type": "assigned_variable", "loc": [104, 104], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99106:FunctionDef_L97_C2", "vector": [14, 2, 0.7075, 0.0068, 2, 0.91, 0.2353, 3, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "safe", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " safe = \"@\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99106:If_L105_C4", "label": "if", "type": "if", "loc": [105, 106], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99106:FunctionDef_L97_C2", "vector": [4, 2, 0.7177, 0.0136, 2, 0.91, 0.2941, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if operator == '+':\n safe = RESERVED"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99106:Assign_L106_C6", "label": "safe =", "type": "assigned_variable", "loc": [106, 106], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99106:If_L105_C4", "vector": [14, 3, 0.7211, 0.0068, 3, 0.32, 0.0, 3, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "safe", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " safe = RESERVED"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99106:Assign_L107_C4", "label": "varspecs = split()", "type": "assigned_variable", "loc": [107, 107], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99106:FunctionDef_L97_C2", "vector": [14, 2, 0.7279, 0.0068, 2, 0.91, 0.3529, 988, 3, 1, 0, 0, 908, 10, 1], "semantic": {"name": "varspecs", "arg_names": [], "import_names": [], "rhs_call_name": "split", "annotation": ""}, "snippet": " varspecs = varlist.split(\",\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99106:Assign_L108_C4", "label": "varnames =", "type": "assigned_variable", "loc": [108, 108], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99106:FunctionDef_L97_C2", "vector": [14, 2, 0.7347, 0.0068, 2, 0.91, 0.4118, 728, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "varnames", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " varnames = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99106:Assign_L109_C4", "label": "defaults =", "type": "assigned_variable", "loc": [109, 109], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99106:FunctionDef_L97_C2", "vector": [14, 2, 0.7415, 0.0068, 2, 0.91, 0.4706, 233, 0, 0, 0, 0, 0, 6, 0], "semantic": {"name": "defaults", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " defaults = {}"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99106:For_L110_C4", "label": "for varspec", "type": "for", "loc": [110, 119], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99106:FunctionDef_L97_C2", "vector": [6, 2, 0.7789, 0.068, 2, 0.91, 0.5294, 106, 2, 0, 0, 0, 0, 0, 7], "semantic": {"name": "varspec", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for varspec in varspecs:\n m = VAR.search(varspec)\n groupdict = m.groupdict()\n varname = groupdict.get('varname')\n explode = groupdict.get('explode')\n partial = groupdict.get('partial')\n default = groupdict.get('default')\n if default:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99106:Assign_L111_C6", "label": "m = search()", "type": "assigned_variable", "loc": [111, 111], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99106:For_L110_C4", "vector": [14, 3, 0.7551, 0.0068, 3, 0.7, 0.0, 711, 3, 1, 0, 0, 163, 10, 1], "semantic": {"name": "m", "arg_names": [], "import_names": [], "rhs_call_name": "search", "annotation": ""}, "snippet": " m = VAR.search(varspec)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99106:Assign_L112_C6", "label": "groupdict = groupdict()", "type": "assigned_variable", "loc": [112, 112], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99106:For_L110_C4", "vector": [14, 3, 0.7619, 0.0068, 3, 0.7, 0.1429, 572, 3, 0, 0, 0, 572, 10, 1], "semantic": {"name": "groupdict", "arg_names": [], "import_names": [], "rhs_call_name": "groupdict", "annotation": ""}, "snippet": " groupdict = m.groupdict()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99106:Assign_L113_C6", "label": "varname = get()", "type": "assigned_variable", "loc": [113, 113], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99106:For_L110_C4", "vector": [14, 3, 0.7687, 0.0068, 3, 0.7, 0.2857, 769, 3, 1, 0, 0, 607, 10, 1], "semantic": {"name": "varname", "arg_names": [], "import_names": [], "rhs_call_name": "get", "annotation": ""}, "snippet": " varname = groupdict.get('varname')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99106:Assign_L114_C6", "label": "explode = get()", "type": "assigned_variable", "loc": [114, 114], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99106:For_L110_C4", "vector": [14, 3, 0.7755, 0.0068, 3, 0.7, 0.4286, 531, 3, 1, 0, 0, 607, 10, 1], "semantic": {"name": "explode", "arg_names": [], "import_names": [], "rhs_call_name": "get", "annotation": ""}, "snippet": " explode = groupdict.get('explode')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99106:Assign_L115_C6", "label": "partial = get()", "type": "assigned_variable", "loc": [115, 115], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99106:For_L110_C4", "vector": [14, 3, 0.7823, 0.0068, 3, 0.7, 0.5714, 365, 3, 1, 0, 0, 607, 10, 1], "semantic": {"name": "partial", "arg_names": [], "import_names": [], "rhs_call_name": "get", "annotation": ""}, "snippet": " partial = groupdict.get('partial')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99106:Assign_L116_C6", "label": "default = get()", "type": "assigned_variable", "loc": [116, 116], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99106:For_L110_C4", "vector": [14, 3, 0.7891, 0.0068, 3, 0.7, 0.7143, 977, 3, 1, 0, 0, 607, 10, 1], "semantic": {"name": "default", "arg_names": [], "import_names": [], "rhs_call_name": "get", "annotation": ""}, "snippet": " default = groupdict.get('default')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99106:If_L117_C6", "label": "if", "type": "if", "loc": [117, 118], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99106:For_L110_C4", "vector": [4, 3, 0.7993, 0.0136, 3, 0.7, 0.8571, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if default:\n defaults[varname] = default"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99106:Assign_L118_C8", "label": "assign", "type": "assigned_variable", "loc": [118, 118], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99106:If_L117_C6", "vector": [14, 4, 0.8027, 0.0068, 4, 0.72, 0.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " defaults[varname] = default"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99106:Expr_L119_C6", "label": "append()", "type": "expression", "loc": [119, 119], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99106:For_L110_C4", "vector": [8, 3, 0.8095, 0.0068, 3, 0.7, 1.0, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " varnames.append((varname, explode, partial))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99106:Assign_L121_C4", "label": "retval =", "type": "assigned_variable", "loc": [121, 121], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99106:FunctionDef_L97_C2", "vector": [14, 2, 0.8231, 0.0068, 2, 0.91, 0.5882, 991, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "retval", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " retval = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99106:Assign_L122_C4", "label": "joiner =", "type": "assigned_variable", "loc": [122, 122], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99106:FunctionDef_L97_C2", "vector": [14, 2, 0.8299, 0.0068, 2, 0.91, 0.6471, 555, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "joiner", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " joiner = operator"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99106:Assign_L123_C4", "label": "prefix =", "type": "assigned_variable", "loc": [123, 123], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99106:FunctionDef_L97_C2", "vector": [14, 2, 0.8367, 0.0068, 2, 0.91, 0.7059, 284, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "prefix", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " prefix = operator"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99106:If_L124_C4", "label": "if", "type": "if", "loc": [124, 126], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99106:FunctionDef_L97_C2", "vector": [4, 2, 0.8503, 0.0204, 2, 0.91, 0.7647, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if operator == \"+\":\n prefix = \"\"\n joiner = \",\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99106:Assign_L125_C6", "label": "prefix =", "type": "assigned_variable", "loc": [125, 125], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99106:If_L124_C4", "vector": [14, 3, 0.8503, 0.0068, 3, 0.46, 0.0, 284, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "prefix", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " prefix = \"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99106:Assign_L126_C6", "label": "joiner =", "type": "assigned_variable", "loc": [126, 126], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99106:If_L124_C4", "vector": [14, 3, 0.8571, 0.0068, 3, 0.46, 1.0, 555, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "joiner", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " joiner = \",\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99106:If_L127_C4", "label": "if", "type": "if", "loc": [127, 128], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99106:FunctionDef_L97_C2", "vector": [4, 2, 0.8673, 0.0136, 2, 0.91, 0.8235, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if operator == \"?\":\n joiner = \"&\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99106:Assign_L128_C6", "label": "joiner =", "type": "assigned_variable", "loc": [128, 128], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99106:If_L127_C4", "vector": [14, 3, 0.8707, 0.0068, 3, 0.99, 0.0, 555, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "joiner", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " joiner = \"&\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99106:If_L129_C4", "label": "if", "type": "if", "loc": [129, 130], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99106:FunctionDef_L97_C2", "vector": [4, 2, 0.881, 0.0136, 2, 0.91, 0.8824, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if operator == \"\":\n joiner = \",\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99106:Assign_L130_C6", "label": "joiner =", "type": "assigned_variable", "loc": [130, 130], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99106:If_L129_C4", "vector": [14, 3, 0.8844, 0.0068, 3, 0.33, 0.0, 555, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "joiner", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " joiner = \",\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99106:For_L131_C4", "label": "for varname, explode, partial", "type": "for", "loc": [131, 141], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99106:FunctionDef_L97_C2", "vector": [6, 2, 0.9252, 0.0748, 2, 0.91, 0.9412, 975, 2, 0, 0, 0, 0, 0, 2], "semantic": {"name": "varname, explode, partial", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for varname, explode, partial in varnames:\n if varname in vars:\n value = vars[varname]\n #if not value and (type(value) == type({}) or type(value) == type([])) and varname in defaults:\n if not value and value != \"\" and varname in defaults:\n value = defaults[varname]\n elif varname in defaults:\n value = defaults[varname]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99106:If_L132_C6", "label": "if", "type": "if", "loc": [132, 140], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99106:For_L131_C4", "vector": [4, 3, 0.9252, 0.0612, 3, 0.61, 0.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if varname in vars:\n value = vars[varname]\n #if not value and (type(value) == type({}) or type(value) == type([])) and varname in defaults:\n if not value and value != \"\" and varname in defaults:\n value = defaults[varname]\n elif varname in defaults:\n value = defaults[varname]\n else:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99106:Assign_L133_C8", "label": "value =", "type": "assigned_variable", "loc": [133, 133], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99106:If_L132_C6", "vector": [14, 4, 0.9048, 0.0068, 4, 0.75, 0.0, 441, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "value", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " value = vars[varname]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99106:If_L135_C8", "label": "if", "type": "if", "loc": [135, 136], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99106:If_L132_C6", "vector": [4, 4, 0.9218, 0.0136, 4, 0.75, 0.5, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not value and value != \"\" and varname in defaults:\n value = defaults[varname]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99106:Assign_L136_C10", "label": "value =", "type": "assigned_variable", "loc": [136, 136], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99106:If_L135_C8", "vector": [14, 5, 0.9252, 0.0068, 5, 0.2, 0.0, 441, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "value", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " value = defaults[varname]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99106:If_L137_C6", "label": "if", "type": "if", "loc": [137, 140], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99106:If_L132_C6", "vector": [4, 4, 0.9422, 0.0272, 4, 0.75, 1.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " elif varname in defaults:\n value = defaults[varname]\n else:\n continue"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99106:Assign_L138_C8", "label": "value =", "type": "assigned_variable", "loc": [138, 138], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99106:If_L137_C6", "vector": [14, 5, 0.9388, 0.0068, 5, 0.53, 0.0, 441, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "value", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " value = defaults[varname]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99106:Expr_L141_C6", "label": "append()", "type": "expression", "loc": [141, 141], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99106:For_L131_C4", "vector": [8, 3, 0.9592, 0.0068, 3, 0.61, 1.0, 243, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " retval.append(TOSTRING[operator](varname, value, explode, operator, safe=safe))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99106:If_L142_C4", "label": "if", "type": "if", "loc": [142, 145], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99106:FunctionDef_L97_C2", "vector": [4, 2, 0.9762, 0.0272, 2, 0.91, 1.0, 0, 3, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if \"\".join(retval):\n return prefix + joiner.join(retval)\n else:\n return \"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99106:Return_L143_C6", "label": "return", "type": "return", "loc": [143, 143], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99106:If_L142_C4", "vector": [13, 3, 0.9728, 0.0068, 3, 0.76, 0.0, 0, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return prefix + joiner.join(retval)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99106:Return_L145_C6", "label": "return", "type": "return", "loc": [145, 145], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99106:If_L142_C4", "vector": [13, 3, 0.9864, 0.0068, 3, 0.76, 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_99106:Return_L147_C2", "label": "return", "type": "return", "loc": [147, 147], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99106:FunctionDef_L96_C0", "vector": [13, 1, 1.0, 0.0068, 1, 0.05, 1.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return TEMPLATE.sub(_sub, template)"}]
[{"f": "ajibawa-2023/Python-Code-Large/train/row_99106:FunctionDef_L13_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99106:If_L14_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99106:If_L14_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99106:If_L15_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99106:If_L15_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99106:Return_L16_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99106:If_L15_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99106:Return_L18_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99106:FunctionDef_L13_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99106:If_L19_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99106:If_L19_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99106:Assign_L20_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99106:If_L19_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99106:Expr_L21_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99106:If_L19_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99106:If_L22_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99106:If_L22_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99106:Return_L23_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99106:If_L22_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99106:Return_L25_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99106:If_L19_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99106:Return_L27_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99106:FunctionDef_L30_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99106:Assign_L31_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99106:FunctionDef_L30_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99106:If_L32_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99106:If_L32_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99106:If_L33_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99106:If_L33_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99106:Return_L34_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99106:If_L33_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99106:If_L35_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99106:If_L35_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99106:Return_L36_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99106:If_L35_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99106:Return_L38_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99106:If_L32_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99106:If_L39_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99106:If_L39_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99106:Assign_L40_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99106:If_L39_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99106:Expr_L41_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99106:If_L39_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99106:If_L42_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99106:If_L42_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99106:Return_L43_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99106:If_L42_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99106:If_L44_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99106:If_L44_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99106:Return_L45_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99106:If_L44_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99106:Return_L47_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99106:If_L39_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99106:If_L49_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99106:If_L49_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99106:Return_L50_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99106:If_L49_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99106:Return_L52_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99106:FunctionDef_L54_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99106:Assign_L55_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99106:FunctionDef_L54_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99106:Assign_L56_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99106:FunctionDef_L54_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99106:If_L57_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99106:If_L57_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99106:Assign_L58_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99106:If_L57_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99106:Assign_L59_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99106:FunctionDef_L54_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99106:If_L60_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99106:If_L60_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99106:If_L61_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99106:If_L61_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99106:Return_L62_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99106:If_L60_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99106:If_L63_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99106:If_L63_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99106:Return_L64_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99106:If_L63_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99106:If_L65_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99106:If_L65_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99106:Return_L66_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99106:If_L65_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99106:Return_L68_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99106:If_L60_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99106:If_L69_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99106:If_L69_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99106:If_L70_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99106:If_L70_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99106:Return_L71_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99106:If_L69_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99106:Assign_L72_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99106:If_L69_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99106:Expr_L73_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99106:If_L69_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99106:If_L74_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99106:If_L74_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99106:Return_L75_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99106:If_L74_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99106:If_L76_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99106:If_L76_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99106:Return_L77_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99106:If_L76_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99106:Return_L79_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99106:If_L69_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99106:If_L81_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99106:If_L81_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99106:Return_L82_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99106:If_L81_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99106:Return_L84_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99106:FunctionDef_L96_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99106:FunctionDef_L97_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99106:FunctionDef_L97_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99106:Assign_L98_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99106:FunctionDef_L97_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99106:Assign_L99_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99106:FunctionDef_L97_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99106:If_L100_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99106:If_L100_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99106:Assign_L101_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99106:FunctionDef_L97_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99106:Assign_L102_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99106:FunctionDef_L97_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99106:Assign_L104_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99106:FunctionDef_L97_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99106:If_L105_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99106:If_L105_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99106:Assign_L106_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99106:FunctionDef_L97_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99106:Assign_L107_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99106:FunctionDef_L97_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99106:Assign_L108_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99106:FunctionDef_L97_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99106:Assign_L109_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99106:FunctionDef_L97_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99106:For_L110_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99106:For_L110_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99106:Assign_L111_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99106:For_L110_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99106:Assign_L112_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99106:For_L110_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99106:Assign_L113_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99106:For_L110_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99106:Assign_L114_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99106:For_L110_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99106:Assign_L115_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99106:For_L110_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99106:Assign_L116_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99106:For_L110_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99106:If_L117_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99106:If_L117_C6", "t": "ajibawa-2023/Python-Code-Large/train/row_99106:Assign_L118_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99106:For_L110_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99106:Expr_L119_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99106:FunctionDef_L97_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99106:Assign_L121_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99106:FunctionDef_L97_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99106:Assign_L122_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99106:FunctionDef_L97_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99106:Assign_L123_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99106:FunctionDef_L97_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99106:If_L124_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99106:If_L124_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99106:Assign_L125_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99106:If_L124_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99106:Assign_L126_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99106:FunctionDef_L97_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99106:If_L127_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99106:If_L127_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99106:Assign_L128_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99106:FunctionDef_L97_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99106:If_L129_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99106:If_L129_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99106:Assign_L130_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99106:FunctionDef_L97_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99106:For_L131_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99106:For_L131_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99106:If_L132_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99106:If_L132_C6", "t": "ajibawa-2023/Python-Code-Large/train/row_99106:Assign_L133_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99106:If_L132_C6", "t": "ajibawa-2023/Python-Code-Large/train/row_99106:If_L135_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99106:If_L135_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99106:Assign_L136_C10"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99106:If_L132_C6", "t": "ajibawa-2023/Python-Code-Large/train/row_99106:If_L137_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99106:If_L137_C6", "t": "ajibawa-2023/Python-Code-Large/train/row_99106:Assign_L138_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99106:For_L131_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99106:Expr_L141_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99106:FunctionDef_L97_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99106:If_L142_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99106:If_L142_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99106:Return_L143_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99106:If_L142_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99106:Return_L145_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99106:FunctionDef_L96_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99106:Return_L147_C2"}]
import os print "lis.exe" for n in range(5): os.system(r'time ./lis.exe >> c_time.log') print "java LisAlgorithm" for n in range(5): os.system(r'time java LisAlgorithm >> j_time.log')
ajibawa-2023/Python-Code-Large/train/row_99107
7
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"]
[{"id": "ajibawa-2023/Python-Code-Large/train/row_99107:Import_L3_C0", "label": "os import os", "type": "import", "loc": [3, 3], "level": 0, "parent": null, "vector": [1, 0, 0.2308, 0.0769, 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_99107:Expr_L5_C0", "label": "print()", "type": "expression", "loc": [5, 5], "level": 0, "parent": null, "vector": [8, 0, 0.3846, 0.0769, 0, 0.66, 0.25, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": "print(\"lis.exe\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99107:For_L6_C0", "label": "for n", "type": "for", "loc": [6, 7], "level": 0, "parent": null, "vector": [6, 0, 0.5, 0.1538, 0, 0.66, 0.5, 773, 3, 0, 0, 0, 0, 0, 2], "semantic": {"name": "n", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "for n in range(5):\n\tos.system(r'time ./lis.exe >> c_time.log')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99107:Expr_L7_C1", "label": "system()", "type": "expression", "loc": [7, 7], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99107:For_L6_C0", "vector": [8, 1, 0.5385, 0.0769, 1, 0.16, 0.0, 856, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "system", "arg_names": [], "import_names": [], "rhs_call_name": "system", "annotation": ""}, "snippet": "\tos.system(r'time ./lis.exe >> c_time.log')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99107:Expr_L9_C0", "label": "print()", "type": "expression", "loc": [9, 9], "level": 0, "parent": null, "vector": [8, 0, 0.6923, 0.0769, 0, 0.66, 0.75, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": "print(\"java LisAlgorithm\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99107:For_L10_C0", "label": "for n", "type": "for", "loc": [10, 11], "level": 0, "parent": null, "vector": [6, 0, 0.8077, 0.1538, 0, 0.66, 1.0, 773, 3, 0, 0, 0, 0, 0, 2], "semantic": {"name": "n", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "for n in range(5):\n\tos.system(r'time java LisAlgorithm >> j_time.log')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99107:Expr_L11_C1", "label": "system()", "type": "expression", "loc": [11, 11], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99107:For_L10_C0", "vector": [8, 1, 0.8462, 0.0769, 1, 0.37, 0.0, 856, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "system", "arg_names": [], "import_names": [], "rhs_call_name": "system", "annotation": ""}, "snippet": "\tos.system(r'time java LisAlgorithm >> j_time.log')"}]
[{"f": "ajibawa-2023/Python-Code-Large/train/row_99107:For_L6_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99107:Expr_L7_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99107:For_L10_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99107:Expr_L11_C1"}]
# -*- coding: utf-8 -*- # Form implementation generated from reading ui file 'qtBrowser.ui' # # Created: Fri Nov 19 20:47:11 2010 # by: PyQt4 UI code generator 4.8.1 # # WARNING! All changes made in this file will be lost! from PyQt4 import QtCore, QtGui try: _fromUtf8 = QtCore.QString.fromUtf8 except AttributeError: _fromUtf8 = lambda s: s class Ui_Form(object): def setupUi(self, Form): Form.setObjectName(_fromUtf8("Form")) Form.resize(800, 600) self.gridLayout = QtGui.QGridLayout(Form) self.gridLayout.setMargin(0) self.gridLayout.setObjectName(_fromUtf8("gridLayout")) self.webView = QtWebKit.QWebView(Form) self.webView.setUrl(QtCore.QUrl(_fromUtf8("http://web2.qq.com/"))) self.webView.setObjectName(_fromUtf8("webView")) self.gridLayout.addWidget(self.webView, 0, 0, 1, 1) self.retranslateUi(Form) QtCore.QMetaObject.connectSlotsByName(Form) def retranslateUi(self, Form): Form.setWindowTitle(QtGui.QApplication.translate("Form", "Form", None, QtGui.QApplication.UnicodeUTF8)) from PyQt4 import QtWebKit if __name__ == "__main__": import sys app = QtGui.QApplication(sys.argv) Form = QtGui.QWidget() ui = Ui_Form() ui.setupUi(Form) Form.show() sys.exit(app.exec_())
ajibawa-2023/Python-Code-Large/train/row_99108
28
45
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_99108:ImportFrom_L10_C0", "label": "from PyQt4 import QtCore, QtGui", "type": "import", "loc": [10, 10], "level": 0, "parent": null, "vector": [1, 0, 0.2222, 0.0222, 0, 0.66, 0.0, 154, 0, 2, 0, 0, 154, 0, 0], "semantic": {"name": "PyQt4", "arg_names": [], "import_names": ["QtCore", "QtGui"], "rhs_call_name": "", "annotation": ""}, "snippet": "from PyQt4 import QtCore, QtGui"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99108:Try_L12_C0", "label": "try", "type": "try", "loc": [12, 15], "level": 0, "parent": null, "vector": [7, 0, 0.3, 0.0889, 0, 0.66, 0.25, 0, 0, 1, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "try:\n _fromUtf8 = QtCore.QString.fromUtf8\nexcept AttributeError:\n _fromUtf8 = lambda s: s"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99108:Assign_L13_C4", "label": "_fromUtf8 =", "type": "assigned_variable", "loc": [13, 13], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99108:Try_L12_C0", "vector": [14, 1, 0.2889, 0.0222, 1, 0.56, 0.0, 412, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "_fromUtf8", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " _fromUtf8 = QtCore.QString.fromUtf8"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99108:Assign_L15_C4", "label": "_fromUtf8 =", "type": "assigned_variable", "loc": [15, 15], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99108:Try_L12_C0", "vector": [14, 1, 0.3333, 0.0222, 1, 0.56, 0.0, 412, 9, 0, 0, 0, 0, 0, 0], "semantic": {"name": "_fromUtf8", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " _fromUtf8 = lambda s: s"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99108:ClassDef_L17_C0", "label": "Ui_Form", "type": "class", "loc": [17, 33], "level": 0, "parent": null, "vector": [3, 0, 0.5556, 0.3778, 0, 0.66, 0.5, 879, 0, 2, 0, 0, 186, 0, 18], "semantic": {"name": "Ui_Form", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class Ui_Form(object):\n def setupUi(self, Form):\n Form.setObjectName(_fromUtf8(\"Form\"))\n Form.resize(800, 600)\n self.gridLayout = QtGui.QGridLayout(Form)\n self.gridLayout.setMargin(0)\n self.gridLayout.setObjectName(_fromUtf8(\"gridLayout\"))\n self.webView = QtWebKit.QWebView(Form)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99108:FunctionDef_L18_C4", "label": "setupUi", "type": "function", "loc": [18, 30], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99108:ClassDef_L17_C0", "vector": [2, 1, 0.5333, 0.2889, 1, 0.26, 0.0, 419, 0, 2, 0, 0, 0, 0, 16], "semantic": {"name": "setupUi", "arg_names": ["self", "Form"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def setupUi(self, Form):\n Form.setObjectName(_fromUtf8(\"Form\"))\n Form.resize(800, 600)\n self.gridLayout = QtGui.QGridLayout(Form)\n self.gridLayout.setMargin(0)\n self.gridLayout.setObjectName(_fromUtf8(\"gridLayout\"))\n self.webView = QtWebKit.QWebView(Form)\n self.webView.setUrl(QtCore.QUrl(_fromUtf8(\"http://web2.qq.com/\")))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99108:Expr_L19_C8", "label": "setObjectName()", "type": "expression", "loc": [19, 19], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99108:FunctionDef_L18_C4", "vector": [8, 2, 0.4222, 0.0222, 2, 0.8, 0.0, 470, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "setObjectName", "arg_names": [], "import_names": [], "rhs_call_name": "setObjectName", "annotation": ""}, "snippet": " Form.setObjectName(_fromUtf8(\"Form\"))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99108:Expr_L20_C8", "label": "resize()", "type": "expression", "loc": [20, 20], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99108:FunctionDef_L18_C4", "vector": [8, 2, 0.4444, 0.0222, 2, 0.8, 0.1, 834, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "resize", "arg_names": [], "import_names": [], "rhs_call_name": "resize", "annotation": ""}, "snippet": " Form.resize(800, 600)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99108:Assign_L21_C8", "label": "self.gridLayout = QGridLayout()", "type": "assigned_variable", "loc": [21, 21], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99108:FunctionDef_L18_C4", "vector": [14, 2, 0.4667, 0.0222, 2, 0.8, 0.2, 317, 3, 1, 0, 0, 319, 10, 1], "semantic": {"name": "self.gridLayout", "arg_names": [], "import_names": [], "rhs_call_name": "QGridLayout", "annotation": ""}, "snippet": " self.gridLayout = QtGui.QGridLayout(Form)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99108:Expr_L22_C8", "label": "setMargin()", "type": "expression", "loc": [22, 22], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99108:FunctionDef_L18_C4", "vector": [8, 2, 0.4889, 0.0222, 2, 0.8, 0.3, 470, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "setMargin", "arg_names": [], "import_names": [], "rhs_call_name": "setMargin", "annotation": ""}, "snippet": " self.gridLayout.setMargin(0)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99108:Expr_L23_C8", "label": "setObjectName()", "type": "expression", "loc": [23, 23], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99108:FunctionDef_L18_C4", "vector": [8, 2, 0.5111, 0.0222, 2, 0.8, 0.4, 470, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "setObjectName", "arg_names": [], "import_names": [], "rhs_call_name": "setObjectName", "annotation": ""}, "snippet": " self.gridLayout.setObjectName(_fromUtf8(\"gridLayout\"))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99108:Assign_L24_C8", "label": "self.webView = QWebView()", "type": "assigned_variable", "loc": [24, 24], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99108:FunctionDef_L18_C4", "vector": [14, 2, 0.5333, 0.0222, 2, 0.8, 0.5, 933, 3, 1, 0, 0, 844, 10, 1], "semantic": {"name": "self.webView", "arg_names": [], "import_names": [], "rhs_call_name": "QWebView", "annotation": ""}, "snippet": " self.webView = QtWebKit.QWebView(Form)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99108:Expr_L25_C8", "label": "setUrl()", "type": "expression", "loc": [25, 25], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99108:FunctionDef_L18_C4", "vector": [8, 2, 0.5556, 0.0222, 2, 0.8, 0.6, 138, 3, 1, 0, 0, 0, 0, 3], "semantic": {"name": "setUrl", "arg_names": [], "import_names": [], "rhs_call_name": "setUrl", "annotation": ""}, "snippet": " self.webView.setUrl(QtCore.QUrl(_fromUtf8(\"http://web2.qq.com/\")))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99108:Expr_L26_C8", "label": "setObjectName()", "type": "expression", "loc": [26, 26], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99108:FunctionDef_L18_C4", "vector": [8, 2, 0.5778, 0.0222, 2, 0.8, 0.7, 470, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "setObjectName", "arg_names": [], "import_names": [], "rhs_call_name": "setObjectName", "annotation": ""}, "snippet": " self.webView.setObjectName(_fromUtf8(\"webView\"))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99108:Expr_L27_C8", "label": "addWidget()", "type": "expression", "loc": [27, 27], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99108:FunctionDef_L18_C4", "vector": [8, 2, 0.6, 0.0222, 2, 0.8, 0.8, 653, 3, 5, 0, 0, 0, 0, 1], "semantic": {"name": "addWidget", "arg_names": [], "import_names": [], "rhs_call_name": "addWidget", "annotation": ""}, "snippet": " self.gridLayout.addWidget(self.webView, 0, 0, 1, 1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99108:Expr_L29_C8", "label": "retranslateUi()", "type": "expression", "loc": [29, 29], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99108:FunctionDef_L18_C4", "vector": [8, 2, 0.6444, 0.0222, 2, 0.8, 0.9, 520, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "retranslateUi", "arg_names": [], "import_names": [], "rhs_call_name": "retranslateUi", "annotation": ""}, "snippet": " self.retranslateUi(Form)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99108:Expr_L30_C8", "label": "connectSlotsByName()", "type": "expression", "loc": [30, 30], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99108:FunctionDef_L18_C4", "vector": [8, 2, 0.6667, 0.0222, 2, 0.8, 1.0, 419, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "connectSlotsByName", "arg_names": [], "import_names": [], "rhs_call_name": "connectSlotsByName", "annotation": ""}, "snippet": " QtCore.QMetaObject.connectSlotsByName(Form)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99108:FunctionDef_L32_C4", "label": "retranslateUi", "type": "function", "loc": [32, 33], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99108:ClassDef_L17_C0", "vector": [2, 1, 0.7222, 0.0444, 1, 0.26, 1.0, 520, 0, 2, 0, 0, 0, 0, 2], "semantic": {"name": "retranslateUi", "arg_names": ["self", "Form"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def retranslateUi(self, Form):\n Form.setWindowTitle(QtGui.QApplication.translate(\"Form\", \"Form\", None, QtGui.QApplication.UnicodeUTF8))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99108:Expr_L33_C8", "label": "setWindowTitle()", "type": "expression", "loc": [33, 33], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99108:FunctionDef_L32_C4", "vector": [8, 2, 0.7333, 0.0222, 2, 0.44, 0.0, 38, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "setWindowTitle", "arg_names": [], "import_names": [], "rhs_call_name": "setWindowTitle", "annotation": ""}, "snippet": " Form.setWindowTitle(QtGui.QApplication.translate(\"Form\", \"Form\", None, QtGui.QApplication.UnicodeUTF8))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99108:ImportFrom_L35_C0", "label": "from PyQt4 import QtWebKit", "type": "import", "loc": [35, 35], "level": 0, "parent": null, "vector": [1, 0, 0.7778, 0.0222, 0, 0.66, 0.75, 154, 0, 1, 0, 0, 154, 0, 0], "semantic": {"name": "PyQt4", "arg_names": [], "import_names": ["QtWebKit"], "rhs_call_name": "", "annotation": ""}, "snippet": "from PyQt4 import QtWebKit"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99108:If_L37_C0", "label": "if", "type": "if", "loc": [37, 44], "level": 0, "parent": null, "vector": [4, 0, 0.9, 0.1778, 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 import sys\n app = QtGui.QApplication(sys.argv)\n Form = QtGui.QWidget()\n ui = Ui_Form()\n ui.setupUi(Form)\n Form.show()\n sys.exit(app.exec_())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99108:Import_L38_C4", "label": "sys import sys", "type": "import", "loc": [38, 38], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99108:If_L37_C0", "vector": [1, 1, 0.8444, 0.0222, 1, 0.2, 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_99108:Assign_L39_C4", "label": "app = QApplication()", "type": "assigned_variable", "loc": [39, 39], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99108:If_L37_C0", "vector": [14, 1, 0.8667, 0.0222, 1, 0.2, 0.1667, 494, 3, 1, 0, 0, 447, 10, 1], "semantic": {"name": "app", "arg_names": [], "import_names": [], "rhs_call_name": "QApplication", "annotation": ""}, "snippet": " app = QtGui.QApplication(sys.argv)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99108:Assign_L40_C4", "label": "Form = QWidget()", "type": "assigned_variable", "loc": [40, 40], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99108:If_L37_C0", "vector": [14, 1, 0.8889, 0.0222, 1, 0.2, 0.3333, 897, 3, 0, 0, 0, 317, 10, 1], "semantic": {"name": "Form", "arg_names": [], "import_names": [], "rhs_call_name": "QWidget", "annotation": ""}, "snippet": " Form = QtGui.QWidget()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99108:Assign_L41_C4", "label": "ui = Ui_Form()", "type": "assigned_variable", "loc": [41, 41], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99108:If_L37_C0", "vector": [14, 1, 0.9111, 0.0222, 1, 0.2, 0.5, 303, 3, 0, 0, 0, 879, 10, 1], "semantic": {"name": "ui", "arg_names": [], "import_names": [], "rhs_call_name": "Ui_Form", "annotation": ""}, "snippet": " ui = Ui_Form()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99108:Expr_L42_C4", "label": "setupUi()", "type": "expression", "loc": [42, 42], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99108:If_L37_C0", "vector": [8, 1, 0.9333, 0.0222, 1, 0.2, 0.6667, 419, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "setupUi", "arg_names": [], "import_names": [], "rhs_call_name": "setupUi", "annotation": ""}, "snippet": " ui.setupUi(Form)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99108:Expr_L43_C4", "label": "show()", "type": "expression", "loc": [43, 43], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99108:If_L37_C0", "vector": [8, 1, 0.9556, 0.0222, 1, 0.2, 0.8333, 497, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "show", "arg_names": [], "import_names": [], "rhs_call_name": "show", "annotation": ""}, "snippet": " Form.show()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99108:Expr_L44_C4", "label": "exit()", "type": "expression", "loc": [44, 44], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99108:If_L37_C0", "vector": [8, 1, 0.9778, 0.0222, 1, 0.2, 1.0, 436, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "exit", "arg_names": [], "import_names": [], "rhs_call_name": "exit", "annotation": ""}, "snippet": " sys.exit(app.exec_())"}]
[{"f": "ajibawa-2023/Python-Code-Large/train/row_99108:Try_L12_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99108:Assign_L13_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99108:Try_L12_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99108:Assign_L15_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99108:ClassDef_L17_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99108:FunctionDef_L18_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99108:FunctionDef_L18_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99108:Expr_L19_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99108:FunctionDef_L18_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99108:Expr_L20_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99108:FunctionDef_L18_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99108:Assign_L21_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99108:FunctionDef_L18_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99108:Expr_L22_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99108:FunctionDef_L18_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99108:Expr_L23_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99108:FunctionDef_L18_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99108:Assign_L24_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99108:FunctionDef_L18_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99108:Expr_L25_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99108:FunctionDef_L18_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99108:Expr_L26_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99108:FunctionDef_L18_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99108:Expr_L27_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99108:FunctionDef_L18_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99108:Expr_L29_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99108:FunctionDef_L18_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99108:Expr_L30_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99108:ClassDef_L17_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99108:FunctionDef_L32_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99108:FunctionDef_L32_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99108:Expr_L33_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99108:If_L37_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99108:Import_L38_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99108:If_L37_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99108:Assign_L39_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99108:If_L37_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99108:Assign_L40_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99108:If_L37_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99108:Assign_L41_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99108:If_L37_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99108:Expr_L42_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99108:If_L37_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99108:Expr_L43_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99108:If_L37_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99108:Expr_L44_C4"}]
#!/usr/bin/env python # coding=utf-8 import os import logging # set log def get_file_log(logFileName): logger = logging.getLogger(os.path.abspath(logFileName)) hdlr = logging.FileHandler(logFileName) formatter = logging.Formatter('%(asctime)s %(levelname)s:: %(message)s') hdlr.setFormatter(formatter) logger.addHandler(hdlr) logger.setLevel(logging.INFO) return logger
ajibawa-2023/Python-Code-Large/train/row_99109
10
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_99109:Import_L4_C0", "label": "os import os", "type": "import", "loc": [4, 4], "level": 0, "parent": null, "vector": [1, 0, 0.2667, 0.0667, 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_99109:Import_L5_C0", "label": "logging import logging", "type": "import", "loc": [5, 5], "level": 0, "parent": null, "vector": [1, 0, 0.3333, 0.0667, 0, 0.66, 0.5, 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_99109:FunctionDef_L8_C0", "label": "get_file_log", "type": "function", "loc": [8, 15], "level": 0, "parent": null, "vector": [2, 0, 0.7667, 0.5333, 0, 0.66, 1.0, 730, 0, 1, 1, 0, 0, 0, 7], "semantic": {"name": "get_file_log", "arg_names": ["logFileName"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def get_file_log(logFileName):\n logger = logging.getLogger(os.path.abspath(logFileName))\n hdlr = logging.FileHandler(logFileName)\n formatter = logging.Formatter('%(asctime)s %(levelname)s:: %(message)s')\n hdlr.setFormatter(formatter)\n logger.addHandler(hdlr)\n logger.setLevel(logging.INFO)\n return logger"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99109:Assign_L9_C4", "label": "logger = getLogger()", "type": "assigned_variable", "loc": [9, 9], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99109:FunctionDef_L8_C0", "vector": [14, 1, 0.6, 0.0667, 1, 0.22, 0.0, 532, 3, 1, 0, 0, 71, 10, 2], "semantic": {"name": "logger", "arg_names": [], "import_names": [], "rhs_call_name": "getLogger", "annotation": ""}, "snippet": " logger = logging.getLogger(os.path.abspath(logFileName))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99109:Assign_L10_C4", "label": "hdlr = FileHandler()", "type": "assigned_variable", "loc": [10, 10], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99109:FunctionDef_L8_C0", "vector": [14, 1, 0.6667, 0.0667, 1, 0.22, 0.1667, 149, 3, 1, 0, 0, 306, 10, 1], "semantic": {"name": "hdlr", "arg_names": [], "import_names": [], "rhs_call_name": "FileHandler", "annotation": ""}, "snippet": " hdlr = logging.FileHandler(logFileName)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99109:Assign_L11_C4", "label": "formatter = Formatter()", "type": "assigned_variable", "loc": [11, 11], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99109:FunctionDef_L8_C0", "vector": [14, 1, 0.7333, 0.0667, 1, 0.22, 0.3333, 791, 3, 1, 0, 0, 766, 10, 1], "semantic": {"name": "formatter", "arg_names": [], "import_names": [], "rhs_call_name": "Formatter", "annotation": ""}, "snippet": " formatter = logging.Formatter('%(asctime)s %(levelname)s:: %(message)s')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99109:Expr_L12_C4", "label": "setFormatter()", "type": "expression", "loc": [12, 12], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99109:FunctionDef_L8_C0", "vector": [8, 1, 0.8, 0.0667, 1, 0.22, 0.5, 948, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "setFormatter", "arg_names": [], "import_names": [], "rhs_call_name": "setFormatter", "annotation": ""}, "snippet": " hdlr.setFormatter(formatter)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99109:Expr_L13_C4", "label": "addHandler()", "type": "expression", "loc": [13, 13], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99109:FunctionDef_L8_C0", "vector": [8, 1, 0.8667, 0.0667, 1, 0.22, 0.6667, 255, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "addHandler", "arg_names": [], "import_names": [], "rhs_call_name": "addHandler", "annotation": ""}, "snippet": " logger.addHandler(hdlr)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99109:Expr_L14_C4", "label": "setLevel()", "type": "expression", "loc": [14, 14], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99109:FunctionDef_L8_C0", "vector": [8, 1, 0.9333, 0.0667, 1, 0.22, 0.8333, 810, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "setLevel", "arg_names": [], "import_names": [], "rhs_call_name": "setLevel", "annotation": ""}, "snippet": " logger.setLevel(logging.INFO)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99109:Return_L15_C4", "label": "return", "type": "return", "loc": [15, 15], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99109:FunctionDef_L8_C0", "vector": [13, 1, 1.0, 0.0667, 1, 0.22, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return logger"}]
[{"f": "ajibawa-2023/Python-Code-Large/train/row_99109:FunctionDef_L8_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99109:Assign_L9_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99109:FunctionDef_L8_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99109:Assign_L10_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99109:FunctionDef_L8_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99109:Assign_L11_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99109:FunctionDef_L8_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99109:Expr_L12_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99109:FunctionDef_L8_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99109:Expr_L13_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99109:FunctionDef_L8_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99109:Expr_L14_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99109:FunctionDef_L8_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99109:Return_L15_C4"}]
#!/usr/bin/python import os,sys import re import glob def ProcSourceFile(filename, newfilename): fp=open(filename,'r'); lines=fp.readlines() fp.close() addInfoLino = []; for n in range(len(lines)-1): # change ID if re.match(r' \* @\(#\)\$Id:[^\n]*$\n', lines[n]): lines[n] = r' * @(#)$Id$' + '\n' # change 2003 to 2008 if re.match(r' \* \(c\) PIONEER CORPORATION 2003', lines[n]): lines[n] = r' * (c) PIONEER CORPORATION 2008' + '\n' ##find class rem #if re.match(r'/\*',lines[n]) and re.match(r' \*\s+class\s+',lines[n+1]): #m=n #while not (re.search(r'\*/',lines[m])): #m=m+1 #addInfoLino.insert(0,(n,m)) #fine class rem by class definition if re.match(r'\s*class\s+[^;]*\n', lines[n]): if lines[n-1].find(r'*/')>0 and lines[n-1].find(r'/*')<0: remEnd = n-1; remStart = n-1; while lines[remStart].find(r'/*')<0: remStart = remStart -1 addInfoLino.insert(0, (remStart,remEnd)); elif lines[n-2].find(r'*/')>0 and lines[n-2].find(r'/*')<0: remEnd = n-2; remStart = n-2; while lines[remStart].find(r'/*')<0: remStart = remStart -1 addInfoLino.insert(0, (remStart,remEnd)); elif lines[n-3].find(r'*/')>0 and lines[n-3].find(r'/*')<0: remEnd = n-3; remStart = n-3; while lines[remStart].find(r'/*')<0: remStart = remStart -1 addInfoLino.insert(0, (remStart,remEnd)); # remove Log if re.match(r'/\*', lines[n]) and re.match(r' \*\s+\$Log',lines[n+1]): m=n while not (re.search(r'\*/', lines[m])): lines[m]='' m=m+1 lines[m]='' for pls in addInfoLino: n,m = pls for ln in range(n,m): if re.search('@author', lines[ln]) or re.search('@version', lines[ln]) or re.search('@date', lines[ln]): lines[ln]='' lines.insert(m, r' * @date $Date:: $'+'\n') lines.insert(m, r' * @version $Revision$'+'\n') lines.insert(m, r' * @author $Author$'+'\n') if re.search(r'\.h\s*$', filename): # if this is a .h file, add #endif rem Ifndef = []; for n in range(len(lines)): if lines[n].startswith(r'#if'): Ifndef.append(n); elif lines[n].startswith(r'#endif'): if len(Ifndef)==1 and lines[Ifndef[0]].startswith(r'#ifndef'): ndefVar = lines[Ifndef[0]].split()[-1] if lines[n].find(ndefVar)<0: lines[n] = r'#endif ' + '/* ' + ndefVar + r' */' + '\n' Ifndef.pop() # remove empty lines '' for n in range(lines.count('')): lines.remove('') fp = open(newfilename, 'w') fp.writelines(lines) fp.close(); def main(): if len(sys.argv)==1: print "usage: CvtSrc.py sourcefile1 sourcefile2 ..." else: for gfn in sys.argv[1:]: for filename in glob.glob(gfn): print "processing " + filename ProcSourceFile(filename,filename) print "Convert finished." if __name__ == '__main__': main() #ProcSourceFile(r'stdafx.h', r'stdafx.h')
ajibawa-2023/Python-Code-Large/train/row_99110
72
107
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_99110:Import_L3_C0", "label": "os import os, sys", "type": "import", "loc": [3, 3], "level": 0, "parent": null, "vector": [1, 0, 0.028, 0.0093, 0, 0.66, 0.0, 688, 0, 2, 0, 0, 688, 0, 0], "semantic": {"name": "os", "arg_names": [], "import_names": ["os", "sys"], "rhs_call_name": "", "annotation": ""}, "snippet": "import os,sys"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99110:Import_L4_C0", "label": "re import re", "type": "import", "loc": [4, 4], "level": 0, "parent": null, "vector": [1, 0, 0.0374, 0.0093, 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_99110:Import_L5_C0", "label": "glob import glob", "type": "import", "loc": [5, 5], "level": 0, "parent": null, "vector": [1, 0, 0.0467, 0.0093, 0, 0.66, 0.4, 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_99110:FunctionDef_L7_C0", "label": "ProcSourceFile", "type": "function", "loc": [7, 88], "level": 0, "parent": null, "vector": [2, 0, 0.4439, 0.7664, 0, 0.66, 0.6, 392, 0, 2, 0, 0, 0, 0, 47], "semantic": {"name": "ProcSourceFile", "arg_names": ["filename", "newfilename"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def ProcSourceFile(filename, newfilename):\n fp=open(filename,'r');\n lines=fp.readlines()\n fp.close()\n \n addInfoLino = [];\n for n in range(len(lines)-1):\n # change ID"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99110:Assign_L8_C4", "label": "fp = open()", "type": "assigned_variable", "loc": [8, 8], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99110:FunctionDef_L7_C0", "vector": [14, 1, 0.0748, 0.0093, 1, 0.18, 0.0, 392, 3, 2, 0, 0, 693, 10, 1], "semantic": {"name": "fp", "arg_names": [], "import_names": [], "rhs_call_name": "open", "annotation": ""}, "snippet": " fp=open(filename,'r');"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99110:Assign_L9_C4", "label": "lines = readlines()", "type": "assigned_variable", "loc": [9, 9], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99110:FunctionDef_L7_C0", "vector": [14, 1, 0.0841, 0.0093, 1, 0.18, 0.1, 73, 3, 0, 0, 0, 841, 10, 1], "semantic": {"name": "lines", "arg_names": [], "import_names": [], "rhs_call_name": "readlines", "annotation": ""}, "snippet": " lines=fp.readlines()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99110:Expr_L10_C4", "label": "close()", "type": "expression", "loc": [10, 10], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99110:FunctionDef_L7_C0", "vector": [8, 1, 0.0935, 0.0093, 1, 0.18, 0.2, 77, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "close", "arg_names": [], "import_names": [], "rhs_call_name": "close", "annotation": ""}, "snippet": " fp.close()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99110:Assign_L12_C4", "label": "addInfoLino =", "type": "assigned_variable", "loc": [12, 12], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99110:FunctionDef_L7_C0", "vector": [14, 1, 0.1121, 0.0093, 1, 0.18, 0.3, 628, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "addInfoLino", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " addInfoLino = [];"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99110:For_L13_C4", "label": "for n", "type": "for", "loc": [13, 55], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99110:FunctionDef_L7_C0", "vector": [6, 1, 0.3178, 0.4019, 1, 0.18, 0.4, 773, 3, 0, 0, 0, 0, 0, 20], "semantic": {"name": "n", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for n in range(len(lines)-1):\n # change ID\n if re.match(r' \\* @\\(#\\)\\$Id:[^\\n]*$\\n', lines[n]):\n lines[n] = r' * @(#)$Id$' + '\\n'\n # change 2003 to 2008\n if re.match(r' \\* \\(c\\) PIONEER CORPORATION 2003', lines[n]):\n lines[n] = r' * (c) PIONEER CORPORATION 2008' + '\\n'\n "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99110:If_L15_C8", "label": "if", "type": "if", "loc": [15, 16], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99110:For_L13_C4", "vector": [4, 2, 0.1449, 0.0187, 2, 0.37, 0.0, 0, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if re.match(r' \\* @\\(#\\)\\$Id:[^\\n]*$\\n', lines[n]):\n lines[n] = r' * @(#)$Id$' + '\\n'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99110:Assign_L16_C12", "label": "assign", "type": "assigned_variable", "loc": [16, 16], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99110:If_L15_C8", "vector": [14, 3, 0.1495, 0.0093, 3, 0.16, 0.0, 0, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " lines[n] = r' * @(#)$Id$' + '\\n'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99110:If_L18_C8", "label": "if", "type": "if", "loc": [18, 19], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99110:For_L13_C4", "vector": [4, 2, 0.1729, 0.0187, 2, 0.37, 0.3333, 0, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if re.match(r' \\* \\(c\\) PIONEER CORPORATION 2003', lines[n]):\n lines[n] = r' * (c) PIONEER CORPORATION 2008' + '\\n'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99110:Assign_L19_C12", "label": "assign", "type": "assigned_variable", "loc": [19, 19], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99110:If_L18_C8", "vector": [14, 3, 0.1776, 0.0093, 3, 0.62, 0.0, 0, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " lines[n] = r' * (c) PIONEER CORPORATION 2008' + '\\n'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99110:If_L29_C8", "label": "if", "type": "if", "loc": [29, 47], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99110:For_L13_C4", "vector": [4, 2, 0.3551, 0.1776, 2, 0.37, 0.6667, 0, 3, 0, 0, 0, 0, 0, 13], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if re.match(r'\\s*class\\s+[^;]*\\n', lines[n]):\n if lines[n-1].find(r'*/')>0 and lines[n-1].find(r'/*')<0:\n remEnd = n-1;\n remStart = n-1;\n while lines[remStart].find(r'/*')<0:\n remStart = remStart -1\n addInfoLino.insert(0, (remStart,remEnd));\n elif lines[n-2].find(r'*/')>0 and lines[n-2].find(r'/*')<0:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99110:If_L30_C12", "label": "if", "type": "if", "loc": [30, 47], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99110:If_L29_C8", "vector": [4, 3, 0.3598, 0.1682, 3, 0.26, 0.0, 0, 0, 0, 0, 0, 0, 0, 12], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if lines[n-1].find(r'*/')>0 and lines[n-1].find(r'/*')<0:\n remEnd = n-1;\n remStart = n-1;\n while lines[remStart].find(r'/*')<0:\n remStart = remStart -1\n addInfoLino.insert(0, (remStart,remEnd));\n elif lines[n-2].find(r'*/')>0 and lines[n-2].find(r'/*')<0:\n remEnd = n-2;"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99110:Assign_L31_C16", "label": "remEnd =", "type": "assigned_variable", "loc": [31, 31], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99110:If_L30_C12", "vector": [14, 4, 0.2897, 0.0093, 4, 0.81, 0.0, 803, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "remEnd", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " remEnd = n-1;"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99110:Assign_L32_C16", "label": "remStart =", "type": "assigned_variable", "loc": [32, 32], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99110:If_L30_C12", "vector": [14, 4, 0.2991, 0.0093, 4, 0.81, 0.25, 681, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "remStart", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " remStart = n-1;"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99110:While_L33_C16", "label": "while", "type": "while", "loc": [33, 34], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99110:If_L30_C12", "vector": [5, 4, 0.3131, 0.0187, 4, 0.81, 0.5, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " while lines[remStart].find(r'/*')<0:\n remStart = remStart -1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99110:Assign_L34_C20", "label": "remStart =", "type": "assigned_variable", "loc": [34, 34], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99110:While_L33_C16", "vector": [14, 5, 0.3178, 0.0093, 5, 0.62, 0.0, 681, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "remStart", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " remStart = remStart -1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99110:Expr_L35_C16", "label": "insert()", "type": "expression", "loc": [35, 35], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99110:If_L30_C12", "vector": [8, 4, 0.3271, 0.0093, 4, 0.81, 0.75, 368, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "insert", "arg_names": [], "import_names": [], "rhs_call_name": "insert", "annotation": ""}, "snippet": " addInfoLino.insert(0, (remStart,remEnd));"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99110:If_L36_C12", "label": "if", "type": "if", "loc": [36, 47], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99110:If_L30_C12", "vector": [4, 4, 0.3879, 0.1121, 4, 0.81, 1.0, 0, 0, 0, 0, 0, 0, 0, 8], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " elif lines[n-2].find(r'*/')>0 and lines[n-2].find(r'/*')<0:\n remEnd = n-2;\n remStart = n-2;\n while lines[remStart].find(r'/*')<0:\n remStart = remStart -1\n addInfoLino.insert(0, (remStart,remEnd));\n elif lines[n-3].find(r'*/')>0 and lines[n-3].find(r'/*')<0:\n remEnd = n-3;"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99110:Assign_L37_C16", "label": "remEnd =", "type": "assigned_variable", "loc": [37, 37], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99110:If_L36_C12", "vector": [14, 5, 0.3458, 0.0093, 5, 0.24, 0.0, 803, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "remEnd", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " remEnd = n-2;"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99110:Assign_L38_C16", "label": "remStart =", "type": "assigned_variable", "loc": [38, 38], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99110:If_L36_C12", "vector": [14, 5, 0.3551, 0.0093, 5, 0.24, 0.25, 681, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "remStart", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " remStart = n-2;"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99110:While_L39_C16", "label": "while", "type": "while", "loc": [39, 40], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99110:If_L36_C12", "vector": [5, 5, 0.3692, 0.0187, 5, 0.24, 0.5, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " while lines[remStart].find(r'/*')<0:\n remStart = remStart -1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99110:Assign_L40_C20", "label": "remStart =", "type": "assigned_variable", "loc": [40, 40], "level": 6, "parent": "ajibawa-2023/Python-Code-Large/train/row_99110:While_L39_C16", "vector": [14, 6, 0.3738, 0.0093, 6, 0.43, 0.0, 681, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "remStart", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " remStart = remStart -1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99110:Expr_L41_C16", "label": "insert()", "type": "expression", "loc": [41, 41], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99110:If_L36_C12", "vector": [8, 5, 0.3832, 0.0093, 5, 0.24, 0.75, 368, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "insert", "arg_names": [], "import_names": [], "rhs_call_name": "insert", "annotation": ""}, "snippet": " addInfoLino.insert(0, (remStart,remEnd));"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99110:If_L42_C12", "label": "if", "type": "if", "loc": [42, 47], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99110:If_L36_C12", "vector": [4, 5, 0.4159, 0.0561, 5, 0.24, 1.0, 0, 0, 0, 0, 0, 0, 0, 4], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " elif lines[n-3].find(r'*/')>0 and lines[n-3].find(r'/*')<0:\n remEnd = n-3;\n remStart = n-3;\n while lines[remStart].find(r'/*')<0:\n remStart = remStart -1\n addInfoLino.insert(0, (remStart,remEnd));"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99110:Assign_L43_C16", "label": "remEnd =", "type": "assigned_variable", "loc": [43, 43], "level": 6, "parent": "ajibawa-2023/Python-Code-Large/train/row_99110:If_L42_C12", "vector": [14, 6, 0.4019, 0.0093, 6, 0.2, 0.0, 803, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "remEnd", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " remEnd = n-3;"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99110:Assign_L44_C16", "label": "remStart =", "type": "assigned_variable", "loc": [44, 44], "level": 6, "parent": "ajibawa-2023/Python-Code-Large/train/row_99110:If_L42_C12", "vector": [14, 6, 0.4112, 0.0093, 6, 0.2, 0.3333, 681, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "remStart", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " remStart = n-3;"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99110:While_L45_C16", "label": "while", "type": "while", "loc": [45, 46], "level": 6, "parent": "ajibawa-2023/Python-Code-Large/train/row_99110:If_L42_C12", "vector": [5, 6, 0.4252, 0.0187, 6, 0.2, 0.6667, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " while lines[remStart].find(r'/*')<0:\n remStart = remStart -1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99110:Assign_L46_C20", "label": "remStart =", "type": "assigned_variable", "loc": [46, 46], "level": 7, "parent": "ajibawa-2023/Python-Code-Large/train/row_99110:While_L45_C16", "vector": [14, 7, 0.4299, 0.0093, 7, 0.62, 0.0, 681, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "remStart", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " remStart = remStart -1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99110:Expr_L47_C16", "label": "insert()", "type": "expression", "loc": [47, 47], "level": 6, "parent": "ajibawa-2023/Python-Code-Large/train/row_99110:If_L42_C12", "vector": [8, 6, 0.4393, 0.0093, 6, 0.2, 1.0, 368, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "insert", "arg_names": [], "import_names": [], "rhs_call_name": "insert", "annotation": ""}, "snippet": " addInfoLino.insert(0, (remStart,remEnd));"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99110:If_L50_C8", "label": "if", "type": "if", "loc": [50, 55], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99110:For_L13_C4", "vector": [4, 2, 0.4907, 0.0561, 2, 0.37, 1.0, 0, 0, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if re.match(r'/\\*', lines[n]) and re.match(r' \\*\\s+\\$Log',lines[n+1]):\n m=n\n while not (re.search(r'\\*/', lines[m])):\n lines[m]=''\n m=m+1\n lines[m]=''"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99110:Assign_L51_C12", "label": "m =", "type": "assigned_variable", "loc": [51, 51], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99110:If_L50_C8", "vector": [14, 3, 0.4766, 0.0093, 3, 0.12, 0.0, 711, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "m", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " m=n"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99110:While_L52_C12", "label": "while", "type": "while", "loc": [52, 54], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99110:If_L50_C8", "vector": [5, 3, 0.4953, 0.028, 3, 0.12, 0.5, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " while not (re.search(r'\\*/', lines[m])):\n lines[m]=''\n m=m+1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99110:Assign_L53_C16", "label": "assign", "type": "assigned_variable", "loc": [53, 53], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99110:While_L52_C12", "vector": [14, 4, 0.4953, 0.0093, 4, 0.47, 0.0, 0, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " lines[m]=''"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99110:Assign_L54_C16", "label": "m =", "type": "assigned_variable", "loc": [54, 54], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99110:While_L52_C12", "vector": [14, 4, 0.5047, 0.0093, 4, 0.47, 1.0, 711, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "m", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " m=m+1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99110:Assign_L55_C12", "label": "assign", "type": "assigned_variable", "loc": [55, 55], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99110:If_L50_C8", "vector": [14, 3, 0.514, 0.0093, 3, 0.12, 1.0, 0, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " lines[m]=''"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99110:For_L58_C4", "label": "for pls", "type": "for", "loc": [58, 65], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99110:FunctionDef_L7_C0", "vector": [6, 1, 0.5748, 0.0748, 1, 0.18, 0.5, 792, 2, 0, 0, 0, 0, 0, 7], "semantic": {"name": "pls", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for pls in addInfoLino:\n n,m = pls\n for ln in range(n,m):\n if re.search('@author', lines[ln]) or re.search('@version', lines[ln]) or re.search('@date', lines[ln]):\n lines[ln]=''\n lines.insert(m, r' * @date $Date:: $'+'\\n')\n lines.insert(m, r' * @version $Revision$'+'\\n')\n lines.insert(m, r' * @author $Author$'+'\\n')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99110:Assign_L59_C8", "label": "n, m =", "type": "assigned_variable", "loc": [59, 59], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99110:For_L58_C4", "vector": [14, 2, 0.5514, 0.0093, 2, 0.08, 0.0, 51, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "n, m", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " n,m = pls"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99110:For_L60_C8", "label": "for ln", "type": "for", "loc": [60, 62], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99110:For_L58_C4", "vector": [6, 2, 0.5701, 0.028, 2, 0.08, 0.25, 199, 3, 0, 0, 0, 0, 0, 4], "semantic": {"name": "ln", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for ln in range(n,m):\n if re.search('@author', lines[ln]) or re.search('@version', lines[ln]) or re.search('@date', lines[ln]):\n lines[ln]=''"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99110:If_L61_C12", "label": "if", "type": "if", "loc": [61, 62], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99110:For_L60_C8", "vector": [4, 3, 0.5748, 0.0187, 3, 0.68, 0.0, 0, 0, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if re.search('@author', lines[ln]) or re.search('@version', lines[ln]) or re.search('@date', lines[ln]):\n lines[ln]=''"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99110:Assign_L62_C16", "label": "assign", "type": "assigned_variable", "loc": [62, 62], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99110:If_L61_C12", "vector": [14, 4, 0.5794, 0.0093, 4, 0.44, 0.0, 0, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " lines[ln]=''"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99110:Expr_L63_C8", "label": "insert()", "type": "expression", "loc": [63, 63], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99110:For_L58_C4", "vector": [8, 2, 0.5888, 0.0093, 2, 0.08, 0.5, 368, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "insert", "arg_names": [], "import_names": [], "rhs_call_name": "insert", "annotation": ""}, "snippet": " lines.insert(m, r' * @date $Date:: $'+'\\n')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99110:Expr_L64_C8", "label": "insert()", "type": "expression", "loc": [64, 64], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99110:For_L58_C4", "vector": [8, 2, 0.5981, 0.0093, 2, 0.08, 0.75, 368, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "insert", "arg_names": [], "import_names": [], "rhs_call_name": "insert", "annotation": ""}, "snippet": " lines.insert(m, r' * @version $Revision$'+'\\n')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99110:Expr_L65_C8", "label": "insert()", "type": "expression", "loc": [65, 65], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99110:For_L58_C4", "vector": [8, 2, 0.6075, 0.0093, 2, 0.08, 1.0, 368, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "insert", "arg_names": [], "import_names": [], "rhs_call_name": "insert", "annotation": ""}, "snippet": " lines.insert(m, r' * @author $Author$'+'\\n')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99110:If_L68_C4", "label": "if", "type": "if", "loc": [68, 78], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99110:FunctionDef_L7_C0", "vector": [4, 1, 0.6822, 0.1028, 1, 0.18, 0.6, 0, 3, 0, 0, 0, 0, 0, 11], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if re.search(r'\\.h\\s*$', filename): # if this is a .h file, add #endif rem\n Ifndef = [];\n for n in range(len(lines)):\n if lines[n].startswith(r'#if'):\n Ifndef.append(n);\n elif lines[n].startswith(r'#endif'):\n if len(Ifndef)==1 and lines[Ifndef[0]].startswith(r'#ifndef'):\n ndefVar = lines[Ifndef[0]].split()[-1]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99110:Assign_L69_C8", "label": "Ifndef =", "type": "assigned_variable", "loc": [69, 69], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99110:If_L68_C4", "vector": [14, 2, 0.6449, 0.0093, 2, 0.36, 0.0, 543, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "Ifndef", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " Ifndef = [];"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99110:For_L70_C8", "label": "for n", "type": "for", "loc": [70, 78], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99110:If_L68_C4", "vector": [6, 2, 0.6916, 0.0841, 2, 0.36, 1.0, 773, 3, 0, 0, 0, 0, 0, 10], "semantic": {"name": "n", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for n in range(len(lines)):\n if lines[n].startswith(r'#if'):\n Ifndef.append(n);\n elif lines[n].startswith(r'#endif'):\n if len(Ifndef)==1 and lines[Ifndef[0]].startswith(r'#ifndef'):\n ndefVar = lines[Ifndef[0]].split()[-1]\n if lines[n].find(ndefVar)<0:\n lines[n] = r'#endif ' + '/* ' + ndefVar + r' */' + '\\n'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99110:If_L71_C12", "label": "if", "type": "if", "loc": [71, 78], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99110:For_L70_C8", "vector": [4, 3, 0.6963, 0.0748, 3, 0.66, 0.0, 0, 3, 0, 0, 0, 0, 0, 8], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if lines[n].startswith(r'#if'):\n Ifndef.append(n);\n elif lines[n].startswith(r'#endif'):\n if len(Ifndef)==1 and lines[Ifndef[0]].startswith(r'#ifndef'):\n ndefVar = lines[Ifndef[0]].split()[-1]\n if lines[n].find(ndefVar)<0:\n lines[n] = r'#endif ' + '/* ' + ndefVar + r' */' + '\\n'\n Ifndef.pop()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99110:Expr_L72_C16", "label": "append()", "type": "expression", "loc": [72, 72], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99110:If_L71_C12", "vector": [8, 4, 0.6729, 0.0093, 4, 0.94, 0.0, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " Ifndef.append(n);"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99110:If_L73_C12", "label": "if", "type": "if", "loc": [73, 78], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99110:If_L71_C12", "vector": [4, 4, 0.7056, 0.0561, 4, 0.94, 1.0, 0, 3, 0, 0, 0, 0, 0, 6], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " elif lines[n].startswith(r'#endif'):\n if len(Ifndef)==1 and lines[Ifndef[0]].startswith(r'#ifndef'):\n ndefVar = lines[Ifndef[0]].split()[-1]\n if lines[n].find(ndefVar)<0:\n lines[n] = r'#endif ' + '/* ' + ndefVar + r' */' + '\\n'\n Ifndef.pop()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99110:If_L74_C16", "label": "if", "type": "if", "loc": [74, 77], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99110:If_L73_C12", "vector": [4, 5, 0.7056, 0.0374, 5, 0.28, 0.0, 0, 0, 0, 0, 0, 0, 0, 4], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if len(Ifndef)==1 and lines[Ifndef[0]].startswith(r'#ifndef'):\n ndefVar = lines[Ifndef[0]].split()[-1]\n if lines[n].find(ndefVar)<0:\n lines[n] = r'#endif ' + '/* ' + ndefVar + r' */' + '\\n'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99110:Assign_L75_C20", "label": "ndefVar =", "type": "assigned_variable", "loc": [75, 75], "level": 6, "parent": "ajibawa-2023/Python-Code-Large/train/row_99110:If_L74_C16", "vector": [14, 6, 0.7009, 0.0093, 6, 0.17, 0.0, 919, 6, 0, 0, 0, 0, 0, 1], "semantic": {"name": "ndefVar", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ndefVar = lines[Ifndef[0]].split()[-1]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99110:If_L76_C20", "label": "if", "type": "if", "loc": [76, 77], "level": 6, "parent": "ajibawa-2023/Python-Code-Large/train/row_99110:If_L74_C16", "vector": [4, 6, 0.715, 0.0187, 6, 0.17, 1.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if lines[n].find(ndefVar)<0:\n lines[n] = r'#endif ' + '/* ' + ndefVar + r' */' + '\\n'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99110:Assign_L77_C24", "label": "assign", "type": "assigned_variable", "loc": [77, 77], "level": 7, "parent": "ajibawa-2023/Python-Code-Large/train/row_99110:If_L76_C20", "vector": [14, 7, 0.7196, 0.0093, 7, 0.35, 0.0, 0, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " lines[n] = r'#endif ' + '/* ' + ndefVar + r' */' + '\\n'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99110:Expr_L78_C16", "label": "pop()", "type": "expression", "loc": [78, 78], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99110:If_L73_C12", "vector": [8, 5, 0.729, 0.0093, 5, 0.28, 1.0, 969, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "pop", "arg_names": [], "import_names": [], "rhs_call_name": "pop", "annotation": ""}, "snippet": " Ifndef.pop()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99110:For_L83_C4", "label": "for n", "type": "for", "loc": [83, 84], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99110:FunctionDef_L7_C0", "vector": [6, 1, 0.7804, 0.0187, 1, 0.18, 0.7, 773, 3, 0, 0, 0, 0, 0, 3], "semantic": {"name": "n", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for n in range(lines.count('')):\n lines.remove('')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99110:Expr_L84_C8", "label": "remove()", "type": "expression", "loc": [84, 84], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99110:For_L83_C4", "vector": [8, 2, 0.785, 0.0093, 2, 0.94, 0.0, 185, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "remove", "arg_names": [], "import_names": [], "rhs_call_name": "remove", "annotation": ""}, "snippet": " lines.remove('')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99110:Assign_L86_C4", "label": "fp = open()", "type": "assigned_variable", "loc": [86, 86], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99110:FunctionDef_L7_C0", "vector": [14, 1, 0.8037, 0.0093, 1, 0.18, 0.8, 392, 3, 2, 0, 0, 693, 10, 1], "semantic": {"name": "fp", "arg_names": [], "import_names": [], "rhs_call_name": "open", "annotation": ""}, "snippet": " fp = open(newfilename, 'w')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99110:Expr_L87_C4", "label": "writelines()", "type": "expression", "loc": [87, 87], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99110:FunctionDef_L7_C0", "vector": [8, 1, 0.8131, 0.0093, 1, 0.18, 0.9, 290, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "writelines", "arg_names": [], "import_names": [], "rhs_call_name": "writelines", "annotation": ""}, "snippet": " fp.writelines(lines)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99110:Expr_L88_C4", "label": "close()", "type": "expression", "loc": [88, 88], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99110:FunctionDef_L7_C0", "vector": [8, 1, 0.8224, 0.0093, 1, 0.18, 1.0, 77, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "close", "arg_names": [], "import_names": [], "rhs_call_name": "close", "annotation": ""}, "snippet": " fp.close();"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99110:FunctionDef_L90_C0", "label": "main", "type": "function", "loc": [90, 98], "level": 0, "parent": null, "vector": [2, 0, 0.8785, 0.0841, 0, 0.66, 0.8, 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 print(\"usage: CvtSrc.py sourcefile1 sourcefile2 ...\")\n else:\n for gfn in sys.argv[1:]:\n for filename in glob.glob(gfn):\n print(\"processing \" + filename)\n ProcSourceFile(filename,filename)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99110:If_L91_C4", "label": "if", "type": "if", "loc": [91, 98], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99110:FunctionDef_L90_C0", "vector": [4, 1, 0.8832, 0.0748, 1, 0.32, 0.0, 0, 0, 0, 0, 0, 0, 0, 6], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if len(sys.argv)==1:\n print(\"usage: CvtSrc.py sourcefile1 sourcefile2 ...\")\n else:\n for gfn in sys.argv[1:]:\n for filename in glob.glob(gfn):\n print(\"processing \" + filename)\n ProcSourceFile(filename,filename)\n print(\"Convert finished.\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99110:Expr_L92_C8", "label": "print()", "type": "expression", "loc": [92, 92], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99110:If_L91_C4", "vector": [8, 2, 0.8598, 0.0093, 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(\"usage: CvtSrc.py sourcefile1 sourcefile2 ...\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99110:For_L94_C8", "label": "for gfn", "type": "for", "loc": [94, 97], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99110:If_L91_C4", "vector": [6, 2, 0.8925, 0.0374, 2, 0.37, 0.5, 943, 6, 0, 0, 0, 0, 0, 3], "semantic": {"name": "gfn", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for gfn in sys.argv[1:]:\n for filename in glob.glob(gfn):\n print(\"processing \" + filename)\n ProcSourceFile(filename,filename)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99110:For_L95_C12", "label": "for filename", "type": "for", "loc": [95, 97], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99110:For_L94_C8", "vector": [6, 3, 0.8972, 0.028, 3, 0.61, 0.0, 275, 3, 0, 0, 0, 0, 0, 3], "semantic": {"name": "filename", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for filename in glob.glob(gfn):\n print(\"processing \" + filename)\n ProcSourceFile(filename,filename)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99110:Expr_L96_C16", "label": "print()", "type": "expression", "loc": [96, 96], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99110:For_L95_C12", "vector": [8, 4, 0.8972, 0.0093, 4, 0.04, 0.0, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print(\"processing \" + filename)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99110:Expr_L97_C16", "label": "ProcSourceFile()", "type": "expression", "loc": [97, 97], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99110:For_L95_C12", "vector": [8, 4, 0.9065, 0.0093, 4, 0.04, 1.0, 392, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "ProcSourceFile", "arg_names": [], "import_names": [], "rhs_call_name": "ProcSourceFile", "annotation": ""}, "snippet": " ProcSourceFile(filename,filename)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99110:Expr_L98_C8", "label": "print()", "type": "expression", "loc": [98, 98], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99110:If_L91_C4", "vector": [8, 2, 0.9159, 0.0093, 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(\"Convert finished.\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99110:If_L102_C0", "label": "if", "type": "if", "loc": [102, 103], "level": 0, "parent": null, "vector": [4, 0, 0.9579, 0.0187, 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_99110:Expr_L103_C4", "label": "main()", "type": "expression", "loc": [103, 103], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99110:If_L102_C0", "vector": [8, 1, 0.9626, 0.0093, 1, 0.11, 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_99110:FunctionDef_L7_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99110:Assign_L8_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99110:FunctionDef_L7_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99110:Assign_L9_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99110:FunctionDef_L7_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99110:Expr_L10_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99110:FunctionDef_L7_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99110:Assign_L12_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99110:FunctionDef_L7_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99110:For_L13_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99110:For_L13_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99110:If_L15_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99110:If_L15_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99110:Assign_L16_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99110:For_L13_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99110:If_L18_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99110:If_L18_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99110:Assign_L19_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99110:For_L13_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99110:If_L29_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99110:If_L29_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99110:If_L30_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99110:If_L30_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99110:Assign_L31_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99110:If_L30_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99110:Assign_L32_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99110:If_L30_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99110:While_L33_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99110:While_L33_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99110:Assign_L34_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99110:If_L30_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99110:Expr_L35_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99110:If_L30_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99110:If_L36_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99110:If_L36_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99110:Assign_L37_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99110:If_L36_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99110:Assign_L38_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99110:If_L36_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99110:While_L39_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99110:While_L39_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99110:Assign_L40_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99110:If_L36_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99110:Expr_L41_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99110:If_L36_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99110:If_L42_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99110:If_L42_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99110:Assign_L43_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99110:If_L42_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99110:Assign_L44_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99110:If_L42_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99110:While_L45_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99110:While_L45_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99110:Assign_L46_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99110:If_L42_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99110:Expr_L47_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99110:For_L13_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99110:If_L50_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99110:If_L50_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99110:Assign_L51_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99110:If_L50_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99110:While_L52_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99110:While_L52_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99110:Assign_L53_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99110:While_L52_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99110:Assign_L54_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99110:If_L50_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99110:Assign_L55_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99110:FunctionDef_L7_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99110:For_L58_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99110:For_L58_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99110:Assign_L59_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99110:For_L58_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99110:For_L60_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99110:For_L60_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99110:If_L61_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99110:If_L61_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99110:Assign_L62_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99110:For_L58_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99110:Expr_L63_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99110:For_L58_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99110:Expr_L64_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99110:For_L58_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99110:Expr_L65_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99110:FunctionDef_L7_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99110:If_L68_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99110:If_L68_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99110:Assign_L69_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99110:If_L68_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99110:For_L70_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99110:For_L70_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99110:If_L71_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99110:If_L71_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99110:Expr_L72_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99110:If_L71_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99110:If_L73_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99110:If_L73_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99110:If_L74_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99110:If_L74_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99110:Assign_L75_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99110:If_L74_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99110:If_L76_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99110:If_L76_C20", "t": "ajibawa-2023/Python-Code-Large/train/row_99110:Assign_L77_C24"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99110:If_L73_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99110:Expr_L78_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99110:FunctionDef_L7_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99110:For_L83_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99110:For_L83_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99110:Expr_L84_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99110:FunctionDef_L7_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99110:Assign_L86_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99110:FunctionDef_L7_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99110:Expr_L87_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99110:FunctionDef_L7_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99110:Expr_L88_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99110:FunctionDef_L90_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99110:If_L91_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99110:If_L91_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99110:Expr_L92_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99110:If_L91_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99110:For_L94_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99110:For_L94_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99110:For_L95_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99110:For_L95_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99110:Expr_L96_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99110:For_L95_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99110:Expr_L97_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99110:If_L91_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99110:Expr_L98_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99110:If_L102_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99110:Expr_L103_C4"}]
#!/usr/bin/env python # coding=utf-8 import os import sys import time import anydbm import zlib def main(): if len(sys.argv) == 1: return if len(sys.argv) > 2: num = int(sys.argv[2]) delFromDb = True else: num = 50 delFromDb = False dbfn = sys.argv[1] pt = os.path.split(os.path.abspath(dbfn))[0] dbn = os.path.split(os.path.abspath(dbfn))[1] os.chdir(pt) db = anydbm.open(dbn, 'w') keys = list(db.iterkeys()) keys.sort() keysd = [] for key in keys: try: if num <= 0: break num -= 1 fn = key + '.bmp' f = open(fn, 'wb') f.write(zlib.decompress(db[key])) f.close() keysd.append(key) except: pass if delFromDb: for key in keysd: del db[key] db.close() if __name__ == '__main__': main()
ajibawa-2023/Python-Code-Large/train/row_99111
34
47
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_99111:Import_L4_C0", "label": "os import os", "type": "import", "loc": [4, 4], "level": 0, "parent": null, "vector": [1, 0, 0.0851, 0.0213, 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_99111:Import_L5_C0", "label": "sys import sys", "type": "import", "loc": [5, 5], "level": 0, "parent": null, "vector": [1, 0, 0.1064, 0.0213, 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_99111:Import_L6_C0", "label": "time import time", "type": "import", "loc": [6, 6], "level": 0, "parent": null, "vector": [1, 0, 0.1277, 0.0213, 0, 0.66, 0.3333, 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_99111:Import_L7_C0", "label": "anydbm import anydbm", "type": "import", "loc": [7, 7], "level": 0, "parent": null, "vector": [1, 0, 0.1489, 0.0213, 0, 0.66, 0.5, 434, 0, 1, 0, 0, 434, 0, 0], "semantic": {"name": "anydbm", "arg_names": [], "import_names": ["anydbm"], "rhs_call_name": "", "annotation": ""}, "snippet": "import anydbm"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99111:Import_L8_C0", "label": "zlib import zlib", "type": "import", "loc": [8, 8], "level": 0, "parent": null, "vector": [1, 0, 0.1702, 0.0213, 0, 0.66, 0.6667, 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_99111:FunctionDef_L11_C0", "label": "main", "type": "function", "loc": [11, 43], "level": 0, "parent": null, "vector": [2, 0, 0.5745, 0.7021, 0, 0.66, 0.8333, 624, 0, 0, 0, 0, 0, 0, 18], "semantic": {"name": "main", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def main():\n\tif len(sys.argv) == 1:\n\t\treturn\n\tif len(sys.argv) > 2:\n\t\tnum = int(sys.argv[2])\n\t\tdelFromDb = True\n\telse:\n\t\tnum = 50"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99111:If_L12_C1", "label": "if", "type": "if", "loc": [12, 13], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99111:FunctionDef_L11_C0", "vector": [4, 1, 0.266, 0.0426, 1, 0.37, 0.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tif len(sys.argv) == 1:\n\t\treturn"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99111:Return_L13_C2", "label": "return", "type": "return", "loc": [13, 13], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99111:If_L12_C1", "vector": [13, 2, 0.2766, 0.0213, 2, 0.43, 0.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\treturn"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99111:If_L14_C1", "label": "if", "type": "if", "loc": [14, 19], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99111:FunctionDef_L11_C0", "vector": [4, 1, 0.3511, 0.1277, 1, 0.37, 0.0833, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tif len(sys.argv) > 2:\n\t\tnum = int(sys.argv[2])\n\t\tdelFromDb = True\n\telse:\n\t\tnum = 50\n\t\tdelFromDb = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99111:Assign_L15_C2", "label": "num = int()", "type": "assigned_variable", "loc": [15, 15], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99111:If_L14_C1", "vector": [14, 2, 0.3191, 0.0213, 2, 0.33, 0.0, 328, 3, 1, 0, 0, 901, 10, 1], "semantic": {"name": "num", "arg_names": [], "import_names": [], "rhs_call_name": "int", "annotation": ""}, "snippet": "\t\tnum = int(sys.argv[2])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99111:Assign_L16_C2", "label": "delFromDb =", "type": "assigned_variable", "loc": [16, 16], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99111:If_L14_C1", "vector": [14, 2, 0.3404, 0.0213, 2, 0.33, 0.3333, 555, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "delFromDb", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tdelFromDb = True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99111:Assign_L18_C2", "label": "num =", "type": "assigned_variable", "loc": [18, 18], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99111:If_L14_C1", "vector": [14, 2, 0.383, 0.0213, 2, 0.33, 0.6667, 328, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "num", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tnum = 50"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99111:Assign_L19_C2", "label": "delFromDb =", "type": "assigned_variable", "loc": [19, 19], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99111:If_L14_C1", "vector": [14, 2, 0.4043, 0.0213, 2, 0.33, 1.0, 555, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "delFromDb", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tdelFromDb = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99111:Assign_L20_C1", "label": "dbfn =", "type": "assigned_variable", "loc": [20, 20], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99111:FunctionDef_L11_C0", "vector": [14, 1, 0.4255, 0.0213, 1, 0.37, 0.1667, 460, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "dbfn", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tdbfn = sys.argv[1]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99111:Assign_L21_C1", "label": "pt =", "type": "assigned_variable", "loc": [21, 21], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99111:FunctionDef_L11_C0", "vector": [14, 1, 0.4468, 0.0213, 1, 0.37, 0.25, 989, 6, 0, 0, 0, 0, 0, 2], "semantic": {"name": "pt", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tpt = os.path.split(os.path.abspath(dbfn))[0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99111:Assign_L22_C1", "label": "dbn =", "type": "assigned_variable", "loc": [22, 22], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99111:FunctionDef_L11_C0", "vector": [14, 1, 0.4681, 0.0213, 1, 0.37, 0.3333, 717, 6, 0, 0, 0, 0, 0, 2], "semantic": {"name": "dbn", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tdbn = os.path.split(os.path.abspath(dbfn))[1]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99111:Expr_L23_C1", "label": "chdir()", "type": "expression", "loc": [23, 23], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99111:FunctionDef_L11_C0", "vector": [8, 1, 0.4894, 0.0213, 1, 0.37, 0.4167, 122, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "chdir", "arg_names": [], "import_names": [], "rhs_call_name": "chdir", "annotation": ""}, "snippet": "\tos.chdir(pt)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99111:Assign_L24_C1", "label": "db = open()", "type": "assigned_variable", "loc": [24, 24], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99111:FunctionDef_L11_C0", "vector": [14, 1, 0.5106, 0.0213, 1, 0.37, 0.5, 761, 3, 2, 0, 0, 693, 10, 1], "semantic": {"name": "db", "arg_names": [], "import_names": [], "rhs_call_name": "open", "annotation": ""}, "snippet": "\tdb = anydbm.open(dbn, 'w')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99111:Assign_L25_C1", "label": "keys = list()", "type": "assigned_variable", "loc": [25, 25], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99111:FunctionDef_L11_C0", "vector": [14, 1, 0.5319, 0.0213, 1, 0.37, 0.5833, 204, 3, 1, 0, 0, 430, 10, 2], "semantic": {"name": "keys", "arg_names": [], "import_names": [], "rhs_call_name": "list", "annotation": ""}, "snippet": "\tkeys = list(db.iterkeys())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99111:Expr_L26_C1", "label": "sort()", "type": "expression", "loc": [26, 26], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99111:FunctionDef_L11_C0", "vector": [8, 1, 0.5532, 0.0213, 1, 0.37, 0.6667, 489, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "sort", "arg_names": [], "import_names": [], "rhs_call_name": "sort", "annotation": ""}, "snippet": "\tkeys.sort()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99111:Assign_L27_C1", "label": "keysd =", "type": "assigned_variable", "loc": [27, 27], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99111:FunctionDef_L11_C0", "vector": [14, 1, 0.5745, 0.0213, 1, 0.37, 0.75, 831, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "keysd", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tkeysd = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99111:For_L28_C1", "label": "for key", "type": "for", "loc": [28, 39], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99111:FunctionDef_L11_C0", "vector": [6, 1, 0.7128, 0.2553, 1, 0.37, 0.8333, 230, 2, 0, 0, 0, 0, 0, 5], "semantic": {"name": "key", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tfor key in keys:\n\t\ttry:\n\t\t\tif num <= 0:\n\t\t\t\tbreak\n\t\t\tnum -= 1\n\t\t\tfn = key + '.bmp'\n\t\t\tf = open(fn, 'wb')\n\t\t\tf.write(zlib.decompress(db[key]))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99111:Try_L29_C2", "label": "try", "type": "try", "loc": [29, 39], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99111:For_L28_C1", "vector": [7, 2, 0.7234, 0.234, 2, 0.88, 0.0, 0, 0, 1, 0, 0, 0, 0, 5], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\ttry:\n\t\t\tif num <= 0:\n\t\t\t\tbreak\n\t\t\tnum -= 1\n\t\t\tfn = key + '.bmp'\n\t\t\tf = open(fn, 'wb')\n\t\t\tf.write(zlib.decompress(db[key]))\n\t\t\tf.close()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99111:If_L30_C3", "label": "if", "type": "if", "loc": [30, 31], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99111:Try_L29_C2", "vector": [4, 3, 0.6489, 0.0426, 3, 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\tif num <= 0:\n\t\t\t\tbreak"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99111:Assign_L33_C3", "label": "fn =", "type": "assigned_variable", "loc": [33, 33], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99111:Try_L29_C2", "vector": [14, 3, 0.7021, 0.0213, 3, 0.02, 0.2, 59, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "fn", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\tfn = key + '.bmp'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99111:Assign_L34_C3", "label": "f = open()", "type": "assigned_variable", "loc": [34, 34], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99111:Try_L29_C2", "vector": [14, 3, 0.7234, 0.0213, 3, 0.02, 0.4, 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(fn, 'wb')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99111:Expr_L35_C3", "label": "write()", "type": "expression", "loc": [35, 35], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99111:Try_L29_C2", "vector": [8, 3, 0.7447, 0.0213, 3, 0.02, 0.6, 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(zlib.decompress(db[key]))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99111:Expr_L36_C3", "label": "close()", "type": "expression", "loc": [36, 36], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99111:Try_L29_C2", "vector": [8, 3, 0.766, 0.0213, 3, 0.02, 0.8, 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_99111:Expr_L37_C3", "label": "append()", "type": "expression", "loc": [37, 37], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99111:Try_L29_C2", "vector": [8, 3, 0.7872, 0.0213, 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\tkeysd.append(key)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99111:If_L40_C1", "label": "if", "type": "if", "loc": [40, 42], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99111:FunctionDef_L11_C0", "vector": [4, 1, 0.8723, 0.0638, 1, 0.37, 0.9167, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tif delFromDb:\n\t\tfor key in keysd:\n\t\t\tdel db[key]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99111:For_L41_C2", "label": "for key", "type": "for", "loc": [41, 42], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99111:If_L40_C1", "vector": [6, 2, 0.883, 0.0426, 2, 0.97, 0.0, 230, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "key", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tfor key in keysd:\n\t\t\tdel db[key]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99111:Expr_L43_C1", "label": "close()", "type": "expression", "loc": [43, 43], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99111:FunctionDef_L11_C0", "vector": [8, 1, 0.9149, 0.0213, 1, 0.37, 1.0, 77, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "close", "arg_names": [], "import_names": [], "rhs_call_name": "close", "annotation": ""}, "snippet": "\tdb.close()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99111:If_L45_C0", "label": "if", "type": "if", "loc": [45, 46], "level": 0, "parent": null, "vector": [4, 0, 0.9681, 0.0426, 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\tmain()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99111:Expr_L46_C1", "label": "main()", "type": "expression", "loc": [46, 46], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99111:If_L45_C0", "vector": [8, 1, 0.9787, 0.0213, 1, 0.4, 0.0, 624, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "main", "arg_names": [], "import_names": [], "rhs_call_name": "main", "annotation": ""}, "snippet": "\tmain()"}]
[{"f": "ajibawa-2023/Python-Code-Large/train/row_99111:FunctionDef_L11_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99111:If_L12_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99111:If_L12_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99111:Return_L13_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99111:FunctionDef_L11_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99111:If_L14_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99111:If_L14_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99111:Assign_L15_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99111:If_L14_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99111:Assign_L16_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99111:If_L14_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99111:Assign_L18_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99111:If_L14_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99111:Assign_L19_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99111:FunctionDef_L11_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99111:Assign_L20_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99111:FunctionDef_L11_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99111:Assign_L21_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99111:FunctionDef_L11_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99111:Assign_L22_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99111:FunctionDef_L11_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99111:Expr_L23_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99111:FunctionDef_L11_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99111:Assign_L24_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99111:FunctionDef_L11_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99111:Assign_L25_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99111:FunctionDef_L11_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99111:Expr_L26_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99111:FunctionDef_L11_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99111:Assign_L27_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99111:FunctionDef_L11_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99111:For_L28_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99111:For_L28_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99111:Try_L29_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99111:Try_L29_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99111:If_L30_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99111:Try_L29_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99111:Assign_L33_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99111:Try_L29_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99111:Assign_L34_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99111:Try_L29_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99111:Expr_L35_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99111:Try_L29_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99111:Expr_L36_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99111:Try_L29_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99111:Expr_L37_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99111:FunctionDef_L11_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99111:If_L40_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99111:If_L40_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99111:For_L41_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99111:FunctionDef_L11_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99111:Expr_L43_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99111:If_L45_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99111:Expr_L46_C1"}]
#!/usr/bin/env python # coding=utf-8 import os import sys import time import anydbm import zlib import glob def main(): if len(sys.argv) == 1: return else: dbfolder = sys.argv[1] os.chdir(dbfolder) dbns = (s[:-4] for s in glob.glob(r'*.dat')) for dbn in dbns: extract_db(dbn) def extract_db(dbn): db = anydbm.open(dbn, 'w') for key in db.iterkeys(): try: fn = key + '.bmp' with open(fn, 'wb') as f: f.write(zlib.decompress(db[key])) except: pass db.close() if __name__ == '__main__': main()
ajibawa-2023/Python-Code-Large/train/row_99112
23
35
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_99112:Import_L4_C0", "label": "os import os", "type": "import", "loc": [4, 4], "level": 0, "parent": null, "vector": [1, 0, 0.1143, 0.0286, 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_99112:Import_L5_C0", "label": "sys import sys", "type": "import", "loc": [5, 5], "level": 0, "parent": null, "vector": [1, 0, 0.1429, 0.0286, 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_99112:Import_L6_C0", "label": "time import time", "type": "import", "loc": [6, 6], "level": 0, "parent": null, "vector": [1, 0, 0.1714, 0.0286, 0, 0.66, 0.25, 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_99112:Import_L7_C0", "label": "anydbm import anydbm", "type": "import", "loc": [7, 7], "level": 0, "parent": null, "vector": [1, 0, 0.2, 0.0286, 0, 0.66, 0.375, 434, 0, 1, 0, 0, 434, 0, 0], "semantic": {"name": "anydbm", "arg_names": [], "import_names": ["anydbm"], "rhs_call_name": "", "annotation": ""}, "snippet": "import anydbm"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99112:Import_L8_C0", "label": "zlib import zlib", "type": "import", "loc": [8, 8], "level": 0, "parent": null, "vector": [1, 0, 0.2286, 0.0286, 0, 0.66, 0.5, 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_99112:Import_L9_C0", "label": "glob import glob", "type": "import", "loc": [9, 9], "level": 0, "parent": null, "vector": [1, 0, 0.2571, 0.0286, 0, 0.66, 0.625, 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_99112:FunctionDef_L12_C0", "label": "main", "type": "function", "loc": [12, 20], "level": 0, "parent": null, "vector": [2, 0, 0.4571, 0.2571, 0, 0.66, 0.75, 624, 0, 0, 0, 0, 0, 0, 4], "semantic": {"name": "main", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def main():\n\tif len(sys.argv) == 1:\n\t\treturn\n\telse:\n\t\tdbfolder = sys.argv[1]\n\tos.chdir(dbfolder)\n\tdbns = (s[:-4] for s in glob.glob(r'*.dat'))\n\tfor dbn in dbns:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99112:If_L13_C1", "label": "if", "type": "if", "loc": [13, 16], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99112:FunctionDef_L12_C0", "vector": [4, 1, 0.4143, 0.1143, 1, 0.51, 0.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tif len(sys.argv) == 1:\n\t\treturn\n\telse:\n\t\tdbfolder = sys.argv[1]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99112:Return_L14_C2", "label": "return", "type": "return", "loc": [14, 14], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99112:If_L13_C1", "vector": [13, 2, 0.4, 0.0286, 2, 0.73, 0.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\treturn"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99112:Assign_L16_C2", "label": "dbfolder =", "type": "assigned_variable", "loc": [16, 16], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99112:If_L13_C1", "vector": [14, 2, 0.4571, 0.0286, 2, 0.73, 1.0, 623, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "dbfolder", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tdbfolder = sys.argv[1]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99112:Expr_L17_C1", "label": "chdir()", "type": "expression", "loc": [17, 17], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99112:FunctionDef_L12_C0", "vector": [8, 1, 0.4857, 0.0286, 1, 0.51, 0.3333, 122, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "chdir", "arg_names": [], "import_names": [], "rhs_call_name": "chdir", "annotation": ""}, "snippet": "\tos.chdir(dbfolder)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99112:Assign_L18_C1", "label": "dbns =", "type": "assigned_variable", "loc": [18, 18], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99112:FunctionDef_L12_C0", "vector": [14, 1, 0.5143, 0.0286, 1, 0.51, 0.6667, 905, 5, 0, 0, 0, 0, 0, 1], "semantic": {"name": "dbns", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tdbns = (s[:-4] for s in glob.glob(r'*.dat'))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99112:For_L19_C1", "label": "for dbn", "type": "for", "loc": [19, 20], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99112:FunctionDef_L12_C0", "vector": [6, 1, 0.5571, 0.0571, 1, 0.51, 1.0, 717, 2, 0, 0, 0, 0, 0, 1], "semantic": {"name": "dbn", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tfor dbn in dbns:\n\t\t\textract_db(dbn)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99112:Expr_L20_C3", "label": "extract_db()", "type": "expression", "loc": [20, 20], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99112:For_L19_C1", "vector": [8, 2, 0.5714, 0.0286, 2, 0.98, 0.0, 892, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "extract_db", "arg_names": [], "import_names": [], "rhs_call_name": "extract_db", "annotation": ""}, "snippet": "\t\t\textract_db(dbn)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99112:FunctionDef_L22_C0", "label": "extract_db", "type": "function", "loc": [22, 31], "level": 0, "parent": null, "vector": [2, 0, 0.7571, 0.2857, 0, 0.66, 0.875, 892, 0, 1, 0, 0, 0, 0, 6], "semantic": {"name": "extract_db", "arg_names": ["dbn"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def extract_db(dbn):\n\tdb = anydbm.open(dbn, 'w')\n\tfor key in db.iterkeys():\n\t\ttry:\n\t\t\tfn = key + '.bmp'\n\t\t\twith open(fn, 'wb') as f:\n\t\t\t\tf.write(zlib.decompress(db[key]))\n\t\texcept:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99112:Assign_L23_C1", "label": "db = open()", "type": "assigned_variable", "loc": [23, 23], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99112:FunctionDef_L22_C0", "vector": [14, 1, 0.6571, 0.0286, 1, 0.27, 0.0, 761, 3, 2, 0, 0, 693, 10, 1], "semantic": {"name": "db", "arg_names": [], "import_names": [], "rhs_call_name": "open", "annotation": ""}, "snippet": "\tdb = anydbm.open(dbn, 'w')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99112:For_L24_C1", "label": "for key", "type": "for", "loc": [24, 30], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99112:FunctionDef_L22_C0", "vector": [6, 1, 0.7714, 0.2, 1, 0.27, 0.5, 230, 3, 0, 0, 0, 0, 0, 4], "semantic": {"name": "key", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tfor key in db.iterkeys():\n\t\ttry:\n\t\t\tfn = key + '.bmp'\n\t\t\twith open(fn, 'wb') as f:\n\t\t\t\tf.write(zlib.decompress(db[key]))\n\t\texcept:\n\t\t\tpass"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99112:Try_L25_C2", "label": "try", "type": "try", "loc": [25, 30], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99112:For_L24_C1", "vector": [7, 2, 0.7857, 0.1714, 2, 0.14, 0.0, 0, 0, 1, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\ttry:\n\t\t\tfn = key + '.bmp'\n\t\t\twith open(fn, 'wb') as f:\n\t\t\t\tf.write(zlib.decompress(db[key]))\n\t\texcept:\n\t\t\tpass"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99112:Assign_L26_C3", "label": "fn =", "type": "assigned_variable", "loc": [26, 26], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99112:Try_L25_C2", "vector": [14, 3, 0.7429, 0.0286, 3, 0.8, 0.0, 59, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "fn", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\tfn = key + '.bmp'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99112:Expr_L28_C4", "label": "write()", "type": "expression", "loc": [28, 28], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99112:Try_L25_C2", "vector": [8, 3, 0.8, 0.0286, 3, 0.8, 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\tf.write(zlib.decompress(db[key]))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99112:Expr_L31_C1", "label": "close()", "type": "expression", "loc": [31, 31], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99112:FunctionDef_L22_C0", "vector": [8, 1, 0.8857, 0.0286, 1, 0.27, 1.0, 77, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "close", "arg_names": [], "import_names": [], "rhs_call_name": "close", "annotation": ""}, "snippet": "\tdb.close()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99112:If_L33_C0", "label": "if", "type": "if", "loc": [33, 34], "level": 0, "parent": null, "vector": [4, 0, 0.9571, 0.0571, 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\tmain()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99112:Expr_L34_C1", "label": "main()", "type": "expression", "loc": [34, 34], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99112:If_L33_C0", "vector": [8, 1, 0.9714, 0.0286, 1, 0.65, 0.0, 624, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "main", "arg_names": [], "import_names": [], "rhs_call_name": "main", "annotation": ""}, "snippet": "\tmain()"}]
[{"f": "ajibawa-2023/Python-Code-Large/train/row_99112:FunctionDef_L12_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99112:If_L13_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99112:If_L13_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99112:Return_L14_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99112:If_L13_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99112:Assign_L16_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99112:FunctionDef_L12_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99112:Expr_L17_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99112:FunctionDef_L12_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99112:Assign_L18_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99112:FunctionDef_L12_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99112:For_L19_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99112:For_L19_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99112:Expr_L20_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99112:FunctionDef_L22_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99112:Assign_L23_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99112:FunctionDef_L22_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99112:For_L24_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99112:For_L24_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99112:Try_L25_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99112:Try_L25_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99112:Assign_L26_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99112:Try_L25_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99112:Expr_L28_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99112:FunctionDef_L22_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99112:Expr_L31_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99112:If_L33_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99112:Expr_L34_C1"}]
#!/usr/bin/env python # coding=utf-8 CAPTURE_FOLDER = r'D:\captures' DB_FILENAME = 'capturedb' INTERVAL_CAPTURE = 60 import os import time import datetime import anydbm import zlib import win32gui, win32ui, win32con, win32api def window_capture(): hwnd = 0 hwndDC = win32gui.GetWindowDC(hwnd) mfcDC=win32ui.CreateDCFromHandle(hwndDC) saveDC=mfcDC.CreateCompatibleDC() saveBitMap = win32ui.CreateBitmap() MoniterDev=win32api.EnumDisplayMonitors(None,None) w = MoniterDev[0][2][2] h = MoniterDev[0][2][3] #print w,h saveBitMap.CreateCompatibleBitmap(mfcDC, w, h) saveDC.SelectObject(saveBitMap) saveDC.BitBlt((0,0),(w, h) , mfcDC, (0,0), win32con.SRCCOPY) bmpname = os.tmpnam() saveBitMap.SaveBitmapFile(saveDC, bmpname) f = open(bmpname, 'rb') bmpcontent = f.read() f.close() os.remove(bmpname) return bmpcontent def append_capture(dbn): bmpcontent = window_capture() key = time.strftime("%Y%m%d-%H%M%S") value = zlib.compress(bmpcontent) del bmpcontent db = anydbm.open(dbn, 'c') db[key] = value db.close() print key def main(): if os.path.isfile(CAPTURE_FOLDER): sys.exit(1) if not os.path.exists(CAPTURE_FOLDER): os.mkdir(CAPTURE_FOLDER) if not os.path.isdir(CAPTURE_FOLDER): sys.exit(1) os.chdir(CAPTURE_FOLDER) dbn = time.strftime("%Y%m%d-%H%M%S-") + DB_FILENAME while True: append_capture(dbn) time.sleep(INTERVAL_CAPTURE) if __name__ == '__main__': main()
ajibawa-2023/Python-Code-Large/train/row_99113
50
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_99113:Assign_L4_C0", "label": "CAPTURE_FOLDER =", "type": "assigned_variable", "loc": [4, 4], "level": 0, "parent": null, "vector": [14, 0, 0.0656, 0.0164, 0, 0.66, 0.0, 262, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "CAPTURE_FOLDER", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "CAPTURE_FOLDER = r'D:\\captures'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99113:Assign_L5_C0", "label": "DB_FILENAME =", "type": "assigned_variable", "loc": [5, 5], "level": 0, "parent": null, "vector": [14, 0, 0.082, 0.0164, 0, 0.66, 0.0833, 139, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "DB_FILENAME", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "DB_FILENAME = 'capturedb'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99113:Assign_L6_C0", "label": "INTERVAL_CAPTURE =", "type": "assigned_variable", "loc": [6, 6], "level": 0, "parent": null, "vector": [14, 0, 0.0984, 0.0164, 0, 0.66, 0.1667, 590, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "INTERVAL_CAPTURE", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "INTERVAL_CAPTURE = 60"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99113:Import_L8_C0", "label": "os import os", "type": "import", "loc": [8, 8], "level": 0, "parent": null, "vector": [1, 0, 0.1311, 0.0164, 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_99113:Import_L9_C0", "label": "time import time", "type": "import", "loc": [9, 9], "level": 0, "parent": null, "vector": [1, 0, 0.1475, 0.0164, 0, 0.66, 0.3333, 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_99113:Import_L10_C0", "label": "datetime import datetime", "type": "import", "loc": [10, 10], "level": 0, "parent": null, "vector": [1, 0, 0.1639, 0.0164, 0, 0.66, 0.4167, 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_99113:Import_L11_C0", "label": "anydbm import anydbm", "type": "import", "loc": [11, 11], "level": 0, "parent": null, "vector": [1, 0, 0.1803, 0.0164, 0, 0.66, 0.5, 434, 0, 1, 0, 0, 434, 0, 0], "semantic": {"name": "anydbm", "arg_names": [], "import_names": ["anydbm"], "rhs_call_name": "", "annotation": ""}, "snippet": "import anydbm"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99113:Import_L12_C0", "label": "zlib import zlib", "type": "import", "loc": [12, 12], "level": 0, "parent": null, "vector": [1, 0, 0.1967, 0.0164, 0, 0.66, 0.5833, 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_99113:Import_L13_C0", "label": "win32gui import win32gui, win32ui, win32con\u2026", "type": "import", "loc": [13, 13], "level": 0, "parent": null, "vector": [1, 0, 0.2131, 0.0164, 0, 0.66, 0.6667, 615, 0, 4, 0, 0, 615, 0, 0], "semantic": {"name": "win32gui", "arg_names": [], "import_names": ["win32gui", "win32ui", "win32con", "win32api"], "rhs_call_name": "", "annotation": ""}, "snippet": "import win32gui, win32ui, win32con, win32api"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99113:FunctionDef_L15_C0", "label": "window_capture", "type": "function", "loc": [15, 34], "level": 0, "parent": null, "vector": [2, 0, 0.4016, 0.3279, 0, 0.66, 0.75, 29, 0, 0, 1, 0, 0, 0, 14], "semantic": {"name": "window_capture", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def window_capture():\n\thwnd = 0\n\thwndDC = win32gui.GetWindowDC(hwnd)\n\tmfcDC=win32ui.CreateDCFromHandle(hwndDC)\n\tsaveDC=mfcDC.CreateCompatibleDC()\n\tsaveBitMap = win32ui.CreateBitmap()\n\tMoniterDev=win32api.EnumDisplayMonitors(None,None)\n\tw = MoniterDev[0][2][2]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99113:Assign_L16_C1", "label": "hwnd =", "type": "assigned_variable", "loc": [16, 16], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99113:FunctionDef_L15_C0", "vector": [14, 1, 0.2623, 0.0164, 1, 0.38, 0.0, 655, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "hwnd", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\thwnd = 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99113:Assign_L17_C1", "label": "hwndDC = GetWindowDC()", "type": "assigned_variable", "loc": [17, 17], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99113:FunctionDef_L15_C0", "vector": [14, 1, 0.2787, 0.0164, 1, 0.38, 0.0588, 813, 3, 1, 0, 0, 448, 10, 1], "semantic": {"name": "hwndDC", "arg_names": [], "import_names": [], "rhs_call_name": "GetWindowDC", "annotation": ""}, "snippet": "\thwndDC = win32gui.GetWindowDC(hwnd)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99113:Assign_L18_C1", "label": "mfcDC = CreateDCFromHandle()", "type": "assigned_variable", "loc": [18, 18], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99113:FunctionDef_L15_C0", "vector": [14, 1, 0.2951, 0.0164, 1, 0.38, 0.1176, 846, 3, 1, 0, 0, 427, 10, 1], "semantic": {"name": "mfcDC", "arg_names": [], "import_names": [], "rhs_call_name": "CreateDCFromHandle", "annotation": ""}, "snippet": "\tmfcDC=win32ui.CreateDCFromHandle(hwndDC)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99113:Assign_L19_C1", "label": "saveDC = CreateCompatibleDC()", "type": "assigned_variable", "loc": [19, 19], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99113:FunctionDef_L15_C0", "vector": [14, 1, 0.3115, 0.0164, 1, 0.38, 0.1765, 576, 3, 0, 0, 0, 132, 10, 1], "semantic": {"name": "saveDC", "arg_names": [], "import_names": [], "rhs_call_name": "CreateCompatibleDC", "annotation": ""}, "snippet": "\tsaveDC=mfcDC.CreateCompatibleDC()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99113:Assign_L20_C1", "label": "saveBitMap = CreateBitmap()", "type": "assigned_variable", "loc": [20, 20], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99113:FunctionDef_L15_C0", "vector": [14, 1, 0.3279, 0.0164, 1, 0.38, 0.2353, 273, 3, 0, 0, 0, 354, 10, 1], "semantic": {"name": "saveBitMap", "arg_names": [], "import_names": [], "rhs_call_name": "CreateBitmap", "annotation": ""}, "snippet": "\tsaveBitMap = win32ui.CreateBitmap()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99113:Assign_L21_C1", "label": "MoniterDev = EnumDisplayMonitors()", "type": "assigned_variable", "loc": [21, 21], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99113:FunctionDef_L15_C0", "vector": [14, 1, 0.3443, 0.0164, 1, 0.38, 0.2941, 971, 3, 2, 0, 0, 580, 10, 1], "semantic": {"name": "MoniterDev", "arg_names": [], "import_names": [], "rhs_call_name": "EnumDisplayMonitors", "annotation": ""}, "snippet": "\tMoniterDev=win32api.EnumDisplayMonitors(None,None)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99113:Assign_L22_C1", "label": "w =", "type": "assigned_variable", "loc": [22, 22], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99113:FunctionDef_L15_C0", "vector": [14, 1, 0.3607, 0.0164, 1, 0.38, 0.3529, 549, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "w", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tw = MoniterDev[0][2][2]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99113:Assign_L23_C1", "label": "h =", "type": "assigned_variable", "loc": [23, 23], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99113:FunctionDef_L15_C0", "vector": [14, 1, 0.377, 0.0164, 1, 0.38, 0.4118, 686, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "h", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\th = MoniterDev[0][2][3]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99113:Expr_L25_C1", "label": "CreateCompatibleBitmap()", "type": "expression", "loc": [25, 25], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99113:FunctionDef_L15_C0", "vector": [8, 1, 0.4098, 0.0164, 1, 0.38, 0.4706, 366, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "CreateCompatibleBitmap", "arg_names": [], "import_names": [], "rhs_call_name": "CreateCompatibleBitmap", "annotation": ""}, "snippet": "\tsaveBitMap.CreateCompatibleBitmap(mfcDC, w, h)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99113:Expr_L26_C1", "label": "SelectObject()", "type": "expression", "loc": [26, 26], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99113:FunctionDef_L15_C0", "vector": [8, 1, 0.4262, 0.0164, 1, 0.38, 0.5294, 817, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "SelectObject", "arg_names": [], "import_names": [], "rhs_call_name": "SelectObject", "annotation": ""}, "snippet": "\tsaveDC.SelectObject(saveBitMap)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99113:Expr_L27_C1", "label": "BitBlt()", "type": "expression", "loc": [27, 27], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99113:FunctionDef_L15_C0", "vector": [8, 1, 0.4426, 0.0164, 1, 0.38, 0.5882, 207, 3, 5, 0, 0, 0, 0, 1], "semantic": {"name": "BitBlt", "arg_names": [], "import_names": [], "rhs_call_name": "BitBlt", "annotation": ""}, "snippet": "\tsaveDC.BitBlt((0,0),(w, h) , mfcDC, (0,0), win32con.SRCCOPY)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99113:Assign_L28_C1", "label": "bmpname = tmpnam()", "type": "assigned_variable", "loc": [28, 28], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99113:FunctionDef_L15_C0", "vector": [14, 1, 0.459, 0.0164, 1, 0.38, 0.6471, 568, 3, 0, 0, 0, 749, 10, 1], "semantic": {"name": "bmpname", "arg_names": [], "import_names": [], "rhs_call_name": "tmpnam", "annotation": ""}, "snippet": "\tbmpname = os.tmpnam()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99113:Expr_L29_C1", "label": "SaveBitmapFile()", "type": "expression", "loc": [29, 29], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99113:FunctionDef_L15_C0", "vector": [8, 1, 0.4754, 0.0164, 1, 0.38, 0.7059, 73, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "SaveBitmapFile", "arg_names": [], "import_names": [], "rhs_call_name": "SaveBitmapFile", "annotation": ""}, "snippet": "\tsaveBitMap.SaveBitmapFile(saveDC, bmpname)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99113:Assign_L30_C1", "label": "f = open()", "type": "assigned_variable", "loc": [30, 30], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99113:FunctionDef_L15_C0", "vector": [14, 1, 0.4918, 0.0164, 1, 0.38, 0.7647, 899, 3, 2, 0, 0, 693, 10, 1], "semantic": {"name": "f", "arg_names": [], "import_names": [], "rhs_call_name": "open", "annotation": ""}, "snippet": "\tf = open(bmpname, 'rb')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99113:Assign_L31_C1", "label": "bmpcontent = read()", "type": "assigned_variable", "loc": [31, 31], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99113:FunctionDef_L15_C0", "vector": [14, 1, 0.5082, 0.0164, 1, 0.38, 0.8235, 402, 3, 0, 0, 0, 453, 10, 1], "semantic": {"name": "bmpcontent", "arg_names": [], "import_names": [], "rhs_call_name": "read", "annotation": ""}, "snippet": "\tbmpcontent = f.read()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99113:Expr_L32_C1", "label": "close()", "type": "expression", "loc": [32, 32], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99113:FunctionDef_L15_C0", "vector": [8, 1, 0.5246, 0.0164, 1, 0.38, 0.8824, 77, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "close", "arg_names": [], "import_names": [], "rhs_call_name": "close", "annotation": ""}, "snippet": "\tf.close()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99113:Expr_L33_C1", "label": "remove()", "type": "expression", "loc": [33, 33], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99113:FunctionDef_L15_C0", "vector": [8, 1, 0.541, 0.0164, 1, 0.38, 0.9412, 185, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "remove", "arg_names": [], "import_names": [], "rhs_call_name": "remove", "annotation": ""}, "snippet": "\tos.remove(bmpname)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99113:Return_L34_C1", "label": "return", "type": "return", "loc": [34, 34], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99113:FunctionDef_L15_C0", "vector": [13, 1, 0.5574, 0.0164, 1, 0.38, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\treturn bmpcontent"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99113:FunctionDef_L36_C0", "label": "append_capture", "type": "function", "loc": [36, 44], "level": 0, "parent": null, "vector": [2, 0, 0.6557, 0.1475, 0, 0.66, 0.8333, 509, 0, 1, 0, 0, 0, 0, 6], "semantic": {"name": "append_capture", "arg_names": ["dbn"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def append_capture(dbn):\n\tbmpcontent = window_capture()\n\tkey = time.strftime(\"%Y%m%d-%H%M%S\")\n\tvalue = zlib.compress(bmpcontent)\n\tdel bmpcontent\n\tdb = anydbm.open(dbn, 'c')\n\tdb[key] = value\n\tdb.close()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99113:Assign_L37_C1", "label": "bmpcontent = window_capture()", "type": "assigned_variable", "loc": [37, 37], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99113:FunctionDef_L36_C0", "vector": [14, 1, 0.6066, 0.0164, 1, 0.45, 0.0, 402, 3, 0, 0, 0, 29, 10, 1], "semantic": {"name": "bmpcontent", "arg_names": [], "import_names": [], "rhs_call_name": "window_capture", "annotation": ""}, "snippet": "\tbmpcontent = window_capture()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99113:Assign_L38_C1", "label": "key = strftime()", "type": "assigned_variable", "loc": [38, 38], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99113:FunctionDef_L36_C0", "vector": [14, 1, 0.623, 0.0164, 1, 0.45, 0.1667, 230, 3, 1, 0, 0, 668, 10, 1], "semantic": {"name": "key", "arg_names": [], "import_names": [], "rhs_call_name": "strftime", "annotation": ""}, "snippet": "\tkey = time.strftime(\"%Y%m%d-%H%M%S\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99113:Assign_L39_C1", "label": "value = compress()", "type": "assigned_variable", "loc": [39, 39], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99113:FunctionDef_L36_C0", "vector": [14, 1, 0.6393, 0.0164, 1, 0.45, 0.3333, 441, 3, 1, 0, 0, 657, 10, 1], "semantic": {"name": "value", "arg_names": [], "import_names": [], "rhs_call_name": "compress", "annotation": ""}, "snippet": "\tvalue = zlib.compress(bmpcontent)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99113:Assign_L41_C1", "label": "db = open()", "type": "assigned_variable", "loc": [41, 41], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99113:FunctionDef_L36_C0", "vector": [14, 1, 0.6721, 0.0164, 1, 0.45, 0.5, 761, 3, 2, 0, 0, 693, 10, 1], "semantic": {"name": "db", "arg_names": [], "import_names": [], "rhs_call_name": "open", "annotation": ""}, "snippet": "\tdb = anydbm.open(dbn, 'c')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99113:Assign_L42_C1", "label": "assign", "type": "assigned_variable", "loc": [42, 42], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99113:FunctionDef_L36_C0", "vector": [14, 1, 0.6885, 0.0164, 1, 0.45, 0.6667, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tdb[key] = value"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99113:Expr_L43_C1", "label": "close()", "type": "expression", "loc": [43, 43], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99113:FunctionDef_L36_C0", "vector": [8, 1, 0.7049, 0.0164, 1, 0.45, 0.8333, 77, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "close", "arg_names": [], "import_names": [], "rhs_call_name": "close", "annotation": ""}, "snippet": "\tdb.close()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99113:Expr_L44_C1", "label": "print()", "type": "expression", "loc": [44, 44], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99113:FunctionDef_L36_C0", "vector": [8, 1, 0.7213, 0.0164, 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": "\tprint(key)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99113:FunctionDef_L46_C0", "label": "main", "type": "function", "loc": [46, 57], "level": 0, "parent": null, "vector": [2, 0, 0.8443, 0.1967, 0, 0.66, 0.9167, 624, 0, 0, 0, 0, 0, 0, 10], "semantic": {"name": "main", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def main():\n\tif os.path.isfile(CAPTURE_FOLDER):\n\t\tsys.exit(1)\n\tif not os.path.exists(CAPTURE_FOLDER):\n\t\tos.mkdir(CAPTURE_FOLDER)\n\tif not os.path.isdir(CAPTURE_FOLDER):\n\t\tsys.exit(1)\n\tos.chdir(CAPTURE_FOLDER)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99113:If_L47_C1", "label": "if", "type": "if", "loc": [47, 48], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99113:FunctionDef_L46_C0", "vector": [4, 1, 0.7787, 0.0328, 1, 0.48, 0.0, 0, 3, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tif os.path.isfile(CAPTURE_FOLDER):\n\t\tsys.exit(1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99113:Expr_L48_C2", "label": "exit()", "type": "expression", "loc": [48, 48], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99113:If_L47_C1", "vector": [8, 2, 0.7869, 0.0164, 2, 0.03, 0.0, 436, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "exit", "arg_names": [], "import_names": [], "rhs_call_name": "exit", "annotation": ""}, "snippet": "\t\tsys.exit(1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99113:If_L49_C1", "label": "if", "type": "if", "loc": [49, 50], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99113:FunctionDef_L46_C0", "vector": [4, 1, 0.8115, 0.0328, 1, 0.48, 0.2, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tif not os.path.exists(CAPTURE_FOLDER):\n\t\tos.mkdir(CAPTURE_FOLDER)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99113:Expr_L50_C2", "label": "mkdir()", "type": "expression", "loc": [50, 50], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99113:If_L49_C1", "vector": [8, 2, 0.8197, 0.0164, 2, 0.19, 0.0, 853, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "mkdir", "arg_names": [], "import_names": [], "rhs_call_name": "mkdir", "annotation": ""}, "snippet": "\t\tos.mkdir(CAPTURE_FOLDER)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99113:If_L51_C1", "label": "if", "type": "if", "loc": [51, 52], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99113:FunctionDef_L46_C0", "vector": [4, 1, 0.8443, 0.0328, 1, 0.48, 0.4, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tif not os.path.isdir(CAPTURE_FOLDER):\n\t\tsys.exit(1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99113:Expr_L52_C2", "label": "exit()", "type": "expression", "loc": [52, 52], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99113:If_L51_C1", "vector": [8, 2, 0.8525, 0.0164, 2, 0.53, 0.0, 436, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "exit", "arg_names": [], "import_names": [], "rhs_call_name": "exit", "annotation": ""}, "snippet": "\t\tsys.exit(1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99113:Expr_L53_C1", "label": "chdir()", "type": "expression", "loc": [53, 53], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99113:FunctionDef_L46_C0", "vector": [8, 1, 0.8689, 0.0164, 1, 0.48, 0.6, 122, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "chdir", "arg_names": [], "import_names": [], "rhs_call_name": "chdir", "annotation": ""}, "snippet": "\tos.chdir(CAPTURE_FOLDER)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99113:Assign_L54_C1", "label": "dbn =", "type": "assigned_variable", "loc": [54, 54], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99113:FunctionDef_L46_C0", "vector": [14, 1, 0.8852, 0.0164, 1, 0.48, 0.8, 717, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "dbn", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tdbn = time.strftime(\"%Y%m%d-%H%M%S-\") + DB_FILENAME"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99113:While_L55_C1", "label": "while", "type": "while", "loc": [55, 57], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99113:FunctionDef_L46_C0", "vector": [5, 1, 0.918, 0.0492, 1, 0.48, 1.0, 0, 1, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\twhile True:\n\t\tappend_capture(dbn)\n\t\ttime.sleep(INTERVAL_CAPTURE)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99113:Expr_L56_C2", "label": "append_capture()", "type": "expression", "loc": [56, 56], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99113:While_L55_C1", "vector": [8, 2, 0.918, 0.0164, 2, 0.06, 0.0, 509, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append_capture", "arg_names": [], "import_names": [], "rhs_call_name": "append_capture", "annotation": ""}, "snippet": "\t\tappend_capture(dbn)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99113:Expr_L57_C2", "label": "sleep()", "type": "expression", "loc": [57, 57], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99113:While_L55_C1", "vector": [8, 2, 0.9344, 0.0164, 2, 0.06, 1.0, 476, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "sleep", "arg_names": [], "import_names": [], "rhs_call_name": "sleep", "annotation": ""}, "snippet": "\t\ttime.sleep(INTERVAL_CAPTURE)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99113:If_L59_C0", "label": "if", "type": "if", "loc": [59, 60], "level": 0, "parent": null, "vector": [4, 0, 0.9754, 0.0328, 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\tmain()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99113:Expr_L60_C1", "label": "main()", "type": "expression", "loc": [60, 60], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99113:If_L59_C0", "vector": [8, 1, 0.9836, 0.0164, 1, 0.57, 0.0, 624, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "main", "arg_names": [], "import_names": [], "rhs_call_name": "main", "annotation": ""}, "snippet": "\tmain()"}]
[{"f": "ajibawa-2023/Python-Code-Large/train/row_99113:FunctionDef_L15_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99113:Assign_L16_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99113:FunctionDef_L15_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99113:Assign_L17_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99113:FunctionDef_L15_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99113:Assign_L18_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99113:FunctionDef_L15_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99113:Assign_L19_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99113:FunctionDef_L15_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99113:Assign_L20_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99113:FunctionDef_L15_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99113:Assign_L21_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99113:FunctionDef_L15_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99113:Assign_L22_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99113:FunctionDef_L15_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99113:Assign_L23_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99113:FunctionDef_L15_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99113:Expr_L25_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99113:FunctionDef_L15_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99113:Expr_L26_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99113:FunctionDef_L15_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99113:Expr_L27_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99113:FunctionDef_L15_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99113:Assign_L28_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99113:FunctionDef_L15_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99113:Expr_L29_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99113:FunctionDef_L15_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99113:Assign_L30_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99113:FunctionDef_L15_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99113:Assign_L31_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99113:FunctionDef_L15_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99113:Expr_L32_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99113:FunctionDef_L15_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99113:Expr_L33_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99113:FunctionDef_L15_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99113:Return_L34_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99113:FunctionDef_L36_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99113:Assign_L37_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99113:FunctionDef_L36_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99113:Assign_L38_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99113:FunctionDef_L36_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99113:Assign_L39_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99113:FunctionDef_L36_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99113:Assign_L41_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99113:FunctionDef_L36_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99113:Assign_L42_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99113:FunctionDef_L36_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99113:Expr_L43_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99113:FunctionDef_L36_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99113:Expr_L44_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99113:FunctionDef_L46_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99113:If_L47_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99113:If_L47_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99113:Expr_L48_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99113:FunctionDef_L46_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99113:If_L49_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99113:If_L49_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99113:Expr_L50_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99113:FunctionDef_L46_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99113:If_L51_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99113:If_L51_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99113:Expr_L52_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99113:FunctionDef_L46_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99113:Expr_L53_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99113:FunctionDef_L46_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99113:Assign_L54_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99113:FunctionDef_L46_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99113:While_L55_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99113:While_L55_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99113:Expr_L56_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99113:While_L55_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99113:Expr_L57_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99113:If_L59_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99113:Expr_L60_C1"}]
#!/usr/bin/env python # coding=utf-8 import os import sys import re import codecs import pickle import cPickle from OffsetDump import KiwiDataManager from VrDicCheck import * import time KIWI_INDEX_FILE = r'\\solar\data$\10Model\JB014\090213_SP2\INDEXDAT.KWI' VR_DIC_FOLDER = r'\\solar\data$\10Model\JB014\090213_SP2\VoiceData\CHN\80\VOICE' # set log import CheckLog log = CheckLog.get_file_log(r'check.log') def check(): print('Loading Kiwi Data ...') DicItem._folder = VR_DIC_FOLDER dumpFilename = KIWI_INDEX_FILE.replace('\\', '_').replace('$', '_').replace(':', '_') if os.path.isfile(dumpFilename): kdm = cPickle.load(open(dumpFilename, 'r')) else: kdm = KiwiDataManager(KIWI_INDEX_FILE) f = open(dumpFilename, 'w') cPickle.dump(kdm, f) f.close() DicItem._kiwiDataManager = kdm print('Checking ...') rt = DicRootItem() rt.check_recursively() print('Check Finished') def main(): if len(sys.argv) != 3: print('Usage:') print(r'python check.py [KiwiIndexFilepath] [VrDicPath]') print(r'Example: python check.py \\solar\data$\10Model\JB014\090213_SP2\INDEXDAT.KWI \\solar\data$\10Model\JB014\090213_SP2\VocieData\CHN\80\VOICE') sys.exit(0) global KIWI_INDEX_FILE, VR_DIC_FOLDER KIWI_INDEX_FILE = sys.argv[1] VR_DIC_FOLDER = sys.argv[2] try: import psyco psyco.full() except: print('Warning: Using psyco failed. It will still work correctly, but much more slowly.') check() if __name__ == '__main__': main()
ajibawa-2023/Python-Code-Large/train/row_99114
43
57
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_99114:Import_L4_C0", "label": "os import os", "type": "import", "loc": [4, 4], "level": 0, "parent": null, "vector": [1, 0, 0.0702, 0.0175, 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_99114:Import_L5_C0", "label": "sys import sys", "type": "import", "loc": [5, 5], "level": 0, "parent": null, "vector": [1, 0, 0.0877, 0.0175, 0, 0.66, 0.0667, 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_99114:Import_L6_C0", "label": "re import re", "type": "import", "loc": [6, 6], "level": 0, "parent": null, "vector": [1, 0, 0.1053, 0.0175, 0, 0.66, 0.1333, 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_99114:Import_L7_C0", "label": "codecs import codecs", "type": "import", "loc": [7, 7], "level": 0, "parent": null, "vector": [1, 0, 0.1228, 0.0175, 0, 0.66, 0.2, 220, 0, 1, 0, 0, 220, 0, 0], "semantic": {"name": "codecs", "arg_names": [], "import_names": ["codecs"], "rhs_call_name": "", "annotation": ""}, "snippet": "import codecs"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99114:Import_L8_C0", "label": "pickle import pickle", "type": "import", "loc": [8, 8], "level": 0, "parent": null, "vector": [1, 0, 0.1404, 0.0175, 0, 0.66, 0.2667, 848, 0, 1, 0, 0, 848, 0, 0], "semantic": {"name": "pickle", "arg_names": [], "import_names": ["pickle"], "rhs_call_name": "", "annotation": ""}, "snippet": "import pickle"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99114:Import_L9_C0", "label": "cPickle import cPickle", "type": "import", "loc": [9, 9], "level": 0, "parent": null, "vector": [1, 0, 0.1579, 0.0175, 0, 0.66, 0.3333, 279, 0, 1, 0, 0, 279, 0, 0], "semantic": {"name": "cPickle", "arg_names": [], "import_names": ["cPickle"], "rhs_call_name": "", "annotation": ""}, "snippet": "import cPickle"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99114:ImportFrom_L10_C0", "label": "from OffsetDump import KiwiDataManager", "type": "import", "loc": [10, 10], "level": 0, "parent": null, "vector": [1, 0, 0.1754, 0.0175, 0, 0.66, 0.4, 935, 0, 1, 0, 0, 935, 0, 0], "semantic": {"name": "OffsetDump", "arg_names": [], "import_names": ["KiwiDataManager"], "rhs_call_name": "", "annotation": ""}, "snippet": "from OffsetDump import KiwiDataManager"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99114:ImportFrom_L11_C0", "label": "from VrDicCheck import *", "type": "import", "loc": [11, 11], "level": 0, "parent": null, "vector": [1, 0, 0.193, 0.0175, 0, 0.66, 0.4667, 317, 0, 1, 0, 0, 317, 0, 0], "semantic": {"name": "VrDicCheck", "arg_names": [], "import_names": ["*"], "rhs_call_name": "", "annotation": ""}, "snippet": "from VrDicCheck import *"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99114:Import_L12_C0", "label": "time import time", "type": "import", "loc": [12, 12], "level": 0, "parent": null, "vector": [1, 0, 0.2105, 0.0175, 0, 0.66, 0.5333, 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_99114:Assign_L14_C0", "label": "KIWI_INDEX_FILE =", "type": "assigned_variable", "loc": [14, 14], "level": 0, "parent": null, "vector": [14, 0, 0.2456, 0.0175, 0, 0.66, 0.6, 814, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "KIWI_INDEX_FILE", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "KIWI_INDEX_FILE = r'\\\\solar\\data$\\10Model\\JB014\\090213_SP2\\INDEXDAT.KWI'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99114:Assign_L15_C0", "label": "VR_DIC_FOLDER =", "type": "assigned_variable", "loc": [15, 15], "level": 0, "parent": null, "vector": [14, 0, 0.2632, 0.0175, 0, 0.66, 0.6667, 595, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "VR_DIC_FOLDER", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "VR_DIC_FOLDER = r'\\\\solar\\data$\\10Model\\JB014\\090213_SP2\\VoiceData\\CHN\\80\\VOICE'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99114:Import_L17_C0", "label": "CheckLog import CheckLog", "type": "import", "loc": [17, 17], "level": 0, "parent": null, "vector": [1, 0, 0.2982, 0.0175, 0, 0.66, 0.7333, 11, 0, 1, 0, 0, 11, 0, 0], "semantic": {"name": "CheckLog", "arg_names": [], "import_names": ["CheckLog"], "rhs_call_name": "", "annotation": ""}, "snippet": "import CheckLog"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99114:Assign_L18_C0", "label": "log = get_file_log()", "type": "assigned_variable", "loc": [18, 18], "level": 0, "parent": null, "vector": [14, 0, 0.3158, 0.0175, 0, 0.66, 0.8, 432, 3, 1, 0, 0, 730, 10, 1], "semantic": {"name": "log", "arg_names": [], "import_names": [], "rhs_call_name": "get_file_log", "annotation": ""}, "snippet": "log = CheckLog.get_file_log(r'check.log')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99114:FunctionDef_L21_C0", "label": "check", "type": "function", "loc": [21, 37], "level": 0, "parent": null, "vector": [2, 0, 0.5088, 0.2982, 0, 0.66, 0.8667, 803, 0, 0, 0, 0, 0, 0, 15], "semantic": {"name": "check", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def check():\n\tprint('Loading Kiwi Data ...')\n\tDicItem._folder = VR_DIC_FOLDER\n\tdumpFilename = KIWI_INDEX_FILE.replace('\\\\', '_').replace('$', '_').replace(':', '_')\n\tif os.path.isfile(dumpFilename):\n\t\tkdm = cPickle.load(open(dumpFilename, 'r'))\n\telse:\n\t\tkdm = KiwiDataManager(KIWI_INDEX_FILE)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99114:Expr_L22_C1", "label": "print()", "type": "expression", "loc": [22, 22], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99114:FunctionDef_L21_C0", "vector": [8, 1, 0.386, 0.0175, 1, 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": "\tprint('Loading Kiwi Data ...')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99114:Assign_L23_C1", "label": "DicItem._folder =", "type": "assigned_variable", "loc": [23, 23], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99114:FunctionDef_L21_C0", "vector": [14, 1, 0.4035, 0.0175, 1, 0.35, 0.125, 885, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "DicItem._folder", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tDicItem._folder = VR_DIC_FOLDER"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99114:Assign_L24_C1", "label": "dumpFilename = replace()", "type": "assigned_variable", "loc": [24, 24], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99114:FunctionDef_L21_C0", "vector": [14, 1, 0.4211, 0.0175, 1, 0.35, 0.25, 880, 3, 2, 0, 0, 293, 10, 3], "semantic": {"name": "dumpFilename", "arg_names": [], "import_names": [], "rhs_call_name": "replace", "annotation": ""}, "snippet": "\tdumpFilename = KIWI_INDEX_FILE.replace('\\\\', '_').replace('$', '_').replace(':', '_')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99114:If_L25_C1", "label": "if", "type": "if", "loc": [25, 31], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99114:FunctionDef_L21_C0", "vector": [4, 1, 0.4912, 0.1228, 1, 0.35, 0.375, 0, 3, 0, 0, 0, 0, 0, 7], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tif os.path.isfile(dumpFilename):\n\t\tkdm = cPickle.load(open(dumpFilename, 'r'))\n\telse:\n\t\tkdm = KiwiDataManager(KIWI_INDEX_FILE)\n\t\tf = open(dumpFilename, 'w')\n\t\tcPickle.dump(kdm, f)\n\t\tf.close()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99114:Assign_L26_C2", "label": "kdm = load()", "type": "assigned_variable", "loc": [26, 26], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99114:If_L25_C1", "vector": [14, 2, 0.4561, 0.0175, 2, 0.03, 0.0, 444, 3, 1, 0, 0, 37, 10, 2], "semantic": {"name": "kdm", "arg_names": [], "import_names": [], "rhs_call_name": "load", "annotation": ""}, "snippet": "\t\tkdm = cPickle.load(open(dumpFilename, 'r'))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99114:Assign_L28_C2", "label": "kdm = KiwiDataManager()", "type": "assigned_variable", "loc": [28, 28], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99114:If_L25_C1", "vector": [14, 2, 0.4912, 0.0175, 2, 0.03, 0.25, 444, 3, 1, 0, 0, 240, 10, 1], "semantic": {"name": "kdm", "arg_names": [], "import_names": [], "rhs_call_name": "KiwiDataManager", "annotation": ""}, "snippet": "\t\tkdm = KiwiDataManager(KIWI_INDEX_FILE)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99114:Assign_L29_C2", "label": "f = open()", "type": "assigned_variable", "loc": [29, 29], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99114:If_L25_C1", "vector": [14, 2, 0.5088, 0.0175, 2, 0.03, 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(dumpFilename, 'w')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99114:Expr_L30_C2", "label": "dump()", "type": "expression", "loc": [30, 30], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99114:If_L25_C1", "vector": [8, 2, 0.5263, 0.0175, 2, 0.03, 0.75, 952, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "dump", "arg_names": [], "import_names": [], "rhs_call_name": "dump", "annotation": ""}, "snippet": "\t\tcPickle.dump(kdm, f)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99114:Expr_L31_C2", "label": "close()", "type": "expression", "loc": [31, 31], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99114:If_L25_C1", "vector": [8, 2, 0.5439, 0.0175, 2, 0.03, 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_99114:Assign_L33_C1", "label": "DicItem._kiwiDataManager =", "type": "assigned_variable", "loc": [33, 33], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99114:FunctionDef_L21_C0", "vector": [14, 1, 0.5789, 0.0175, 1, 0.35, 0.5, 665, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "DicItem._kiwiDataManager", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tDicItem._kiwiDataManager = kdm"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99114:Expr_L34_C1", "label": "print()", "type": "expression", "loc": [34, 34], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99114:FunctionDef_L21_C0", "vector": [8, 1, 0.5965, 0.0175, 1, 0.35, 0.625, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": "\tprint('Checking ...')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99114:Assign_L35_C1", "label": "rt = DicRootItem()", "type": "assigned_variable", "loc": [35, 35], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99114:FunctionDef_L21_C0", "vector": [14, 1, 0.614, 0.0175, 1, 0.35, 0.75, 991, 3, 0, 0, 0, 896, 10, 1], "semantic": {"name": "rt", "arg_names": [], "import_names": [], "rhs_call_name": "DicRootItem", "annotation": ""}, "snippet": "\trt = DicRootItem()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99114:Expr_L36_C1", "label": "check_recursively()", "type": "expression", "loc": [36, 36], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99114:FunctionDef_L21_C0", "vector": [8, 1, 0.6316, 0.0175, 1, 0.35, 0.875, 612, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "check_recursively", "arg_names": [], "import_names": [], "rhs_call_name": "check_recursively", "annotation": ""}, "snippet": "\trt.check_recursively()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99114:Expr_L37_C1", "label": "print()", "type": "expression", "loc": [37, 37], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99114:FunctionDef_L21_C0", "vector": [8, 1, 0.6491, 0.0175, 1, 0.35, 1.0, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": "\tprint('Check Finished')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99114:FunctionDef_L39_C0", "label": "main", "type": "function", "loc": [39, 53], "level": 0, "parent": null, "vector": [2, 0, 0.807, 0.2632, 0, 0.66, 0.9333, 624, 0, 0, 0, 0, 0, 0, 8], "semantic": {"name": "main", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def main():\n\tif len(sys.argv) != 3:\n\t\tprint('Usage:')\n\t\tprint(r'python check.py [KiwiIndexFilepath] [VrDicPath]')\n\t\tprint(r'Example: python check.py \\\\solar\\data$\\10Model\\JB014\\090213_SP2\\INDEXDAT.KWI \\\\solar\\data$\\10Model\\JB014\\090213_SP2\\VocieData\\CHN\\80\\VOICE')\n\t\tsys.exit(0)\n\tglobal KIWI_INDEX_FILE, VR_DIC_FOLDER\n\tKIWI_INDEX_FILE = sys.argv[1]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99114:If_L40_C1", "label": "if", "type": "if", "loc": [40, 44], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99114:FunctionDef_L39_C0", "vector": [4, 1, 0.7368, 0.0877, 1, 0.15, 0.0, 0, 0, 0, 0, 0, 0, 0, 5], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tif len(sys.argv) != 3:\n\t\tprint('Usage:')\n\t\tprint(r'python check.py [KiwiIndexFilepath] [VrDicPath]')\n\t\tprint(r'Example: python check.py \\\\solar\\data$\\10Model\\JB014\\090213_SP2\\INDEXDAT.KWI \\\\solar\\data$\\10Model\\JB014\\090213_SP2\\VocieData\\CHN\\80\\VOICE')\n\t\tsys.exit(0)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99114:Expr_L41_C2", "label": "print()", "type": "expression", "loc": [41, 41], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99114:If_L40_C1", "vector": [8, 2, 0.7193, 0.0175, 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": "\t\tprint('Usage:')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99114:Expr_L42_C2", "label": "print()", "type": "expression", "loc": [42, 42], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99114:If_L40_C1", "vector": [8, 2, 0.7368, 0.0175, 2, 0.08, 0.3333, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": "\t\tprint(r'python check.py [KiwiIndexFilepath] [VrDicPath]')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99114:Expr_L43_C2", "label": "print()", "type": "expression", "loc": [43, 43], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99114:If_L40_C1", "vector": [8, 2, 0.7544, 0.0175, 2, 0.08, 0.6667, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": "\t\tprint(r'Example: python check.py \\\\solar\\data$\\10Model\\JB014\\090213_SP2\\INDEXDAT.KWI \\\\solar\\data$\\10Model\\JB014\\090213_SP2\\VocieData\\CHN\\80\\VOICE')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99114:Expr_L44_C2", "label": "exit()", "type": "expression", "loc": [44, 44], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99114:If_L40_C1", "vector": [8, 2, 0.7719, 0.0175, 2, 0.08, 1.0, 436, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "exit", "arg_names": [], "import_names": [], "rhs_call_name": "exit", "annotation": ""}, "snippet": "\t\tsys.exit(0)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99114:Assign_L46_C1", "label": "KIWI_INDEX_FILE =", "type": "assigned_variable", "loc": [46, 46], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99114:FunctionDef_L39_C0", "vector": [14, 1, 0.807, 0.0175, 1, 0.15, 0.25, 814, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "KIWI_INDEX_FILE", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tKIWI_INDEX_FILE = sys.argv[1]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99114:Assign_L47_C1", "label": "VR_DIC_FOLDER =", "type": "assigned_variable", "loc": [47, 47], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99114:FunctionDef_L39_C0", "vector": [14, 1, 0.8246, 0.0175, 1, 0.15, 0.5, 595, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "VR_DIC_FOLDER", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tVR_DIC_FOLDER = sys.argv[2]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99114:Try_L48_C1", "label": "try", "type": "try", "loc": [48, 52], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99114:FunctionDef_L39_C0", "vector": [7, 1, 0.8772, 0.0877, 1, 0.15, 0.75, 0, 0, 1, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\ttry:\n\t\timport psyco\n\t\tpsyco.full()\n\texcept:\n\t\tprint('Warning: Using psyco failed. It will still work correctly, but much more slowly.')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99114:Import_L49_C2", "label": "psyco import psyco", "type": "import", "loc": [49, 49], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99114:Try_L48_C1", "vector": [1, 2, 0.8596, 0.0175, 2, 0.09, 0.0, 17, 0, 1, 0, 0, 17, 0, 0], "semantic": {"name": "psyco", "arg_names": [], "import_names": ["psyco"], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\timport psyco"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99114:Expr_L50_C2", "label": "full()", "type": "expression", "loc": [50, 50], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99114:Try_L48_C1", "vector": [8, 2, 0.8772, 0.0175, 2, 0.09, 1.0, 159, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "full", "arg_names": [], "import_names": [], "rhs_call_name": "full", "annotation": ""}, "snippet": "\t\tpsyco.full()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99114:Expr_L52_C2", "label": "print()", "type": "expression", "loc": [52, 52], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99114:Try_L48_C1", "vector": [8, 2, 0.9123, 0.0175, 2, 0.09, 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('Warning: Using psyco failed. It will still work correctly, but much more slowly.')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99114:Expr_L53_C1", "label": "check()", "type": "expression", "loc": [53, 53], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99114:FunctionDef_L39_C0", "vector": [8, 1, 0.9298, 0.0175, 1, 0.15, 1.0, 803, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "check", "arg_names": [], "import_names": [], "rhs_call_name": "check", "annotation": ""}, "snippet": "\tcheck()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99114:If_L55_C0", "label": "if", "type": "if", "loc": [55, 56], "level": 0, "parent": null, "vector": [4, 0, 0.9737, 0.0351, 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\tmain()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99114:Expr_L56_C1", "label": "main()", "type": "expression", "loc": [56, 56], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99114:If_L55_C0", "vector": [8, 1, 0.9825, 0.0175, 1, 0.57, 0.0, 624, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "main", "arg_names": [], "import_names": [], "rhs_call_name": "main", "annotation": ""}, "snippet": "\tmain()"}]
[{"f": "ajibawa-2023/Python-Code-Large/train/row_99114:FunctionDef_L21_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99114:Expr_L22_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99114:FunctionDef_L21_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99114:Assign_L23_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99114:FunctionDef_L21_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99114:Assign_L24_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99114:FunctionDef_L21_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99114:If_L25_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99114:If_L25_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99114:Assign_L26_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99114:If_L25_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99114:Assign_L28_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99114:If_L25_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99114:Assign_L29_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99114:If_L25_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99114:Expr_L30_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99114:If_L25_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99114:Expr_L31_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99114:FunctionDef_L21_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99114:Assign_L33_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99114:FunctionDef_L21_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99114:Expr_L34_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99114:FunctionDef_L21_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99114:Assign_L35_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99114:FunctionDef_L21_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99114:Expr_L36_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99114:FunctionDef_L21_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99114:Expr_L37_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99114:FunctionDef_L39_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99114:If_L40_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99114:If_L40_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99114:Expr_L41_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99114:If_L40_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99114:Expr_L42_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99114:If_L40_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99114:Expr_L43_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99114:If_L40_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99114:Expr_L44_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99114:FunctionDef_L39_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99114:Assign_L46_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99114:FunctionDef_L39_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99114:Assign_L47_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99114:FunctionDef_L39_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99114:Try_L48_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99114:Try_L48_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99114:Import_L49_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99114:Try_L48_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99114:Expr_L50_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99114:Try_L48_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99114:Expr_L52_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99114:FunctionDef_L39_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99114:Expr_L53_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99114:If_L55_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99114:Expr_L56_C1"}]
#!/usr/bin/env python # coding=utf-8 import os import sys from smtplib import SMTP from email.MIMEMultipart import MIMEMultipart from email.mime.application import MIMEApplication import time GMAIL_ACCOUNT = r'user@gmail.com' GMAIL_PASSWD = r'passwd' def send_file_to_gmail(filename): """GMail file sender: Send a file use GMail. """ config = { 'from': GMAIL_ACCOUNT, 'to': GMAIL_ACCOUNT, 'subject': '[gsend]Send file ' + filename, 'file': filename, 'server': 'smtp.gmail.com', 'port': 587, 'username': GMAIL_ACCOUNT, 'password': GMAIL_PASSWD, } print 'Preparing...', message = MIMEMultipart( ) message['from'] = config['from'] message['to'] = config['to'] message['Reply-To'] = config['from'] message['Subject'] = config['subject'] message['Date'] = time.ctime(time.time()) message['X-Priority'] = '3' message['X-MSMail-Priority'] = 'Normal' message['X-Mailer'] = 'Microsoft Outlook Express 6.00.2900.2180' message['X-MimeOLE'] = 'Produced By Microsoft MimeOLE V6.00.2900.2180' with open(config['file'], 'rb') as f: file = MIMEApplication(f.read()) file.add_header('Content-Disposition', 'attachment', filename=os.path.basename(config['file'])) message.attach(file) print 'OK' print 'Logging...', smtp = SMTP(config['server'], config['port']) smtp.ehlo() smtp.starttls() smtp.ehlo() smtp.login(config['username'], config['password']) print 'OK' print 'Sending...', smtp.sendmail(config['from'], [config['from'], config['to']], message.as_string()) print 'OK' smtp.close() #time.sleep(1) send_file_to_gmail(r'D:\hello.txt')
ajibawa-2023/Python-Code-Large/train/row_99115
38
66
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_99115:Import_L4_C0", "label": "os import os", "type": "import", "loc": [4, 4], "level": 0, "parent": null, "vector": [1, 0, 0.0606, 0.0152, 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_99115:Import_L5_C0", "label": "sys import sys", "type": "import", "loc": [5, 5], "level": 0, "parent": null, "vector": [1, 0, 0.0758, 0.0152, 0, 0.66, 0.1111, 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_99115:ImportFrom_L6_C0", "label": "from smtplib import SMTP", "type": "import", "loc": [6, 6], "level": 0, "parent": null, "vector": [1, 0, 0.0909, 0.0152, 0, 0.66, 0.2222, 389, 0, 1, 0, 0, 389, 0, 0], "semantic": {"name": "smtplib", "arg_names": [], "import_names": ["SMTP"], "rhs_call_name": "", "annotation": ""}, "snippet": "from smtplib import SMTP "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99115:ImportFrom_L7_C0", "label": "from email.MIMEMultipart import MIMEMultipart", "type": "import", "loc": [7, 7], "level": 0, "parent": null, "vector": [1, 0, 0.1061, 0.0152, 0, 0.66, 0.3333, 349, 0, 1, 0, 0, 349, 0, 0], "semantic": {"name": "email.MIMEMultipart", "arg_names": [], "import_names": ["MIMEMultipart"], "rhs_call_name": "", "annotation": ""}, "snippet": "from email.MIMEMultipart import MIMEMultipart "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99115:ImportFrom_L8_C0", "label": "from email.mime.application import MIMEApplication", "type": "import", "loc": [8, 8], "level": 0, "parent": null, "vector": [1, 0, 0.1212, 0.0152, 0, 0.66, 0.4444, 521, 0, 1, 0, 0, 521, 0, 0], "semantic": {"name": "email.mime.application", "arg_names": [], "import_names": ["MIMEApplication"], "rhs_call_name": "", "annotation": ""}, "snippet": "from email.mime.application import MIMEApplication "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99115:Import_L9_C0", "label": "time import time", "type": "import", "loc": [9, 9], "level": 0, "parent": null, "vector": [1, 0, 0.1364, 0.0152, 0, 0.66, 0.5556, 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_99115:Assign_L11_C0", "label": "GMAIL_ACCOUNT =", "type": "assigned_variable", "loc": [11, 11], "level": 0, "parent": null, "vector": [14, 0, 0.1667, 0.0152, 0, 0.66, 0.6667, 329, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "GMAIL_ACCOUNT", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "GMAIL_ACCOUNT = r'user@gmail.com'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99115:Assign_L12_C0", "label": "GMAIL_PASSWD =", "type": "assigned_variable", "loc": [12, 12], "level": 0, "parent": null, "vector": [14, 0, 0.1818, 0.0152, 0, 0.66, 0.7778, 301, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "GMAIL_PASSWD", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "GMAIL_PASSWD = r'passwd'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99115:FunctionDef_L14_C0", "label": "send_file_to_gmail", "type": "function", "loc": [14, 62], "level": 0, "parent": null, "vector": [2, 0, 0.5758, 0.7424, 0, 0.66, 0.8889, 739, 0, 1, 0, 0, 0, 0, 23], "semantic": {"name": "send_file_to_gmail", "arg_names": ["filename"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def send_file_to_gmail(filename):\n\t\"\"\"GMail file sender: Send a file use GMail. \"\"\"\n\tconfig = { \n\t 'from': GMAIL_ACCOUNT,\n\t 'to': GMAIL_ACCOUNT,\n\t 'subject': '[gsend]Send file ' + filename,\n\t 'file': filename,\n\t 'server': 'smtp.gmail.com', "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99115:Expr_L15_C1", "label": "expression", "type": "expression", "loc": [15, 15], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99115:FunctionDef_L14_C0", "vector": [8, 1, 0.2273, 0.0152, 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\"\"\"GMail file sender: Send a file use GMail. \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99115:Assign_L16_C1", "label": "config =", "type": "assigned_variable", "loc": [16, 25], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99115:FunctionDef_L14_C0", "vector": [14, 1, 0.3106, 0.1515, 1, 0.62, 0.0385, 308, 0, 0, 0, 0, 0, 6, 0], "semantic": {"name": "config", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tconfig = { \n\t 'from': GMAIL_ACCOUNT,\n\t 'to': GMAIL_ACCOUNT,\n\t 'subject': '[gsend]Send file ' + filename,\n\t 'file': filename,\n\t 'server': 'smtp.gmail.com', \n\t 'port': 587, \n\t 'username': GMAIL_ACCOUNT,"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99115:Expr_L27_C1", "label": "print()", "type": "expression", "loc": [27, 27], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99115:FunctionDef_L14_C0", "vector": [8, 1, 0.4091, 0.0152, 1, 0.62, 0.0769, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": "\tprint('Preparing...',)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99115:Assign_L29_C1", "label": "message = MIMEMultipart()", "type": "assigned_variable", "loc": [29, 29], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99115:FunctionDef_L14_C0", "vector": [14, 1, 0.4394, 0.0152, 1, 0.62, 0.1154, 635, 3, 0, 0, 0, 621, 10, 1], "semantic": {"name": "message", "arg_names": [], "import_names": [], "rhs_call_name": "MIMEMultipart", "annotation": ""}, "snippet": "\tmessage = MIMEMultipart( ) "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99115:Assign_L30_C1", "label": "assign", "type": "assigned_variable", "loc": [30, 30], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99115:FunctionDef_L14_C0", "vector": [14, 1, 0.4545, 0.0152, 1, 0.62, 0.1538, 0, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tmessage['from'] = config['from'] "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99115:Assign_L31_C1", "label": "assign", "type": "assigned_variable", "loc": [31, 31], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99115:FunctionDef_L14_C0", "vector": [14, 1, 0.4697, 0.0152, 1, 0.62, 0.1923, 0, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tmessage['to'] = config['to'] "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99115:Assign_L32_C1", "label": "assign", "type": "assigned_variable", "loc": [32, 32], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99115:FunctionDef_L14_C0", "vector": [14, 1, 0.4848, 0.0152, 1, 0.62, 0.2308, 0, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tmessage['Reply-To'] = config['from'] "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99115:Assign_L33_C1", "label": "assign", "type": "assigned_variable", "loc": [33, 33], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99115:FunctionDef_L14_C0", "vector": [14, 1, 0.5, 0.0152, 1, 0.62, 0.2692, 0, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tmessage['Subject'] = config['subject'] "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99115:Assign_L34_C1", "label": " = ctime()", "type": "assigned_variable", "loc": [34, 34], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99115:FunctionDef_L14_C0", "vector": [14, 1, 0.5152, 0.0152, 1, 0.62, 0.3077, 0, 3, 1, 0, 0, 671, 10, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "ctime", "annotation": ""}, "snippet": "\tmessage['Date'] = time.ctime(time.time()) "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99115:Assign_L36_C1", "label": "assign", "type": "assigned_variable", "loc": [36, 36], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99115:FunctionDef_L14_C0", "vector": [14, 1, 0.5455, 0.0152, 1, 0.62, 0.3462, 0, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tmessage['X-Priority'] = '3' "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99115:Assign_L37_C1", "label": "assign", "type": "assigned_variable", "loc": [37, 37], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99115:FunctionDef_L14_C0", "vector": [14, 1, 0.5606, 0.0152, 1, 0.62, 0.3846, 0, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tmessage['X-MSMail-Priority'] = 'Normal' "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99115:Assign_L38_C1", "label": "assign", "type": "assigned_variable", "loc": [38, 38], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99115:FunctionDef_L14_C0", "vector": [14, 1, 0.5758, 0.0152, 1, 0.62, 0.4231, 0, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tmessage['X-Mailer'] = 'Microsoft Outlook Express 6.00.2900.2180' "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99115:Assign_L39_C1", "label": "assign", "type": "assigned_variable", "loc": [39, 39], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99115:FunctionDef_L14_C0", "vector": [14, 1, 0.5909, 0.0152, 1, 0.62, 0.4615, 0, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tmessage['X-MimeOLE'] = 'Produced By Microsoft MimeOLE V6.00.2900.2180' "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99115:Assign_L42_C5", "label": "file = MIMEApplication()", "type": "assigned_variable", "loc": [42, 42], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99115:FunctionDef_L14_C0", "vector": [14, 1, 0.6364, 0.0152, 1, 0.62, 0.0, 107, 3, 1, 0, 0, 862, 10, 2], "semantic": {"name": "file", "arg_names": [], "import_names": [], "rhs_call_name": "MIMEApplication", "annotation": ""}, "snippet": "\t file = MIMEApplication(f.read()) "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99115:Expr_L43_C1", "label": "add_header()", "type": "expression", "loc": [43, 43], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99115:FunctionDef_L14_C0", "vector": [8, 1, 0.6515, 0.0152, 1, 0.62, 0.5, 643, 3, 3, 0, 0, 0, 0, 2], "semantic": {"name": "add_header", "arg_names": [], "import_names": [], "rhs_call_name": "add_header", "annotation": ""}, "snippet": "\tfile.add_header('Content-Disposition', 'attachment', filename=os.path.basename(config['file'])) "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99115:Expr_L44_C1", "label": "attach()", "type": "expression", "loc": [44, 44], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99115:FunctionDef_L14_C0", "vector": [8, 1, 0.6667, 0.0152, 1, 0.62, 0.5385, 522, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "attach", "arg_names": [], "import_names": [], "rhs_call_name": "attach", "annotation": ""}, "snippet": "\tmessage.attach(file) "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99115:Expr_L46_C1", "label": "print()", "type": "expression", "loc": [46, 46], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99115:FunctionDef_L14_C0", "vector": [8, 1, 0.697, 0.0152, 1, 0.62, 0.5769, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": "\tprint('OK')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99115:Expr_L47_C1", "label": "print()", "type": "expression", "loc": [47, 47], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99115:FunctionDef_L14_C0", "vector": [8, 1, 0.7121, 0.0152, 1, 0.62, 0.6154, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": "\tprint('Logging...',)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99115:Assign_L49_C1", "label": "smtp = SMTP()", "type": "assigned_variable", "loc": [49, 49], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99115:FunctionDef_L14_C0", "vector": [14, 1, 0.7424, 0.0152, 1, 0.62, 0.6538, 116, 3, 2, 0, 0, 709, 10, 1], "semantic": {"name": "smtp", "arg_names": [], "import_names": [], "rhs_call_name": "SMTP", "annotation": ""}, "snippet": "\tsmtp = SMTP(config['server'], config['port']) "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99115:Expr_L50_C1", "label": "ehlo()", "type": "expression", "loc": [50, 50], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99115:FunctionDef_L14_C0", "vector": [8, 1, 0.7576, 0.0152, 1, 0.62, 0.6923, 292, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "ehlo", "arg_names": [], "import_names": [], "rhs_call_name": "ehlo", "annotation": ""}, "snippet": "\tsmtp.ehlo() "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99115:Expr_L51_C1", "label": "starttls()", "type": "expression", "loc": [51, 51], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99115:FunctionDef_L14_C0", "vector": [8, 1, 0.7727, 0.0152, 1, 0.62, 0.7308, 262, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "starttls", "arg_names": [], "import_names": [], "rhs_call_name": "starttls", "annotation": ""}, "snippet": "\tsmtp.starttls() "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99115:Expr_L52_C1", "label": "ehlo()", "type": "expression", "loc": [52, 52], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99115:FunctionDef_L14_C0", "vector": [8, 1, 0.7879, 0.0152, 1, 0.62, 0.7692, 292, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "ehlo", "arg_names": [], "import_names": [], "rhs_call_name": "ehlo", "annotation": ""}, "snippet": "\tsmtp.ehlo() "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99115:Expr_L53_C1", "label": "login()", "type": "expression", "loc": [53, 53], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99115:FunctionDef_L14_C0", "vector": [8, 1, 0.803, 0.0152, 1, 0.62, 0.8077, 724, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "login", "arg_names": [], "import_names": [], "rhs_call_name": "login", "annotation": ""}, "snippet": "\tsmtp.login(config['username'], config['password']) "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99115:Expr_L55_C1", "label": "print()", "type": "expression", "loc": [55, 55], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99115:FunctionDef_L14_C0", "vector": [8, 1, 0.8333, 0.0152, 1, 0.62, 0.8462, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": "\tprint('OK')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99115:Expr_L56_C1", "label": "print()", "type": "expression", "loc": [56, 56], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99115:FunctionDef_L14_C0", "vector": [8, 1, 0.8485, 0.0152, 1, 0.62, 0.8846, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": "\tprint('Sending...',)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99115:Expr_L58_C1", "label": "sendmail()", "type": "expression", "loc": [58, 58], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99115:FunctionDef_L14_C0", "vector": [8, 1, 0.8788, 0.0152, 1, 0.62, 0.9231, 176, 3, 3, 0, 0, 0, 0, 2], "semantic": {"name": "sendmail", "arg_names": [], "import_names": [], "rhs_call_name": "sendmail", "annotation": ""}, "snippet": "\tsmtp.sendmail(config['from'], [config['from'], config['to']], message.as_string()) "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99115:Expr_L60_C1", "label": "print()", "type": "expression", "loc": [60, 60], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99115:FunctionDef_L14_C0", "vector": [8, 1, 0.9091, 0.0152, 1, 0.62, 0.9615, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": "\tprint('OK')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99115:Expr_L62_C1", "label": "close()", "type": "expression", "loc": [62, 62], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99115:FunctionDef_L14_C0", "vector": [8, 1, 0.9394, 0.0152, 1, 0.62, 1.0, 77, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "close", "arg_names": [], "import_names": [], "rhs_call_name": "close", "annotation": ""}, "snippet": "\tsmtp.close() "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99115:Expr_L66_C0", "label": "send_file_to_gmail()", "type": "expression", "loc": [66, 66], "level": 0, "parent": null, "vector": [8, 0, 1.0, 0.0152, 0, 0.66, 1.0, 739, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "send_file_to_gmail", "arg_names": [], "import_names": [], "rhs_call_name": "send_file_to_gmail", "annotation": ""}, "snippet": "send_file_to_gmail(r'D:\\hello.txt')"}]
[{"f": "ajibawa-2023/Python-Code-Large/train/row_99115:FunctionDef_L14_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99115:Expr_L15_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99115:FunctionDef_L14_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99115:Assign_L16_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99115:FunctionDef_L14_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99115:Expr_L27_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99115:FunctionDef_L14_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99115:Assign_L29_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99115:FunctionDef_L14_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99115:Assign_L30_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99115:FunctionDef_L14_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99115:Assign_L31_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99115:FunctionDef_L14_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99115:Assign_L32_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99115:FunctionDef_L14_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99115:Assign_L33_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99115:FunctionDef_L14_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99115:Assign_L34_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99115:FunctionDef_L14_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99115:Assign_L36_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99115:FunctionDef_L14_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99115:Assign_L37_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99115:FunctionDef_L14_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99115:Assign_L38_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99115:FunctionDef_L14_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99115:Assign_L39_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99115:FunctionDef_L14_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99115:Assign_L42_C5"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99115:FunctionDef_L14_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99115:Expr_L43_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99115:FunctionDef_L14_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99115:Expr_L44_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99115:FunctionDef_L14_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99115:Expr_L46_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99115:FunctionDef_L14_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99115:Expr_L47_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99115:FunctionDef_L14_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99115:Assign_L49_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99115:FunctionDef_L14_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99115:Expr_L50_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99115:FunctionDef_L14_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99115:Expr_L51_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99115:FunctionDef_L14_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99115:Expr_L52_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99115:FunctionDef_L14_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99115:Expr_L53_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99115:FunctionDef_L14_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99115:Expr_L55_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99115:FunctionDef_L14_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99115:Expr_L56_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99115:FunctionDef_L14_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99115:Expr_L58_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99115:FunctionDef_L14_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99115:Expr_L60_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99115:FunctionDef_L14_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99115:Expr_L62_C1"}]
#!/usr/bin/env python # coding=utf-8 import os import sys import codecs import string import logging import glob # set log logFileName = 'FilterRoads.log' def init_log(): logger = logging.getLogger() hdlr = logging.FileHandler(logFileName) formatter = logging.Formatter('%(asctime)s %(levelname)s:: %(message)s') hdlr.setFormatter(formatter) logger.addHandler(hdlr) logger.setLevel(logging.INFO) return logger log = init_log() stdRoads = set(tuple(line.split()[0] for line in codecs.open(r'D:\ylb_work\VR\100kRoads\Places.txt', 'r', 'utf-8').readlines())) def std_filter(roads): rds = [] other = [] for r in roads: if r in stdRoads: rds.append(r) else: other.append(r) return rds, other def isroad(s): for c in s: if ord(c) < 256: return False if s.endswith(u'路') \ or s.endswith(u'巷') \ or s.endswith(u'大道') \ or s.endswith(u'街道') \ or s.endswith(u'国道') \ or s.endswith(u'省道'): if s.count(u'路') > 1: return False else: return True else: return False def filter_roads(roads): ret = [] for r in roads: while r[-1].isspace(): r = r[:-1] if isroad(r): ret.append(r) return ret def remove_repeated(roads): roads.sort() repeatedPos = [] for pos in range(2, len(roads)): if roads[pos] == roads[pos - 1]: repeatedPos.append(pos) repeatedPos.reverse() print(len(repeatedPos)) for pos in repeatedPos: roads.pop(pos) return roads def write_file(roads, filename): f = codecs.open(filename, 'w', 'utf-8') for r in roads: print>>f, r return len(roads) def main(): if len(sys.argv) != 3: print('Usage:') print('FilterRoads.py infile outfile') sys.exit(0) infilename = sys.argv[1] outfilename = sys.argv[2] infile = codecs.open(infilename, 'r', 'utf-8') roads = filter_roads(infile.readlines()) roads = remove_repeated(roads) infile.close() write_file(roads, outfilename) rds, other = std_filter(roads) other.sort(key = lambda s: len(s)) write_file(rds, 'rds.txt') write_file(other, 'other.txt') return True if __name__ == '__main__': main()
ajibawa-2023/Python-Code-Large/train/row_99117
77
102
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_99117:Import_L4_C0", "label": "os import os", "type": "import", "loc": [4, 4], "level": 0, "parent": null, "vector": [1, 0, 0.0392, 0.0098, 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_99117:Import_L5_C0", "label": "sys import sys", "type": "import", "loc": [5, 5], "level": 0, "parent": null, "vector": [1, 0, 0.049, 0.0098, 0, 0.66, 0.0625, 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_99117:Import_L6_C0", "label": "codecs import codecs", "type": "import", "loc": [6, 6], "level": 0, "parent": null, "vector": [1, 0, 0.0588, 0.0098, 0, 0.66, 0.125, 220, 0, 1, 0, 0, 220, 0, 0], "semantic": {"name": "codecs", "arg_names": [], "import_names": ["codecs"], "rhs_call_name": "", "annotation": ""}, "snippet": "import codecs"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99117:Import_L7_C0", "label": "string import string", "type": "import", "loc": [7, 7], "level": 0, "parent": null, "vector": [1, 0, 0.0686, 0.0098, 0, 0.66, 0.1875, 890, 0, 1, 0, 0, 890, 0, 0], "semantic": {"name": "string", "arg_names": [], "import_names": ["string"], "rhs_call_name": "", "annotation": ""}, "snippet": "import string"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99117:Import_L8_C0", "label": "logging import logging", "type": "import", "loc": [8, 8], "level": 0, "parent": null, "vector": [1, 0, 0.0784, 0.0098, 0, 0.66, 0.25, 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_99117:Import_L9_C0", "label": "glob import glob", "type": "import", "loc": [9, 9], "level": 0, "parent": null, "vector": [1, 0, 0.0882, 0.0098, 0, 0.66, 0.3125, 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_99117:Assign_L12_C0", "label": "logFileName =", "type": "assigned_variable", "loc": [12, 12], "level": 0, "parent": null, "vector": [14, 0, 0.1176, 0.0098, 0, 0.66, 0.375, 181, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "logFileName", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "logFileName = 'FilterRoads.log'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99117:FunctionDef_L13_C0", "label": "init_log", "type": "function", "loc": [13, 20], "level": 0, "parent": null, "vector": [2, 0, 0.1618, 0.0784, 0, 0.66, 0.4375, 377, 0, 0, 1, 0, 0, 0, 6], "semantic": {"name": "init_log", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def init_log():\n logger = logging.getLogger()\n hdlr = logging.FileHandler(logFileName)\n formatter = logging.Formatter('%(asctime)s %(levelname)s:: %(message)s')\n hdlr.setFormatter(formatter)\n logger.addHandler(hdlr)\n logger.setLevel(logging.INFO)\n return logger"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99117:Assign_L14_C4", "label": "logger = getLogger()", "type": "assigned_variable", "loc": [14, 14], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99117:FunctionDef_L13_C0", "vector": [14, 1, 0.1373, 0.0098, 1, 0.51, 0.0, 532, 3, 0, 0, 0, 71, 10, 1], "semantic": {"name": "logger", "arg_names": [], "import_names": [], "rhs_call_name": "getLogger", "annotation": ""}, "snippet": " logger = logging.getLogger()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99117:Assign_L15_C4", "label": "hdlr = FileHandler()", "type": "assigned_variable", "loc": [15, 15], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99117:FunctionDef_L13_C0", "vector": [14, 1, 0.1471, 0.0098, 1, 0.51, 0.1667, 149, 3, 1, 0, 0, 306, 10, 1], "semantic": {"name": "hdlr", "arg_names": [], "import_names": [], "rhs_call_name": "FileHandler", "annotation": ""}, "snippet": " hdlr = logging.FileHandler(logFileName)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99117:Assign_L16_C4", "label": "formatter = Formatter()", "type": "assigned_variable", "loc": [16, 16], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99117:FunctionDef_L13_C0", "vector": [14, 1, 0.1569, 0.0098, 1, 0.51, 0.3333, 791, 3, 1, 0, 0, 766, 10, 1], "semantic": {"name": "formatter", "arg_names": [], "import_names": [], "rhs_call_name": "Formatter", "annotation": ""}, "snippet": " formatter = logging.Formatter('%(asctime)s %(levelname)s:: %(message)s')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99117:Expr_L17_C4", "label": "setFormatter()", "type": "expression", "loc": [17, 17], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99117:FunctionDef_L13_C0", "vector": [8, 1, 0.1667, 0.0098, 1, 0.51, 0.5, 948, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "setFormatter", "arg_names": [], "import_names": [], "rhs_call_name": "setFormatter", "annotation": ""}, "snippet": " hdlr.setFormatter(formatter)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99117:Expr_L18_C4", "label": "addHandler()", "type": "expression", "loc": [18, 18], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99117:FunctionDef_L13_C0", "vector": [8, 1, 0.1765, 0.0098, 1, 0.51, 0.6667, 255, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "addHandler", "arg_names": [], "import_names": [], "rhs_call_name": "addHandler", "annotation": ""}, "snippet": " logger.addHandler(hdlr)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99117:Expr_L19_C4", "label": "setLevel()", "type": "expression", "loc": [19, 19], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99117:FunctionDef_L13_C0", "vector": [8, 1, 0.1863, 0.0098, 1, 0.51, 0.8333, 810, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "setLevel", "arg_names": [], "import_names": [], "rhs_call_name": "setLevel", "annotation": ""}, "snippet": " logger.setLevel(logging.INFO)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99117:Return_L20_C4", "label": "return", "type": "return", "loc": [20, 20], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99117:FunctionDef_L13_C0", "vector": [13, 1, 0.1961, 0.0098, 1, 0.51, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return logger"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99117:Assign_L22_C0", "label": "log = init_log()", "type": "assigned_variable", "loc": [22, 22], "level": 0, "parent": null, "vector": [14, 0, 0.2157, 0.0098, 0, 0.66, 0.5, 432, 3, 0, 0, 0, 377, 10, 1], "semantic": {"name": "log", "arg_names": [], "import_names": [], "rhs_call_name": "init_log", "annotation": ""}, "snippet": "log = init_log()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99117:Assign_L24_C0", "label": "stdRoads = set()", "type": "assigned_variable", "loc": [24, 24], "level": 0, "parent": null, "vector": [14, 0, 0.2353, 0.0098, 0, 0.66, 0.5625, 398, 3, 1, 0, 0, 21, 10, 5], "semantic": {"name": "stdRoads", "arg_names": [], "import_names": [], "rhs_call_name": "set", "annotation": ""}, "snippet": "stdRoads = set(tuple(line.split()[0] for line in codecs.open(r'D:\\ylb_work\\VR\\100kRoads\\Places.txt', 'r', 'utf-8').readlines()))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99117:FunctionDef_L26_C0", "label": "std_filter", "type": "function", "loc": [26, 34], "level": 0, "parent": null, "vector": [2, 0, 0.2941, 0.0882, 0, 0.66, 0.625, 871, 0, 1, 1, 0, 0, 0, 2], "semantic": {"name": "std_filter", "arg_names": ["roads"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def std_filter(roads):\n\trds = []\n\tother = []\n\tfor r in roads:\n\t\tif r in stdRoads:\n\t\t\trds.append(r)\n\t\telse:\n\t\t\tother.append(r)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99117:Assign_L27_C1", "label": "rds =", "type": "assigned_variable", "loc": [27, 27], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99117:FunctionDef_L26_C0", "vector": [14, 1, 0.2647, 0.0098, 1, 0.12, 0.0, 985, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "rds", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\trds = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99117:Assign_L28_C1", "label": "other =", "type": "assigned_variable", "loc": [28, 28], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99117:FunctionDef_L26_C0", "vector": [14, 1, 0.2745, 0.0098, 1, 0.12, 0.3333, 341, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "other", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tother = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99117:For_L29_C1", "label": "for r", "type": "for", "loc": [29, 33], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99117:FunctionDef_L26_C0", "vector": [6, 1, 0.3039, 0.049, 1, 0.12, 0.6667, 436, 2, 0, 0, 0, 0, 0, 2], "semantic": {"name": "r", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tfor r in roads:\n\t\tif r in stdRoads:\n\t\t\trds.append(r)\n\t\telse:\n\t\t\tother.append(r)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99117:If_L30_C2", "label": "if", "type": "if", "loc": [30, 33], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99117:For_L29_C1", "vector": [4, 2, 0.3088, 0.0392, 2, 0.33, 0.0, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tif r in stdRoads:\n\t\t\trds.append(r)\n\t\telse:\n\t\t\tother.append(r)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99117:Expr_L31_C3", "label": "append()", "type": "expression", "loc": [31, 31], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99117:If_L30_C2", "vector": [8, 3, 0.3039, 0.0098, 3, 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": "\t\t\trds.append(r)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99117:Expr_L33_C3", "label": "append()", "type": "expression", "loc": [33, 33], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99117:If_L30_C2", "vector": [8, 3, 0.3235, 0.0098, 3, 0.4, 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\tother.append(r)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99117:Return_L34_C1", "label": "return", "type": "return", "loc": [34, 34], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99117:FunctionDef_L26_C0", "vector": [13, 1, 0.3333, 0.0098, 1, 0.12, 1.0, 0, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\treturn rds, other"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99117:FunctionDef_L36_C0", "label": "isroad", "type": "function", "loc": [36, 51], "level": 0, "parent": null, "vector": [2, 0, 0.4265, 0.1569, 0, 0.66, 0.6875, 796, 0, 1, 1, 0, 0, 0, 8], "semantic": {"name": "isroad", "arg_names": ["s"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def isroad(s):\n\tfor c in s:\n\t\tif ord(c) < 256:\n\t\t\treturn False\n\tif s.endswith(u'\u8def') \\\n\t\t\tor s.endswith(u'\u5df7') \\\n\t\t\tor s.endswith(u'\u5927\u9053') \\\n\t\t\tor s.endswith(u'\u8857\u9053') \\"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99117:For_L37_C1", "label": "for c", "type": "for", "loc": [37, 39], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99117:FunctionDef_L36_C0", "vector": [6, 1, 0.3725, 0.0294, 1, 0.4, 0.0, 411, 2, 0, 0, 0, 0, 0, 1], "semantic": {"name": "c", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tfor c in s:\n\t\tif ord(c) < 256:\n\t\t\treturn False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99117:If_L38_C2", "label": "if", "type": "if", "loc": [38, 39], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99117:For_L37_C1", "vector": [4, 2, 0.3775, 0.0196, 2, 0.85, 0.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tif ord(c) < 256:\n\t\t\treturn False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99117:Return_L39_C3", "label": "return", "type": "return", "loc": [39, 39], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99117:If_L38_C2", "vector": [13, 3, 0.3824, 0.0098, 3, 0.72, 0.0, 0, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\treturn False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99117:If_L40_C1", "label": "if", "type": "if", "loc": [40, 51], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99117:FunctionDef_L36_C0", "vector": [4, 1, 0.4461, 0.1176, 1, 0.4, 1.0, 0, 0, 0, 0, 0, 0, 0, 7], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tif s.endswith(u'\u8def') \\\n\t\t\tor s.endswith(u'\u5df7') \\\n\t\t\tor s.endswith(u'\u5927\u9053') \\\n\t\t\tor s.endswith(u'\u8857\u9053') \\\n\t\t\tor s.endswith(u'\u56fd\u9053') \\\n\t\t\tor s.endswith(u'\u7701\u9053'):\n\t\tif s.count(u'\u8def') > 1:\n\t\t\treturn False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99117:If_L46_C2", "label": "if", "type": "if", "loc": [46, 49], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99117:If_L40_C1", "vector": [4, 2, 0.4657, 0.0392, 2, 0.97, 0.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tif s.count(u'\u8def') > 1:\n\t\t\treturn False\n\t\telse:\n\t\t\treturn True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99117:Return_L47_C3", "label": "return", "type": "return", "loc": [47, 47], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99117:If_L46_C2", "vector": [13, 3, 0.4608, 0.0098, 3, 0.93, 0.0, 0, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\treturn False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99117:Return_L49_C3", "label": "return", "type": "return", "loc": [49, 49], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99117:If_L46_C2", "vector": [13, 3, 0.4804, 0.0098, 3, 0.93, 1.0, 0, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\treturn True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99117:Return_L51_C2", "label": "return", "type": "return", "loc": [51, 51], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99117:If_L40_C1", "vector": [13, 2, 0.5, 0.0098, 2, 0.97, 1.0, 0, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\treturn False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99117:FunctionDef_L54_C0", "label": "filter_roads", "type": "function", "loc": [54, 61], "level": 0, "parent": null, "vector": [2, 0, 0.5637, 0.0784, 0, 0.66, 0.75, 905, 0, 1, 1, 0, 0, 0, 3], "semantic": {"name": "filter_roads", "arg_names": ["roads"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def filter_roads(roads):\n\tret = []\n\tfor r in roads:\n\t\twhile r[-1].isspace():\n\t\t\tr = r[:-1]\n\t\tif isroad(r):\n\t\t\tret.append(r)\n\treturn ret"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99117:Assign_L55_C1", "label": "ret =", "type": "assigned_variable", "loc": [55, 55], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99117:FunctionDef_L54_C0", "vector": [14, 1, 0.5392, 0.0098, 1, 0.07, 0.0, 501, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "ret", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tret = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99117:For_L56_C1", "label": "for r", "type": "for", "loc": [56, 60], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99117:FunctionDef_L54_C0", "vector": [6, 1, 0.5686, 0.049, 1, 0.07, 0.5, 436, 2, 0, 0, 0, 0, 0, 3], "semantic": {"name": "r", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tfor r in roads:\n\t\twhile r[-1].isspace():\n\t\t\tr = r[:-1]\n\t\tif isroad(r):\n\t\t\tret.append(r)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99117:While_L57_C2", "label": "while", "type": "while", "loc": [57, 58], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99117:For_L56_C1", "vector": [5, 2, 0.5637, 0.0196, 2, 0.01, 0.0, 0, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\twhile r[-1].isspace():\n\t\t\tr = r[:-1]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99117:Assign_L58_C3", "label": "r =", "type": "assigned_variable", "loc": [58, 58], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99117:While_L57_C2", "vector": [14, 3, 0.5686, 0.0098, 3, 0.28, 0.0, 436, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "r", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\tr = r[:-1]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99117:If_L59_C2", "label": "if", "type": "if", "loc": [59, 60], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99117:For_L56_C1", "vector": [4, 2, 0.5833, 0.0196, 2, 0.01, 1.0, 0, 3, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tif isroad(r):\n\t\t\tret.append(r)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99117:Expr_L60_C3", "label": "append()", "type": "expression", "loc": [60, 60], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99117:If_L59_C2", "vector": [8, 3, 0.5882, 0.0098, 3, 0.84, 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\tret.append(r)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99117:Return_L61_C1", "label": "return", "type": "return", "loc": [61, 61], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99117:FunctionDef_L54_C0", "vector": [13, 1, 0.598, 0.0098, 1, 0.07, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\treturn ret"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99117:FunctionDef_L63_C0", "label": "remove_repeated", "type": "function", "loc": [63, 73], "level": 0, "parent": null, "vector": [2, 0, 0.6667, 0.1078, 0, 0.66, 0.8125, 164, 0, 1, 1, 0, 0, 0, 8], "semantic": {"name": "remove_repeated", "arg_names": ["roads"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def remove_repeated(roads):\n\troads.sort()\n\trepeatedPos = []\n\tfor pos in range(2, len(roads)):\n\t\tif roads[pos] == roads[pos - 1]:\n\t\t\trepeatedPos.append(pos)\n\trepeatedPos.reverse()\n\tprint(len(repeatedPos))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99117:Expr_L64_C1", "label": "sort()", "type": "expression", "loc": [64, 64], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99117:FunctionDef_L63_C0", "vector": [8, 1, 0.6275, 0.0098, 1, 0.38, 0.0, 489, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "sort", "arg_names": [], "import_names": [], "rhs_call_name": "sort", "annotation": ""}, "snippet": "\troads.sort()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99117:Assign_L65_C1", "label": "repeatedPos =", "type": "assigned_variable", "loc": [65, 65], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99117:FunctionDef_L63_C0", "vector": [14, 1, 0.6373, 0.0098, 1, 0.38, 0.1667, 253, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "repeatedPos", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\trepeatedPos = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99117:For_L66_C1", "label": "for pos", "type": "for", "loc": [66, 68], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99117:FunctionDef_L63_C0", "vector": [6, 1, 0.6569, 0.0294, 1, 0.38, 0.3333, 627, 3, 0, 0, 0, 0, 0, 3], "semantic": {"name": "pos", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tfor pos in range(2, len(roads)):\n\t\tif roads[pos] == roads[pos - 1]:\n\t\t\trepeatedPos.append(pos)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99117:If_L67_C2", "label": "if", "type": "if", "loc": [67, 68], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99117:For_L66_C1", "vector": [4, 2, 0.6618, 0.0196, 2, 0.95, 0.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tif roads[pos] == roads[pos - 1]:\n\t\t\trepeatedPos.append(pos)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99117:Expr_L68_C3", "label": "append()", "type": "expression", "loc": [68, 68], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99117:If_L67_C2", "vector": [8, 3, 0.6667, 0.0098, 3, 0.42, 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\trepeatedPos.append(pos)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99117:Expr_L69_C1", "label": "reverse()", "type": "expression", "loc": [69, 69], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99117:FunctionDef_L63_C0", "vector": [8, 1, 0.6765, 0.0098, 1, 0.38, 0.5, 109, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "reverse", "arg_names": [], "import_names": [], "rhs_call_name": "reverse", "annotation": ""}, "snippet": "\trepeatedPos.reverse()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99117:Expr_L70_C1", "label": "print()", "type": "expression", "loc": [70, 70], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99117:FunctionDef_L63_C0", "vector": [8, 1, 0.6863, 0.0098, 1, 0.38, 0.6667, 535, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": "\tprint(len(repeatedPos))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99117:For_L71_C1", "label": "for pos", "type": "for", "loc": [71, 72], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99117:FunctionDef_L63_C0", "vector": [6, 1, 0.701, 0.0196, 1, 0.38, 0.8333, 627, 2, 0, 0, 0, 0, 0, 1], "semantic": {"name": "pos", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tfor pos in repeatedPos:\n\t\troads.pop(pos)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99117:Expr_L72_C2", "label": "pop()", "type": "expression", "loc": [72, 72], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99117:For_L71_C1", "vector": [8, 2, 0.7059, 0.0098, 2, 0.93, 0.0, 969, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "pop", "arg_names": [], "import_names": [], "rhs_call_name": "pop", "annotation": ""}, "snippet": "\t\troads.pop(pos)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99117:Return_L73_C1", "label": "return", "type": "return", "loc": [73, 73], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99117:FunctionDef_L63_C0", "vector": [13, 1, 0.7157, 0.0098, 1, 0.38, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\treturn roads"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99117:FunctionDef_L75_C0", "label": "write_file", "type": "function", "loc": [75, 79], "level": 0, "parent": null, "vector": [2, 0, 0.7549, 0.049, 0, 0.66, 0.875, 725, 0, 2, 1, 0, 0, 0, 2], "semantic": {"name": "write_file", "arg_names": ["roads", "filename"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def write_file(roads, filename):\n\tf = codecs.open(filename, 'w', 'utf-8')\n\tfor r in roads:\n\t\tprint>>f, r\n\treturn len(roads)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99117:Assign_L76_C1", "label": "f = open()", "type": "assigned_variable", "loc": [76, 76], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99117:FunctionDef_L75_C0", "vector": [14, 1, 0.7451, 0.0098, 1, 0.07, 0.0, 899, 3, 3, 0, 0, 693, 10, 1], "semantic": {"name": "f", "arg_names": [], "import_names": [], "rhs_call_name": "open", "annotation": ""}, "snippet": "\tf = codecs.open(filename, 'w', 'utf-8')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99117:For_L77_C1", "label": "for r", "type": "for", "loc": [77, 78], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99117:FunctionDef_L75_C0", "vector": [6, 1, 0.7598, 0.0196, 1, 0.07, 0.5, 436, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "r", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tfor r in roads:\n\t\tprint>>f, r"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99117:Expr_L78_C2", "label": "expression", "type": "expression", "loc": [78, 78], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99117:For_L77_C1", "vector": [8, 2, 0.7647, 0.0098, 2, 0.2, 0.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tprint>>f, r"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99117:Return_L79_C1", "label": "return", "type": "return", "loc": [79, 79], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99117:FunctionDef_L75_C0", "vector": [13, 1, 0.7745, 0.0098, 1, 0.07, 1.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\treturn len(roads)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99117:FunctionDef_L81_C0", "label": "main", "type": "function", "loc": [81, 98], "level": 0, "parent": null, "vector": [2, 0, 0.8775, 0.1765, 0, 0.66, 0.9375, 624, 0, 0, 1, 0, 0, 0, 15], "semantic": {"name": "main", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def main():\n\tif len(sys.argv) != 3:\n\t\tprint('Usage:')\n\t\tprint('FilterRoads.py infile outfile')\n\t\tsys.exit(0)\n\tinfilename = sys.argv[1]\n\toutfilename = sys.argv[2]\n\tinfile = codecs.open(infilename, 'r', 'utf-8')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99117:If_L82_C1", "label": "if", "type": "if", "loc": [82, 85], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99117:FunctionDef_L81_C0", "vector": [4, 1, 0.8186, 0.0392, 1, 0.34, 0.0, 0, 0, 0, 0, 0, 0, 0, 4], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tif len(sys.argv) != 3:\n\t\tprint('Usage:')\n\t\tprint('FilterRoads.py infile outfile')\n\t\tsys.exit(0)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99117:Expr_L83_C2", "label": "print()", "type": "expression", "loc": [83, 83], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99117:If_L82_C1", "vector": [8, 2, 0.8137, 0.0098, 2, 0.82, 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('Usage:')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99117:Expr_L84_C2", "label": "print()", "type": "expression", "loc": [84, 84], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99117:If_L82_C1", "vector": [8, 2, 0.8235, 0.0098, 2, 0.82, 0.5, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": "\t\tprint('FilterRoads.py infile outfile')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99117:Expr_L85_C2", "label": "exit()", "type": "expression", "loc": [85, 85], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99117:If_L82_C1", "vector": [8, 2, 0.8333, 0.0098, 2, 0.82, 1.0, 436, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "exit", "arg_names": [], "import_names": [], "rhs_call_name": "exit", "annotation": ""}, "snippet": "\t\tsys.exit(0)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99117:Assign_L86_C1", "label": "infilename =", "type": "assigned_variable", "loc": [86, 86], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99117:FunctionDef_L81_C0", "vector": [14, 1, 0.8431, 0.0098, 1, 0.34, 0.0833, 715, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "infilename", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tinfilename = sys.argv[1]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99117:Assign_L87_C1", "label": "outfilename =", "type": "assigned_variable", "loc": [87, 87], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99117:FunctionDef_L81_C0", "vector": [14, 1, 0.8529, 0.0098, 1, 0.34, 0.1667, 535, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "outfilename", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\toutfilename = sys.argv[2]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99117:Assign_L88_C1", "label": "infile = open()", "type": "assigned_variable", "loc": [88, 88], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99117:FunctionDef_L81_C0", "vector": [14, 1, 0.8627, 0.0098, 1, 0.34, 0.25, 463, 3, 3, 0, 0, 693, 10, 1], "semantic": {"name": "infile", "arg_names": [], "import_names": [], "rhs_call_name": "open", "annotation": ""}, "snippet": "\tinfile = codecs.open(infilename, 'r', 'utf-8')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99117:Assign_L89_C1", "label": "roads = filter_roads()", "type": "assigned_variable", "loc": [89, 89], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99117:FunctionDef_L81_C0", "vector": [14, 1, 0.8725, 0.0098, 1, 0.34, 0.3333, 737, 3, 1, 0, 0, 905, 10, 2], "semantic": {"name": "roads", "arg_names": [], "import_names": [], "rhs_call_name": "filter_roads", "annotation": ""}, "snippet": "\troads = filter_roads(infile.readlines())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99117:Assign_L90_C1", "label": "roads = remove_repeated()", "type": "assigned_variable", "loc": [90, 90], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99117:FunctionDef_L81_C0", "vector": [14, 1, 0.8824, 0.0098, 1, 0.34, 0.4167, 737, 3, 1, 0, 0, 164, 10, 1], "semantic": {"name": "roads", "arg_names": [], "import_names": [], "rhs_call_name": "remove_repeated", "annotation": ""}, "snippet": "\troads = remove_repeated(roads)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99117:Expr_L91_C1", "label": "close()", "type": "expression", "loc": [91, 91], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99117:FunctionDef_L81_C0", "vector": [8, 1, 0.8922, 0.0098, 1, 0.34, 0.5, 77, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "close", "arg_names": [], "import_names": [], "rhs_call_name": "close", "annotation": ""}, "snippet": "\tinfile.close()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99117:Expr_L92_C1", "label": "write_file()", "type": "expression", "loc": [92, 92], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99117:FunctionDef_L81_C0", "vector": [8, 1, 0.902, 0.0098, 1, 0.34, 0.5833, 725, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "write_file", "arg_names": [], "import_names": [], "rhs_call_name": "write_file", "annotation": ""}, "snippet": "\twrite_file(roads, outfilename)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99117:Assign_L93_C1", "label": "rds, other = std_filter()", "type": "assigned_variable", "loc": [93, 93], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99117:FunctionDef_L81_C0", "vector": [14, 1, 0.9118, 0.0098, 1, 0.34, 0.6667, 196, 3, 1, 0, 0, 871, 10, 1], "semantic": {"name": "rds, other", "arg_names": [], "import_names": [], "rhs_call_name": "std_filter", "annotation": ""}, "snippet": "\trds, other = std_filter(roads)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99117:Expr_L94_C1", "label": "sort()", "type": "expression", "loc": [94, 94], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99117:FunctionDef_L81_C0", "vector": [8, 1, 0.9216, 0.0098, 1, 0.34, 0.75, 489, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "sort", "arg_names": [], "import_names": [], "rhs_call_name": "sort", "annotation": ""}, "snippet": "\tother.sort(key = lambda s: len(s))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99117:Expr_L95_C1", "label": "write_file()", "type": "expression", "loc": [95, 95], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99117:FunctionDef_L81_C0", "vector": [8, 1, 0.9314, 0.0098, 1, 0.34, 0.8333, 725, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "write_file", "arg_names": [], "import_names": [], "rhs_call_name": "write_file", "annotation": ""}, "snippet": "\twrite_file(rds, 'rds.txt')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99117:Expr_L96_C1", "label": "write_file()", "type": "expression", "loc": [96, 96], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99117:FunctionDef_L81_C0", "vector": [8, 1, 0.9412, 0.0098, 1, 0.34, 0.9167, 725, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "write_file", "arg_names": [], "import_names": [], "rhs_call_name": "write_file", "annotation": ""}, "snippet": "\twrite_file(other, 'other.txt')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99117:Return_L98_C1", "label": "return", "type": "return", "loc": [98, 98], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99117:FunctionDef_L81_C0", "vector": [13, 1, 0.9608, 0.0098, 1, 0.34, 1.0, 0, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\treturn True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99117:If_L100_C0", "label": "if", "type": "if", "loc": [100, 101], "level": 0, "parent": null, "vector": [4, 0, 0.9853, 0.0196, 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\tmain()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99117:Expr_L101_C1", "label": "main()", "type": "expression", "loc": [101, 101], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99117:If_L100_C0", "vector": [8, 1, 0.9902, 0.0098, 1, 0.44, 0.0, 624, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "main", "arg_names": [], "import_names": [], "rhs_call_name": "main", "annotation": ""}, "snippet": "\tmain()"}]
[{"f": "ajibawa-2023/Python-Code-Large/train/row_99117:FunctionDef_L13_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99117:Assign_L14_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99117:FunctionDef_L13_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99117:Assign_L15_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99117:FunctionDef_L13_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99117:Assign_L16_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99117:FunctionDef_L13_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99117:Expr_L17_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99117:FunctionDef_L13_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99117:Expr_L18_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99117:FunctionDef_L13_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99117:Expr_L19_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99117:FunctionDef_L13_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99117:Return_L20_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99117:FunctionDef_L26_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99117:Assign_L27_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99117:FunctionDef_L26_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99117:Assign_L28_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99117:FunctionDef_L26_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99117:For_L29_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99117:For_L29_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99117:If_L30_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99117:If_L30_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99117:Expr_L31_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99117:If_L30_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99117:Expr_L33_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99117:FunctionDef_L26_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99117:Return_L34_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99117:FunctionDef_L36_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99117:For_L37_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99117:For_L37_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99117:If_L38_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99117:If_L38_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99117:Return_L39_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99117:FunctionDef_L36_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99117:If_L40_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99117:If_L40_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99117:If_L46_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99117:If_L46_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99117:Return_L47_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99117:If_L46_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99117:Return_L49_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99117:If_L40_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99117:Return_L51_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99117:FunctionDef_L54_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99117:Assign_L55_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99117:FunctionDef_L54_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99117:For_L56_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99117:For_L56_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99117:While_L57_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99117:While_L57_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99117:Assign_L58_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99117:For_L56_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99117:If_L59_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99117:If_L59_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99117:Expr_L60_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99117:FunctionDef_L54_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99117:Return_L61_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99117:FunctionDef_L63_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99117:Expr_L64_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99117:FunctionDef_L63_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99117:Assign_L65_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99117:FunctionDef_L63_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99117:For_L66_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99117:For_L66_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99117:If_L67_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99117:If_L67_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99117:Expr_L68_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99117:FunctionDef_L63_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99117:Expr_L69_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99117:FunctionDef_L63_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99117:Expr_L70_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99117:FunctionDef_L63_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99117:For_L71_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99117:For_L71_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99117:Expr_L72_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99117:FunctionDef_L63_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99117:Return_L73_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99117:FunctionDef_L75_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99117:Assign_L76_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99117:FunctionDef_L75_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99117:For_L77_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99117:For_L77_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99117:Expr_L78_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99117:FunctionDef_L75_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99117:Return_L79_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99117:FunctionDef_L81_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99117:If_L82_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99117:If_L82_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99117:Expr_L83_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99117:If_L82_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99117:Expr_L84_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99117:If_L82_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99117:Expr_L85_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99117:FunctionDef_L81_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99117:Assign_L86_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99117:FunctionDef_L81_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99117:Assign_L87_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99117:FunctionDef_L81_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99117:Assign_L88_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99117:FunctionDef_L81_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99117:Assign_L89_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99117:FunctionDef_L81_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99117:Assign_L90_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99117:FunctionDef_L81_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99117:Expr_L91_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99117:FunctionDef_L81_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99117:Expr_L92_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99117:FunctionDef_L81_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99117:Assign_L93_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99117:FunctionDef_L81_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99117:Expr_L94_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99117:FunctionDef_L81_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99117:Expr_L95_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99117:FunctionDef_L81_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99117:Expr_L96_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99117:FunctionDef_L81_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99117:Return_L98_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99117:If_L100_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99117:Expr_L101_C1"}]
#!/usr/bin/env python # coding=utf-8 import os import sys import codecs import string import logging import glob # set log logFileName = 'CheckEncoding.log' def init_log(): logger = logging.getLogger() hdlr = logging.FileHandler(logFileName) formatter = logging.Formatter('%(asctime)s %(levelname)s:: %(message)s') hdlr.setFormatter(formatter) logger.addHandler(hdlr) logger.setLevel(logging.INFO) return logger log = init_log() # output file outfile = None def check_file(filename): 'Check the file and output to outfile.\n' try: codecs.open(filename, 'r', 'gb2312').read() return True except: fpath, fname = os.path.split(filename) print>>outfile, 'Filename : ' + fname f = codecs.open(filename, 'r', 'gbk') lines = f.readlines() for lineno in range(len(lines)): line = lines[lineno] while line[-1].isspace(): line = line[:-1] try: line.encode('gb2312') except: print>>outfile, '\tLine %d :\t%s'%(lineno, line) for c in line: try: c.encode('gb2312') except: print>>outfile, u'\t\t' + c print>>outfile return False def main(): if len(sys.argv) != 3: print('Usage:') print('CheckEncoding.py [File|Folder] output_file') sys.exit(0) global outfile outfile = codecs.open(sys.argv[2], 'w', 'utf-8') if os.path.isfile(sys.argv[1]): check_file(sys.argv[1]) elif os.path.isdir(sys.argv[1]): for fn in glob.glob(os.path.join(sys.argv[1], '*.txt')): check_file(fn) else: print>>sys.stderr, 'The first argument is not a filepath or folder' sys.exit(1) if __name__ == '__main__': main()
ajibawa-2023/Python-Code-Large/train/row_99118
54
72
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_99118:Import_L4_C0", "label": "os import os", "type": "import", "loc": [4, 4], "level": 0, "parent": null, "vector": [1, 0, 0.0556, 0.0139, 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_99118:Import_L5_C0", "label": "sys import sys", "type": "import", "loc": [5, 5], "level": 0, "parent": null, "vector": [1, 0, 0.0694, 0.0139, 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_99118:Import_L6_C0", "label": "codecs import codecs", "type": "import", "loc": [6, 6], "level": 0, "parent": null, "vector": [1, 0, 0.0833, 0.0139, 0, 0.66, 0.1667, 220, 0, 1, 0, 0, 220, 0, 0], "semantic": {"name": "codecs", "arg_names": [], "import_names": ["codecs"], "rhs_call_name": "", "annotation": ""}, "snippet": "import codecs"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99118:Import_L7_C0", "label": "string import string", "type": "import", "loc": [7, 7], "level": 0, "parent": null, "vector": [1, 0, 0.0972, 0.0139, 0, 0.66, 0.25, 890, 0, 1, 0, 0, 890, 0, 0], "semantic": {"name": "string", "arg_names": [], "import_names": ["string"], "rhs_call_name": "", "annotation": ""}, "snippet": "import string"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99118:Import_L8_C0", "label": "logging import logging", "type": "import", "loc": [8, 8], "level": 0, "parent": null, "vector": [1, 0, 0.1111, 0.0139, 0, 0.66, 0.3333, 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_99118:Import_L9_C0", "label": "glob import glob", "type": "import", "loc": [9, 9], "level": 0, "parent": null, "vector": [1, 0, 0.125, 0.0139, 0, 0.66, 0.4167, 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_99118:Assign_L12_C0", "label": "logFileName =", "type": "assigned_variable", "loc": [12, 12], "level": 0, "parent": null, "vector": [14, 0, 0.1667, 0.0139, 0, 0.66, 0.5, 181, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "logFileName", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "logFileName = 'CheckEncoding.log'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99118:FunctionDef_L13_C0", "label": "init_log", "type": "function", "loc": [13, 20], "level": 0, "parent": null, "vector": [2, 0, 0.2292, 0.1111, 0, 0.66, 0.5833, 377, 0, 0, 1, 0, 0, 0, 6], "semantic": {"name": "init_log", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def init_log():\n logger = logging.getLogger()\n hdlr = logging.FileHandler(logFileName)\n formatter = logging.Formatter('%(asctime)s %(levelname)s:: %(message)s')\n hdlr.setFormatter(formatter)\n logger.addHandler(hdlr)\n logger.setLevel(logging.INFO)\n return logger"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99118:Assign_L14_C4", "label": "logger = getLogger()", "type": "assigned_variable", "loc": [14, 14], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99118:FunctionDef_L13_C0", "vector": [14, 1, 0.1944, 0.0139, 1, 0.27, 0.0, 532, 3, 0, 0, 0, 71, 10, 1], "semantic": {"name": "logger", "arg_names": [], "import_names": [], "rhs_call_name": "getLogger", "annotation": ""}, "snippet": " logger = logging.getLogger()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99118:Assign_L15_C4", "label": "hdlr = FileHandler()", "type": "assigned_variable", "loc": [15, 15], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99118:FunctionDef_L13_C0", "vector": [14, 1, 0.2083, 0.0139, 1, 0.27, 0.1667, 149, 3, 1, 0, 0, 306, 10, 1], "semantic": {"name": "hdlr", "arg_names": [], "import_names": [], "rhs_call_name": "FileHandler", "annotation": ""}, "snippet": " hdlr = logging.FileHandler(logFileName)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99118:Assign_L16_C4", "label": "formatter = Formatter()", "type": "assigned_variable", "loc": [16, 16], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99118:FunctionDef_L13_C0", "vector": [14, 1, 0.2222, 0.0139, 1, 0.27, 0.3333, 791, 3, 1, 0, 0, 766, 10, 1], "semantic": {"name": "formatter", "arg_names": [], "import_names": [], "rhs_call_name": "Formatter", "annotation": ""}, "snippet": " formatter = logging.Formatter('%(asctime)s %(levelname)s:: %(message)s')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99118:Expr_L17_C4", "label": "setFormatter()", "type": "expression", "loc": [17, 17], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99118:FunctionDef_L13_C0", "vector": [8, 1, 0.2361, 0.0139, 1, 0.27, 0.5, 948, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "setFormatter", "arg_names": [], "import_names": [], "rhs_call_name": "setFormatter", "annotation": ""}, "snippet": " hdlr.setFormatter(formatter)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99118:Expr_L18_C4", "label": "addHandler()", "type": "expression", "loc": [18, 18], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99118:FunctionDef_L13_C0", "vector": [8, 1, 0.25, 0.0139, 1, 0.27, 0.6667, 255, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "addHandler", "arg_names": [], "import_names": [], "rhs_call_name": "addHandler", "annotation": ""}, "snippet": " logger.addHandler(hdlr)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99118:Expr_L19_C4", "label": "setLevel()", "type": "expression", "loc": [19, 19], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99118:FunctionDef_L13_C0", "vector": [8, 1, 0.2639, 0.0139, 1, 0.27, 0.8333, 810, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "setLevel", "arg_names": [], "import_names": [], "rhs_call_name": "setLevel", "annotation": ""}, "snippet": " logger.setLevel(logging.INFO)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99118:Return_L20_C4", "label": "return", "type": "return", "loc": [20, 20], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99118:FunctionDef_L13_C0", "vector": [13, 1, 0.2778, 0.0139, 1, 0.27, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return logger"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99118:Assign_L22_C0", "label": "log = init_log()", "type": "assigned_variable", "loc": [22, 22], "level": 0, "parent": null, "vector": [14, 0, 0.3056, 0.0139, 0, 0.66, 0.6667, 432, 3, 0, 0, 0, 377, 10, 1], "semantic": {"name": "log", "arg_names": [], "import_names": [], "rhs_call_name": "init_log", "annotation": ""}, "snippet": "log = init_log()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99118:Assign_L25_C0", "label": "outfile =", "type": "assigned_variable", "loc": [25, 25], "level": 0, "parent": null, "vector": [14, 0, 0.3472, 0.0139, 0, 0.66, 0.75, 206, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "outfile", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "outfile = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99118:FunctionDef_L27_C0", "label": "check_file", "type": "function", "loc": [27, 51], "level": 0, "parent": null, "vector": [2, 0, 0.5417, 0.3472, 0, 0.66, 0.8333, 627, 0, 1, 1, 0, 0, 0, 10], "semantic": {"name": "check_file", "arg_names": ["filename"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def check_file(filename):\n\t'Check the file and output to outfile.\\n'\n\ttry:\n\t\tcodecs.open(filename, 'r', 'gb2312').read()\n\t\treturn\tTrue\n\texcept:\n\t\tfpath, fname = os.path.split(filename)\n\t\tprint>>outfile, 'Filename : ' + fname"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99118:Expr_L28_C1", "label": "expression", "type": "expression", "loc": [28, 28], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99118:FunctionDef_L27_C0", "vector": [8, 1, 0.3889, 0.0139, 1, 0.53, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t'Check the file and output to outfile.\\n'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99118:Try_L29_C1", "label": "try", "type": "try", "loc": [29, 34], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99118:FunctionDef_L27_C0", "vector": [7, 1, 0.4375, 0.0833, 1, 0.53, 0.1667, 0, 0, 1, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\ttry:\n\t\tcodecs.open(filename, 'r', 'gb2312').read()\n\t\treturn\tTrue\n\texcept:\n\t\tfpath, fname = os.path.split(filename)\n\t\tprint>>outfile, 'Filename : ' + fname"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99118:Expr_L30_C2", "label": "read()", "type": "expression", "loc": [30, 30], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99118:Try_L29_C1", "vector": [8, 2, 0.4167, 0.0139, 2, 0.46, 0.0, 453, 3, 0, 0, 0, 0, 0, 2], "semantic": {"name": "read", "arg_names": [], "import_names": [], "rhs_call_name": "read", "annotation": ""}, "snippet": "\t\tcodecs.open(filename, 'r', 'gb2312').read()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99118:Return_L31_C2", "label": "return", "type": "return", "loc": [31, 31], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99118:Try_L29_C1", "vector": [13, 2, 0.4306, 0.0139, 2, 0.46, 1.0, 0, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\treturn\tTrue"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99118:Assign_L33_C2", "label": "fpath, fname = split()", "type": "assigned_variable", "loc": [33, 33], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99118:Try_L29_C1", "vector": [14, 2, 0.4583, 0.0139, 2, 0.46, 0.0, 545, 3, 1, 0, 0, 908, 10, 1], "semantic": {"name": "fpath, fname", "arg_names": [], "import_names": [], "rhs_call_name": "split", "annotation": ""}, "snippet": "\t\tfpath, fname = os.path.split(filename)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99118:Expr_L34_C2", "label": "expression", "type": "expression", "loc": [34, 34], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99118:Try_L29_C1", "vector": [8, 2, 0.4722, 0.0139, 2, 0.46, 1.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tprint>>outfile, 'Filename : ' + fname"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99118:Assign_L35_C1", "label": "f = open()", "type": "assigned_variable", "loc": [35, 35], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99118:FunctionDef_L27_C0", "vector": [14, 1, 0.4861, 0.0139, 1, 0.53, 0.3333, 899, 3, 3, 0, 0, 693, 10, 1], "semantic": {"name": "f", "arg_names": [], "import_names": [], "rhs_call_name": "open", "annotation": ""}, "snippet": "\tf = codecs.open(filename, 'r', 'gbk')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99118:Assign_L36_C1", "label": "lines = readlines()", "type": "assigned_variable", "loc": [36, 36], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99118:FunctionDef_L27_C0", "vector": [14, 1, 0.5, 0.0139, 1, 0.53, 0.5, 73, 3, 0, 0, 0, 841, 10, 1], "semantic": {"name": "lines", "arg_names": [], "import_names": [], "rhs_call_name": "readlines", "annotation": ""}, "snippet": "\tlines = f.readlines()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99118:For_L37_C1", "label": "for lineno", "type": "for", "loc": [37, 49], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99118:FunctionDef_L27_C0", "vector": [6, 1, 0.5972, 0.1806, 1, 0.53, 0.6667, 48, 3, 0, 0, 0, 0, 0, 5], "semantic": {"name": "lineno", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tfor lineno in range(len(lines)):\n\t\tline = lines[lineno]\n\t\twhile line[-1].isspace():\n\t\t\tline = line[:-1]\n\t\ttry:\n\t\t\tline.encode('gb2312')\n\t\texcept:\n\t\t\tprint>>outfile, '\\tLine %d :\\t%s'%(lineno, line)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99118:Assign_L38_C2", "label": "line =", "type": "assigned_variable", "loc": [38, 38], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99118:For_L37_C1", "vector": [14, 2, 0.5278, 0.0139, 2, 0.13, 0.0, 373, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "line", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tline = lines[lineno]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99118:While_L39_C2", "label": "while", "type": "while", "loc": [39, 40], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99118:For_L37_C1", "vector": [5, 2, 0.5486, 0.0278, 2, 0.13, 0.5, 0, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\twhile line[-1].isspace():\n\t\t\tline = line[:-1]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99118:Assign_L40_C3", "label": "line =", "type": "assigned_variable", "loc": [40, 40], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99118:While_L39_C2", "vector": [14, 3, 0.5556, 0.0139, 3, 0.1, 0.0, 373, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "line", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\tline = line[:-1]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99118:Try_L41_C2", "label": "try", "type": "try", "loc": [41, 49], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99118:For_L37_C1", "vector": [7, 2, 0.625, 0.125, 2, 0.13, 1.0, 0, 0, 1, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\ttry:\n\t\t\tline.encode('gb2312')\n\t\texcept:\n\t\t\tprint>>outfile, '\\tLine %d :\\t%s'%(lineno, line)\n\t\t\tfor c in line:\n\t\t\t\ttry:\n\t\t\t\t\tc.encode('gb2312')\n\t\t\t\texcept:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99118:Expr_L42_C3", "label": "encode()", "type": "expression", "loc": [42, 42], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99118:Try_L41_C2", "vector": [8, 3, 0.5833, 0.0139, 3, 0.54, 0.0, 623, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "encode", "arg_names": [], "import_names": [], "rhs_call_name": "encode", "annotation": ""}, "snippet": "\t\t\tline.encode('gb2312')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99118:Expr_L44_C3", "label": "expression", "type": "expression", "loc": [44, 44], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99118:Try_L41_C2", "vector": [8, 3, 0.6111, 0.0139, 3, 0.54, 0.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\tprint>>outfile, '\\tLine %d :\\t%s'%(lineno, line)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99118:For_L45_C3", "label": "for c", "type": "for", "loc": [45, 49], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99118:Try_L41_C2", "vector": [6, 3, 0.6528, 0.0694, 3, 0.54, 1.0, 411, 2, 0, 0, 0, 0, 0, 1], "semantic": {"name": "c", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\tfor c in line:\n\t\t\t\ttry:\n\t\t\t\t\tc.encode('gb2312')\n\t\t\t\texcept:\n\t\t\t\t\tprint>>outfile, u'\\t\\t' + c"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99118:Try_L46_C4", "label": "try", "type": "try", "loc": [46, 49], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99118:For_L45_C3", "vector": [7, 4, 0.6597, 0.0556, 4, 0.96, 0.0, 0, 0, 1, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\t\ttry:\n\t\t\t\t\tc.encode('gb2312')\n\t\t\t\texcept:\n\t\t\t\t\tprint>>outfile, u'\\t\\t' + c"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99118:Expr_L47_C5", "label": "encode()", "type": "expression", "loc": [47, 47], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99118:Try_L46_C4", "vector": [8, 5, 0.6528, 0.0139, 5, 0.1, 0.0, 623, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "encode", "arg_names": [], "import_names": [], "rhs_call_name": "encode", "annotation": ""}, "snippet": "\t\t\t\t\tc.encode('gb2312')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99118:Expr_L49_C5", "label": "expression", "type": "expression", "loc": [49, 49], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99118:Try_L46_C4", "vector": [8, 5, 0.6806, 0.0139, 5, 0.1, 0.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\t\t\tprint>>outfile, u'\\t\\t' + c"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99118:Expr_L50_C1", "label": "expression", "type": "expression", "loc": [50, 50], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99118:FunctionDef_L27_C0", "vector": [8, 1, 0.6944, 0.0139, 1, 0.53, 0.8333, 0, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tprint>>outfile"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99118:Return_L51_C1", "label": "return", "type": "return", "loc": [51, 51], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99118:FunctionDef_L27_C0", "vector": [13, 1, 0.7083, 0.0139, 1, 0.53, 1.0, 0, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\treturn False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99118:FunctionDef_L54_C0", "label": "main", "type": "function", "loc": [54, 68], "level": 0, "parent": null, "vector": [2, 0, 0.8472, 0.2083, 0, 0.66, 0.9167, 624, 0, 0, 0, 0, 0, 0, 12], "semantic": {"name": "main", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def main():\n\tif len(sys.argv) != 3:\n\t\tprint('Usage:')\n\t\tprint('CheckEncoding.py [File|Folder] output_file')\n\t\tsys.exit(0)\n\tglobal outfile\n\toutfile = codecs.open(sys.argv[2], 'w', 'utf-8')\n\tif os.path.isfile(sys.argv[1]):"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99118:If_L55_C1", "label": "if", "type": "if", "loc": [55, 58], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99118:FunctionDef_L54_C0", "vector": [4, 1, 0.7847, 0.0556, 1, 0.33, 0.0, 0, 0, 0, 0, 0, 0, 0, 4], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tif len(sys.argv) != 3:\n\t\tprint('Usage:')\n\t\tprint('CheckEncoding.py [File|Folder] output_file')\n\t\tsys.exit(0)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99118:Expr_L56_C2", "label": "print()", "type": "expression", "loc": [56, 56], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99118:If_L55_C1", "vector": [8, 2, 0.7778, 0.0139, 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": "\t\tprint('Usage:')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99118:Expr_L57_C2", "label": "print()", "type": "expression", "loc": [57, 57], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99118:If_L55_C1", "vector": [8, 2, 0.7917, 0.0139, 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": "\t\tprint('CheckEncoding.py [File|Folder] output_file')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99118:Expr_L58_C2", "label": "exit()", "type": "expression", "loc": [58, 58], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99118:If_L55_C1", "vector": [8, 2, 0.8056, 0.0139, 2, 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": "\t\tsys.exit(0)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99118:Assign_L60_C1", "label": "outfile = open()", "type": "assigned_variable", "loc": [60, 60], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99118:FunctionDef_L54_C0", "vector": [14, 1, 0.8333, 0.0139, 1, 0.33, 0.5, 206, 3, 3, 0, 0, 693, 10, 1], "semantic": {"name": "outfile", "arg_names": [], "import_names": [], "rhs_call_name": "open", "annotation": ""}, "snippet": "\toutfile = codecs.open(sys.argv[2], 'w', 'utf-8')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99118:If_L61_C1", "label": "if", "type": "if", "loc": [61, 68], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99118:FunctionDef_L54_C0", "vector": [4, 1, 0.8958, 0.1111, 1, 0.33, 1.0, 0, 3, 0, 0, 0, 0, 0, 7], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tif os.path.isfile(sys.argv[1]):\n\t\tcheck_file(sys.argv[1])\n\telif os.path.isdir(sys.argv[1]):\n\t\tfor fn in glob.glob(os.path.join(sys.argv[1], '*.txt')):\n\t\t\tcheck_file(fn)\n\telse:\n\t\tprint>>sys.stderr, 'The first argument is not a filepath or folder'\n\t\tsys.exit(1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99118:Expr_L62_C2", "label": "check_file()", "type": "expression", "loc": [62, 62], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99118:If_L61_C1", "vector": [8, 2, 0.8611, 0.0139, 2, 0.44, 0.0, 627, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "check_file", "arg_names": [], "import_names": [], "rhs_call_name": "check_file", "annotation": ""}, "snippet": "\t\tcheck_file(sys.argv[1])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99118:If_L63_C1", "label": "if", "type": "if", "loc": [63, 68], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99118:If_L61_C1", "vector": [4, 2, 0.9097, 0.0833, 2, 0.44, 1.0, 0, 3, 0, 0, 0, 0, 0, 5], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\telif os.path.isdir(sys.argv[1]):\n\t\tfor fn in glob.glob(os.path.join(sys.argv[1], '*.txt')):\n\t\t\tcheck_file(fn)\n\telse:\n\t\tprint>>sys.stderr, 'The first argument is not a filepath or folder'\n\t\tsys.exit(1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99118:For_L64_C2", "label": "for fn", "type": "for", "loc": [64, 65], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99118:If_L63_C1", "vector": [6, 3, 0.8958, 0.0278, 3, 0.5, 0.0, 59, 3, 0, 0, 0, 0, 0, 3], "semantic": {"name": "fn", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tfor fn in glob.glob(os.path.join(sys.argv[1], '*.txt')):\n\t\t\tcheck_file(fn)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99118:Expr_L65_C3", "label": "check_file()", "type": "expression", "loc": [65, 65], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99118:For_L64_C2", "vector": [8, 4, 0.9028, 0.0139, 4, 0.72, 0.0, 627, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "check_file", "arg_names": [], "import_names": [], "rhs_call_name": "check_file", "annotation": ""}, "snippet": "\t\t\tcheck_file(fn)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99118:Expr_L67_C2", "label": "expression", "type": "expression", "loc": [67, 67], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99118:If_L63_C1", "vector": [8, 3, 0.9306, 0.0139, 3, 0.5, 0.5, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tprint>>sys.stderr, 'The first argument is not a filepath or folder'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99118:Expr_L68_C2", "label": "exit()", "type": "expression", "loc": [68, 68], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99118:If_L63_C1", "vector": [8, 3, 0.9444, 0.0139, 3, 0.5, 1.0, 436, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "exit", "arg_names": [], "import_names": [], "rhs_call_name": "exit", "annotation": ""}, "snippet": "\t\tsys.exit(1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99118:If_L70_C0", "label": "if", "type": "if", "loc": [70, 71], "level": 0, "parent": null, "vector": [4, 0, 0.9792, 0.0278, 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\tmain()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99118:Expr_L71_C1", "label": "main()", "type": "expression", "loc": [71, 71], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99118:If_L70_C0", "vector": [8, 1, 0.9861, 0.0139, 1, 0.5, 0.0, 624, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "main", "arg_names": [], "import_names": [], "rhs_call_name": "main", "annotation": ""}, "snippet": "\tmain()"}]
[{"f": "ajibawa-2023/Python-Code-Large/train/row_99118:FunctionDef_L13_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99118:Assign_L14_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99118:FunctionDef_L13_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99118:Assign_L15_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99118:FunctionDef_L13_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99118:Assign_L16_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99118:FunctionDef_L13_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99118:Expr_L17_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99118:FunctionDef_L13_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99118:Expr_L18_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99118:FunctionDef_L13_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99118:Expr_L19_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99118:FunctionDef_L13_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99118:Return_L20_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99118:FunctionDef_L27_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99118:Expr_L28_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99118:FunctionDef_L27_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99118:Try_L29_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99118:Try_L29_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99118:Expr_L30_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99118:Try_L29_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99118:Return_L31_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99118:Try_L29_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99118:Assign_L33_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99118:Try_L29_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99118:Expr_L34_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99118:FunctionDef_L27_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99118:Assign_L35_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99118:FunctionDef_L27_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99118:Assign_L36_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99118:FunctionDef_L27_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99118:For_L37_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99118:For_L37_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99118:Assign_L38_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99118:For_L37_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99118:While_L39_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99118:While_L39_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99118:Assign_L40_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99118:For_L37_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99118:Try_L41_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99118:Try_L41_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99118:Expr_L42_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99118:Try_L41_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99118:Expr_L44_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99118:Try_L41_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99118:For_L45_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99118:For_L45_C3", "t": "ajibawa-2023/Python-Code-Large/train/row_99118:Try_L46_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99118:Try_L46_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99118:Expr_L47_C5"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99118:Try_L46_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99118:Expr_L49_C5"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99118:FunctionDef_L27_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99118:Expr_L50_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99118:FunctionDef_L27_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99118:Return_L51_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99118:FunctionDef_L54_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99118:If_L55_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99118:If_L55_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99118:Expr_L56_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99118:If_L55_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99118:Expr_L57_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99118:If_L55_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99118:Expr_L58_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99118:FunctionDef_L54_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99118:Assign_L60_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99118:FunctionDef_L54_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99118:If_L61_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99118:If_L61_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99118:Expr_L62_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99118:If_L61_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99118:If_L63_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99118:If_L63_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99118:For_L64_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99118:For_L64_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99118:Expr_L65_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99118:If_L63_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99118:Expr_L67_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99118:If_L63_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99118:Expr_L68_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99118:If_L70_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99118:Expr_L71_C1"}]
#!/usr/bin/env python # coding=utf-8 """ Check A0000001.txt. """ import os import sys import re import codecs import CheckLog log = CheckLog.get_file_log(r'checkA.log') class DicItemA: def __init__(self, s): s = s.strip() self._linestr = s pat = re.match( \ r'^(\S+)\t([\w ]+)\t(0x[\dA-F]{4})\t(0x[\dA-F]{4})\t(0x[\dA-F]{8})$', \ self._linestr) if not pat: log.warning(r'<String Match Error> : %s : %s', self.get_father()['nextLevelId'], self.get_str()) return self._name = pat.group(1) self._pinyin = pat.group(2) self._minKiwiId = pat.group(3) self._maxKiwiId = pat.group(4) self._num0 = pat.group(5) def get_str(self): return self._linestr def __getitem__(self, attr): if attr == 'name': return self._name elif attr == 'pinyin': return self._pinyin elif attr == 'minKiwiId': return self._minKiwiId elif attr == 'maxKiwiId': return self._maxKiwiId elif attr == 'num0': return self._num0 else: raise KeyError() def check(self): """ Check the item itself only. """ checker = DicItemAChecker(self) r = checker.check() if not r: log.warning(r'<Error> : %s', self.get_str()) return r class DicItemAChecker(): pinyinChars = set(u'abcdefghijklmnopqrstuvwxyz /1234') def __init__(self, item): self._item = item def check(self): r1 = self._check_1() r2 = self._check_2() return r1 and r2 def _check_1(self): """Check encoding, which is checked in function check(). """ return True def _check_2(self): """Check pinyin. """ d = self._dicItem r1 = self._check_2_1() r2 = self._check_2_2(); if not r1: log.info(r'<Check_2 Error> Alphabet text but not NoPinYin : %s', self._dicItem.get_str()) return False if not r2: log.info(r'<Check_2 Error> Pinyin contains other characters : %s', self._dicItem.get_str()) return False return True def _check_2_1(self): """Check if text has alphabet, then pinyin should be "NoPinYin". """ def has_alphabet(s): for c in s: if c in self.alphabets: return True return False if has_alphabet(self._dicItem['name']): if self._dicItem['pinyin'] != u'NoPinYin': return False return True def _check_2_2(self): """Check characters in pinyin. """ pinyin = self._dicItem['pinyin'] if pinyin == 'NoPinYin': return True for c in pinyin: if not c in self.pinyinChars: return False return True def check(filename): """Check records in file. """ f = codecs.open(filename, 'r', 'gbk') try: ls = f.readlines() except: log.info(r'<Check Encoding Error> Contain non-GBK character : %s', self._dicItem.get_str()) return False rds = tuple(DicItemA(line) for line in ls) r = tuple(r.check() for r in rds) return all(r) def main(): if len(sys.argv) != 2: print('Usage:') print(r'python check.py [Filepath of A000000.txt]') sys.exit(0) filename = sys.argv[1] check(filename)
ajibawa-2023/Python-Code-Large/train/row_99119
100
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_99119:Expr_L4_C0", "label": "expression", "type": "expression", "loc": [4, 6], "level": 0, "parent": null, "vector": [8, 0, 0.0382, 0.0229, 0, 0.66, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\"\"\"\nCheck A0000001.txt.\n\"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99119:Import_L8_C0", "label": "os import os", "type": "import", "loc": [8, 8], "level": 0, "parent": null, "vector": [1, 0, 0.0611, 0.0076, 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_99119:Import_L9_C0", "label": "sys import sys", "type": "import", "loc": [9, 9], "level": 0, "parent": null, "vector": [1, 0, 0.0687, 0.0076, 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_99119:Import_L10_C0", "label": "re import re", "type": "import", "loc": [10, 10], "level": 0, "parent": null, "vector": [1, 0, 0.0763, 0.0076, 0, 0.66, 0.3, 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_99119:Import_L11_C0", "label": "codecs import codecs", "type": "import", "loc": [11, 11], "level": 0, "parent": null, "vector": [1, 0, 0.084, 0.0076, 0, 0.66, 0.4, 220, 0, 1, 0, 0, 220, 0, 0], "semantic": {"name": "codecs", "arg_names": [], "import_names": ["codecs"], "rhs_call_name": "", "annotation": ""}, "snippet": "import codecs"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99119:Import_L13_C0", "label": "CheckLog import CheckLog", "type": "import", "loc": [13, 13], "level": 0, "parent": null, "vector": [1, 0, 0.0992, 0.0076, 0, 0.66, 0.5, 11, 0, 1, 0, 0, 11, 0, 0], "semantic": {"name": "CheckLog", "arg_names": [], "import_names": ["CheckLog"], "rhs_call_name": "", "annotation": ""}, "snippet": "import CheckLog"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99119:Assign_L14_C0", "label": "log = get_file_log()", "type": "assigned_variable", "loc": [14, 14], "level": 0, "parent": null, "vector": [14, 0, 0.1069, 0.0076, 0, 0.66, 0.6, 432, 3, 1, 0, 0, 730, 10, 1], "semantic": {"name": "log", "arg_names": [], "import_names": [], "rhs_call_name": "get_file_log", "annotation": ""}, "snippet": "log = CheckLog.get_file_log(r'checkA.log')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99119:ClassDef_L16_C0", "label": "DicItemA", "type": "class", "loc": [16, 56], "level": 0, "parent": null, "vector": [3, 0, 0.2748, 0.313, 0, 0.66, 0.7, 209, 0, 4, 0, 0, 0, 0, 15], "semantic": {"name": "DicItemA", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class DicItemA:\n\tdef __init__(self, s):\n\t\ts = s.strip()\n\t\tself._linestr = s\n\t\tpat = re.match( \\\n\t\t\t\tr'^(\\S+)\\t([\\w ]+)\\t(0x[\\dA-F]{4})\\t(0x[\\dA-F]{4})\\t(0x[\\dA-F]{8})$', \\\n\t\t\t\tself._linestr)\n\t\tif not pat:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99119:FunctionDef_L17_C1", "label": "__init__", "type": "function", "loc": [17, 30], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99119:ClassDef_L16_C0", "vector": [2, 1, 0.1794, 0.1069, 1, 0.11, 0.0, 555, 0, 2, 0, 0, 0, 0, 10], "semantic": {"name": "__init__", "arg_names": ["self", "s"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tdef __init__(self, s):\n\t\ts = s.strip()\n\t\tself._linestr = s\n\t\tpat = re.match( \\\n\t\t\t\tr'^(\\S+)\\t([\\w ]+)\\t(0x[\\dA-F]{4})\\t(0x[\\dA-F]{4})\\t(0x[\\dA-F]{8})$', \\\n\t\t\t\tself._linestr)\n\t\tif not pat:\n\t\t\tlog.warning(r'<String Match Error> : %s : %s', self.get_father()['nextLevelId'], self.get_str())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99119:Assign_L18_C2", "label": "s = strip()", "type": "assigned_variable", "loc": [18, 18], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99119:FunctionDef_L17_C1", "vector": [14, 2, 0.1374, 0.0076, 2, 0.6, 0.0, 553, 3, 0, 0, 0, 973, 10, 1], "semantic": {"name": "s", "arg_names": [], "import_names": [], "rhs_call_name": "strip", "annotation": ""}, "snippet": "\t\ts = s.strip()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99119:Assign_L19_C2", "label": "self._linestr =", "type": "assigned_variable", "loc": [19, 19], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99119:FunctionDef_L17_C1", "vector": [14, 2, 0.145, 0.0076, 2, 0.6, 0.125, 293, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self._linestr", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tself._linestr = s"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99119:Assign_L20_C2", "label": "pat = match()", "type": "assigned_variable", "loc": [20, 22], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99119:FunctionDef_L17_C1", "vector": [14, 2, 0.1603, 0.0229, 2, 0.6, 0.25, 545, 3, 2, 0, 0, 36, 10, 1], "semantic": {"name": "pat", "arg_names": [], "import_names": [], "rhs_call_name": "match", "annotation": ""}, "snippet": "\t\tpat = re.match( \\\n\t\t\t\tr'^(\\S+)\\t([\\w ]+)\\t(0x[\\dA-F]{4})\\t(0x[\\dA-F]{4})\\t(0x[\\dA-F]{8})$', \\\n\t\t\t\tself._linestr)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99119:If_L23_C2", "label": "if", "type": "if", "loc": [23, 25], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99119:FunctionDef_L17_C1", "vector": [4, 2, 0.1832, 0.0229, 2, 0.6, 0.375, 0, 0, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tif not pat:\n\t\t\tlog.warning(r'<String Match Error> : %s : %s', self.get_father()['nextLevelId'], self.get_str())\n\t\t\treturn"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99119:Expr_L24_C3", "label": "warning()", "type": "expression", "loc": [24, 24], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99119:If_L23_C2", "vector": [8, 3, 0.1832, 0.0076, 3, 0.74, 0.0, 320, 3, 3, 0, 0, 0, 0, 3], "semantic": {"name": "warning", "arg_names": [], "import_names": [], "rhs_call_name": "warning", "annotation": ""}, "snippet": "\t\t\tlog.warning(r'<String Match Error> : %s : %s', self.get_father()['nextLevelId'], self.get_str())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99119:Return_L25_C3", "label": "return", "type": "return", "loc": [25, 25], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99119:If_L23_C2", "vector": [13, 3, 0.1908, 0.0076, 3, 0.74, 1.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_99119:Assign_L26_C2", "label": "self._name = group()", "type": "assigned_variable", "loc": [26, 26], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99119:FunctionDef_L17_C1", "vector": [14, 2, 0.1985, 0.0076, 2, 0.6, 0.5, 257, 3, 1, 0, 0, 43, 10, 1], "semantic": {"name": "self._name", "arg_names": [], "import_names": [], "rhs_call_name": "group", "annotation": ""}, "snippet": "\t\tself._name = pat.group(1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99119:Assign_L27_C2", "label": "self._pinyin = group()", "type": "assigned_variable", "loc": [27, 27], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99119:FunctionDef_L17_C1", "vector": [14, 2, 0.2061, 0.0076, 2, 0.6, 0.625, 711, 3, 1, 0, 0, 43, 10, 1], "semantic": {"name": "self._pinyin", "arg_names": [], "import_names": [], "rhs_call_name": "group", "annotation": ""}, "snippet": "\t\tself._pinyin = pat.group(2)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99119:Assign_L28_C2", "label": "self._minKiwiId = group()", "type": "assigned_variable", "loc": [28, 28], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99119:FunctionDef_L17_C1", "vector": [14, 2, 0.2137, 0.0076, 2, 0.6, 0.75, 108, 3, 1, 0, 0, 43, 10, 1], "semantic": {"name": "self._minKiwiId", "arg_names": [], "import_names": [], "rhs_call_name": "group", "annotation": ""}, "snippet": "\t\tself._minKiwiId = pat.group(3)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99119:Assign_L29_C2", "label": "self._maxKiwiId = group()", "type": "assigned_variable", "loc": [29, 29], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99119:FunctionDef_L17_C1", "vector": [14, 2, 0.2214, 0.0076, 2, 0.6, 0.875, 896, 3, 1, 0, 0, 43, 10, 1], "semantic": {"name": "self._maxKiwiId", "arg_names": [], "import_names": [], "rhs_call_name": "group", "annotation": ""}, "snippet": "\t\tself._maxKiwiId = pat.group(4)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99119:Assign_L30_C2", "label": "self._num0 = group()", "type": "assigned_variable", "loc": [30, 30], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99119:FunctionDef_L17_C1", "vector": [14, 2, 0.229, 0.0076, 2, 0.6, 1.0, 60, 3, 1, 0, 0, 43, 10, 1], "semantic": {"name": "self._num0", "arg_names": [], "import_names": [], "rhs_call_name": "group", "annotation": ""}, "snippet": "\t\tself._num0 = pat.group(5)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99119:FunctionDef_L32_C1", "label": "get_str", "type": "function", "loc": [32, 33], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99119:ClassDef_L16_C0", "vector": [2, 1, 0.2481, 0.0153, 1, 0.11, 0.3333, 383, 0, 1, 1, 0, 0, 0, 0], "semantic": {"name": "get_str", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tdef get_str(self):\n\t\treturn self._linestr"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99119:Return_L33_C2", "label": "return", "type": "return", "loc": [33, 33], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99119:FunctionDef_L32_C1", "vector": [13, 2, 0.2519, 0.0076, 2, 0.16, 0.0, 0, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\treturn self._linestr"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99119:FunctionDef_L35_C1", "label": "__getitem__", "type": "function", "loc": [35, 47], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99119:ClassDef_L16_C0", "vector": [2, 1, 0.313, 0.0992, 1, 0.11, 0.6667, 698, 0, 2, 1, 0, 0, 0, 1], "semantic": {"name": "__getitem__", "arg_names": ["self", "attr"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tdef __getitem__(self, attr):\n\t\tif attr == 'name':\n\t\t\treturn self._name\n\t\telif attr == 'pinyin':\n\t\t\treturn self._pinyin\n\t\telif attr == 'minKiwiId':\n\t\t\treturn self._minKiwiId\n\t\telif attr == 'maxKiwiId':"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99119:If_L36_C2", "label": "if", "type": "if", "loc": [36, 47], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99119:FunctionDef_L35_C1", "vector": [4, 2, 0.3168, 0.0916, 2, 0.64, 0.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tif attr == 'name':\n\t\t\treturn self._name\n\t\telif attr == 'pinyin':\n\t\t\treturn self._pinyin\n\t\telif attr == 'minKiwiId':\n\t\t\treturn self._minKiwiId\n\t\telif attr == 'maxKiwiId':\n\t\t\treturn self._maxKiwiId"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99119:Return_L37_C3", "label": "return", "type": "return", "loc": [37, 37], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99119:If_L36_C2", "vector": [13, 3, 0.2824, 0.0076, 3, 0.14, 0.0, 0, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\treturn self._name"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99119:If_L38_C2", "label": "if", "type": "if", "loc": [38, 47], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99119:If_L36_C2", "vector": [4, 3, 0.3244, 0.0763, 3, 0.14, 1.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\telif attr == 'pinyin':\n\t\t\treturn self._pinyin\n\t\telif attr == 'minKiwiId':\n\t\t\treturn self._minKiwiId\n\t\telif attr == 'maxKiwiId':\n\t\t\treturn self._maxKiwiId\n\t\telif attr == 'num0':\n\t\t\treturn self._num0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99119:Return_L39_C3", "label": "return", "type": "return", "loc": [39, 39], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99119:If_L38_C2", "vector": [13, 4, 0.2977, 0.0076, 4, 0.74, 0.0, 0, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\treturn self._pinyin"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99119:If_L40_C2", "label": "if", "type": "if", "loc": [40, 47], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99119:If_L38_C2", "vector": [4, 4, 0.3321, 0.0611, 4, 0.74, 1.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\telif attr == 'minKiwiId':\n\t\t\treturn self._minKiwiId\n\t\telif attr == 'maxKiwiId':\n\t\t\treturn self._maxKiwiId\n\t\telif attr == 'num0':\n\t\t\treturn self._num0\n\t\telse:\n\t\t\traise KeyError()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99119:Return_L41_C3", "label": "return", "type": "return", "loc": [41, 41], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99119:If_L40_C2", "vector": [13, 5, 0.313, 0.0076, 5, 0.77, 0.0, 0, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\treturn self._minKiwiId"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99119:If_L42_C2", "label": "if", "type": "if", "loc": [42, 47], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99119:If_L40_C2", "vector": [4, 5, 0.3397, 0.0458, 5, 0.77, 1.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\telif attr == 'maxKiwiId':\n\t\t\treturn self._maxKiwiId\n\t\telif attr == 'num0':\n\t\t\treturn self._num0\n\t\telse:\n\t\t\traise KeyError()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99119:Return_L43_C3", "label": "return", "type": "return", "loc": [43, 43], "level": 6, "parent": "ajibawa-2023/Python-Code-Large/train/row_99119:If_L42_C2", "vector": [13, 6, 0.3282, 0.0076, 6, 0.14, 0.0, 0, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\treturn self._maxKiwiId"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99119:If_L44_C2", "label": "if", "type": "if", "loc": [44, 47], "level": 6, "parent": "ajibawa-2023/Python-Code-Large/train/row_99119:If_L42_C2", "vector": [4, 6, 0.3473, 0.0305, 6, 0.14, 1.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\telif attr == 'num0':\n\t\t\treturn self._num0\n\t\telse:\n\t\t\traise KeyError()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99119:Return_L45_C3", "label": "return", "type": "return", "loc": [45, 45], "level": 7, "parent": "ajibawa-2023/Python-Code-Large/train/row_99119:If_L44_C2", "vector": [13, 7, 0.3435, 0.0076, 7, 0.09, 0.0, 0, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\treturn self._num0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99119:FunctionDef_L49_C1", "label": "check", "type": "function", "loc": [49, 56], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99119:ClassDef_L16_C0", "vector": [2, 1, 0.4008, 0.0611, 1, 0.11, 1.0, 803, 0, 1, 1, 0, 0, 0, 4], "semantic": {"name": "check", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tdef check(self):\n\t\t\"\"\" Check the item itself only.\n\t\t\"\"\"\n\t\tchecker = DicItemAChecker(self)\n\t\tr = checker.check()\n\t\tif not r:\n\t\t\tlog.warning(r'<Error> : %s', self.get_str())\n\t\treturn r"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99119:Expr_L50_C2", "label": "expression", "type": "expression", "loc": [50, 51], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99119:FunctionDef_L49_C1", "vector": [8, 2, 0.3855, 0.0153, 2, 0.14, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\"\"\" Check the item itself only.\n\t\t\"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99119:Assign_L52_C2", "label": "checker = DicItemAChecker()", "type": "assigned_variable", "loc": [52, 52], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99119:FunctionDef_L49_C1", "vector": [14, 2, 0.3969, 0.0076, 2, 0.14, 0.25, 279, 3, 1, 0, 0, 687, 10, 1], "semantic": {"name": "checker", "arg_names": [], "import_names": [], "rhs_call_name": "DicItemAChecker", "annotation": ""}, "snippet": "\t\tchecker = DicItemAChecker(self)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99119:Assign_L53_C2", "label": "r = check()", "type": "assigned_variable", "loc": [53, 53], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99119:FunctionDef_L49_C1", "vector": [14, 2, 0.4046, 0.0076, 2, 0.14, 0.5, 436, 3, 0, 0, 0, 803, 10, 1], "semantic": {"name": "r", "arg_names": [], "import_names": [], "rhs_call_name": "check", "annotation": ""}, "snippet": "\t\tr = checker.check()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99119:If_L54_C2", "label": "if", "type": "if", "loc": [54, 55], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99119:FunctionDef_L49_C1", "vector": [4, 2, 0.416, 0.0153, 2, 0.14, 0.75, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tif not r:\n\t\t\tlog.warning(r'<Error> : %s', self.get_str())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99119:Expr_L55_C3", "label": "warning()", "type": "expression", "loc": [55, 55], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99119:If_L54_C2", "vector": [8, 3, 0.4198, 0.0076, 3, 0.69, 0.0, 320, 3, 2, 0, 0, 0, 0, 2], "semantic": {"name": "warning", "arg_names": [], "import_names": [], "rhs_call_name": "warning", "annotation": ""}, "snippet": "\t\t\tlog.warning(r'<Error> : %s', self.get_str())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99119:Return_L56_C2", "label": "return", "type": "return", "loc": [56, 56], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99119:FunctionDef_L49_C1", "vector": [13, 2, 0.4275, 0.0076, 2, 0.14, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\treturn r"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99119:ClassDef_L58_C0", "label": "DicItemAChecker", "type": "class", "loc": [58, 110], "level": 0, "parent": null, "vector": [3, 0, 0.6412, 0.4046, 0, 0.66, 0.8, 687, 0, 7, 0, 0, 0, 0, 10], "semantic": {"name": "DicItemAChecker", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class DicItemAChecker():\n\tpinyinChars = set(u'abcdefghijklmnopqrstuvwxyz /1234')\n\t\n\tdef __init__(self, item):\n\t\tself._item = item\n\t\t\n\tdef check(self):\n\t\tr1 = self._check_1()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99119:Assign_L59_C1", "label": "pinyinChars = set()", "type": "assigned_variable", "loc": [59, 59], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99119:ClassDef_L58_C0", "vector": [14, 1, 0.4504, 0.0076, 1, 0.14, 0.0, 473, 3, 1, 0, 0, 21, 10, 1], "semantic": {"name": "pinyinChars", "arg_names": [], "import_names": [], "rhs_call_name": "set", "annotation": ""}, "snippet": "\tpinyinChars = set(u'abcdefghijklmnopqrstuvwxyz /1234')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99119:FunctionDef_L61_C1", "label": "__init__", "type": "function", "loc": [61, 62], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99119:ClassDef_L58_C0", "vector": [2, 1, 0.4695, 0.0153, 1, 0.14, 0.1667, 555, 0, 2, 0, 0, 0, 0, 0], "semantic": {"name": "__init__", "arg_names": ["self", "item"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tdef __init__(self, item):\n\t\tself._item = item"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99119:Assign_L62_C2", "label": "self._item =", "type": "assigned_variable", "loc": [62, 62], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99119:FunctionDef_L61_C1", "vector": [14, 2, 0.4733, 0.0076, 2, 0.08, 0.0, 201, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self._item", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tself._item = item"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99119:FunctionDef_L64_C1", "label": "check", "type": "function", "loc": [64, 67], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99119:ClassDef_L58_C0", "vector": [2, 1, 0.5, 0.0305, 1, 0.14, 0.3333, 803, 0, 1, 1, 0, 0, 0, 2], "semantic": {"name": "check", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tdef check(self):\n\t\tr1 = self._check_1()\n\t\tr2 = self._check_2()\n\t\treturn r1 and r2"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99119:Assign_L65_C2", "label": "r1 = _check_1()", "type": "assigned_variable", "loc": [65, 65], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99119:FunctionDef_L64_C1", "vector": [14, 2, 0.4962, 0.0076, 2, 0.95, 0.0, 648, 3, 0, 0, 0, 388, 10, 1], "semantic": {"name": "r1", "arg_names": [], "import_names": [], "rhs_call_name": "_check_1", "annotation": ""}, "snippet": "\t\tr1 = self._check_1()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99119:Assign_L66_C2", "label": "r2 = _check_2()", "type": "assigned_variable", "loc": [66, 66], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99119:FunctionDef_L64_C1", "vector": [14, 2, 0.5038, 0.0076, 2, 0.95, 0.5, 959, 3, 0, 0, 0, 203, 10, 1], "semantic": {"name": "r2", "arg_names": [], "import_names": [], "rhs_call_name": "_check_2", "annotation": ""}, "snippet": "\t\tr2 = self._check_2()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99119:Return_L67_C2", "label": "return", "type": "return", "loc": [67, 67], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99119:FunctionDef_L64_C1", "vector": [13, 2, 0.5115, 0.0076, 2, 0.95, 1.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\treturn r1 and r2"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99119:FunctionDef_L69_C1", "label": "_check_1", "type": "function", "loc": [69, 72], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99119:ClassDef_L58_C0", "vector": [2, 1, 0.5382, 0.0305, 1, 0.14, 0.5, 388, 0, 1, 1, 0, 0, 0, 0], "semantic": {"name": "_check_1", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tdef _check_1(self):\n\t\t\"\"\"Check encoding, which is checked in function check().\n\t\t\"\"\"\n\t\treturn True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99119:Expr_L70_C2", "label": "expression", "type": "expression", "loc": [70, 71], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99119:FunctionDef_L69_C1", "vector": [8, 2, 0.5382, 0.0153, 2, 0.57, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\"\"\"Check encoding, which is checked in function check().\n\t\t\"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99119:Return_L72_C2", "label": "return", "type": "return", "loc": [72, 72], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99119:FunctionDef_L69_C1", "vector": [13, 2, 0.5496, 0.0076, 2, 0.57, 1.0, 0, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\treturn True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99119:FunctionDef_L74_C1", "label": "_check_2", "type": "function", "loc": [74, 86], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99119:ClassDef_L58_C0", "vector": [2, 1, 0.6107, 0.0992, 1, 0.14, 0.6667, 203, 0, 1, 1, 0, 0, 0, 6], "semantic": {"name": "_check_2", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tdef _check_2(self):\n\t\t\"\"\"Check pinyin.\n\t\t\"\"\"\n\t\td = self._dicItem\n\t\tr1 = self._check_2_1()\n\t\tr2 = self._check_2_2();\n\t\tif not r1:\n\t\t\tlog.info(r'<Check_2 Error> Alphabet text but not NoPinYin : %s', self._dicItem.get_str())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99119:Expr_L75_C2", "label": "expression", "type": "expression", "loc": [75, 76], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99119:FunctionDef_L74_C1", "vector": [8, 2, 0.5763, 0.0153, 2, 0.33, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\"\"\"Check pinyin.\n\t\t\"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99119:Assign_L77_C2", "label": "d =", "type": "assigned_variable", "loc": [77, 77], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99119:FunctionDef_L74_C1", "vector": [14, 2, 0.5878, 0.0076, 2, 0.33, 0.1667, 355, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "d", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\td = self._dicItem"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99119:Assign_L78_C2", "label": "r1 = _check_2_1()", "type": "assigned_variable", "loc": [78, 78], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99119:FunctionDef_L74_C1", "vector": [14, 2, 0.5954, 0.0076, 2, 0.33, 0.3333, 648, 3, 0, 0, 0, 474, 10, 1], "semantic": {"name": "r1", "arg_names": [], "import_names": [], "rhs_call_name": "_check_2_1", "annotation": ""}, "snippet": "\t\tr1 = self._check_2_1()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99119:Assign_L79_C2", "label": "r2 = _check_2_2()", "type": "assigned_variable", "loc": [79, 79], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99119:FunctionDef_L74_C1", "vector": [14, 2, 0.6031, 0.0076, 2, 0.33, 0.5, 959, 3, 0, 0, 0, 16, 10, 1], "semantic": {"name": "r2", "arg_names": [], "import_names": [], "rhs_call_name": "_check_2_2", "annotation": ""}, "snippet": "\t\tr2 = self._check_2_2();"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99119:If_L80_C2", "label": "if", "type": "if", "loc": [80, 82], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99119:FunctionDef_L74_C1", "vector": [4, 2, 0.6183, 0.0229, 2, 0.33, 0.6667, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tif not r1:\n\t\t\tlog.info(r'<Check_2 Error> Alphabet text but not NoPinYin : %s', self._dicItem.get_str())\n\t\t\treturn False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99119:Expr_L81_C3", "label": "info()", "type": "expression", "loc": [81, 81], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99119:If_L80_C2", "vector": [8, 3, 0.6183, 0.0076, 3, 0.49, 0.0, 730, 3, 2, 0, 0, 0, 0, 2], "semantic": {"name": "info", "arg_names": [], "import_names": [], "rhs_call_name": "info", "annotation": ""}, "snippet": "\t\t\tlog.info(r'<Check_2 Error> Alphabet text but not NoPinYin : %s', self._dicItem.get_str())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99119:Return_L82_C3", "label": "return", "type": "return", "loc": [82, 82], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99119:If_L80_C2", "vector": [13, 3, 0.626, 0.0076, 3, 0.49, 1.0, 0, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\treturn False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99119:If_L83_C2", "label": "if", "type": "if", "loc": [83, 85], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99119:FunctionDef_L74_C1", "vector": [4, 2, 0.6412, 0.0229, 2, 0.33, 0.8333, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tif not r2:\n\t\t\tlog.info(r'<Check_2 Error> Pinyin contains other characters : %s', self._dicItem.get_str())\n\t\t\treturn False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99119:Expr_L84_C3", "label": "info()", "type": "expression", "loc": [84, 84], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99119:If_L83_C2", "vector": [8, 3, 0.6412, 0.0076, 3, 0.48, 0.0, 730, 3, 2, 0, 0, 0, 0, 2], "semantic": {"name": "info", "arg_names": [], "import_names": [], "rhs_call_name": "info", "annotation": ""}, "snippet": "\t\t\tlog.info(r'<Check_2 Error> Pinyin contains other characters : %s', self._dicItem.get_str())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99119:Return_L85_C3", "label": "return", "type": "return", "loc": [85, 85], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99119:If_L83_C2", "vector": [13, 3, 0.6489, 0.0076, 3, 0.48, 1.0, 0, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\treturn False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99119:Return_L86_C2", "label": "return", "type": "return", "loc": [86, 86], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99119:FunctionDef_L74_C1", "vector": [13, 2, 0.6565, 0.0076, 2, 0.33, 1.0, 0, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\treturn True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99119:FunctionDef_L88_C1", "label": "_check_2_1", "type": "function", "loc": [88, 99], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99119:ClassDef_L58_C0", "vector": [2, 1, 0.7137, 0.0916, 1, 0.14, 0.8333, 474, 0, 1, 1, 0, 0, 0, 1], "semantic": {"name": "_check_2_1", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tdef _check_2_1(self):\n\t\t\"\"\"Check if text has alphabet, then pinyin should be \"NoPinYin\".\n\t\t\"\"\"\n\t\tdef has_alphabet(s):\n\t\t\tfor c in s:\n\t\t\t\tif c in self.alphabets:\n\t\t\t\t\treturn True\n\t\t\treturn False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99119:Expr_L89_C2", "label": "expression", "type": "expression", "loc": [89, 90], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99119:FunctionDef_L88_C1", "vector": [8, 2, 0.6832, 0.0153, 2, 0.94, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\"\"\"Check if text has alphabet, then pinyin should be \"NoPinYin\".\n\t\t\"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99119:FunctionDef_L91_C2", "label": "has_alphabet", "type": "function", "loc": [91, 95], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99119:FunctionDef_L88_C1", "vector": [2, 2, 0.7099, 0.0382, 2, 0.94, 0.3333, 135, 0, 1, 1, 0, 0, 0, 0], "semantic": {"name": "has_alphabet", "arg_names": ["s"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tdef has_alphabet(s):\n\t\t\tfor c in s:\n\t\t\t\tif c in self.alphabets:\n\t\t\t\t\treturn True\n\t\t\treturn False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99119:For_L92_C3", "label": "for c", "type": "for", "loc": [92, 94], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99119:FunctionDef_L91_C2", "vector": [6, 3, 0.7099, 0.0229, 3, 0.67, 0.0, 411, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "c", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\tfor c in s:\n\t\t\t\tif c in self.alphabets:\n\t\t\t\t\treturn True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99119:If_L93_C4", "label": "if", "type": "if", "loc": [93, 94], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99119:For_L92_C3", "vector": [4, 4, 0.7137, 0.0153, 4, 0.68, 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 c in self.alphabets:\n\t\t\t\t\treturn True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99119:Return_L94_C5", "label": "return", "type": "return", "loc": [94, 94], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99119:If_L93_C4", "vector": [13, 5, 0.7176, 0.0076, 5, 0.27, 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\treturn True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99119:Return_L95_C3", "label": "return", "type": "return", "loc": [95, 95], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99119:FunctionDef_L91_C2", "vector": [13, 3, 0.7252, 0.0076, 3, 0.67, 1.0, 0, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\treturn False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99119:If_L96_C2", "label": "if", "type": "if", "loc": [96, 98], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99119:FunctionDef_L88_C1", "vector": [4, 2, 0.7405, 0.0229, 2, 0.94, 0.6667, 0, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tif has_alphabet(self._dicItem['name']):\n\t\t\tif self._dicItem['pinyin'] != u'NoPinYin':\n\t\t\t\treturn False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99119:If_L97_C3", "label": "if", "type": "if", "loc": [97, 98], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99119:If_L96_C2", "vector": [4, 3, 0.7443, 0.0153, 3, 0.86, 0.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\tif self._dicItem['pinyin'] != u'NoPinYin':\n\t\t\t\treturn False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99119:Return_L98_C4", "label": "return", "type": "return", "loc": [98, 98], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99119:If_L97_C3", "vector": [13, 4, 0.7481, 0.0076, 4, 0.13, 0.0, 0, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\t\treturn False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99119:Return_L99_C2", "label": "return", "type": "return", "loc": [99, 99], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99119:FunctionDef_L88_C1", "vector": [13, 2, 0.7557, 0.0076, 2, 0.94, 1.0, 0, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\treturn True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99119:FunctionDef_L101_C1", "label": "_check_2_2", "type": "function", "loc": [101, 110], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99119:ClassDef_L58_C0", "vector": [2, 1, 0.8053, 0.0763, 1, 0.14, 1.0, 16, 0, 1, 1, 0, 0, 0, 0], "semantic": {"name": "_check_2_2", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tdef _check_2_2(self):\n\t\t\"\"\"Check characters in pinyin.\n\t\t\"\"\"\n\t\tpinyin = self._dicItem['pinyin']\n\t\tif pinyin == 'NoPinYin':\n\t\t\treturn True\n\t\tfor c in pinyin:\n\t\t\tif not c in self.pinyinChars:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99119:Expr_L102_C2", "label": "expression", "type": "expression", "loc": [102, 103], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99119:FunctionDef_L101_C1", "vector": [8, 2, 0.7824, 0.0153, 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\"\"\"Check characters in pinyin.\n\t\t\"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99119:Assign_L104_C2", "label": "pinyin =", "type": "assigned_variable", "loc": [104, 104], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99119:FunctionDef_L101_C1", "vector": [14, 2, 0.7939, 0.0076, 2, 0.99, 0.25, 546, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "pinyin", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tpinyin = self._dicItem['pinyin']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99119:If_L105_C2", "label": "if", "type": "if", "loc": [105, 106], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99119:FunctionDef_L101_C1", "vector": [4, 2, 0.8053, 0.0153, 2, 0.99, 0.5, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tif pinyin == 'NoPinYin':\n\t\t\treturn True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99119:Return_L106_C3", "label": "return", "type": "return", "loc": [106, 106], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99119:If_L105_C2", "vector": [13, 3, 0.8092, 0.0076, 3, 0.27, 0.0, 0, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\treturn True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99119:For_L107_C2", "label": "for c", "type": "for", "loc": [107, 109], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99119:FunctionDef_L101_C1", "vector": [6, 2, 0.8244, 0.0229, 2, 0.99, 0.75, 411, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "c", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tfor c in pinyin:\n\t\t\tif not c in self.pinyinChars:\n\t\t\t\treturn False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99119:If_L108_C3", "label": "if", "type": "if", "loc": [108, 109], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99119:For_L107_C2", "vector": [4, 3, 0.8282, 0.0153, 3, 0.84, 0.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\tif not c in self.pinyinChars:\n\t\t\t\treturn False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99119:Return_L109_C4", "label": "return", "type": "return", "loc": [109, 109], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99119:If_L108_C3", "vector": [13, 4, 0.8321, 0.0076, 4, 0.06, 0.0, 0, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\t\treturn False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99119:Return_L110_C2", "label": "return", "type": "return", "loc": [110, 110], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99119:FunctionDef_L101_C1", "vector": [13, 2, 0.8397, 0.0076, 2, 0.99, 1.0, 0, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\treturn True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99119:FunctionDef_L112_C0", "label": "check", "type": "function", "loc": [112, 123], "level": 0, "parent": null, "vector": [2, 0, 0.8969, 0.0916, 0, 0.66, 0.9, 803, 0, 1, 1, 0, 0, 0, 9], "semantic": {"name": "check", "arg_names": ["filename"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def check(filename):\n\t\"\"\"Check records in file.\n\t\"\"\"\n\tf = codecs.open(filename, 'r', 'gbk')\n\ttry:\n\t\tls = f.readlines()\n\texcept:\n\t\tlog.info(r'<Check Encoding Error> Contain non-GBK character : %s', self._dicItem.get_str())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99119:Expr_L113_C1", "label": "expression", "type": "expression", "loc": [113, 114], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99119:FunctionDef_L112_C0", "vector": [8, 1, 0.8664, 0.0153, 1, 0.17, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\"\"\"Check records in file.\n\t\"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99119:Assign_L115_C1", "label": "f = open()", "type": "assigned_variable", "loc": [115, 115], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99119:FunctionDef_L112_C0", "vector": [14, 1, 0.8779, 0.0076, 1, 0.17, 0.2, 899, 3, 3, 0, 0, 693, 10, 1], "semantic": {"name": "f", "arg_names": [], "import_names": [], "rhs_call_name": "open", "annotation": ""}, "snippet": "\tf = codecs.open(filename, 'r', 'gbk')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99119:Try_L116_C1", "label": "try", "type": "try", "loc": [116, 120], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99119:FunctionDef_L112_C0", "vector": [7, 1, 0.9008, 0.0382, 1, 0.17, 0.4, 0, 0, 1, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\ttry:\n\t\tls = f.readlines()\n\texcept:\n\t\tlog.info(r'<Check Encoding Error> Contain non-GBK character : %s', self._dicItem.get_str())\n\t\treturn False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99119:Assign_L117_C2", "label": "ls = readlines()", "type": "assigned_variable", "loc": [117, 117], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99119:Try_L116_C1", "vector": [14, 2, 0.8931, 0.0076, 2, 0.3, 0.0, 174, 3, 0, 0, 0, 841, 10, 1], "semantic": {"name": "ls", "arg_names": [], "import_names": [], "rhs_call_name": "readlines", "annotation": ""}, "snippet": "\t\tls = f.readlines()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99119:Expr_L119_C2", "label": "info()", "type": "expression", "loc": [119, 119], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99119:Try_L116_C1", "vector": [8, 2, 0.9084, 0.0076, 2, 0.3, 0.0, 730, 3, 2, 0, 0, 0, 0, 2], "semantic": {"name": "info", "arg_names": [], "import_names": [], "rhs_call_name": "info", "annotation": ""}, "snippet": "\t\tlog.info(r'<Check Encoding Error> Contain non-GBK character : %s', self._dicItem.get_str())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99119:Return_L120_C2", "label": "return", "type": "return", "loc": [120, 120], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99119:Try_L116_C1", "vector": [13, 2, 0.916, 0.0076, 2, 0.3, 1.0, 0, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\treturn False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99119:Assign_L121_C1", "label": "rds = tuple()", "type": "assigned_variable", "loc": [121, 121], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99119:FunctionDef_L112_C0", "vector": [14, 1, 0.9237, 0.0076, 1, 0.17, 0.6, 985, 3, 1, 0, 0, 259, 10, 2], "semantic": {"name": "rds", "arg_names": [], "import_names": [], "rhs_call_name": "tuple", "annotation": ""}, "snippet": "\trds = tuple(DicItemA(line) for line in ls)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99119:Assign_L122_C1", "label": "r = tuple()", "type": "assigned_variable", "loc": [122, 122], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99119:FunctionDef_L112_C0", "vector": [14, 1, 0.9313, 0.0076, 1, 0.17, 0.8, 436, 3, 1, 0, 0, 259, 10, 2], "semantic": {"name": "r", "arg_names": [], "import_names": [], "rhs_call_name": "tuple", "annotation": ""}, "snippet": "\tr = tuple(r.check() for r in rds)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99119:Return_L123_C1", "label": "return", "type": "return", "loc": [123, 123], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99119:FunctionDef_L112_C0", "vector": [13, 1, 0.9389, 0.0076, 1, 0.17, 1.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\treturn all(r)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99119:FunctionDef_L125_C0", "label": "main", "type": "function", "loc": [125, 131], "level": 0, "parent": null, "vector": [2, 0, 0.9771, 0.0534, 0, 0.66, 1.0, 624, 0, 0, 0, 0, 0, 0, 5], "semantic": {"name": "main", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def main():\n\tif len(sys.argv) != 2:\n\t\tprint('Usage:')\n\t\tprint(r'python check.py [Filepath of A000000.txt]')\n\t\tsys.exit(0)\n\tfilename = sys.argv[1]\n\tcheck(filename)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99119:If_L126_C1", "label": "if", "type": "if", "loc": [126, 129], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99119:FunctionDef_L125_C0", "vector": [4, 1, 0.9733, 0.0305, 1, 0.48, 0.0, 0, 0, 0, 0, 0, 0, 0, 4], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tif len(sys.argv) != 2:\n\t\tprint('Usage:')\n\t\tprint(r'python check.py [Filepath of A000000.txt]')\n\t\tsys.exit(0)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99119:Expr_L127_C2", "label": "print()", "type": "expression", "loc": [127, 127], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99119:If_L126_C1", "vector": [8, 2, 0.9695, 0.0076, 2, 0.97, 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('Usage:')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99119:Expr_L128_C2", "label": "print()", "type": "expression", "loc": [128, 128], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99119:If_L126_C1", "vector": [8, 2, 0.9771, 0.0076, 2, 0.97, 0.5, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": "\t\tprint(r'python check.py [Filepath of A000000.txt]')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99119:Expr_L129_C2", "label": "exit()", "type": "expression", "loc": [129, 129], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99119:If_L126_C1", "vector": [8, 2, 0.9847, 0.0076, 2, 0.97, 1.0, 436, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "exit", "arg_names": [], "import_names": [], "rhs_call_name": "exit", "annotation": ""}, "snippet": "\t\tsys.exit(0)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99119:Assign_L130_C1", "label": "filename =", "type": "assigned_variable", "loc": [130, 130], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99119:FunctionDef_L125_C0", "vector": [14, 1, 0.9924, 0.0076, 1, 0.48, 0.5, 275, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "filename", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tfilename = sys.argv[1]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99119:Expr_L131_C1", "label": "check()", "type": "expression", "loc": [131, 131], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99119:FunctionDef_L125_C0", "vector": [8, 1, 1.0, 0.0076, 1, 0.48, 1.0, 803, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "check", "arg_names": [], "import_names": [], "rhs_call_name": "check", "annotation": ""}, "snippet": "\tcheck(filename)"}]
[{"f": "ajibawa-2023/Python-Code-Large/train/row_99119:ClassDef_L16_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99119:FunctionDef_L17_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99119:FunctionDef_L17_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99119:Assign_L18_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99119:FunctionDef_L17_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99119:Assign_L19_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99119:FunctionDef_L17_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99119:Assign_L20_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99119:FunctionDef_L17_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99119:If_L23_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99119:If_L23_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99119:Expr_L24_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99119:If_L23_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99119:Return_L25_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99119:FunctionDef_L17_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99119:Assign_L26_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99119:FunctionDef_L17_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99119:Assign_L27_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99119:FunctionDef_L17_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99119:Assign_L28_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99119:FunctionDef_L17_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99119:Assign_L29_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99119:FunctionDef_L17_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99119:Assign_L30_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99119:ClassDef_L16_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99119:FunctionDef_L32_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99119:FunctionDef_L32_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99119:Return_L33_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99119:ClassDef_L16_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99119:FunctionDef_L35_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99119:FunctionDef_L35_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99119:If_L36_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99119:If_L36_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99119:Return_L37_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99119:If_L36_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99119:If_L38_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99119:If_L38_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99119:Return_L39_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99119:If_L38_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99119:If_L40_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99119:If_L40_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99119:Return_L41_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99119:If_L40_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99119:If_L42_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99119:If_L42_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99119:Return_L43_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99119:If_L42_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99119:If_L44_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99119:If_L44_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99119:Return_L45_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99119:ClassDef_L16_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99119:FunctionDef_L49_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99119:FunctionDef_L49_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99119:Expr_L50_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99119:FunctionDef_L49_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99119:Assign_L52_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99119:FunctionDef_L49_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99119:Assign_L53_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99119:FunctionDef_L49_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99119:If_L54_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99119:If_L54_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99119:Expr_L55_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99119:FunctionDef_L49_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99119:Return_L56_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99119:ClassDef_L58_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99119:Assign_L59_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99119:ClassDef_L58_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99119:FunctionDef_L61_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99119:FunctionDef_L61_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99119:Assign_L62_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99119:ClassDef_L58_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99119:FunctionDef_L64_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99119:FunctionDef_L64_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99119:Assign_L65_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99119:FunctionDef_L64_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99119:Assign_L66_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99119:FunctionDef_L64_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99119:Return_L67_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99119:ClassDef_L58_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99119:FunctionDef_L69_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99119:FunctionDef_L69_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99119:Expr_L70_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99119:FunctionDef_L69_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99119:Return_L72_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99119:ClassDef_L58_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99119:FunctionDef_L74_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99119:FunctionDef_L74_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99119:Expr_L75_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99119:FunctionDef_L74_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99119:Assign_L77_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99119:FunctionDef_L74_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99119:Assign_L78_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99119:FunctionDef_L74_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99119:Assign_L79_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99119:FunctionDef_L74_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99119:If_L80_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99119:If_L80_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99119:Expr_L81_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99119:If_L80_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99119:Return_L82_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99119:FunctionDef_L74_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99119:If_L83_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99119:If_L83_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99119:Expr_L84_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99119:If_L83_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99119:Return_L85_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99119:FunctionDef_L74_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99119:Return_L86_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99119:ClassDef_L58_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99119:FunctionDef_L88_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99119:FunctionDef_L88_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99119:Expr_L89_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99119:FunctionDef_L88_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99119:FunctionDef_L91_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99119:FunctionDef_L91_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99119:For_L92_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99119:For_L92_C3", "t": "ajibawa-2023/Python-Code-Large/train/row_99119:If_L93_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99119:If_L93_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99119:Return_L94_C5"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99119:FunctionDef_L91_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99119:Return_L95_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99119:FunctionDef_L88_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99119:If_L96_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99119:If_L96_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99119:If_L97_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99119:If_L97_C3", "t": "ajibawa-2023/Python-Code-Large/train/row_99119:Return_L98_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99119:FunctionDef_L88_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99119:Return_L99_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99119:ClassDef_L58_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99119:FunctionDef_L101_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99119:FunctionDef_L101_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99119:Expr_L102_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99119:FunctionDef_L101_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99119:Assign_L104_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99119:FunctionDef_L101_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99119:If_L105_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99119:If_L105_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99119:Return_L106_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99119:FunctionDef_L101_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99119:For_L107_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99119:For_L107_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99119:If_L108_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99119:If_L108_C3", "t": "ajibawa-2023/Python-Code-Large/train/row_99119:Return_L109_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99119:FunctionDef_L101_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99119:Return_L110_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99119:FunctionDef_L112_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99119:Expr_L113_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99119:FunctionDef_L112_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99119:Assign_L115_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99119:FunctionDef_L112_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99119:Try_L116_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99119:Try_L116_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99119:Assign_L117_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99119:Try_L116_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99119:Expr_L119_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99119:Try_L116_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99119:Return_L120_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99119:FunctionDef_L112_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99119:Assign_L121_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99119:FunctionDef_L112_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99119:Assign_L122_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99119:FunctionDef_L112_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99119:Return_L123_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99119:FunctionDef_L125_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99119:If_L126_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99119:If_L126_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99119:Expr_L127_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99119:If_L126_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99119:Expr_L128_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99119:If_L126_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99119:Expr_L129_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99119:FunctionDef_L125_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99119:Assign_L130_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99119:FunctionDef_L125_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99119:Expr_L131_C1"}]
#!/usr/bin/env python # coding=utf-8 import glob import codecs import random # Keep KEEP_LINES_NUMBER lines in each *.txt KEEP_LINES_NUMBER = 3 def main(): # get filename list filenameList = tuple(glob.glob(r'*.txt')) dicIdList = tuple(fn[:8] for fn in filenameList) # make LoopBack.cfg file loopBackCfg = open('LoopBack.cfg', 'w') for dicId in dicIdList: loopBackCfg.write('CHN\t%s\n'%(dicId,)) loopBackCfg.close() # create *.DicID file for dicId in dicIdList: dicIdFile = open(dicId + '.DicID', 'w') dicIdFile.write('0x' + dicId + '\n') dicIdFile.close() # keep several lines in each *.txt for fn in filenameList: f = codecs.open(fn, 'r', 'gbk') lines = list(f.readlines()) f.close() random.shuffle(lines) f = codecs.open(fn, 'w', 'gbk') f.writelines(lines[:KEEP_LINES_NUMBER]) f.close() if __name__ == '__main__': main()
ajibawa-2023/Python-Code-Large/train/row_99120
25
40
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_99120:Import_L4_C0", "label": "glob import glob", "type": "import", "loc": [4, 4], "level": 0, "parent": null, "vector": [1, 0, 0.1, 0.025, 0, 0.66, 0.0, 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_99120:Import_L5_C0", "label": "codecs import codecs", "type": "import", "loc": [5, 5], "level": 0, "parent": null, "vector": [1, 0, 0.125, 0.025, 0, 0.66, 0.2, 220, 0, 1, 0, 0, 220, 0, 0], "semantic": {"name": "codecs", "arg_names": [], "import_names": ["codecs"], "rhs_call_name": "", "annotation": ""}, "snippet": "import codecs"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99120:Import_L6_C0", "label": "random import random", "type": "import", "loc": [6, 6], "level": 0, "parent": null, "vector": [1, 0, 0.15, 0.025, 0, 0.66, 0.4, 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_99120:Assign_L9_C0", "label": "KEEP_LINES_NUMBER =", "type": "assigned_variable", "loc": [9, 9], "level": 0, "parent": null, "vector": [14, 0, 0.225, 0.025, 0, 0.66, 0.6, 885, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "KEEP_LINES_NUMBER", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "KEEP_LINES_NUMBER = 3"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99120:FunctionDef_L11_C0", "label": "main", "type": "function", "loc": [11, 36], "level": 0, "parent": null, "vector": [2, 0, 0.5875, 0.65, 0, 0.66, 0.8, 624, 0, 0, 0, 0, 0, 0, 17], "semantic": {"name": "main", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def main():\n\t# get filename list\n\tfilenameList = tuple(glob.glob(r'*.txt'))\n\tdicIdList = tuple(fn[:8] for fn in filenameList)\n\n\t# make LoopBack.cfg file\n\tloopBackCfg = open('LoopBack.cfg', 'w')\n\tfor dicId in dicIdList:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99120:Assign_L13_C1", "label": "filenameList = tuple()", "type": "assigned_variable", "loc": [13, 13], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99120:FunctionDef_L11_C0", "vector": [14, 1, 0.325, 0.025, 1, 0.93, 0.0, 562, 3, 1, 0, 0, 259, 10, 2], "semantic": {"name": "filenameList", "arg_names": [], "import_names": [], "rhs_call_name": "tuple", "annotation": ""}, "snippet": "\tfilenameList = tuple(glob.glob(r'*.txt'))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99120:Assign_L14_C1", "label": "dicIdList = tuple()", "type": "assigned_variable", "loc": [14, 14], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99120:FunctionDef_L11_C0", "vector": [14, 1, 0.35, 0.025, 1, 0.93, 0.1667, 876, 3, 1, 0, 0, 259, 10, 1], "semantic": {"name": "dicIdList", "arg_names": [], "import_names": [], "rhs_call_name": "tuple", "annotation": ""}, "snippet": "\tdicIdList = tuple(fn[:8] for fn in filenameList)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99120:Assign_L17_C1", "label": "loopBackCfg = open()", "type": "assigned_variable", "loc": [17, 17], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99120:FunctionDef_L11_C0", "vector": [14, 1, 0.425, 0.025, 1, 0.93, 0.3333, 642, 3, 2, 0, 0, 693, 10, 1], "semantic": {"name": "loopBackCfg", "arg_names": [], "import_names": [], "rhs_call_name": "open", "annotation": ""}, "snippet": "\tloopBackCfg = open('LoopBack.cfg', 'w')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99120:For_L18_C1", "label": "for dicId", "type": "for", "loc": [18, 19], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99120:FunctionDef_L11_C0", "vector": [6, 1, 0.4625, 0.05, 1, 0.93, 0.5, 40, 2, 0, 0, 0, 0, 0, 1], "semantic": {"name": "dicId", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tfor dicId in dicIdList:\n\t\tloopBackCfg.write('CHN\\t%s\\n'%(dicId,))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99120:Expr_L19_C2", "label": "write()", "type": "expression", "loc": [19, 19], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99120:For_L18_C1", "vector": [8, 2, 0.475, 0.025, 2, 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": "\t\tloopBackCfg.write('CHN\\t%s\\n'%(dicId,))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99120:Expr_L20_C1", "label": "close()", "type": "expression", "loc": [20, 20], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99120:FunctionDef_L11_C0", "vector": [8, 1, 0.5, 0.025, 1, 0.93, 0.6667, 77, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "close", "arg_names": [], "import_names": [], "rhs_call_name": "close", "annotation": ""}, "snippet": "\tloopBackCfg.close()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99120:For_L23_C1", "label": "for dicId", "type": "for", "loc": [23, 26], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99120:FunctionDef_L11_C0", "vector": [6, 1, 0.6125, 0.1, 1, 0.93, 0.8333, 40, 2, 0, 0, 0, 0, 0, 3], "semantic": {"name": "dicId", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tfor dicId in dicIdList:\n\t\tdicIdFile = open(dicId + '.DicID', 'w')\n\t\tdicIdFile.write('0x' + dicId + '\\n')\n\t\tdicIdFile.close()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99120:Assign_L24_C2", "label": "dicIdFile = open()", "type": "assigned_variable", "loc": [24, 24], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99120:For_L23_C1", "vector": [14, 2, 0.6, 0.025, 2, 0.66, 0.0, 765, 3, 2, 0, 0, 693, 10, 1], "semantic": {"name": "dicIdFile", "arg_names": [], "import_names": [], "rhs_call_name": "open", "annotation": ""}, "snippet": "\t\tdicIdFile = open(dicId + '.DicID', 'w')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99120:Expr_L25_C2", "label": "write()", "type": "expression", "loc": [25, 25], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99120:For_L23_C1", "vector": [8, 2, 0.625, 0.025, 2, 0.66, 0.5, 837, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "write", "arg_names": [], "import_names": [], "rhs_call_name": "write", "annotation": ""}, "snippet": "\t\tdicIdFile.write('0x' + dicId + '\\n')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99120:Expr_L26_C2", "label": "close()", "type": "expression", "loc": [26, 26], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99120:For_L23_C1", "vector": [8, 2, 0.65, 0.025, 2, 0.66, 1.0, 77, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "close", "arg_names": [], "import_names": [], "rhs_call_name": "close", "annotation": ""}, "snippet": "\t\tdicIdFile.close()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99120:For_L29_C1", "label": "for fn", "type": "for", "loc": [29, 36], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99120:FunctionDef_L11_C0", "vector": [6, 1, 0.8125, 0.2, 1, 0.93, 1.0, 59, 2, 0, 0, 0, 0, 0, 8], "semantic": {"name": "fn", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tfor fn in filenameList:\n\t\tf = codecs.open(fn, 'r', 'gbk')\n\t\tlines = list(f.readlines())\n\t\tf.close()\n\t\trandom.shuffle(lines)\n\t\tf = codecs.open(fn, 'w', 'gbk')\n\t\tf.writelines(lines[:KEEP_LINES_NUMBER])\n\t\tf.close()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99120:Assign_L30_C2", "label": "f = open()", "type": "assigned_variable", "loc": [30, 30], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99120:For_L29_C1", "vector": [14, 2, 0.75, 0.025, 2, 0.75, 0.0, 899, 3, 3, 0, 0, 693, 10, 1], "semantic": {"name": "f", "arg_names": [], "import_names": [], "rhs_call_name": "open", "annotation": ""}, "snippet": "\t\tf = codecs.open(fn, 'r', 'gbk')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99120:Assign_L31_C2", "label": "lines = list()", "type": "assigned_variable", "loc": [31, 31], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99120:For_L29_C1", "vector": [14, 2, 0.775, 0.025, 2, 0.75, 0.1667, 73, 3, 1, 0, 0, 430, 10, 2], "semantic": {"name": "lines", "arg_names": [], "import_names": [], "rhs_call_name": "list", "annotation": ""}, "snippet": "\t\tlines = list(f.readlines())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99120:Expr_L32_C2", "label": "close()", "type": "expression", "loc": [32, 32], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99120:For_L29_C1", "vector": [8, 2, 0.8, 0.025, 2, 0.75, 0.3333, 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_99120:Expr_L33_C2", "label": "shuffle()", "type": "expression", "loc": [33, 33], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99120:For_L29_C1", "vector": [8, 2, 0.825, 0.025, 2, 0.75, 0.5, 903, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "shuffle", "arg_names": [], "import_names": [], "rhs_call_name": "shuffle", "annotation": ""}, "snippet": "\t\trandom.shuffle(lines)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99120:Assign_L34_C2", "label": "f = open()", "type": "assigned_variable", "loc": [34, 34], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99120:For_L29_C1", "vector": [14, 2, 0.85, 0.025, 2, 0.75, 0.6667, 899, 3, 3, 0, 0, 693, 10, 1], "semantic": {"name": "f", "arg_names": [], "import_names": [], "rhs_call_name": "open", "annotation": ""}, "snippet": "\t\tf = codecs.open(fn, 'w', 'gbk')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99120:Expr_L35_C2", "label": "writelines()", "type": "expression", "loc": [35, 35], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99120:For_L29_C1", "vector": [8, 2, 0.875, 0.025, 2, 0.75, 0.8333, 290, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "writelines", "arg_names": [], "import_names": [], "rhs_call_name": "writelines", "annotation": ""}, "snippet": "\t\tf.writelines(lines[:KEEP_LINES_NUMBER])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99120:Expr_L36_C2", "label": "close()", "type": "expression", "loc": [36, 36], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99120:For_L29_C1", "vector": [8, 2, 0.9, 0.025, 2, 0.75, 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_99120:If_L38_C0", "label": "if", "type": "if", "loc": [38, 39], "level": 0, "parent": null, "vector": [4, 0, 0.9625, 0.05, 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\tmain()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99120:Expr_L39_C1", "label": "main()", "type": "expression", "loc": [39, 39], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99120:If_L38_C0", "vector": [8, 1, 0.975, 0.025, 1, 0.5, 0.0, 624, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "main", "arg_names": [], "import_names": [], "rhs_call_name": "main", "annotation": ""}, "snippet": "\tmain()"}]
[{"f": "ajibawa-2023/Python-Code-Large/train/row_99120:FunctionDef_L11_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99120:Assign_L13_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99120:FunctionDef_L11_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99120:Assign_L14_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99120:FunctionDef_L11_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99120:Assign_L17_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99120:FunctionDef_L11_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99120:For_L18_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99120:For_L18_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99120:Expr_L19_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99120:FunctionDef_L11_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99120:Expr_L20_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99120:FunctionDef_L11_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99120:For_L23_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99120:For_L23_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99120:Assign_L24_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99120:For_L23_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99120:Expr_L25_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99120:For_L23_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99120:Expr_L26_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99120:FunctionDef_L11_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99120:For_L29_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99120:For_L29_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99120:Assign_L30_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99120:For_L29_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99120:Assign_L31_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99120:For_L29_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99120:Expr_L32_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99120:For_L29_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99120:Expr_L33_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99120:For_L29_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99120:Assign_L34_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99120:For_L29_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99120:Expr_L35_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99120:For_L29_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99120:Expr_L36_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99120:If_L38_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99120:Expr_L39_C1"}]
#!/usr/bin/env python # coding: utf-8 import os,sys import re import glob import shutil SECTIONS = { 'habitation': ( r'#street name dictionary start', r'#district name dictionary end' ), 'num1':( r'#1 digit number dictionary start', r'#1 digit number dictionary end' ), 'num3':( r'#3 digit number dictionary start', r'#3 digit number dictionary end' ), 'num4':( r'#4 digit number dictionary start', r'#4 digit number dictionary end' ), 'num5':( r'#5 digit number dictionary start', r'#5 digit number dictionary end' ), 'landline':( r'#landline dictionary start', r'#landline dictionary end' ), 'mobile_phone_number':( r'#mobile phone number(13digit) dictionary start', r'#mobile phone number(13digit) dictionary end' ), 'landline1':( r'#landline1 dictionary start', r'#landline1 dictionary end' ), 'num34':( r'#3 or 4 digit number dictionary start', r'#3 or 4 digit number dictionary end' ), 'num345':( r'#3,4,5 Digit dictionary start', r'#3,4,5 Digit dictionary end' ), 'num789':( r'#7,8,9 Digit dictionary start', r'#7,8,9 Digit dictionary end' ), 'num101112':( r'#10,11,12 Digit dictionary start', r'#10,11,12 Digit dictionary end' ) } START_LINE = r'#street name dictionary start' END_LINE = r'#district name dictionary end' target_dir_no = {'Beijing':0, 'Gan':50, 'Kejia':40, 'Min':10, 'Wu':30, 'Xiang':60, 'Yue':20} class CannotFindError(Exception): pass def WriteCtlFile(ctlpath, ctlfn, tplfn, startLineC, endLineC): # get A:str A = ctlpath # lines from template.ctl ctllines = open(tplfn).readlines() # get B:int, C:str r = re.match(r'speaker(\d{1,2})([^.]*)\.ctl', ctlfn) B = r.groups()[0] B = int(B) C = r.groups()[1] # delete lines all_start_lino = FindLino(ctllines, r'user\s*edit\s*section\s*start') all_end_lino = FindLino(ctllines, r'user\s*edit\s*section\s*end') st_lino = FindLino(ctllines, startLineC) end_lino = FindLino(ctllines, endLineC) ctllines[end_lino+1:all_end_lino]=[] ctllines[all_start_lino+1:st_lino]=[] # process lines st_lino = FindLino(ctllines, startLineC) end_lino = FindLino(ctllines, endLineC) for n in range(st_lino, end_lino): # need process determine sline = ctllines[n] r = re.match( r'\s*Reco\s*\(\s*speaker(\d+)_unicode[^\)]*\)\s*\.\.\\([^\\]+)\\([^\\]+)\\([^\\]*)\\', sline) if r: # make D:int, E:str, F:str, G:str D = r.groups()[0] D = int(D) E = A F = B + target_dir_no[A] F = str(F).zfill(3) G = "C1" if C=="" else C[1:] if 1<=B<=5: D = B elif 6<=B<=10: D = B-5 sline = re.sub(r'\.\.\\[^\\]+\\[^\\]+\\[^\\]+\\', r'..\\' + E + r'\\' + F + r'\\' + G + r'\\', sline) sline = re.sub(r'(?<=speaker)\d*(?=_unicode)', str(D), sline) ctllines[n] = sline # write to file of = open(ctlpath+'\\'+ctlfn,'w') of.writelines(ctllines) of.close() def FindLino(lines, s): for n in range(len(lines)): if lines[n].find(s)>=0: return n for n in range(len(lines)): if re.search(s,lines[n]): return n raise CannotFindError() def ProcSectionFiles(sn): LogPrint(r'processing section: '+ sn) for dir in target_dir_no.keys(): for fn in glob.glob(dir + r'\*.ctl'): LogPrint(fn) WriteCtlFile(dir, fn.split('\\')[1], r'template.ctl', SECTIONS[sn][0], SECTIONS[sn][1]) def RunEvalVoice(): os.system(r'Go_All.bat') # copy .res file to ResArchive\ def PlaceRes(sn): res_ar_fold = "ResArchive" if not os.path.exists(res_ar_fold): os.mkdir(res_ar_fold) if not os.path.exists(os.path.join(res_ar_fold, sn)): os.mkdir( os.path.join(res_ar_fold, sn)) for fres in glob.glob(r'*\*.res'): foldn = fres.split('\\')[0] filen = fres.split('\\')[1] if not os.path.exists(os.path.join(res_ar_fold, sn, foldn)): os.mkdir(os.path.join(res_ar_fold, sn, foldn)) shutil.move(fres, os.path.join(res_ar_fold, sn, fres)) LogPrint( "move " + fres + " to " + os.path.join(res_ar_fold, sn, fres)) for flog in glob.glob(r'*\*.log'): foldn = flog.split('\\')[0] filen = flog.split('\\')[1] if not os.path.exists(os.path.join(res_ar_fold, sn, foldn)): os.mkdir(os.path.join(res_ar_fold, sn, foldn)) shutil.move(flog, os.path.join(res_ar_fold, sn, flog)) LogPrint( "move " + flog + " to " + os.path.join(res_ar_fold, sn, flog)) for fctl in glob.glob(r'*\*.ctl'): foldn = fctl.split('\\')[0] filen = fctl.split('\\')[1] if not os.path.exists(os.path.join(res_ar_fold, sn, foldn)): os.mkdir(os.path.join(res_ar_fold, sn, foldn)) shutil.copyfile(fctl, os.path.join(res_ar_fold, sn, fctl)) LogPrint( "copy " + fctl + " to " + os.path.join(res_ar_fold, sn, fctl)) LOG_FILE = open('ProcCtl.log', 'w') def LogPrint(s): print s print >> LOG_FILE, s def __main__(): for sn in SECTIONS.keys(): ProcSectionFiles(sn) LogPrint('\n\n\n\n') RunEvalVoice() LogPrint('\n\n\n\n') PlaceRes(sn) LogPrint('\n\n\n\n') # PlaceRes(r'habitation') # lines = open(r'template.ctl','r').readlines() # for k in SECTIONS.keys(): # for li in SECTIONS[k]: # print li + r' ==>> ' + str(FindLino(lines, li)) # return # for dir in target_dir_no.keys(): # for fn in glob.glob(dir + r'\*.ctl'): # print fn # WriteCtlFile(dir, fn.split('\\')[1], r'template.ctl', START_LINE, END_LINE) if __name__ == '__main__': __main__()
ajibawa-2023/Python-Code-Large/train/row_99121
99
201
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_99121:Import_L4_C0", "label": "os import os, sys", "type": "import", "loc": [4, 4], "level": 0, "parent": null, "vector": [1, 0, 0.0199, 0.005, 0, 0.66, 0.0, 688, 0, 2, 0, 0, 688, 0, 0], "semantic": {"name": "os", "arg_names": [], "import_names": ["os", "sys"], "rhs_call_name": "", "annotation": ""}, "snippet": "import os,sys"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99121:Import_L5_C0", "label": "re import re", "type": "import", "loc": [5, 5], "level": 0, "parent": null, "vector": [1, 0, 0.0249, 0.005, 0, 0.66, 0.0588, 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_99121:Import_L6_C0", "label": "glob import glob", "type": "import", "loc": [6, 6], "level": 0, "parent": null, "vector": [1, 0, 0.0299, 0.005, 0, 0.66, 0.1176, 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_99121:Import_L7_C0", "label": "shutil import shutil", "type": "import", "loc": [7, 7], "level": 0, "parent": null, "vector": [1, 0, 0.0348, 0.005, 0, 0.66, 0.1765, 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_99121:Assign_L9_C0", "label": "SECTIONS =", "type": "assigned_variable", "loc": [9, 58], "level": 0, "parent": null, "vector": [14, 0, 0.1667, 0.2488, 0, 0.66, 0.2353, 544, 0, 0, 0, 0, 0, 6, 0], "semantic": {"name": "SECTIONS", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "SECTIONS = {\n\t\t'habitation': (\n\t\t\tr'#street name dictionary start',\n\t\t\tr'#district name dictionary end'\n\t\t\t),\n\t\t'num1':(\n\t\t\tr'#1 digit number dictionary start',\n\t\t\tr'#1 digit number dictionary end'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99121:Assign_L60_C0", "label": "START_LINE =", "type": "assigned_variable", "loc": [60, 60], "level": 0, "parent": null, "vector": [14, 0, 0.2985, 0.005, 0, 0.66, 0.2941, 581, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "START_LINE", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "START_LINE = r'#street name dictionary start'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99121:Assign_L61_C0", "label": "END_LINE =", "type": "assigned_variable", "loc": [61, 61], "level": 0, "parent": null, "vector": [14, 0, 0.3035, 0.005, 0, 0.66, 0.3529, 326, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "END_LINE", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "END_LINE = r'#district name dictionary end'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99121:Assign_L62_C0", "label": "target_dir_no =", "type": "assigned_variable", "loc": [62, 62], "level": 0, "parent": null, "vector": [14, 0, 0.3085, 0.005, 0, 0.66, 0.4118, 875, 0, 0, 0, 0, 0, 6, 0], "semantic": {"name": "target_dir_no", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "target_dir_no = {'Beijing':0, 'Gan':50, 'Kejia':40, 'Min':10, 'Wu':30, 'Xiang':60, 'Yue':20}"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99121:ClassDef_L64_C0", "label": "CannotFindError", "type": "class", "loc": [64, 64], "level": 0, "parent": null, "vector": [3, 0, 0.3184, 0.005, 0, 0.66, 0.4706, 337, 0, 0, 0, 0, 645, 0, 0], "semantic": {"name": "CannotFindError", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class CannotFindError(Exception): pass"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99121:FunctionDef_L66_C0", "label": "WriteCtlFile", "type": "function", "loc": [66, 117], "level": 0, "parent": null, "vector": [2, 0, 0.4552, 0.2587, 0, 0.66, 0.5294, 222, 0, 5, 0, 0, 0, 0, 24], "semantic": {"name": "WriteCtlFile", "arg_names": ["ctlpath", "ctlfn", "tplfn", "startLineC", "endLineC"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def WriteCtlFile(ctlpath, ctlfn, tplfn, startLineC, endLineC):\n\t# get A:str\n\tA = ctlpath\n\n\t# lines from template.ctl\n\tctllines = open(tplfn).readlines()\n\n\t# get B:int, C:str"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99121:Assign_L68_C1", "label": "A =", "type": "assigned_variable", "loc": [68, 68], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99121:FunctionDef_L66_C0", "vector": [14, 1, 0.3383, 0.005, 1, 0.06, 0.0, 429, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "A", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tA = ctlpath"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99121:Assign_L71_C1", "label": "ctllines = readlines()", "type": "assigned_variable", "loc": [71, 71], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99121:FunctionDef_L66_C0", "vector": [14, 1, 0.3532, 0.005, 1, 0.06, 0.0588, 805, 3, 0, 0, 0, 841, 10, 2], "semantic": {"name": "ctllines", "arg_names": [], "import_names": [], "rhs_call_name": "readlines", "annotation": ""}, "snippet": "\tctllines = open(tplfn).readlines()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99121:Assign_L74_C1", "label": "r = match()", "type": "assigned_variable", "loc": [74, 74], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99121:FunctionDef_L66_C0", "vector": [14, 1, 0.3682, 0.005, 1, 0.06, 0.1176, 436, 3, 2, 0, 0, 36, 10, 1], "semantic": {"name": "r", "arg_names": [], "import_names": [], "rhs_call_name": "match", "annotation": ""}, "snippet": "\tr = re.match(r'speaker(\\d{1,2})([^.]*)\\.ctl', ctlfn)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99121:Assign_L75_C1", "label": "B =", "type": "assigned_variable", "loc": [75, 75], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99121:FunctionDef_L66_C0", "vector": [14, 1, 0.3731, 0.005, 1, 0.06, 0.1765, 197, 6, 0, 0, 0, 0, 0, 1], "semantic": {"name": "B", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tB = r.groups()[0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99121:Assign_L76_C1", "label": "B = int()", "type": "assigned_variable", "loc": [76, 76], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99121:FunctionDef_L66_C0", "vector": [14, 1, 0.3781, 0.005, 1, 0.06, 0.2353, 197, 3, 1, 0, 0, 901, 10, 1], "semantic": {"name": "B", "arg_names": [], "import_names": [], "rhs_call_name": "int", "annotation": ""}, "snippet": "\tB = int(B)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99121:Assign_L77_C1", "label": "C =", "type": "assigned_variable", "loc": [77, 77], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99121:FunctionDef_L66_C0", "vector": [14, 1, 0.3831, 0.005, 1, 0.06, 0.2941, 619, 6, 0, 0, 0, 0, 0, 1], "semantic": {"name": "C", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tC = r.groups()[1]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99121:Assign_L80_C1", "label": "all_start_lino = FindLino()", "type": "assigned_variable", "loc": [80, 80], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99121:FunctionDef_L66_C0", "vector": [14, 1, 0.398, 0.005, 1, 0.06, 0.3529, 799, 3, 2, 0, 0, 729, 10, 1], "semantic": {"name": "all_start_lino", "arg_names": [], "import_names": [], "rhs_call_name": "FindLino", "annotation": ""}, "snippet": "\tall_start_lino = FindLino(ctllines, r'user\\s*edit\\s*section\\s*start')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99121:Assign_L81_C1", "label": "all_end_lino = FindLino()", "type": "assigned_variable", "loc": [81, 81], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99121:FunctionDef_L66_C0", "vector": [14, 1, 0.403, 0.005, 1, 0.06, 0.4118, 547, 3, 2, 0, 0, 729, 10, 1], "semantic": {"name": "all_end_lino", "arg_names": [], "import_names": [], "rhs_call_name": "FindLino", "annotation": ""}, "snippet": "\tall_end_lino = FindLino(ctllines, r'user\\s*edit\\s*section\\s*end')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99121:Assign_L82_C1", "label": "st_lino = FindLino()", "type": "assigned_variable", "loc": [82, 82], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99121:FunctionDef_L66_C0", "vector": [14, 1, 0.408, 0.005, 1, 0.06, 0.4706, 813, 3, 2, 0, 0, 729, 10, 1], "semantic": {"name": "st_lino", "arg_names": [], "import_names": [], "rhs_call_name": "FindLino", "annotation": ""}, "snippet": "\tst_lino = FindLino(ctllines, startLineC)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99121:Assign_L83_C1", "label": "end_lino = FindLino()", "type": "assigned_variable", "loc": [83, 83], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99121:FunctionDef_L66_C0", "vector": [14, 1, 0.4129, 0.005, 1, 0.06, 0.5294, 883, 3, 2, 0, 0, 729, 10, 1], "semantic": {"name": "end_lino", "arg_names": [], "import_names": [], "rhs_call_name": "FindLino", "annotation": ""}, "snippet": "\tend_lino = FindLino(ctllines, endLineC)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99121:Assign_L84_C1", "label": "assign", "type": "assigned_variable", "loc": [84, 84], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99121:FunctionDef_L66_C0", "vector": [14, 1, 0.4179, 0.005, 1, 0.06, 0.5882, 0, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tctllines[end_lino+1:all_end_lino]=[]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99121:Assign_L85_C1", "label": "assign", "type": "assigned_variable", "loc": [85, 85], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99121:FunctionDef_L66_C0", "vector": [14, 1, 0.4229, 0.005, 1, 0.06, 0.6471, 0, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tctllines[all_start_lino+1:st_lino]=[]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99121:Assign_L88_C1", "label": "st_lino = FindLino()", "type": "assigned_variable", "loc": [88, 88], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99121:FunctionDef_L66_C0", "vector": [14, 1, 0.4378, 0.005, 1, 0.06, 0.7059, 813, 3, 2, 0, 0, 729, 10, 1], "semantic": {"name": "st_lino", "arg_names": [], "import_names": [], "rhs_call_name": "FindLino", "annotation": ""}, "snippet": "\tst_lino = FindLino(ctllines, startLineC)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99121:Assign_L89_C1", "label": "end_lino = FindLino()", "type": "assigned_variable", "loc": [89, 89], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99121:FunctionDef_L66_C0", "vector": [14, 1, 0.4428, 0.005, 1, 0.06, 0.7647, 883, 3, 2, 0, 0, 729, 10, 1], "semantic": {"name": "end_lino", "arg_names": [], "import_names": [], "rhs_call_name": "FindLino", "annotation": ""}, "snippet": "\tend_lino = FindLino(ctllines, endLineC)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99121:For_L90_C1", "label": "for n", "type": "for", "loc": [90, 113], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99121:FunctionDef_L66_C0", "vector": [6, 1, 0.505, 0.1194, 1, 0.06, 0.8235, 773, 3, 0, 0, 0, 0, 0, 9], "semantic": {"name": "n", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tfor n in range(st_lino, end_lino):\n\n\t\t# need process determine\n\t\tsline = ctllines[n]\n\t\tr = re.match(\n\t\t\t\tr'\\s*Reco\\s*\\(\\s*speaker(\\d+)_unicode[^\\)]*\\)\\s*\\.\\.\\\\([^\\\\]+)\\\\([^\\\\]+)\\\\([^\\\\]*)\\\\', \n\t\t\t\tsline)\n\t\tif r:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99121:Assign_L93_C2", "label": "sline =", "type": "assigned_variable", "loc": [93, 93], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99121:For_L90_C1", "vector": [14, 2, 0.4627, 0.005, 2, 0.82, 0.0, 76, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "sline", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tsline = ctllines[n]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99121:Assign_L94_C2", "label": "r = match()", "type": "assigned_variable", "loc": [94, 96], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99121:For_L90_C1", "vector": [14, 2, 0.4726, 0.0149, 2, 0.82, 0.5, 436, 3, 2, 0, 0, 36, 10, 1], "semantic": {"name": "r", "arg_names": [], "import_names": [], "rhs_call_name": "match", "annotation": ""}, "snippet": "\t\tr = re.match(\n\t\t\t\tr'\\s*Reco\\s*\\(\\s*speaker(\\d+)_unicode[^\\)]*\\)\\s*\\.\\.\\\\([^\\\\]+)\\\\([^\\\\]+)\\\\([^\\\\]*)\\\\', \n\t\t\t\tsline)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99121:If_L97_C2", "label": "if", "type": "if", "loc": [97, 113], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99121:For_L90_C1", "vector": [4, 2, 0.5224, 0.0846, 2, 0.82, 1.0, 0, 2, 0, 0, 0, 0, 0, 7], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tif r:\n\t\t\t# make D:int, E:str, F:str, G:str\n\t\t\tD = r.groups()[0]\n\t\t\tD = int(D)\n\t\t\tE = A\n\t\t\tF = B + target_dir_no[A]\n\t\t\tF = str(F).zfill(3)\n\t\t\tG = \"C1\" if C==\"\" else C[1:]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99121:Assign_L99_C3", "label": "D =", "type": "assigned_variable", "loc": [99, 99], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99121:If_L97_C2", "vector": [14, 3, 0.4925, 0.005, 3, 0.34, 0.0, 939, 6, 0, 0, 0, 0, 0, 1], "semantic": {"name": "D", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\tD = r.groups()[0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99121:Assign_L100_C3", "label": "D = int()", "type": "assigned_variable", "loc": [100, 100], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99121:If_L97_C2", "vector": [14, 3, 0.4975, 0.005, 3, 0.34, 0.1111, 939, 3, 1, 0, 0, 901, 10, 1], "semantic": {"name": "D", "arg_names": [], "import_names": [], "rhs_call_name": "int", "annotation": ""}, "snippet": "\t\t\tD = int(D)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99121:Assign_L101_C3", "label": "E =", "type": "assigned_variable", "loc": [101, 101], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99121:If_L97_C2", "vector": [14, 3, 0.5025, 0.005, 3, 0.34, 0.2222, 76, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "E", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\tE = A"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99121:Assign_L102_C3", "label": "F =", "type": "assigned_variable", "loc": [102, 102], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99121:If_L97_C2", "vector": [14, 3, 0.5075, 0.005, 3, 0.34, 0.3333, 498, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "F", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\tF = B + target_dir_no[A]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99121:Assign_L103_C3", "label": "F = zfill()", "type": "assigned_variable", "loc": [103, 103], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99121:If_L97_C2", "vector": [14, 3, 0.5124, 0.005, 3, 0.34, 0.4444, 498, 3, 1, 0, 0, 159, 10, 2], "semantic": {"name": "F", "arg_names": [], "import_names": [], "rhs_call_name": "zfill", "annotation": ""}, "snippet": "\t\t\tF = str(F).zfill(3)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99121:Assign_L104_C3", "label": "G =", "type": "assigned_variable", "loc": [104, 104], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99121:If_L97_C2", "vector": [14, 3, 0.5174, 0.005, 3, 0.34, 0.5556, 165, 8, 0, 0, 0, 0, 0, 0], "semantic": {"name": "G", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\tG = \"C1\" if C==\"\" else C[1:]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99121:If_L105_C3", "label": "if", "type": "if", "loc": [105, 108], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99121:If_L97_C2", "vector": [4, 3, 0.5299, 0.0199, 3, 0.34, 0.6667, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\tif 1<=B<=5:\n\t\t\t\tD = B\n\t\t\telif 6<=B<=10:\n\t\t\t\tD = B-5"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99121:Assign_L106_C4", "label": "D =", "type": "assigned_variable", "loc": [106, 106], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99121:If_L105_C3", "vector": [14, 4, 0.5274, 0.005, 4, 0.01, 0.0, 939, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "D", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\t\tD = B"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99121:If_L107_C3", "label": "if", "type": "if", "loc": [107, 108], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99121:If_L105_C3", "vector": [4, 4, 0.5348, 0.01, 4, 0.01, 1.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\telif 6<=B<=10:\n\t\t\t\tD = B-5"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99121:Assign_L108_C4", "label": "D =", "type": "assigned_variable", "loc": [108, 108], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99121:If_L107_C3", "vector": [14, 5, 0.5373, 0.005, 5, 0.76, 0.0, 939, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "D", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\t\tD = B-5"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99121:Assign_L109_C3", "label": "sline = sub()", "type": "assigned_variable", "loc": [109, 111], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99121:If_L97_C2", "vector": [14, 3, 0.5473, 0.0149, 3, 0.34, 0.7778, 76, 3, 3, 0, 0, 819, 10, 1], "semantic": {"name": "sline", "arg_names": [], "import_names": [], "rhs_call_name": "sub", "annotation": ""}, "snippet": "\t\t\tsline = re.sub(r'\\.\\.\\\\[^\\\\]+\\\\[^\\\\]+\\\\[^\\\\]+\\\\', \n\t\t\t\t\t\tr'..\\\\' + E + r'\\\\' + F + r'\\\\' + G + r'\\\\',\n\t\t\t\t\t\tsline)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99121:Assign_L112_C3", "label": "sline = sub()", "type": "assigned_variable", "loc": [112, 112], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99121:If_L97_C2", "vector": [14, 3, 0.5572, 0.005, 3, 0.34, 0.8889, 76, 3, 3, 0, 0, 819, 10, 2], "semantic": {"name": "sline", "arg_names": [], "import_names": [], "rhs_call_name": "sub", "annotation": ""}, "snippet": "\t\t\tsline = re.sub(r'(?<=speaker)\\d*(?=_unicode)', str(D), sline)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99121:Assign_L113_C3", "label": "assign", "type": "assigned_variable", "loc": [113, 113], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99121:If_L97_C2", "vector": [14, 3, 0.5622, 0.005, 3, 0.34, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\tctllines[n] = sline"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99121:Assign_L115_C1", "label": "of = open()", "type": "assigned_variable", "loc": [115, 115], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99121:FunctionDef_L66_C0", "vector": [14, 1, 0.5721, 0.005, 1, 0.06, 0.8824, 835, 3, 2, 0, 0, 693, 10, 1], "semantic": {"name": "of", "arg_names": [], "import_names": [], "rhs_call_name": "open", "annotation": ""}, "snippet": "\tof = open(ctlpath+'\\\\'+ctlfn,'w')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99121:Expr_L116_C1", "label": "writelines()", "type": "expression", "loc": [116, 116], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99121:FunctionDef_L66_C0", "vector": [8, 1, 0.5771, 0.005, 1, 0.06, 0.9412, 290, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "writelines", "arg_names": [], "import_names": [], "rhs_call_name": "writelines", "annotation": ""}, "snippet": "\tof.writelines(ctllines)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99121:Expr_L117_C1", "label": "close()", "type": "expression", "loc": [117, 117], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99121:FunctionDef_L66_C0", "vector": [8, 1, 0.5821, 0.005, 1, 0.06, 1.0, 77, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "close", "arg_names": [], "import_names": [], "rhs_call_name": "close", "annotation": ""}, "snippet": "\tof.close()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99121:FunctionDef_L121_C0", "label": "FindLino", "type": "function", "loc": [121, 128], "level": 0, "parent": null, "vector": [2, 0, 0.6194, 0.0398, 0, 0.66, 0.5882, 729, 0, 2, 1, 0, 0, 0, 7], "semantic": {"name": "FindLino", "arg_names": ["lines", "s"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def FindLino(lines, s):\n\tfor n in range(len(lines)):\n\t\tif lines[n].find(s)>=0:\n\t\t\treturn n\n\tfor n in range(len(lines)):\n\t\tif re.search(s,lines[n]):\n\t\t\treturn n\n\traise CannotFindError()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99121:For_L122_C1", "label": "for n", "type": "for", "loc": [122, 124], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99121:FunctionDef_L121_C0", "vector": [6, 1, 0.6119, 0.0149, 1, 0.3, 0.0, 773, 3, 0, 0, 0, 0, 0, 3], "semantic": {"name": "n", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tfor n in range(len(lines)):\n\t\tif lines[n].find(s)>=0:\n\t\t\treturn n"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99121:If_L123_C2", "label": "if", "type": "if", "loc": [123, 124], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99121:For_L122_C1", "vector": [4, 2, 0.6144, 0.01, 2, 0.99, 0.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tif lines[n].find(s)>=0:\n\t\t\treturn n"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99121:Return_L124_C3", "label": "return", "type": "return", "loc": [124, 124], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99121:If_L123_C2", "vector": [13, 3, 0.6169, 0.005, 3, 0.52, 0.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\treturn n"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99121:For_L125_C1", "label": "for n", "type": "for", "loc": [125, 127], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99121:FunctionDef_L121_C0", "vector": [6, 1, 0.6269, 0.0149, 1, 0.3, 1.0, 773, 3, 0, 0, 0, 0, 0, 3], "semantic": {"name": "n", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tfor n in range(len(lines)):\n\t\tif re.search(s,lines[n]):\n\t\t\treturn n"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99121:If_L126_C2", "label": "if", "type": "if", "loc": [126, 127], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99121:For_L125_C1", "vector": [4, 2, 0.6294, 0.01, 2, 0.23, 0.0, 0, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tif re.search(s,lines[n]):\n\t\t\treturn n"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99121:Return_L127_C3", "label": "return", "type": "return", "loc": [127, 127], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99121:If_L126_C2", "vector": [13, 3, 0.6318, 0.005, 3, 0.94, 0.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\treturn n"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99121:FunctionDef_L130_C0", "label": "ProcSectionFiles", "type": "function", "loc": [130, 135], "level": 0, "parent": null, "vector": [2, 0, 0.6592, 0.0299, 0, 0.66, 0.6471, 979, 0, 1, 0, 0, 0, 0, 6], "semantic": {"name": "ProcSectionFiles", "arg_names": ["sn"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def ProcSectionFiles(sn):\n\tLogPrint(r'processing section: '+ sn)\n\tfor dir in target_dir_no.keys():\n\t\tfor fn in glob.glob(dir + r'\\*.ctl'):\n\t\t\tLogPrint(fn)\n\t\t\tWriteCtlFile(dir, fn.split('\\\\')[1], r'template.ctl', SECTIONS[sn][0], SECTIONS[sn][1])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99121:Expr_L131_C1", "label": "LogPrint()", "type": "expression", "loc": [131, 131], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99121:FunctionDef_L130_C0", "vector": [8, 1, 0.6517, 0.005, 1, 0.6, 0.0, 576, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "LogPrint", "arg_names": [], "import_names": [], "rhs_call_name": "LogPrint", "annotation": ""}, "snippet": "\tLogPrint(r'processing section: '+ sn)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99121:For_L132_C1", "label": "for dir", "type": "for", "loc": [132, 135], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99121:FunctionDef_L130_C0", "vector": [6, 1, 0.6642, 0.0199, 1, 0.6, 1.0, 152, 3, 0, 0, 0, 0, 0, 5], "semantic": {"name": "dir", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tfor dir in target_dir_no.keys():\n\t\tfor fn in glob.glob(dir + r'\\*.ctl'):\n\t\t\tLogPrint(fn)\n\t\t\tWriteCtlFile(dir, fn.split('\\\\')[1], r'template.ctl', SECTIONS[sn][0], SECTIONS[sn][1])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99121:For_L133_C2", "label": "for fn", "type": "for", "loc": [133, 135], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99121:For_L132_C1", "vector": [6, 2, 0.6667, 0.0149, 2, 0.5, 0.0, 59, 3, 0, 0, 0, 0, 0, 4], "semantic": {"name": "fn", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tfor fn in glob.glob(dir + r'\\*.ctl'):\n\t\t\tLogPrint(fn)\n\t\t\tWriteCtlFile(dir, fn.split('\\\\')[1], r'template.ctl', SECTIONS[sn][0], SECTIONS[sn][1])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99121:Expr_L134_C3", "label": "LogPrint()", "type": "expression", "loc": [134, 134], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99121:For_L133_C2", "vector": [8, 3, 0.6667, 0.005, 3, 0.44, 0.0, 576, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "LogPrint", "arg_names": [], "import_names": [], "rhs_call_name": "LogPrint", "annotation": ""}, "snippet": "\t\t\tLogPrint(fn)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99121:Expr_L135_C3", "label": "WriteCtlFile()", "type": "expression", "loc": [135, 135], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99121:For_L133_C2", "vector": [8, 3, 0.6716, 0.005, 3, 0.44, 1.0, 222, 3, 5, 0, 0, 0, 0, 2], "semantic": {"name": "WriteCtlFile", "arg_names": [], "import_names": [], "rhs_call_name": "WriteCtlFile", "annotation": ""}, "snippet": "\t\t\tWriteCtlFile(dir, fn.split('\\\\')[1], r'template.ctl', SECTIONS[sn][0], SECTIONS[sn][1])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99121:FunctionDef_L137_C0", "label": "RunEvalVoice", "type": "function", "loc": [137, 138], "level": 0, "parent": null, "vector": [2, 0, 0.6841, 0.01, 0, 0.66, 0.7059, 397, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "RunEvalVoice", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def RunEvalVoice():\n\tos.system(r'Go_All.bat')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99121:Expr_L138_C1", "label": "system()", "type": "expression", "loc": [138, 138], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99121:FunctionDef_L137_C0", "vector": [8, 1, 0.6866, 0.005, 1, 0.93, 0.0, 856, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "system", "arg_names": [], "import_names": [], "rhs_call_name": "system", "annotation": ""}, "snippet": "\tos.system(r'Go_All.bat')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99121:FunctionDef_L141_C0", "label": "PlaceRes", "type": "function", "loc": [141, 167], "level": 0, "parent": null, "vector": [2, 0, 0.7662, 0.1343, 0, 0.66, 0.7647, 766, 0, 1, 0, 0, 0, 0, 39], "semantic": {"name": "PlaceRes", "arg_names": ["sn"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def PlaceRes(sn):\n\tres_ar_fold = \"ResArchive\"\n\tif not os.path.exists(res_ar_fold):\n\t\tos.mkdir(res_ar_fold)\n\tif not os.path.exists(os.path.join(res_ar_fold, sn)):\n\t\tos.mkdir( os.path.join(res_ar_fold, sn))\n\tfor fres in glob.glob(r'*\\*.res'):\n\t\tfoldn = fres.split('\\\\')[0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99121:Assign_L142_C1", "label": "res_ar_fold =", "type": "assigned_variable", "loc": [142, 142], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99121:FunctionDef_L141_C0", "vector": [14, 1, 0.7065, 0.005, 1, 0.25, 0.0, 283, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "res_ar_fold", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tres_ar_fold = \"ResArchive\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99121:If_L143_C1", "label": "if", "type": "if", "loc": [143, 144], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99121:FunctionDef_L141_C0", "vector": [4, 1, 0.7139, 0.01, 1, 0.25, 0.2, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tif not os.path.exists(res_ar_fold):\n\t\tos.mkdir(res_ar_fold)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99121:Expr_L144_C2", "label": "mkdir()", "type": "expression", "loc": [144, 144], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99121:If_L143_C1", "vector": [8, 2, 0.7164, 0.005, 2, 0.67, 0.0, 853, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "mkdir", "arg_names": [], "import_names": [], "rhs_call_name": "mkdir", "annotation": ""}, "snippet": "\t\tos.mkdir(res_ar_fold)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99121:If_L145_C1", "label": "if", "type": "if", "loc": [145, 146], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99121:FunctionDef_L141_C0", "vector": [4, 1, 0.7239, 0.01, 1, 0.25, 0.4, 0, 0, 0, 0, 0, 0, 0, 4], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tif not os.path.exists(os.path.join(res_ar_fold, sn)):\n\t\tos.mkdir( os.path.join(res_ar_fold, sn))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99121:Expr_L146_C2", "label": "mkdir()", "type": "expression", "loc": [146, 146], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99121:If_L145_C1", "vector": [8, 2, 0.7264, 0.005, 2, 0.91, 0.0, 853, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "mkdir", "arg_names": [], "import_names": [], "rhs_call_name": "mkdir", "annotation": ""}, "snippet": "\t\tos.mkdir( os.path.join(res_ar_fold, sn))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99121:For_L147_C1", "label": "for fres", "type": "for", "loc": [147, 153], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99121:FunctionDef_L141_C0", "vector": [6, 1, 0.7463, 0.0348, 1, 0.25, 0.6, 397, 3, 0, 0, 0, 0, 0, 11], "semantic": {"name": "fres", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tfor fres in glob.glob(r'*\\*.res'):\n\t\tfoldn = fres.split('\\\\')[0]\n\t\tfilen = fres.split('\\\\')[1]\n\t\tif not os.path.exists(os.path.join(res_ar_fold, sn, foldn)):\n\t\t\t\tos.mkdir(os.path.join(res_ar_fold, sn, foldn))\n\t\tshutil.move(fres, os.path.join(res_ar_fold, sn, fres))\t\t\n\t\tLogPrint( \"move \" + fres + \" to \" + os.path.join(res_ar_fold, sn, fres))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99121:Assign_L148_C2", "label": "foldn =", "type": "assigned_variable", "loc": [148, 148], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99121:For_L147_C1", "vector": [14, 2, 0.7363, 0.005, 2, 0.08, 0.0, 813, 6, 0, 0, 0, 0, 0, 1], "semantic": {"name": "foldn", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tfoldn = fres.split('\\\\')[0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99121:Assign_L149_C2", "label": "filen =", "type": "assigned_variable", "loc": [149, 149], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99121:For_L147_C1", "vector": [14, 2, 0.7413, 0.005, 2, 0.08, 0.25, 506, 6, 0, 0, 0, 0, 0, 1], "semantic": {"name": "filen", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tfilen = fres.split('\\\\')[1]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99121:If_L150_C2", "label": "if", "type": "if", "loc": [150, 151], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99121:For_L147_C1", "vector": [4, 2, 0.7488, 0.01, 2, 0.08, 0.5, 0, 0, 0, 0, 0, 0, 0, 4], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tif not os.path.exists(os.path.join(res_ar_fold, sn, foldn)):\n\t\t\t\tos.mkdir(os.path.join(res_ar_fold, sn, foldn))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99121:Expr_L151_C4", "label": "mkdir()", "type": "expression", "loc": [151, 151], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99121:If_L150_C2", "vector": [8, 3, 0.7512, 0.005, 3, 0.73, 0.0, 853, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "mkdir", "arg_names": [], "import_names": [], "rhs_call_name": "mkdir", "annotation": ""}, "snippet": "\t\t\t\tos.mkdir(os.path.join(res_ar_fold, sn, foldn))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99121:Expr_L152_C2", "label": "move()", "type": "expression", "loc": [152, 152], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99121:For_L147_C1", "vector": [8, 2, 0.7562, 0.005, 2, 0.08, 0.75, 856, 3, 2, 0, 0, 0, 0, 2], "semantic": {"name": "move", "arg_names": [], "import_names": [], "rhs_call_name": "move", "annotation": ""}, "snippet": "\t\tshutil.move(fres, os.path.join(res_ar_fold, sn, fres))\t\t"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99121:Expr_L153_C2", "label": "LogPrint()", "type": "expression", "loc": [153, 153], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99121:For_L147_C1", "vector": [8, 2, 0.7612, 0.005, 2, 0.08, 1.0, 576, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "LogPrint", "arg_names": [], "import_names": [], "rhs_call_name": "LogPrint", "annotation": ""}, "snippet": "\t\tLogPrint( \"move \" + fres + \" to \" + os.path.join(res_ar_fold, sn, fres))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99121:For_L154_C1", "label": "for flog", "type": "for", "loc": [154, 160], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99121:FunctionDef_L141_C0", "vector": [6, 1, 0.7811, 0.0348, 1, 0.25, 0.8, 13, 3, 0, 0, 0, 0, 0, 11], "semantic": {"name": "flog", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tfor flog in glob.glob(r'*\\*.log'):\n\t\tfoldn = flog.split('\\\\')[0]\n\t\tfilen = flog.split('\\\\')[1]\n\t\tif not os.path.exists(os.path.join(res_ar_fold, sn, foldn)):\n\t\t\t\tos.mkdir(os.path.join(res_ar_fold, sn, foldn))\n\t\tshutil.move(flog, os.path.join(res_ar_fold, sn, flog))\t\t\n\t\tLogPrint( \"move \" + flog + \" to \" + os.path.join(res_ar_fold, sn, flog))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99121:Assign_L155_C2", "label": "foldn =", "type": "assigned_variable", "loc": [155, 155], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99121:For_L154_C1", "vector": [14, 2, 0.7711, 0.005, 2, 0.95, 0.0, 813, 6, 0, 0, 0, 0, 0, 1], "semantic": {"name": "foldn", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tfoldn = flog.split('\\\\')[0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99121:Assign_L156_C2", "label": "filen =", "type": "assigned_variable", "loc": [156, 156], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99121:For_L154_C1", "vector": [14, 2, 0.7761, 0.005, 2, 0.95, 0.25, 506, 6, 0, 0, 0, 0, 0, 1], "semantic": {"name": "filen", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tfilen = flog.split('\\\\')[1]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99121:If_L157_C2", "label": "if", "type": "if", "loc": [157, 158], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99121:For_L154_C1", "vector": [4, 2, 0.7836, 0.01, 2, 0.95, 0.5, 0, 0, 0, 0, 0, 0, 0, 4], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tif not os.path.exists(os.path.join(res_ar_fold, sn, foldn)):\n\t\t\t\tos.mkdir(os.path.join(res_ar_fold, sn, foldn))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99121:Expr_L158_C4", "label": "mkdir()", "type": "expression", "loc": [158, 158], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99121:If_L157_C2", "vector": [8, 3, 0.7861, 0.005, 3, 0.68, 0.0, 853, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "mkdir", "arg_names": [], "import_names": [], "rhs_call_name": "mkdir", "annotation": ""}, "snippet": "\t\t\t\tos.mkdir(os.path.join(res_ar_fold, sn, foldn))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99121:Expr_L159_C2", "label": "move()", "type": "expression", "loc": [159, 159], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99121:For_L154_C1", "vector": [8, 2, 0.791, 0.005, 2, 0.95, 0.75, 856, 3, 2, 0, 0, 0, 0, 2], "semantic": {"name": "move", "arg_names": [], "import_names": [], "rhs_call_name": "move", "annotation": ""}, "snippet": "\t\tshutil.move(flog, os.path.join(res_ar_fold, sn, flog))\t\t"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99121:Expr_L160_C2", "label": "LogPrint()", "type": "expression", "loc": [160, 160], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99121:For_L154_C1", "vector": [8, 2, 0.796, 0.005, 2, 0.95, 1.0, 576, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "LogPrint", "arg_names": [], "import_names": [], "rhs_call_name": "LogPrint", "annotation": ""}, "snippet": "\t\tLogPrint( \"move \" + flog + \" to \" + os.path.join(res_ar_fold, sn, flog))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99121:For_L161_C1", "label": "for fctl", "type": "for", "loc": [161, 167], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99121:FunctionDef_L141_C0", "vector": [6, 1, 0.8159, 0.0348, 1, 0.25, 1.0, 842, 3, 0, 0, 0, 0, 0, 11], "semantic": {"name": "fctl", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tfor fctl in glob.glob(r'*\\*.ctl'):\n\t\tfoldn = fctl.split('\\\\')[0]\n\t\tfilen = fctl.split('\\\\')[1]\n\t\tif not os.path.exists(os.path.join(res_ar_fold, sn, foldn)):\n\t\t\t\tos.mkdir(os.path.join(res_ar_fold, sn, foldn))\n\t\tshutil.copyfile(fctl, os.path.join(res_ar_fold, sn, fctl))\t\t\n\t\tLogPrint( \"copy \" + fctl + \" to \" + os.path.join(res_ar_fold, sn, fctl))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99121:Assign_L162_C2", "label": "foldn =", "type": "assigned_variable", "loc": [162, 162], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99121:For_L161_C1", "vector": [14, 2, 0.806, 0.005, 2, 0.99, 0.0, 813, 6, 0, 0, 0, 0, 0, 1], "semantic": {"name": "foldn", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tfoldn = fctl.split('\\\\')[0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99121:Assign_L163_C2", "label": "filen =", "type": "assigned_variable", "loc": [163, 163], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99121:For_L161_C1", "vector": [14, 2, 0.8109, 0.005, 2, 0.99, 0.25, 506, 6, 0, 0, 0, 0, 0, 1], "semantic": {"name": "filen", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tfilen = fctl.split('\\\\')[1]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99121:If_L164_C2", "label": "if", "type": "if", "loc": [164, 165], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99121:For_L161_C1", "vector": [4, 2, 0.8184, 0.01, 2, 0.99, 0.5, 0, 0, 0, 0, 0, 0, 0, 4], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tif not os.path.exists(os.path.join(res_ar_fold, sn, foldn)):\n\t\t\t\tos.mkdir(os.path.join(res_ar_fold, sn, foldn))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99121:Expr_L165_C4", "label": "mkdir()", "type": "expression", "loc": [165, 165], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99121:If_L164_C2", "vector": [8, 3, 0.8209, 0.005, 3, 0.24, 0.0, 853, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "mkdir", "arg_names": [], "import_names": [], "rhs_call_name": "mkdir", "annotation": ""}, "snippet": "\t\t\t\tos.mkdir(os.path.join(res_ar_fold, sn, foldn))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99121:Expr_L166_C2", "label": "copyfile()", "type": "expression", "loc": [166, 166], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99121:For_L161_C1", "vector": [8, 2, 0.8259, 0.005, 2, 0.99, 0.75, 918, 3, 2, 0, 0, 0, 0, 2], "semantic": {"name": "copyfile", "arg_names": [], "import_names": [], "rhs_call_name": "copyfile", "annotation": ""}, "snippet": "\t\tshutil.copyfile(fctl, os.path.join(res_ar_fold, sn, fctl))\t\t"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99121:Expr_L167_C2", "label": "LogPrint()", "type": "expression", "loc": [167, 167], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99121:For_L161_C1", "vector": [8, 2, 0.8308, 0.005, 2, 0.99, 1.0, 576, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "LogPrint", "arg_names": [], "import_names": [], "rhs_call_name": "LogPrint", "annotation": ""}, "snippet": "\t\tLogPrint( \"copy \" + fctl + \" to \" + os.path.join(res_ar_fold, sn, fctl))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99121:Assign_L171_C0", "label": "LOG_FILE = open()", "type": "assigned_variable", "loc": [171, 171], "level": 0, "parent": null, "vector": [14, 0, 0.8507, 0.005, 0, 0.66, 0.8235, 260, 3, 2, 0, 0, 693, 10, 1], "semantic": {"name": "LOG_FILE", "arg_names": [], "import_names": [], "rhs_call_name": "open", "annotation": ""}, "snippet": "LOG_FILE = open('ProcCtl.log', 'w')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99121:FunctionDef_L172_C0", "label": "LogPrint", "type": "function", "loc": [172, 173], "level": 0, "parent": null, "vector": [2, 0, 0.8582, 0.01, 0, 0.66, 0.8824, 576, 0, 1, 0, 0, 0, 0, 1], "semantic": {"name": "LogPrint", "arg_names": ["s"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def LogPrint(s):\n\tprint(s)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99121:Expr_L173_C1", "label": "print()", "type": "expression", "loc": [173, 173], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99121:FunctionDef_L172_C0", "vector": [8, 1, 0.8607, 0.005, 1, 0.97, 0.0, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": "\tprint(s)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99121:FunctionDef_L175_C0", "label": "__main__", "type": "function", "loc": [175, 182], "level": 0, "parent": null, "vector": [2, 0, 0.8881, 0.0398, 0, 0.66, 0.9412, 593, 0, 0, 0, 0, 0, 0, 7], "semantic": {"name": "__main__", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def __main__():\n\tfor sn in SECTIONS.keys():\n\t\tProcSectionFiles(sn)\n\t\tLogPrint('\\n\\n\\n\\n')\n\t\tRunEvalVoice()\n\t\tLogPrint('\\n\\n\\n\\n')\n\t\tPlaceRes(sn)\n\t\tLogPrint('\\n\\n\\n\\n')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99121:For_L176_C1", "label": "for sn", "type": "for", "loc": [176, 182], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99121:FunctionDef_L175_C0", "vector": [6, 1, 0.8905, 0.0348, 1, 0.42, 0.0, 981, 3, 0, 0, 0, 0, 0, 7], "semantic": {"name": "sn", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tfor sn in SECTIONS.keys():\n\t\tProcSectionFiles(sn)\n\t\tLogPrint('\\n\\n\\n\\n')\n\t\tRunEvalVoice()\n\t\tLogPrint('\\n\\n\\n\\n')\n\t\tPlaceRes(sn)\n\t\tLogPrint('\\n\\n\\n\\n')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99121:Expr_L177_C2", "label": "ProcSectionFiles()", "type": "expression", "loc": [177, 177], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99121:For_L176_C1", "vector": [8, 2, 0.8806, 0.005, 2, 0.56, 0.0, 979, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "ProcSectionFiles", "arg_names": [], "import_names": [], "rhs_call_name": "ProcSectionFiles", "annotation": ""}, "snippet": "\t\tProcSectionFiles(sn)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99121:Expr_L178_C2", "label": "LogPrint()", "type": "expression", "loc": [178, 178], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99121:For_L176_C1", "vector": [8, 2, 0.8856, 0.005, 2, 0.56, 0.2, 576, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "LogPrint", "arg_names": [], "import_names": [], "rhs_call_name": "LogPrint", "annotation": ""}, "snippet": "\t\tLogPrint('\\n\\n\\n\\n')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99121:Expr_L179_C2", "label": "RunEvalVoice()", "type": "expression", "loc": [179, 179], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99121:For_L176_C1", "vector": [8, 2, 0.8905, 0.005, 2, 0.56, 0.4, 397, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "RunEvalVoice", "arg_names": [], "import_names": [], "rhs_call_name": "RunEvalVoice", "annotation": ""}, "snippet": "\t\tRunEvalVoice()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99121:Expr_L180_C2", "label": "LogPrint()", "type": "expression", "loc": [180, 180], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99121:For_L176_C1", "vector": [8, 2, 0.8955, 0.005, 2, 0.56, 0.6, 576, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "LogPrint", "arg_names": [], "import_names": [], "rhs_call_name": "LogPrint", "annotation": ""}, "snippet": "\t\tLogPrint('\\n\\n\\n\\n')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99121:Expr_L181_C2", "label": "PlaceRes()", "type": "expression", "loc": [181, 181], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99121:For_L176_C1", "vector": [8, 2, 0.9005, 0.005, 2, 0.56, 0.8, 766, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "PlaceRes", "arg_names": [], "import_names": [], "rhs_call_name": "PlaceRes", "annotation": ""}, "snippet": "\t\tPlaceRes(sn)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99121:Expr_L182_C2", "label": "LogPrint()", "type": "expression", "loc": [182, 182], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99121:For_L176_C1", "vector": [8, 2, 0.9055, 0.005, 2, 0.56, 1.0, 576, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "LogPrint", "arg_names": [], "import_names": [], "rhs_call_name": "LogPrint", "annotation": ""}, "snippet": "\t\tLogPrint('\\n\\n\\n\\n')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99121:If_L197_C0", "label": "if", "type": "if", "loc": [197, 198], "level": 0, "parent": null, "vector": [4, 0, 0.9826, 0.01, 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\t__main__()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99121:Expr_L198_C1", "label": "__main__()", "type": "expression", "loc": [198, 198], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99121:If_L197_C0", "vector": [8, 1, 0.9851, 0.005, 1, 0.63, 0.0, 593, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "__main__", "arg_names": [], "import_names": [], "rhs_call_name": "__main__", "annotation": ""}, "snippet": "\t__main__()"}]
[{"f": "ajibawa-2023/Python-Code-Large/train/row_99121:FunctionDef_L66_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99121:Assign_L68_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99121:FunctionDef_L66_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99121:Assign_L71_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99121:FunctionDef_L66_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99121:Assign_L74_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99121:FunctionDef_L66_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99121:Assign_L75_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99121:FunctionDef_L66_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99121:Assign_L76_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99121:FunctionDef_L66_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99121:Assign_L77_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99121:FunctionDef_L66_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99121:Assign_L80_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99121:FunctionDef_L66_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99121:Assign_L81_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99121:FunctionDef_L66_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99121:Assign_L82_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99121:FunctionDef_L66_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99121:Assign_L83_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99121:FunctionDef_L66_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99121:Assign_L84_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99121:FunctionDef_L66_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99121:Assign_L85_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99121:FunctionDef_L66_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99121:Assign_L88_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99121:FunctionDef_L66_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99121:Assign_L89_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99121:FunctionDef_L66_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99121:For_L90_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99121:For_L90_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99121:Assign_L93_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99121:For_L90_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99121:Assign_L94_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99121:For_L90_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99121:If_L97_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99121:If_L97_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99121:Assign_L99_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99121:If_L97_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99121:Assign_L100_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99121:If_L97_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99121:Assign_L101_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99121:If_L97_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99121:Assign_L102_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99121:If_L97_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99121:Assign_L103_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99121:If_L97_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99121:Assign_L104_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99121:If_L97_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99121:If_L105_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99121:If_L105_C3", "t": "ajibawa-2023/Python-Code-Large/train/row_99121:Assign_L106_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99121:If_L105_C3", "t": "ajibawa-2023/Python-Code-Large/train/row_99121:If_L107_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99121:If_L107_C3", "t": "ajibawa-2023/Python-Code-Large/train/row_99121:Assign_L108_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99121:If_L97_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99121:Assign_L109_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99121:If_L97_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99121:Assign_L112_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99121:If_L97_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99121:Assign_L113_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99121:FunctionDef_L66_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99121:Assign_L115_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99121:FunctionDef_L66_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99121:Expr_L116_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99121:FunctionDef_L66_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99121:Expr_L117_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99121:FunctionDef_L121_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99121:For_L122_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99121:For_L122_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99121:If_L123_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99121:If_L123_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99121:Return_L124_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99121:FunctionDef_L121_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99121:For_L125_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99121:For_L125_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99121:If_L126_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99121:If_L126_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99121:Return_L127_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99121:FunctionDef_L130_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99121:Expr_L131_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99121:FunctionDef_L130_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99121:For_L132_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99121:For_L132_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99121:For_L133_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99121:For_L133_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99121:Expr_L134_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99121:For_L133_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99121:Expr_L135_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99121:FunctionDef_L137_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99121:Expr_L138_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99121:FunctionDef_L141_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99121:Assign_L142_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99121:FunctionDef_L141_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99121:If_L143_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99121:If_L143_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99121:Expr_L144_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99121:FunctionDef_L141_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99121:If_L145_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99121:If_L145_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99121:Expr_L146_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99121:FunctionDef_L141_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99121:For_L147_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99121:For_L147_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99121:Assign_L148_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99121:For_L147_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99121:Assign_L149_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99121:For_L147_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99121:If_L150_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99121:If_L150_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99121:Expr_L151_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99121:For_L147_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99121:Expr_L152_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99121:For_L147_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99121:Expr_L153_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99121:FunctionDef_L141_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99121:For_L154_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99121:For_L154_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99121:Assign_L155_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99121:For_L154_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99121:Assign_L156_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99121:For_L154_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99121:If_L157_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99121:If_L157_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99121:Expr_L158_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99121:For_L154_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99121:Expr_L159_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99121:For_L154_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99121:Expr_L160_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99121:FunctionDef_L141_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99121:For_L161_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99121:For_L161_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99121:Assign_L162_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99121:For_L161_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99121:Assign_L163_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99121:For_L161_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99121:If_L164_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99121:If_L164_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99121:Expr_L165_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99121:For_L161_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99121:Expr_L166_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99121:For_L161_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99121:Expr_L167_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99121:FunctionDef_L172_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99121:Expr_L173_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99121:FunctionDef_L175_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99121:For_L176_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99121:For_L176_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99121:Expr_L177_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99121:For_L176_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99121:Expr_L178_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99121:For_L176_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99121:Expr_L179_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99121:For_L176_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99121:Expr_L180_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99121:For_L176_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99121:Expr_L181_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99121:For_L176_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99121:Expr_L182_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99121:If_L197_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99121:Expr_L198_C1"}]
#!/usr/bin/env python # coding=utf-8 import os import sys import re import optparse import winsound from os.path import join as pjoin buildlog = open('build.log', 'w') class ModelSrc: """ manage the source of a model, mainly include download, update, build and delete.\n""" # all the models models = ('je609', 'nx005', 'nx007', 'jg500') # nicknames of the models, they are used at some time(some folder name) nickName = {'je609': '09DOP', 'nx005': '09OverseaSL', 'nx007': '09OverseaH', 'jg500': '09CH'} # build target for Build or Rebuild targets = ('Rebuild', 'Build') # build configuration of Release and Debug configs = ('Release', 'Debug') # all used SDK platforms = ('Windows Mobile 5.0 Pocket PC SDK (ARMV4I)', '09Light Platform (ARMV4I)', 'WS_NX005 (ARMV4I)') # special platform for model modelPlatform = {'je609': platforms[1], 'nx005': platforms[2], 'nx007': platforms[1], 'jg500': platforms[1]} def __init__(self, model, **args): """ variable args: basepath\n """ self.model = model if args.has_key('basepath'): self.basepath = os.path.abspath(args.basepath) else: self.basepath = os.path.abspath('.') self.modelDir = model + 'Apl' self.logf = sys.stdout def setLogFile(f): """ parameter is a filename or a opened writable file\n""" if isinstance(f,file): self.logf = f else: self.logf = open(f,'a') def download(): """ download the source\n """ pass def update(): """ update the souce\n """ pass def delete(): """ delete the whole folder for the model source\n""" pass
ajibawa-2023/Python-Code-Large/train/row_99122
34
66
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_99122:Import_L4_C0", "label": "os import os", "type": "import", "loc": [4, 4], "level": 0, "parent": null, "vector": [1, 0, 0.0606, 0.0152, 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_99122:Import_L5_C0", "label": "sys import sys", "type": "import", "loc": [5, 5], "level": 0, "parent": null, "vector": [1, 0, 0.0758, 0.0152, 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_99122:Import_L6_C0", "label": "re import re", "type": "import", "loc": [6, 6], "level": 0, "parent": null, "vector": [1, 0, 0.0909, 0.0152, 0, 0.66, 0.2857, 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_99122:Import_L7_C0", "label": "optparse import optparse", "type": "import", "loc": [7, 7], "level": 0, "parent": null, "vector": [1, 0, 0.1061, 0.0152, 0, 0.66, 0.4286, 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_99122:Import_L8_C0", "label": "winsound import winsound", "type": "import", "loc": [8, 8], "level": 0, "parent": null, "vector": [1, 0, 0.1212, 0.0152, 0, 0.66, 0.5714, 169, 0, 1, 0, 0, 169, 0, 0], "semantic": {"name": "winsound", "arg_names": [], "import_names": ["winsound"], "rhs_call_name": "", "annotation": ""}, "snippet": "import winsound"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99122:ImportFrom_L10_C0", "label": "from os.path import pjoin", "type": "import", "loc": [10, 10], "level": 0, "parent": null, "vector": [1, 0, 0.1515, 0.0152, 0, 0.66, 0.7143, 79, 0, 1, 0, 0, 79, 0, 0], "semantic": {"name": "os.path", "arg_names": [], "import_names": ["pjoin"], "rhs_call_name": "", "annotation": ""}, "snippet": "from os.path import join as pjoin"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99122:Assign_L12_C0", "label": "buildlog = open()", "type": "assigned_variable", "loc": [12, 12], "level": 0, "parent": null, "vector": [14, 0, 0.1818, 0.0152, 0, 0.66, 0.8571, 68, 3, 2, 0, 0, 693, 10, 1], "semantic": {"name": "buildlog", "arg_names": [], "import_names": [], "rhs_call_name": "open", "annotation": ""}, "snippet": "buildlog = open('build.log', 'w')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99122:ClassDef_L14_C0", "label": "ModelSrc", "type": "class", "loc": [14, 65], "level": 0, "parent": null, "vector": [3, 0, 0.5985, 0.7879, 0, 0.66, 1.0, 988, 0, 5, 0, 0, 0, 0, 5], "semantic": {"name": "ModelSrc", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class ModelSrc:\n\t\"\"\" manage the source of a model, mainly include download, update, build and delete.\\n\"\"\"\n\n\t# all the models\n\tmodels = ('je609', 'nx005', 'nx007', 'jg500')\n\t# nicknames of the models, they are used at some time(some folder name)\n\tnickName = {'je609': '09DOP',\n\t\t\t'nx005': '09OverseaSL',"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99122:Expr_L15_C1", "label": "expression", "type": "expression", "loc": [15, 15], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99122:ClassDef_L14_C0", "vector": [8, 1, 0.2273, 0.0152, 1, 0.67, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\"\"\" manage the source of a model, mainly include download, update, build and delete.\\n\"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99122:Assign_L18_C1", "label": "models =", "type": "assigned_variable", "loc": [18, 18], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99122:ClassDef_L14_C0", "vector": [14, 1, 0.2727, 0.0152, 1, 0.67, 0.0909, 495, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "models", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tmodels = ('je609', 'nx005', 'nx007', 'jg500')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99122:Assign_L20_C1", "label": "nickName =", "type": "assigned_variable", "loc": [20, 23], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99122:ClassDef_L14_C0", "vector": [14, 1, 0.3258, 0.0606, 1, 0.67, 0.1818, 11, 0, 0, 0, 0, 0, 6, 0], "semantic": {"name": "nickName", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tnickName = {'je609': '09DOP',\n\t\t\t'nx005': '09OverseaSL',\n\t\t\t'nx007': '09OverseaH',\n\t\t\t'jg500': '09CH'}"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99122:Assign_L25_C1", "label": "targets =", "type": "assigned_variable", "loc": [25, 25], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99122:ClassDef_L14_C0", "vector": [14, 1, 0.3788, 0.0152, 1, 0.67, 0.2727, 409, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "targets", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\ttargets = ('Rebuild', 'Build')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99122:Assign_L27_C1", "label": "configs =", "type": "assigned_variable", "loc": [27, 27], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99122:ClassDef_L14_C0", "vector": [14, 1, 0.4091, 0.0152, 1, 0.67, 0.3636, 877, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "configs", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tconfigs = ('Release', 'Debug')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99122:Assign_L29_C1", "label": "platforms =", "type": "assigned_variable", "loc": [29, 31], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99122:ClassDef_L14_C0", "vector": [14, 1, 0.4545, 0.0455, 1, 0.67, 0.4545, 332, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "platforms", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tplatforms = ('Windows Mobile 5.0 Pocket PC SDK (ARMV4I)', \n\t\t\t\t'09Light Platform (ARMV4I)',\n\t\t\t\t'WS_NX005 (ARMV4I)')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99122:Assign_L33_C1", "label": "modelPlatform =", "type": "assigned_variable", "loc": [33, 36], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99122:ClassDef_L14_C0", "vector": [14, 1, 0.5227, 0.0606, 1, 0.67, 0.5455, 33, 0, 0, 0, 0, 0, 6, 0], "semantic": {"name": "modelPlatform", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tmodelPlatform = {'je609': platforms[1],\n\t\t\t'nx005': platforms[2],\n\t\t\t'nx007': platforms[1],\n\t\t\t'jg500': platforms[1]}"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99122:FunctionDef_L38_C1", "label": "__init__", "type": "function", "loc": [38, 46], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99122:ClassDef_L14_C0", "vector": [2, 1, 0.6364, 0.1364, 1, 0.67, 0.6364, 555, 0, 3, 0, 0, 0, 0, 3], "semantic": {"name": "__init__", "arg_names": ["self", "model", "args"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tdef __init__(self, model, **args):\n\t\t\"\"\" variable args: basepath\\n \"\"\"\n\t\tself.model = model\n\t\tif args.has_key('basepath'):\n\t\t\tself.basepath = os.path.abspath(args.basepath)\n\t\telse:\n\t\t\tself.basepath = os.path.abspath('.')\n\t\tself.modelDir = model + 'Apl'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99122:Expr_L39_C2", "label": "expression", "type": "expression", "loc": [39, 39], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99122:FunctionDef_L38_C1", "vector": [8, 2, 0.5909, 0.0152, 2, 0.87, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\"\"\" variable args: basepath\\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99122:Assign_L40_C2", "label": "self.model =", "type": "assigned_variable", "loc": [40, 40], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99122:FunctionDef_L38_C1", "vector": [14, 2, 0.6061, 0.0152, 2, 0.87, 0.25, 81, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.model", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tself.model = model"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99122:If_L41_C2", "label": "if", "type": "if", "loc": [41, 44], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99122:FunctionDef_L38_C1", "vector": [4, 2, 0.6439, 0.0606, 2, 0.87, 0.5, 0, 3, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tif args.has_key('basepath'):\n\t\t\tself.basepath = os.path.abspath(args.basepath)\n\t\telse:\n\t\t\tself.basepath = os.path.abspath('.')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99122:Assign_L42_C3", "label": "self.basepath = abspath()", "type": "assigned_variable", "loc": [42, 42], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99122:If_L41_C2", "vector": [14, 3, 0.6364, 0.0152, 3, 0.23, 0.0, 362, 3, 1, 0, 0, 142, 10, 1], "semantic": {"name": "self.basepath", "arg_names": [], "import_names": [], "rhs_call_name": "abspath", "annotation": ""}, "snippet": "\t\t\tself.basepath = os.path.abspath(args.basepath)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99122:Assign_L44_C3", "label": "self.basepath = abspath()", "type": "assigned_variable", "loc": [44, 44], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99122:If_L41_C2", "vector": [14, 3, 0.6667, 0.0152, 3, 0.23, 1.0, 362, 3, 1, 0, 0, 142, 10, 1], "semantic": {"name": "self.basepath", "arg_names": [], "import_names": [], "rhs_call_name": "abspath", "annotation": ""}, "snippet": "\t\t\tself.basepath = os.path.abspath('.')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99122:Assign_L45_C2", "label": "self.modelDir =", "type": "assigned_variable", "loc": [45, 45], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99122:FunctionDef_L38_C1", "vector": [14, 2, 0.6818, 0.0152, 2, 0.87, 0.75, 589, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.modelDir", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tself.modelDir = model + 'Apl'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99122:Assign_L46_C2", "label": "self.logf =", "type": "assigned_variable", "loc": [46, 46], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99122:FunctionDef_L38_C1", "vector": [14, 2, 0.697, 0.0152, 2, 0.87, 1.0, 556, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.logf", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tself.logf = sys.stdout"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99122:FunctionDef_L48_C1", "label": "setLogFile", "type": "function", "loc": [48, 53], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99122:ClassDef_L14_C0", "vector": [2, 1, 0.7652, 0.0909, 1, 0.67, 0.7273, 690, 0, 1, 0, 0, 0, 0, 2], "semantic": {"name": "setLogFile", "arg_names": ["f"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tdef setLogFile(f):\n\t\t\"\"\" parameter is a filename or a opened writable file\\n\"\"\"\n\t\tif isinstance(f,file):\n\t\t\tself.logf = f\n\t\telse:\n\t\t\tself.logf = open(f,'a')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99122:Expr_L49_C2", "label": "expression", "type": "expression", "loc": [49, 49], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99122:FunctionDef_L48_C1", "vector": [8, 2, 0.7424, 0.0152, 2, 0.4, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\"\"\" parameter is a filename or a opened writable file\\n\"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99122:If_L50_C2", "label": "if", "type": "if", "loc": [50, 53], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99122:FunctionDef_L48_C1", "vector": [4, 2, 0.7803, 0.0606, 2, 0.4, 1.0, 0, 3, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tif isinstance(f,file):\n\t\t\tself.logf = f\n\t\telse:\n\t\t\tself.logf = open(f,'a')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99122:Assign_L51_C3", "label": "self.logf =", "type": "assigned_variable", "loc": [51, 51], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99122:If_L50_C2", "vector": [14, 3, 0.7727, 0.0152, 3, 0.58, 0.0, 556, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.logf", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\tself.logf = f"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99122:Assign_L53_C3", "label": "self.logf = open()", "type": "assigned_variable", "loc": [53, 53], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99122:If_L50_C2", "vector": [14, 3, 0.803, 0.0152, 3, 0.58, 1.0, 556, 3, 2, 0, 0, 693, 10, 1], "semantic": {"name": "self.logf", "arg_names": [], "import_names": [], "rhs_call_name": "open", "annotation": ""}, "snippet": "\t\t\tself.logf = open(f,'a')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99122:FunctionDef_L55_C1", "label": "download", "type": "function", "loc": [55, 57], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99122:ClassDef_L14_C0", "vector": [2, 1, 0.8485, 0.0455, 1, 0.67, 0.8182, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "download", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tdef download():\n\t\t\"\"\" download the source\\n \"\"\"\n\t\tpass"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99122:Expr_L56_C2", "label": "expression", "type": "expression", "loc": [56, 56], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99122:FunctionDef_L55_C1", "vector": [8, 2, 0.8485, 0.0152, 2, 0.25, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\"\"\" download the source\\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99122:FunctionDef_L59_C1", "label": "update", "type": "function", "loc": [59, 61], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99122:ClassDef_L14_C0", "vector": [2, 1, 0.9091, 0.0455, 1, 0.67, 0.9091, 637, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "update", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tdef update():\n\t\t\"\"\" update the souce\\n \"\"\"\n\t\tpass"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99122:Expr_L60_C2", "label": "expression", "type": "expression", "loc": [60, 60], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99122:FunctionDef_L59_C1", "vector": [8, 2, 0.9091, 0.0152, 2, 0.78, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\"\"\" update the souce\\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99122:FunctionDef_L63_C1", "label": "delete", "type": "function", "loc": [63, 65], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99122:ClassDef_L14_C0", "vector": [2, 1, 0.9697, 0.0455, 1, 0.67, 1.0, 266, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "delete", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tdef delete():\n\t\t\"\"\" delete the whole folder for the model source\\n\"\"\"\n\t\tpass"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99122:Expr_L64_C2", "label": "expression", "type": "expression", "loc": [64, 64], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99122:FunctionDef_L63_C1", "vector": [8, 2, 0.9697, 0.0152, 2, 0.93, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\"\"\" delete the whole folder for the model source\\n\"\"\""}]
[{"f": "ajibawa-2023/Python-Code-Large/train/row_99122:ClassDef_L14_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99122:Expr_L15_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99122:ClassDef_L14_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99122:Assign_L18_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99122:ClassDef_L14_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99122:Assign_L20_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99122:ClassDef_L14_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99122:Assign_L25_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99122:ClassDef_L14_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99122:Assign_L27_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99122:ClassDef_L14_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99122:Assign_L29_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99122:ClassDef_L14_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99122:Assign_L33_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99122:ClassDef_L14_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99122:FunctionDef_L38_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99122:FunctionDef_L38_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99122:Expr_L39_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99122:FunctionDef_L38_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99122:Assign_L40_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99122:FunctionDef_L38_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99122:If_L41_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99122:If_L41_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99122:Assign_L42_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99122:If_L41_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99122:Assign_L44_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99122:FunctionDef_L38_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99122:Assign_L45_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99122:FunctionDef_L38_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99122:Assign_L46_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99122:ClassDef_L14_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99122:FunctionDef_L48_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99122:FunctionDef_L48_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99122:Expr_L49_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99122:FunctionDef_L48_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99122:If_L50_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99122:If_L50_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99122:Assign_L51_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99122:If_L50_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99122:Assign_L53_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99122:ClassDef_L14_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99122:FunctionDef_L55_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99122:FunctionDef_L55_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99122:Expr_L56_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99122:ClassDef_L14_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99122:FunctionDef_L59_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99122:FunctionDef_L59_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99122:Expr_L60_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99122:ClassDef_L14_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99122:FunctionDef_L63_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99122:FunctionDef_L63_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99122:Expr_L64_C2"}]
#!/usr/bin/env python # coding:utf-8 import os,sys import codecs import re from WorkPath import * import pyExcelerator as pE LOG_FILE = codecs.open('log.txt','w','utf-8') #sys.stdout def CColA2N(colName): """ Convert excel colume to number""" n = 0 for c in colName: n = n*(ord('Z')-ord('A')+1) + (ord(c)-ord('A')) return n THIS_DATA_DIR = DATA_DIR + r'\VoiceID' FROM_EXCEL_FILE = THIS_DATA_DIR + r'\Voice_ID_list_V15.xls' TO_EXCEL_FILE = THIS_DATA_DIR + r'\S.xls' LANGS = ('International English', 'US English', 'UK English', 'German', 'French', 'Dutch', 'Flemmish', 'Spanish', 'Italian', 'Swedish', 'Danish', 'Norwegian', 'Portuguese', 'Russian') LANGS_START_COL = 1 LANGS_POS_COL = ( n*2 + LANGS_START_COL for n in range(len(LANGS))) LANG_COL_PAIRS = zip(LANGS, LANGS_POS_COL) MAX_ROW = 2000 CONTENT_SHEETS = range(1,8) os.chdir(THIS_DATA_DIR) f = pE.parse_xls(FROM_EXCEL_FILE) def ProcContent(s): oris = s s = unicode(s) sp = True if re.match(u'\(.*\)\s*(.*?)\s*\[.*\]\s*\(.*\)\s*$', s): # (*)*[*](*) s = re.match(u'\(.*\)\s*(.*?)\s*\[.*\]\s*\(.*\)\s*$', s).group(1) elif re.match(u'\s*.*?\s*((.*?))\s*$', s): # *(×) s = re.match(u'\s*.*?\s*((.*?))\s*$', s).group(1) elif re.match(u'\s*.*?\s*\((.*?)\)\s*$', s): # *(*) s = re.match(u'\s*.*?\s*\((.*?)\)\s*$', s).group(1) elif re.match(u'\s*((.*?))\s*$', s): # (*) s = re.match(u'\s*((.*?))\s*$', s).group(1) else: if s.find(u'(')>=0 or s.find(u')')>=0 or s.find(u'(')>=0 \ or s.find(u')')>=0 or s.find(u'《')>=0 or s.find(u'<')>=0: print >> LOG_FILE, 'Unexpected content:', s sp = False if sp: print >> LOG_FILE, oris, '->', s s = unicode(s) + u'\0' s = s.encode('utf-16') if s.startswith('\xff\xfe') or s.startswith('\xfe\xff'): s = s[2:] return s def GetLangPhraseWorkbook(wfname, wtname): wt = pE.Workbook() wf = pE.parse_xls(wfname) for lp in LANG_COL_PAIRS: " for each languages" print >> LOG_FILE, lp wts = wt.add_sheet(lp[0]) # language sheet to write wts_r = 0 # language sheet write column for fsheet in CONTENT_SHEETS: """ Sheet number of FromWorkbook""" k = wf[fsheet][1].keys() for row in range(MAX_ROW): k1 = (row, lp[1]) k2 = (row, lp[1]+1) if k1 in k and k2 in k: wts.write(wts_r, 0, (wf[fsheet][1][k1])) wts.write(wts_r, 1, (wf[fsheet][1][k2])) wts.write(wts_r, 2, 1) wts_r = wts_r +1 wt.save(wtname) def CreateTTSFile(wfname): os.chdir(THIS_DATA_DIR) wf = pE.parse_xls(wfname) for sheet in wf: print >> LOG_FILE, sheet[0] k = sheet[1].keys() os.mkdir(sheet[0]) os.chdir(sheet[0]) for row in range(MAX_ROW): if (row, 0) in k and (row, 1) in k: ttsFilename = sheet[1][(row,0)] ttsContent = ProcContent(sheet[1][(row,1)]) # file name if isinstance(ttsFilename, long) or isinstance(ttsFilename, float): ttsFilename = int(ttsFilename) ttsFilename = unicode(ttsFilename) + u'.tts' if os.path.exists(ttsFilename): print >> LOG_FILE, 'File:', os.path.abspath(ttsFilename), 'already exists' ttsf = open(ttsFilename, 'w') ttsf.write(ttsContent) ttsf.close() os.chdir(THIS_DATA_DIR) def __main__(): if '--excel' in sys.argv or '-e' in sys.argv: GetLangPhraseWorkbook(FROM_EXCEL_FILE, TO_EXCEL_FILE) if '--tts' in sys.argv or '-t' in sys.argv: CreateTTSFile(TO_EXCEL_FILE) if __name__ == '__main__': __main__()
ajibawa-2023/Python-Code-Large/train/row_99123
93
119
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_99123:Import_L5_C0", "label": "os import os, sys", "type": "import", "loc": [5, 5], "level": 0, "parent": null, "vector": [1, 0, 0.042, 0.0084, 0, 0.66, 0.0, 688, 0, 2, 0, 0, 688, 0, 0], "semantic": {"name": "os", "arg_names": [], "import_names": ["os", "sys"], "rhs_call_name": "", "annotation": ""}, "snippet": "import os,sys"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99123:Import_L6_C0", "label": "codecs import codecs", "type": "import", "loc": [6, 6], "level": 0, "parent": null, "vector": [1, 0, 0.0504, 0.0084, 0, 0.66, 0.0455, 220, 0, 1, 0, 0, 220, 0, 0], "semantic": {"name": "codecs", "arg_names": [], "import_names": ["codecs"], "rhs_call_name": "", "annotation": ""}, "snippet": "import codecs"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99123:Import_L7_C0", "label": "re import re", "type": "import", "loc": [7, 7], "level": 0, "parent": null, "vector": [1, 0, 0.0588, 0.0084, 0, 0.66, 0.0909, 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_99123:ImportFrom_L8_C0", "label": "from WorkPath import *", "type": "import", "loc": [8, 8], "level": 0, "parent": null, "vector": [1, 0, 0.0672, 0.0084, 0, 0.66, 0.1364, 126, 0, 1, 0, 0, 126, 0, 0], "semantic": {"name": "WorkPath", "arg_names": [], "import_names": ["*"], "rhs_call_name": "", "annotation": ""}, "snippet": "from WorkPath import *"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99123:Import_L9_C0", "label": "pyExcelerator import pE", "type": "import", "loc": [9, 9], "level": 0, "parent": null, "vector": [1, 0, 0.0756, 0.0084, 0, 0.66, 0.1818, 173, 0, 1, 0, 0, 173, 0, 0], "semantic": {"name": "pyExcelerator", "arg_names": [], "import_names": ["pE"], "rhs_call_name": "", "annotation": ""}, "snippet": "import pyExcelerator as pE"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99123:Assign_L11_C0", "label": "LOG_FILE = open()", "type": "assigned_variable", "loc": [11, 11], "level": 0, "parent": null, "vector": [14, 0, 0.0924, 0.0084, 0, 0.66, 0.2273, 260, 3, 3, 0, 0, 693, 10, 1], "semantic": {"name": "LOG_FILE", "arg_names": [], "import_names": [], "rhs_call_name": "open", "annotation": ""}, "snippet": "LOG_FILE = codecs.open('log.txt','w','utf-8') #sys.stdout"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99123:FunctionDef_L13_C0", "label": "CColA2N", "type": "function", "loc": [13, 18], "level": 0, "parent": null, "vector": [2, 0, 0.1303, 0.0504, 0, 0.66, 0.2727, 911, 0, 1, 1, 0, 0, 0, 4], "semantic": {"name": "CColA2N", "arg_names": ["colName"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def CColA2N(colName):\n\t\"\"\" Convert excel colume to number\"\"\"\n\tn = 0\n\tfor c in colName:\n\t\tn = n*(ord('Z')-ord('A')+1) + (ord(c)-ord('A'))\n\treturn n"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99123:Expr_L14_C1", "label": "expression", "type": "expression", "loc": [14, 14], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99123:FunctionDef_L13_C0", "vector": [8, 1, 0.1176, 0.0084, 1, 0.05, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\"\"\" Convert excel colume to number\"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99123:Assign_L15_C1", "label": "n =", "type": "assigned_variable", "loc": [15, 15], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99123:FunctionDef_L13_C0", "vector": [14, 1, 0.1261, 0.0084, 1, 0.05, 0.3333, 773, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "n", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tn = 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99123:For_L16_C1", "label": "for c", "type": "for", "loc": [16, 17], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99123:FunctionDef_L13_C0", "vector": [6, 1, 0.1387, 0.0168, 1, 0.05, 0.6667, 411, 2, 0, 0, 0, 0, 0, 4], "semantic": {"name": "c", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tfor c in colName:\n\t\tn = n*(ord('Z')-ord('A')+1) + (ord(c)-ord('A'))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99123:Assign_L17_C2", "label": "n =", "type": "assigned_variable", "loc": [17, 17], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99123:For_L16_C1", "vector": [14, 2, 0.1429, 0.0084, 2, 0.41, 0.0, 773, 4, 0, 0, 0, 0, 0, 4], "semantic": {"name": "n", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tn = n*(ord('Z')-ord('A')+1) + (ord(c)-ord('A'))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99123:Return_L18_C1", "label": "return", "type": "return", "loc": [18, 18], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99123:FunctionDef_L13_C0", "vector": [13, 1, 0.1513, 0.0084, 1, 0.05, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\treturn n"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99123:Assign_L20_C0", "label": "THIS_DATA_DIR =", "type": "assigned_variable", "loc": [20, 20], "level": 0, "parent": null, "vector": [14, 0, 0.1681, 0.0084, 0, 0.66, 0.3182, 742, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "THIS_DATA_DIR", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "THIS_DATA_DIR = DATA_DIR + r'\\VoiceID'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99123:Assign_L21_C0", "label": "FROM_EXCEL_FILE =", "type": "assigned_variable", "loc": [21, 21], "level": 0, "parent": null, "vector": [14, 0, 0.1765, 0.0084, 0, 0.66, 0.3636, 554, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "FROM_EXCEL_FILE", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "FROM_EXCEL_FILE = THIS_DATA_DIR + r'\\Voice_ID_list_V15.xls'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99123:Assign_L22_C0", "label": "TO_EXCEL_FILE =", "type": "assigned_variable", "loc": [22, 22], "level": 0, "parent": null, "vector": [14, 0, 0.1849, 0.0084, 0, 0.66, 0.4091, 107, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "TO_EXCEL_FILE", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "TO_EXCEL_FILE = THIS_DATA_DIR + r'\\S.xls'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99123:Assign_L24_C0", "label": "LANGS =", "type": "assigned_variable", "loc": [24, 25], "level": 0, "parent": null, "vector": [14, 0, 0.2059, 0.0168, 0, 0.66, 0.4545, 859, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "LANGS", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "LANGS = ('International English', 'US English', 'UK English', 'German', 'French', 'Dutch', 'Flemmish', 'Spanish',\n\t\t\t'Italian', 'Swedish', 'Danish', 'Norwegian', 'Portuguese', 'Russian')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99123:Assign_L26_C0", "label": "LANGS_START_COL =", "type": "assigned_variable", "loc": [26, 26], "level": 0, "parent": null, "vector": [14, 0, 0.2185, 0.0084, 0, 0.66, 0.5, 517, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "LANGS_START_COL", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "LANGS_START_COL = 1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99123:Assign_L27_C0", "label": "LANGS_POS_COL =", "type": "assigned_variable", "loc": [27, 27], "level": 0, "parent": null, "vector": [14, 0, 0.2269, 0.0084, 0, 0.66, 0.5455, 265, 5, 0, 0, 0, 0, 0, 2], "semantic": {"name": "LANGS_POS_COL", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "LANGS_POS_COL = ( n*2 + LANGS_START_COL for n in range(len(LANGS)))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99123:Assign_L28_C0", "label": "LANG_COL_PAIRS = zip()", "type": "assigned_variable", "loc": [28, 28], "level": 0, "parent": null, "vector": [14, 0, 0.2353, 0.0084, 0, 0.66, 0.5909, 37, 3, 2, 0, 0, 814, 10, 1], "semantic": {"name": "LANG_COL_PAIRS", "arg_names": [], "import_names": [], "rhs_call_name": "zip", "annotation": ""}, "snippet": "LANG_COL_PAIRS = zip(LANGS, LANGS_POS_COL)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99123:Assign_L29_C0", "label": "MAX_ROW =", "type": "assigned_variable", "loc": [29, 29], "level": 0, "parent": null, "vector": [14, 0, 0.2437, 0.0084, 0, 0.66, 0.6364, 26, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "MAX_ROW", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "MAX_ROW = 2000"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99123:Assign_L31_C0", "label": "CONTENT_SHEETS = range()", "type": "assigned_variable", "loc": [31, 31], "level": 0, "parent": null, "vector": [14, 0, 0.2605, 0.0084, 0, 0.66, 0.6818, 176, 3, 2, 0, 0, 816, 10, 1], "semantic": {"name": "CONTENT_SHEETS", "arg_names": [], "import_names": [], "rhs_call_name": "range", "annotation": ""}, "snippet": "CONTENT_SHEETS = range(1,8)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99123:Expr_L32_C0", "label": "chdir()", "type": "expression", "loc": [32, 32], "level": 0, "parent": null, "vector": [8, 0, 0.2689, 0.0084, 0, 0.66, 0.7273, 122, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "chdir", "arg_names": [], "import_names": [], "rhs_call_name": "chdir", "annotation": ""}, "snippet": "os.chdir(THIS_DATA_DIR)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99123:Assign_L34_C0", "label": "f = parse_xls()", "type": "assigned_variable", "loc": [34, 34], "level": 0, "parent": null, "vector": [14, 0, 0.2857, 0.0084, 0, 0.66, 0.7727, 899, 3, 1, 0, 0, 508, 10, 1], "semantic": {"name": "f", "arg_names": [], "import_names": [], "rhs_call_name": "parse_xls", "annotation": ""}, "snippet": "f = pE.parse_xls(FROM_EXCEL_FILE)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99123:FunctionDef_L36_C0", "label": "ProcContent", "type": "function", "loc": [36, 59], "level": 0, "parent": null, "vector": [2, 0, 0.3992, 0.2017, 0, 0.66, 0.8182, 561, 0, 1, 1, 0, 0, 0, 23], "semantic": {"name": "ProcContent", "arg_names": ["s"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def ProcContent(s):\n\toris = s\n\ts = unicode(s)\n\tsp = True\n\tif re.match(u'\\(.*\\)\\s*(.*?)\\s*\\[.*\\]\\s*\\(.*\\)\\s*$', s):\t\t\t\t# (*)*[*](*)\n\t\ts = re.match(u'\\(.*\\)\\s*(.*?)\\s*\\[.*\\]\\s*\\(.*\\)\\s*$', s).group(1)\n\telif re.match(u'\\s*.*?\\s*\uff08(.*?)\uff09\\s*$', s):\t\t\t\t\t\t\t# *\uff08\u00d7\uff09\n\t\ts = re.match(u'\\s*.*?\\s*\uff08(.*?)\uff09\\s*$', s).group(1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99123:Assign_L37_C1", "label": "oris =", "type": "assigned_variable", "loc": [37, 37], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99123:FunctionDef_L36_C0", "vector": [14, 1, 0.3109, 0.0084, 1, 0.32, 0.0, 77, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "oris", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\toris = s"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99123:Assign_L38_C1", "label": "s = unicode()", "type": "assigned_variable", "loc": [38, 38], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99123:FunctionDef_L36_C0", "vector": [14, 1, 0.3193, 0.0084, 1, 0.32, 0.125, 553, 3, 1, 0, 0, 733, 10, 1], "semantic": {"name": "s", "arg_names": [], "import_names": [], "rhs_call_name": "unicode", "annotation": ""}, "snippet": "\ts = unicode(s)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99123:Assign_L39_C1", "label": "sp =", "type": "assigned_variable", "loc": [39, 39], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99123:FunctionDef_L36_C0", "vector": [14, 1, 0.3277, 0.0084, 1, 0.32, 0.25, 140, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "sp", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tsp = True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99123:If_L40_C1", "label": "if", "type": "if", "loc": [40, 52], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99123:FunctionDef_L36_C0", "vector": [4, 1, 0.3866, 0.1092, 1, 0.32, 0.375, 0, 3, 0, 0, 0, 0, 0, 18], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tif re.match(u'\\(.*\\)\\s*(.*?)\\s*\\[.*\\]\\s*\\(.*\\)\\s*$', s):\t\t\t\t# (*)*[*](*)\n\t\ts = re.match(u'\\(.*\\)\\s*(.*?)\\s*\\[.*\\]\\s*\\(.*\\)\\s*$', s).group(1)\n\telif re.match(u'\\s*.*?\\s*\uff08(.*?)\uff09\\s*$', s):\t\t\t\t\t\t\t# *\uff08\u00d7\uff09\n\t\ts = re.match(u'\\s*.*?\\s*\uff08(.*?)\uff09\\s*$', s).group(1)\n\telif re.match(u'\\s*.*?\\s*\\((.*?)\\)\\s*$', s):\t\t\t\t\t\t\t# *(*)\n\t\ts = re.match(u'\\s*.*?\\s*\\((.*?)\\)\\s*$', s).group(1)\n\telif re.match(u'\\s*\uff08(.*?)\uff09\\s*$', s):\t\t\t\t\t\t\t\t\t# (*)\n\t\ts = re.match(u'\\s*\uff08(.*?)\uff09\\s*$', s).group(1)\t\t\t"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99123:Assign_L41_C2", "label": "s = group()", "type": "assigned_variable", "loc": [41, 41], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99123:If_L40_C1", "vector": [14, 2, 0.3445, 0.0084, 2, 0.11, 0.0, 553, 3, 1, 0, 0, 43, 10, 2], "semantic": {"name": "s", "arg_names": [], "import_names": [], "rhs_call_name": "group", "annotation": ""}, "snippet": "\t\ts = re.match(u'\\(.*\\)\\s*(.*?)\\s*\\[.*\\]\\s*\\(.*\\)\\s*$', s).group(1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99123:If_L42_C1", "label": "if", "type": "if", "loc": [42, 52], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99123:If_L40_C1", "vector": [4, 2, 0.395, 0.0924, 2, 0.11, 1.0, 0, 3, 0, 0, 0, 0, 0, 15], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\telif re.match(u'\\s*.*?\\s*\uff08(.*?)\uff09\\s*$', s):\t\t\t\t\t\t\t# *\uff08\u00d7\uff09\n\t\ts = re.match(u'\\s*.*?\\s*\uff08(.*?)\uff09\\s*$', s).group(1)\n\telif re.match(u'\\s*.*?\\s*\\((.*?)\\)\\s*$', s):\t\t\t\t\t\t\t# *(*)\n\t\ts = re.match(u'\\s*.*?\\s*\\((.*?)\\)\\s*$', s).group(1)\n\telif re.match(u'\\s*\uff08(.*?)\uff09\\s*$', s):\t\t\t\t\t\t\t\t\t# (*)\n\t\ts = re.match(u'\\s*\uff08(.*?)\uff09\\s*$', s).group(1)\t\t\t\n\telse:\n\t\tif s.find(u'(')>=0 or s.find(u')')>=0 or s.find(u'\uff08')>=0 \\"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99123:Assign_L43_C2", "label": "s = group()", "type": "assigned_variable", "loc": [43, 43], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99123:If_L42_C1", "vector": [14, 3, 0.3613, 0.0084, 3, 0.3, 0.0, 553, 3, 1, 0, 0, 43, 10, 2], "semantic": {"name": "s", "arg_names": [], "import_names": [], "rhs_call_name": "group", "annotation": ""}, "snippet": "\t\ts = re.match(u'\\s*.*?\\s*\uff08(.*?)\uff09\\s*$', s).group(1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99123:If_L44_C1", "label": "if", "type": "if", "loc": [44, 52], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99123:If_L42_C1", "vector": [4, 3, 0.4034, 0.0756, 3, 0.3, 1.0, 0, 3, 0, 0, 0, 0, 0, 12], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\telif re.match(u'\\s*.*?\\s*\\((.*?)\\)\\s*$', s):\t\t\t\t\t\t\t# *(*)\n\t\ts = re.match(u'\\s*.*?\\s*\\((.*?)\\)\\s*$', s).group(1)\n\telif re.match(u'\\s*\uff08(.*?)\uff09\\s*$', s):\t\t\t\t\t\t\t\t\t# (*)\n\t\ts = re.match(u'\\s*\uff08(.*?)\uff09\\s*$', s).group(1)\t\t\t\n\telse:\n\t\tif s.find(u'(')>=0 or s.find(u')')>=0 or s.find(u'\uff08')>=0 \\\n\t\t\t\tor s.find(u'\uff09')>=0 or s.find(u'\u300a')>=0 or s.find(u'<')>=0:\n\t\t\tprint >> LOG_FILE, 'Unexpected content:', s"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99123:Assign_L45_C2", "label": "s = group()", "type": "assigned_variable", "loc": [45, 45], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99123:If_L44_C1", "vector": [14, 4, 0.3782, 0.0084, 4, 0.55, 0.0, 553, 3, 1, 0, 0, 43, 10, 2], "semantic": {"name": "s", "arg_names": [], "import_names": [], "rhs_call_name": "group", "annotation": ""}, "snippet": "\t\ts = re.match(u'\\s*.*?\\s*\\((.*?)\\)\\s*$', s).group(1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99123:If_L46_C1", "label": "if", "type": "if", "loc": [46, 52], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99123:If_L44_C1", "vector": [4, 4, 0.4118, 0.0588, 4, 0.55, 1.0, 0, 3, 0, 0, 0, 0, 0, 9], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\telif re.match(u'\\s*\uff08(.*?)\uff09\\s*$', s):\t\t\t\t\t\t\t\t\t# (*)\n\t\ts = re.match(u'\\s*\uff08(.*?)\uff09\\s*$', s).group(1)\t\t\t\n\telse:\n\t\tif s.find(u'(')>=0 or s.find(u')')>=0 or s.find(u'\uff08')>=0 \\\n\t\t\t\tor s.find(u'\uff09')>=0 or s.find(u'\u300a')>=0 or s.find(u'<')>=0:\n\t\t\tprint >> LOG_FILE, 'Unexpected content:', s\n\t\tsp = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99123:Assign_L47_C2", "label": "s = group()", "type": "assigned_variable", "loc": [47, 47], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99123:If_L46_C1", "vector": [14, 5, 0.395, 0.0084, 5, 0.64, 0.0, 553, 3, 1, 0, 0, 43, 10, 2], "semantic": {"name": "s", "arg_names": [], "import_names": [], "rhs_call_name": "group", "annotation": ""}, "snippet": "\t\ts = re.match(u'\\s*\uff08(.*?)\uff09\\s*$', s).group(1)\t\t\t"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99123:If_L49_C2", "label": "if", "type": "if", "loc": [49, 51], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99123:If_L46_C1", "vector": [4, 5, 0.4202, 0.0252, 5, 0.64, 0.5, 0, 0, 0, 0, 0, 0, 0, 6], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tif s.find(u'(')>=0 or s.find(u')')>=0 or s.find(u'\uff08')>=0 \\\n\t\t\t\tor s.find(u'\uff09')>=0 or s.find(u'\u300a')>=0 or s.find(u'<')>=0:\n\t\t\tprint >> LOG_FILE, 'Unexpected content:', s"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99123:Expr_L51_C3", "label": "expression", "type": "expression", "loc": [51, 51], "level": 6, "parent": "ajibawa-2023/Python-Code-Large/train/row_99123:If_L49_C2", "vector": [8, 6, 0.4286, 0.0084, 6, 0.04, 0.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\tprint >> LOG_FILE, 'Unexpected content:', s"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99123:Assign_L52_C2", "label": "sp =", "type": "assigned_variable", "loc": [52, 52], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99123:If_L46_C1", "vector": [14, 5, 0.437, 0.0084, 5, 0.64, 1.0, 140, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "sp", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tsp = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99123:If_L53_C1", "label": "if", "type": "if", "loc": [53, 54], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99123:FunctionDef_L36_C0", "vector": [4, 1, 0.4496, 0.0168, 1, 0.32, 0.5, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tif sp:\n\t\tprint >> LOG_FILE, oris, '->', s"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99123:Expr_L54_C2", "label": "expression", "type": "expression", "loc": [54, 54], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99123:If_L53_C1", "vector": [8, 2, 0.4538, 0.0084, 2, 0.93, 0.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tprint >> LOG_FILE, oris, '->', s"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99123:Assign_L55_C1", "label": "s =", "type": "assigned_variable", "loc": [55, 55], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99123:FunctionDef_L36_C0", "vector": [14, 1, 0.4622, 0.0084, 1, 0.32, 0.625, 553, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "s", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\ts = unicode(s) + u'\\0'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99123:Assign_L56_C1", "label": "s = encode()", "type": "assigned_variable", "loc": [56, 56], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99123:FunctionDef_L36_C0", "vector": [14, 1, 0.4706, 0.0084, 1, 0.32, 0.75, 553, 3, 1, 0, 0, 623, 10, 1], "semantic": {"name": "s", "arg_names": [], "import_names": [], "rhs_call_name": "encode", "annotation": ""}, "snippet": "\ts = s.encode('utf-16')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99123:If_L57_C1", "label": "if", "type": "if", "loc": [57, 58], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99123:FunctionDef_L36_C0", "vector": [4, 1, 0.4832, 0.0168, 1, 0.32, 0.875, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tif s.startswith('\\xff\\xfe') or s.startswith('\\xfe\\xff'):\n\t\ts = s[2:]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99123:Assign_L58_C2", "label": "s =", "type": "assigned_variable", "loc": [58, 58], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99123:If_L57_C1", "vector": [14, 2, 0.4874, 0.0084, 2, 0.59, 0.0, 553, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "s", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\ts = s[2:]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99123:Return_L59_C1", "label": "return", "type": "return", "loc": [59, 59], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99123:FunctionDef_L36_C0", "vector": [13, 1, 0.4958, 0.0084, 1, 0.32, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\treturn s"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99123:FunctionDef_L61_C0", "label": "GetLangPhraseWorkbook", "type": "function", "loc": [61, 80], "level": 0, "parent": null, "vector": [2, 0, 0.5924, 0.1681, 0, 0.66, 0.8636, 431, 0, 2, 0, 0, 0, 0, 9], "semantic": {"name": "GetLangPhraseWorkbook", "arg_names": ["wfname", "wtname"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def GetLangPhraseWorkbook(wfname, wtname):\n\twt = pE.Workbook()\n\twf = pE.parse_xls(wfname)\n\tfor lp in LANG_COL_PAIRS:\n\t\t\" for each languages\"\n\t\tprint >> LOG_FILE, lp\n\t\twts = wt.add_sheet(lp[0]) # language sheet to write\n\t\twts_r = 0 # language sheet write column"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99123:Assign_L62_C1", "label": "wt = Workbook()", "type": "assigned_variable", "loc": [62, 62], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99123:FunctionDef_L61_C0", "vector": [14, 1, 0.521, 0.0084, 1, 0.26, 0.0, 396, 3, 0, 0, 0, 590, 10, 1], "semantic": {"name": "wt", "arg_names": [], "import_names": [], "rhs_call_name": "Workbook", "annotation": ""}, "snippet": "\twt = pE.Workbook()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99123:Assign_L63_C1", "label": "wf = parse_xls()", "type": "assigned_variable", "loc": [63, 63], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99123:FunctionDef_L61_C0", "vector": [14, 1, 0.5294, 0.0084, 1, 0.26, 0.3333, 192, 3, 1, 0, 0, 508, 10, 1], "semantic": {"name": "wf", "arg_names": [], "import_names": [], "rhs_call_name": "parse_xls", "annotation": ""}, "snippet": "\twf = pE.parse_xls(wfname)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99123:For_L64_C1", "label": "for lp", "type": "for", "loc": [64, 79], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99123:FunctionDef_L61_C0", "vector": [6, 1, 0.6008, 0.1345, 1, 0.26, 0.6667, 721, 2, 0, 0, 0, 0, 0, 6], "semantic": {"name": "lp", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tfor lp in LANG_COL_PAIRS:\n\t\t\" for each languages\"\n\t\tprint >> LOG_FILE, lp\n\t\twts = wt.add_sheet(lp[0]) # language sheet to write\n\t\twts_r = 0 # language sheet write column\n\t\tfor fsheet in CONTENT_SHEETS:\n\t\t\t\"\"\" Sheet number of FromWorkbook\"\"\"\n\t\t\tk = wf[fsheet][1].keys()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99123:Expr_L65_C2", "label": "expression", "type": "expression", "loc": [65, 65], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99123:For_L64_C1", "vector": [8, 2, 0.5462, 0.0084, 2, 0.49, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\" for each languages\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99123:Expr_L66_C2", "label": "expression", "type": "expression", "loc": [66, 66], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99123:For_L64_C1", "vector": [8, 2, 0.5546, 0.0084, 2, 0.49, 0.25, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tprint >> LOG_FILE, lp"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99123:Assign_L67_C2", "label": "wts = add_sheet()", "type": "assigned_variable", "loc": [67, 67], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99123:For_L64_C1", "vector": [14, 2, 0.563, 0.0084, 2, 0.49, 0.5, 220, 3, 1, 0, 0, 478, 10, 1], "semantic": {"name": "wts", "arg_names": [], "import_names": [], "rhs_call_name": "add_sheet", "annotation": ""}, "snippet": "\t\twts = wt.add_sheet(lp[0]) # language sheet to write"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99123:Assign_L68_C2", "label": "wts_r =", "type": "assigned_variable", "loc": [68, 68], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99123:For_L64_C1", "vector": [14, 2, 0.5714, 0.0084, 2, 0.49, 0.75, 475, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "wts_r", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\twts_r = 0 # language sheet write column"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99123:For_L69_C2", "label": "for fsheet", "type": "for", "loc": [69, 79], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99123:For_L64_C1", "vector": [6, 2, 0.6218, 0.0924, 2, 0.49, 1.0, 526, 2, 0, 0, 0, 0, 0, 5], "semantic": {"name": "fsheet", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tfor fsheet in CONTENT_SHEETS:\n\t\t\t\"\"\" Sheet number of FromWorkbook\"\"\"\n\t\t\tk = wf[fsheet][1].keys()\n\t\t\tfor row in range(MAX_ROW):\n\t\t\t\tk1 = (row, lp[1])\n\t\t\t\tk2 = (row, lp[1]+1)\n\t\t\t\tif k1 in k and k2 in k:\n\t\t\t\t\twts.write(wts_r, 0, (wf[fsheet][1][k1]))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99123:Expr_L70_C3", "label": "expression", "type": "expression", "loc": [70, 70], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99123:For_L69_C2", "vector": [8, 3, 0.5882, 0.0084, 3, 0.23, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\t\"\"\" Sheet number of FromWorkbook\"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99123:Assign_L71_C3", "label": "k = keys()", "type": "assigned_variable", "loc": [71, 71], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99123:For_L69_C2", "vector": [14, 3, 0.5966, 0.0084, 3, 0.23, 0.5, 954, 3, 0, 0, 0, 204, 10, 1], "semantic": {"name": "k", "arg_names": [], "import_names": [], "rhs_call_name": "keys", "annotation": ""}, "snippet": "\t\t\tk = wf[fsheet][1].keys()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99123:For_L72_C3", "label": "for row", "type": "for", "loc": [72, 79], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99123:For_L69_C2", "vector": [6, 3, 0.6345, 0.0672, 3, 0.23, 1.0, 767, 3, 0, 0, 0, 0, 0, 4], "semantic": {"name": "row", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\tfor row in range(MAX_ROW):\n\t\t\t\tk1 = (row, lp[1])\n\t\t\t\tk2 = (row, lp[1]+1)\n\t\t\t\tif k1 in k and k2 in k:\n\t\t\t\t\twts.write(wts_r, 0, (wf[fsheet][1][k1]))\n\t\t\t\t\twts.write(wts_r, 1, (wf[fsheet][1][k2]))\n\t\t\t\t\twts.write(wts_r, 2, 1)\n\t\t\t\t\twts_r = wts_r +1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99123:Assign_L73_C4", "label": "k1 =", "type": "assigned_variable", "loc": [73, 73], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99123:For_L72_C3", "vector": [14, 4, 0.6134, 0.0084, 4, 0.99, 0.0, 263, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "k1", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\t\tk1 = (row, lp[1])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99123:Assign_L74_C4", "label": "k2 =", "type": "assigned_variable", "loc": [74, 74], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99123:For_L72_C3", "vector": [14, 4, 0.6218, 0.0084, 4, 0.99, 0.5, 482, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "k2", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\t\tk2 = (row, lp[1]+1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99123:If_L75_C4", "label": "if", "type": "if", "loc": [75, 79], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99123:For_L72_C3", "vector": [4, 4, 0.6471, 0.042, 4, 0.99, 1.0, 0, 0, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\t\tif k1 in k and k2 in k:\n\t\t\t\t\twts.write(wts_r, 0, (wf[fsheet][1][k1]))\n\t\t\t\t\twts.write(wts_r, 1, (wf[fsheet][1][k2]))\n\t\t\t\t\twts.write(wts_r, 2, 1)\n\t\t\t\t\twts_r = wts_r +1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99123:Expr_L76_C5", "label": "write()", "type": "expression", "loc": [76, 76], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99123:If_L75_C4", "vector": [8, 5, 0.6387, 0.0084, 5, 0.85, 0.0, 837, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "write", "arg_names": [], "import_names": [], "rhs_call_name": "write", "annotation": ""}, "snippet": "\t\t\t\t\twts.write(wts_r, 0, (wf[fsheet][1][k1]))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99123:Expr_L77_C5", "label": "write()", "type": "expression", "loc": [77, 77], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99123:If_L75_C4", "vector": [8, 5, 0.6471, 0.0084, 5, 0.85, 0.3333, 837, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "write", "arg_names": [], "import_names": [], "rhs_call_name": "write", "annotation": ""}, "snippet": "\t\t\t\t\twts.write(wts_r, 1, (wf[fsheet][1][k2]))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99123:Expr_L78_C5", "label": "write()", "type": "expression", "loc": [78, 78], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99123:If_L75_C4", "vector": [8, 5, 0.6555, 0.0084, 5, 0.85, 0.6667, 837, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "write", "arg_names": [], "import_names": [], "rhs_call_name": "write", "annotation": ""}, "snippet": "\t\t\t\t\twts.write(wts_r, 2, 1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99123:Assign_L79_C5", "label": "wts_r =", "type": "assigned_variable", "loc": [79, 79], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99123:If_L75_C4", "vector": [14, 5, 0.6639, 0.0084, 5, 0.85, 1.0, 475, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "wts_r", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\t\t\twts_r = wts_r +1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99123:Expr_L80_C1", "label": "save()", "type": "expression", "loc": [80, 80], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99123:FunctionDef_L61_C0", "vector": [8, 1, 0.6723, 0.0084, 1, 0.26, 1.0, 928, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "save", "arg_names": [], "import_names": [], "rhs_call_name": "save", "annotation": ""}, "snippet": "\twt.save(wtname)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99123:FunctionDef_L84_C0", "label": "CreateTTSFile", "type": "function", "loc": [84, 105], "level": 0, "parent": null, "vector": [2, 0, 0.7941, 0.1849, 0, 0.66, 0.9091, 904, 0, 1, 0, 0, 0, 0, 17], "semantic": {"name": "CreateTTSFile", "arg_names": ["wfname"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def CreateTTSFile(wfname):\n\tos.chdir(THIS_DATA_DIR)\n\twf = pE.parse_xls(wfname)\n\tfor sheet in wf:\n\t\tprint >> LOG_FILE, sheet[0]\n\t\tk = sheet[1].keys()\n\t\tos.mkdir(sheet[0])\n\t\tos.chdir(sheet[0])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99123:Expr_L85_C1", "label": "chdir()", "type": "expression", "loc": [85, 85], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99123:FunctionDef_L84_C0", "vector": [8, 1, 0.7143, 0.0084, 1, 0.43, 0.0, 122, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "chdir", "arg_names": [], "import_names": [], "rhs_call_name": "chdir", "annotation": ""}, "snippet": "\tos.chdir(THIS_DATA_DIR)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99123:Assign_L86_C1", "label": "wf = parse_xls()", "type": "assigned_variable", "loc": [86, 86], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99123:FunctionDef_L84_C0", "vector": [14, 1, 0.7227, 0.0084, 1, 0.43, 0.5, 192, 3, 1, 0, 0, 508, 10, 1], "semantic": {"name": "wf", "arg_names": [], "import_names": [], "rhs_call_name": "parse_xls", "annotation": ""}, "snippet": "\twf = pE.parse_xls(wfname)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99123:For_L87_C1", "label": "for sheet", "type": "for", "loc": [87, 105], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99123:FunctionDef_L84_C0", "vector": [6, 1, 0.8067, 0.1597, 1, 0.43, 1.0, 737, 2, 0, 0, 0, 0, 0, 15], "semantic": {"name": "sheet", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tfor sheet in wf:\n\t\tprint >> LOG_FILE, sheet[0]\n\t\tk = sheet[1].keys()\n\t\tos.mkdir(sheet[0])\n\t\tos.chdir(sheet[0])\n\t\tfor row in range(MAX_ROW):\n\t\t\tif (row, 0) in k and (row, 1) in k:\n\t\t\t\tttsFilename = sheet[1][(row,0)]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99123:Expr_L88_C2", "label": "expression", "type": "expression", "loc": [88, 88], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99123:For_L87_C1", "vector": [8, 2, 0.7395, 0.0084, 2, 0.47, 0.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tprint >> LOG_FILE, sheet[0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99123:Assign_L89_C2", "label": "k = keys()", "type": "assigned_variable", "loc": [89, 89], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99123:For_L87_C1", "vector": [14, 2, 0.7479, 0.0084, 2, 0.47, 0.2, 954, 3, 0, 0, 0, 204, 10, 1], "semantic": {"name": "k", "arg_names": [], "import_names": [], "rhs_call_name": "keys", "annotation": ""}, "snippet": "\t\tk = sheet[1].keys()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99123:Expr_L90_C2", "label": "mkdir()", "type": "expression", "loc": [90, 90], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99123:For_L87_C1", "vector": [8, 2, 0.7563, 0.0084, 2, 0.47, 0.4, 853, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "mkdir", "arg_names": [], "import_names": [], "rhs_call_name": "mkdir", "annotation": ""}, "snippet": "\t\tos.mkdir(sheet[0])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99123:Expr_L91_C2", "label": "chdir()", "type": "expression", "loc": [91, 91], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99123:For_L87_C1", "vector": [8, 2, 0.7647, 0.0084, 2, 0.47, 0.6, 122, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "chdir", "arg_names": [], "import_names": [], "rhs_call_name": "chdir", "annotation": ""}, "snippet": "\t\tos.chdir(sheet[0])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99123:For_L92_C2", "label": "for row", "type": "for", "loc": [92, 104], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99123:For_L87_C1", "vector": [6, 2, 0.8235, 0.1092, 2, 0.47, 0.8, 767, 3, 0, 0, 0, 0, 0, 11], "semantic": {"name": "row", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tfor row in range(MAX_ROW):\n\t\t\tif (row, 0) in k and (row, 1) in k:\n\t\t\t\tttsFilename = sheet[1][(row,0)]\n\t\t\t\tttsContent = ProcContent(sheet[1][(row,1)])\n\t\t\t\t# file name\n\t\t\t\tif isinstance(ttsFilename, long) or isinstance(ttsFilename, float):\n\t\t\t\t\tttsFilename = int(ttsFilename)\n\t\t\t\tttsFilename = unicode(ttsFilename) + u'.tts'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99123:If_L93_C3", "label": "if", "type": "if", "loc": [93, 104], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99123:For_L92_C2", "vector": [4, 3, 0.8277, 0.1008, 3, 0.52, 0.0, 0, 0, 0, 0, 0, 0, 0, 10], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\tif (row, 0) in k and (row, 1) in k:\n\t\t\t\tttsFilename = sheet[1][(row,0)]\n\t\t\t\tttsContent = ProcContent(sheet[1][(row,1)])\n\t\t\t\t# file name\n\t\t\t\tif isinstance(ttsFilename, long) or isinstance(ttsFilename, float):\n\t\t\t\t\tttsFilename = int(ttsFilename)\n\t\t\t\tttsFilename = unicode(ttsFilename) + u'.tts'\n\t\t\t\tif os.path.exists(ttsFilename):"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99123:Assign_L94_C4", "label": "ttsFilename =", "type": "assigned_variable", "loc": [94, 94], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99123:If_L93_C3", "vector": [14, 4, 0.7899, 0.0084, 4, 0.42, 0.0, 467, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "ttsFilename", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\t\tttsFilename = sheet[1][(row,0)]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99123:Assign_L95_C4", "label": "ttsContent = ProcContent()", "type": "assigned_variable", "loc": [95, 95], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99123:If_L93_C3", "vector": [14, 4, 0.7983, 0.0084, 4, 0.42, 0.1429, 573, 3, 1, 0, 0, 561, 10, 1], "semantic": {"name": "ttsContent", "arg_names": [], "import_names": [], "rhs_call_name": "ProcContent", "annotation": ""}, "snippet": "\t\t\t\tttsContent = ProcContent(sheet[1][(row,1)])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99123:If_L97_C4", "label": "if", "type": "if", "loc": [97, 98], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99123:If_L93_C3", "vector": [4, 4, 0.8193, 0.0168, 4, 0.42, 0.2857, 0, 0, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\t\tif isinstance(ttsFilename, long) or isinstance(ttsFilename, float):\n\t\t\t\t\tttsFilename = int(ttsFilename)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99123:Assign_L98_C5", "label": "ttsFilename = int()", "type": "assigned_variable", "loc": [98, 98], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99123:If_L97_C4", "vector": [14, 5, 0.8235, 0.0084, 5, 0.93, 0.0, 467, 3, 1, 0, 0, 901, 10, 1], "semantic": {"name": "ttsFilename", "arg_names": [], "import_names": [], "rhs_call_name": "int", "annotation": ""}, "snippet": "\t\t\t\t\tttsFilename = int(ttsFilename)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99123:Assign_L99_C4", "label": "ttsFilename =", "type": "assigned_variable", "loc": [99, 99], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99123:If_L93_C3", "vector": [14, 4, 0.8319, 0.0084, 4, 0.42, 0.4286, 467, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "ttsFilename", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\t\tttsFilename = unicode(ttsFilename) + u'.tts'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99123:If_L100_C4", "label": "if", "type": "if", "loc": [100, 101], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99123:If_L93_C3", "vector": [4, 4, 0.8445, 0.0168, 4, 0.42, 0.5714, 0, 3, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\t\tif os.path.exists(ttsFilename):\n\t\t\t\t\tprint >> LOG_FILE, 'File:', os.path.abspath(ttsFilename), 'already exists'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99123:Expr_L101_C5", "label": "expression", "type": "expression", "loc": [101, 101], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99123:If_L100_C4", "vector": [8, 5, 0.8487, 0.0084, 5, 0.75, 0.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\t\t\tprint >> LOG_FILE, 'File:', os.path.abspath(ttsFilename), 'already exists'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99123:Assign_L102_C4", "label": "ttsf = open()", "type": "assigned_variable", "loc": [102, 102], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99123:If_L93_C3", "vector": [14, 4, 0.8571, 0.0084, 4, 0.42, 0.7143, 661, 3, 2, 0, 0, 693, 10, 1], "semantic": {"name": "ttsf", "arg_names": [], "import_names": [], "rhs_call_name": "open", "annotation": ""}, "snippet": "\t\t\t\tttsf = open(ttsFilename, 'w')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99123:Expr_L103_C4", "label": "write()", "type": "expression", "loc": [103, 103], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99123:If_L93_C3", "vector": [8, 4, 0.8655, 0.0084, 4, 0.42, 0.8571, 837, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "write", "arg_names": [], "import_names": [], "rhs_call_name": "write", "annotation": ""}, "snippet": "\t\t\t\tttsf.write(ttsContent)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99123:Expr_L104_C4", "label": "close()", "type": "expression", "loc": [104, 104], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99123:If_L93_C3", "vector": [8, 4, 0.8739, 0.0084, 4, 0.42, 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\t\tttsf.close()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99123:Expr_L105_C2", "label": "chdir()", "type": "expression", "loc": [105, 105], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99123:For_L87_C1", "vector": [8, 2, 0.8824, 0.0084, 2, 0.47, 1.0, 122, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "chdir", "arg_names": [], "import_names": [], "rhs_call_name": "chdir", "annotation": ""}, "snippet": "\t\tos.chdir(THIS_DATA_DIR)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99123:FunctionDef_L109_C0", "label": "__main__", "type": "function", "loc": [109, 113], "level": 0, "parent": null, "vector": [2, 0, 0.9328, 0.042, 0, 0.66, 0.9545, 593, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "__main__", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def __main__():\n\tif '--excel' in sys.argv or '-e' in sys.argv:\n\t\tGetLangPhraseWorkbook(FROM_EXCEL_FILE, TO_EXCEL_FILE)\n\tif '--tts' in sys.argv or '-t' in sys.argv:\n\t\tCreateTTSFile(TO_EXCEL_FILE)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99123:If_L110_C1", "label": "if", "type": "if", "loc": [110, 111], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99123:FunctionDef_L109_C0", "vector": [4, 1, 0.9286, 0.0168, 1, 0.9, 0.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tif '--excel' in sys.argv or '-e' in sys.argv:\n\t\tGetLangPhraseWorkbook(FROM_EXCEL_FILE, TO_EXCEL_FILE)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99123:Expr_L111_C2", "label": "GetLangPhraseWorkbook()", "type": "expression", "loc": [111, 111], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99123:If_L110_C1", "vector": [8, 2, 0.9328, 0.0084, 2, 0.57, 0.0, 431, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "GetLangPhraseWorkbook", "arg_names": [], "import_names": [], "rhs_call_name": "GetLangPhraseWorkbook", "annotation": ""}, "snippet": "\t\tGetLangPhraseWorkbook(FROM_EXCEL_FILE, TO_EXCEL_FILE)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99123:If_L112_C1", "label": "if", "type": "if", "loc": [112, 113], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99123:FunctionDef_L109_C0", "vector": [4, 1, 0.9454, 0.0168, 1, 0.9, 1.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tif '--tts' in sys.argv or '-t' in sys.argv:\n\t\tCreateTTSFile(TO_EXCEL_FILE)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99123:Expr_L113_C2", "label": "CreateTTSFile()", "type": "expression", "loc": [113, 113], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99123:If_L112_C1", "vector": [8, 2, 0.9496, 0.0084, 2, 0.0, 0.0, 904, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "CreateTTSFile", "arg_names": [], "import_names": [], "rhs_call_name": "CreateTTSFile", "annotation": ""}, "snippet": "\t\tCreateTTSFile(TO_EXCEL_FILE)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99123:If_L116_C0", "label": "if", "type": "if", "loc": [116, 117], "level": 0, "parent": null, "vector": [4, 0, 0.979, 0.0168, 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\t__main__()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99123:Expr_L117_C1", "label": "__main__()", "type": "expression", "loc": [117, 117], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99123:If_L116_C0", "vector": [8, 1, 0.9832, 0.0084, 1, 0.33, 0.0, 593, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "__main__", "arg_names": [], "import_names": [], "rhs_call_name": "__main__", "annotation": ""}, "snippet": "\t__main__()"}]
[{"f": "ajibawa-2023/Python-Code-Large/train/row_99123:FunctionDef_L13_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99123:Expr_L14_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99123:FunctionDef_L13_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99123:Assign_L15_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99123:FunctionDef_L13_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99123:For_L16_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99123:For_L16_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99123:Assign_L17_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99123:FunctionDef_L13_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99123:Return_L18_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99123:FunctionDef_L36_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99123:Assign_L37_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99123:FunctionDef_L36_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99123:Assign_L38_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99123:FunctionDef_L36_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99123:Assign_L39_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99123:FunctionDef_L36_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99123:If_L40_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99123:If_L40_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99123:Assign_L41_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99123:If_L40_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99123:If_L42_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99123:If_L42_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99123:Assign_L43_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99123:If_L42_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99123:If_L44_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99123:If_L44_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99123:Assign_L45_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99123:If_L44_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99123:If_L46_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99123:If_L46_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99123:Assign_L47_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99123:If_L46_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99123:If_L49_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99123:If_L49_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99123:Expr_L51_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99123:If_L46_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99123:Assign_L52_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99123:FunctionDef_L36_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99123:If_L53_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99123:If_L53_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99123:Expr_L54_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99123:FunctionDef_L36_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99123:Assign_L55_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99123:FunctionDef_L36_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99123:Assign_L56_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99123:FunctionDef_L36_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99123:If_L57_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99123:If_L57_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99123:Assign_L58_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99123:FunctionDef_L36_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99123:Return_L59_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99123:FunctionDef_L61_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99123:Assign_L62_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99123:FunctionDef_L61_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99123:Assign_L63_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99123:FunctionDef_L61_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99123:For_L64_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99123:For_L64_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99123:Expr_L65_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99123:For_L64_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99123:Expr_L66_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99123:For_L64_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99123:Assign_L67_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99123:For_L64_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99123:Assign_L68_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99123:For_L64_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99123:For_L69_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99123:For_L69_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99123:Expr_L70_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99123:For_L69_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99123:Assign_L71_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99123:For_L69_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99123:For_L72_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99123:For_L72_C3", "t": "ajibawa-2023/Python-Code-Large/train/row_99123:Assign_L73_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99123:For_L72_C3", "t": "ajibawa-2023/Python-Code-Large/train/row_99123:Assign_L74_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99123:For_L72_C3", "t": "ajibawa-2023/Python-Code-Large/train/row_99123:If_L75_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99123:If_L75_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99123:Expr_L76_C5"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99123:If_L75_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99123:Expr_L77_C5"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99123:If_L75_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99123:Expr_L78_C5"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99123:If_L75_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99123:Assign_L79_C5"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99123:FunctionDef_L61_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99123:Expr_L80_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99123:FunctionDef_L84_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99123:Expr_L85_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99123:FunctionDef_L84_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99123:Assign_L86_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99123:FunctionDef_L84_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99123:For_L87_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99123:For_L87_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99123:Expr_L88_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99123:For_L87_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99123:Assign_L89_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99123:For_L87_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99123:Expr_L90_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99123:For_L87_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99123:Expr_L91_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99123:For_L87_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99123:For_L92_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99123:For_L92_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99123:If_L93_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99123:If_L93_C3", "t": "ajibawa-2023/Python-Code-Large/train/row_99123:Assign_L94_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99123:If_L93_C3", "t": "ajibawa-2023/Python-Code-Large/train/row_99123:Assign_L95_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99123:If_L93_C3", "t": "ajibawa-2023/Python-Code-Large/train/row_99123:If_L97_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99123:If_L97_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99123:Assign_L98_C5"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99123:If_L93_C3", "t": "ajibawa-2023/Python-Code-Large/train/row_99123:Assign_L99_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99123:If_L93_C3", "t": "ajibawa-2023/Python-Code-Large/train/row_99123:If_L100_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99123:If_L100_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99123:Expr_L101_C5"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99123:If_L93_C3", "t": "ajibawa-2023/Python-Code-Large/train/row_99123:Assign_L102_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99123:If_L93_C3", "t": "ajibawa-2023/Python-Code-Large/train/row_99123:Expr_L103_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99123:If_L93_C3", "t": "ajibawa-2023/Python-Code-Large/train/row_99123:Expr_L104_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99123:For_L87_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99123:Expr_L105_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99123:FunctionDef_L109_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99123:If_L110_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99123:If_L110_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99123:Expr_L111_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99123:FunctionDef_L109_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99123:If_L112_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99123:If_L112_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99123:Expr_L113_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99123:If_L116_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99123:Expr_L117_C1"}]
#!/usr/bin/env python WORK_DIR = r'D:\work' DATA_DIR = WORK_DIR + r'\data' PYCODE_DIR = WORK_DIR + r'\pycode'
ajibawa-2023/Python-Code-Large/train/row_99124
3
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_99124:Assign_L3_C0", "label": "WORK_DIR =", "type": "assigned_variable", "loc": [3, 3], "level": 0, "parent": null, "vector": [14, 0, 0.5, 0.1667, 0, 0.66, 0.0, 151, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "WORK_DIR", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "WORK_DIR = r'D:\\work'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99124:Assign_L4_C0", "label": "DATA_DIR =", "type": "assigned_variable", "loc": [4, 4], "level": 0, "parent": null, "vector": [14, 0, 0.6667, 0.1667, 0, 0.66, 0.5, 318, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "DATA_DIR", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "DATA_DIR = WORK_DIR + r'\\data'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99124:Assign_L5_C0", "label": "PYCODE_DIR =", "type": "assigned_variable", "loc": [5, 5], "level": 0, "parent": null, "vector": [14, 0, 0.8333, 0.1667, 0, 0.66, 1.0, 559, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "PYCODE_DIR", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "PYCODE_DIR = WORK_DIR + r'\\pycode'"}]
[]
#!/usr/bin/env python # coding=utf-8 from urlparse import urljoin from urllib import urlopen from HTMLParser import HTMLParser import os import sys import re import codecs HTML_FILEPATH = r'/home/ylb/tmp/yingchao1.htm' class ScoreHTMLParser(HTMLParser): def __init__(self): HTMLParser.__init__(self) self._tbody = 0 self._tr = 0 self._td = 0 self._table = 0 self._tree = ('root', []) self._nodeStack = [self._tree] self._tableCnt = 0 def handle_starttag(self, tag, attrs): if tag.lower() == 'td': newNode = ('td', []) self._nodeStack[-1][1].append(newNode) self._nodeStack.append(newNode) elif tag.lower() == 'tr': newNode = ('tr', []) self._nodeStack[-1][1].append(newNode) self._nodeStack.append(newNode) elif tag.lower() == 'table': self._tableCnt += 1 newNode = ('table', []) self._nodeStack[-1][1].append(newNode) self._nodeStack.append(newNode) elif tag.lower() == 'span': if attrs.has_key('title'): data = ('span', 'title', attrs['title']) if self._nodeStack[-1] != self._tree: self._nodeStack[-1][1].append(data) def handle_endtag(self, tag): if tag.lower() == 'td': #self._nodeStack[-1].append('/td') self._nodeStack.pop() elif tag.lower() == 'tr': #self._nodeStack[-1].append('/tr') self._nodeStack.pop() elif tag.lower() == 'table': #self._nodeStack[-1].append('/table%s'%(self._tableCnt,)) self._tableCnt -= 1 self._nodeStack.pop() def handle_data(self, data): if self._nodeStack[-1] != self._tree: self._nodeStack[-1][1].append(data) #pass def fetch_tree(self): return self._tree def main(): s = codecs.open(HTML_FILEPATH, 'r', 'utf-8').read() shp = ScoreHTMLParser() shp.feed(s) t = shp.fetch_tree() print(t) if __name__ == '__main__': main()
ajibawa-2023/Python-Code-Large/train/row_99125
56
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_99125:ImportFrom_L4_C0", "label": "from urlparse import urljoin", "type": "import", "loc": [4, 4], "level": 0, "parent": null, "vector": [1, 0, 0.0506, 0.0127, 0, 0.66, 0.0, 857, 0, 1, 0, 0, 857, 0, 0], "semantic": {"name": "urlparse", "arg_names": [], "import_names": ["urljoin"], "rhs_call_name": "", "annotation": ""}, "snippet": "from urlparse import urljoin"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99125:ImportFrom_L5_C0", "label": "from urllib import urlopen", "type": "import", "loc": [5, 5], "level": 0, "parent": null, "vector": [1, 0, 0.0633, 0.0127, 0, 0.66, 0.1, 614, 0, 1, 0, 0, 614, 0, 0], "semantic": {"name": "urllib", "arg_names": [], "import_names": ["urlopen"], "rhs_call_name": "", "annotation": ""}, "snippet": "from urllib import urlopen"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99125:ImportFrom_L6_C0", "label": "from HTMLParser import HTMLParser", "type": "import", "loc": [6, 6], "level": 0, "parent": null, "vector": [1, 0, 0.0759, 0.0127, 0, 0.66, 0.2, 217, 0, 1, 0, 0, 217, 0, 0], "semantic": {"name": "HTMLParser", "arg_names": [], "import_names": ["HTMLParser"], "rhs_call_name": "", "annotation": ""}, "snippet": "from HTMLParser import HTMLParser"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99125:Import_L7_C0", "label": "os import os", "type": "import", "loc": [7, 7], "level": 0, "parent": null, "vector": [1, 0, 0.0886, 0.0127, 0, 0.66, 0.3, 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_99125:Import_L8_C0", "label": "sys import sys", "type": "import", "loc": [8, 8], "level": 0, "parent": null, "vector": [1, 0, 0.1013, 0.0127, 0, 0.66, 0.4, 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_99125:Import_L9_C0", "label": "re import re", "type": "import", "loc": [9, 9], "level": 0, "parent": null, "vector": [1, 0, 0.1139, 0.0127, 0, 0.66, 0.5, 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_99125:Import_L10_C0", "label": "codecs import codecs", "type": "import", "loc": [10, 10], "level": 0, "parent": null, "vector": [1, 0, 0.1266, 0.0127, 0, 0.66, 0.6, 220, 0, 1, 0, 0, 220, 0, 0], "semantic": {"name": "codecs", "arg_names": [], "import_names": ["codecs"], "rhs_call_name": "", "annotation": ""}, "snippet": "import codecs"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99125:Assign_L13_C0", "label": "HTML_FILEPATH =", "type": "assigned_variable", "loc": [13, 13], "level": 0, "parent": null, "vector": [14, 0, 0.1646, 0.0127, 0, 0.66, 0.7, 770, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "HTML_FILEPATH", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "HTML_FILEPATH = r'/home/ylb/tmp/yingchao1.htm'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99125:ClassDef_L16_C0", "label": "ScoreHTMLParser", "type": "class", "loc": [16, 67], "level": 0, "parent": null, "vector": [3, 0, 0.5253, 0.6582, 0, 0.66, 0.8, 42, 0, 5, 0, 0, 217, 0, 20], "semantic": {"name": "ScoreHTMLParser", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class ScoreHTMLParser(HTMLParser):\n\tdef __init__(self):\n\t\tHTMLParser.__init__(self)\n\t\tself._tbody = 0\n\t\tself._tr = 0\n\t\tself._td = 0\n\t\tself._table = 0\n\t\tself._tree = ('root', [])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99125:FunctionDef_L17_C1", "label": "__init__", "type": "function", "loc": [17, 25], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99125:ClassDef_L16_C0", "vector": [2, 1, 0.2658, 0.1139, 1, 0.35, 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\tHTMLParser.__init__(self)\n\t\tself._tbody = 0\n\t\tself._tr = 0\n\t\tself._td = 0\n\t\tself._table = 0\n\t\tself._tree = ('root', [])\n\t\tself._nodeStack = [self._tree]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99125:Expr_L18_C2", "label": "__init__()", "type": "expression", "loc": [18, 18], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99125:FunctionDef_L17_C1", "vector": [8, 2, 0.2278, 0.0127, 2, 0.68, 0.0, 555, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "__init__", "arg_names": [], "import_names": [], "rhs_call_name": "__init__", "annotation": ""}, "snippet": "\t\tHTMLParser.__init__(self)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99125:Assign_L19_C2", "label": "self._tbody =", "type": "assigned_variable", "loc": [19, 19], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99125:FunctionDef_L17_C1", "vector": [14, 2, 0.2405, 0.0127, 2, 0.68, 0.1429, 345, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "self._tbody", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tself._tbody = 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99125:Assign_L20_C2", "label": "self._tr =", "type": "assigned_variable", "loc": [20, 20], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99125:FunctionDef_L17_C1", "vector": [14, 2, 0.2532, 0.0127, 2, 0.68, 0.2857, 18, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "self._tr", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tself._tr = 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99125:Assign_L21_C2", "label": "self._td =", "type": "assigned_variable", "loc": [21, 21], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99125:FunctionDef_L17_C1", "vector": [14, 2, 0.2658, 0.0127, 2, 0.68, 0.4286, 123, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "self._td", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tself._td = 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99125:Assign_L22_C2", "label": "self._table =", "type": "assigned_variable", "loc": [22, 22], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99125:FunctionDef_L17_C1", "vector": [14, 2, 0.2785, 0.0127, 2, 0.68, 0.5714, 840, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "self._table", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tself._table = 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99125:Assign_L23_C2", "label": "self._tree =", "type": "assigned_variable", "loc": [23, 23], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99125:FunctionDef_L17_C1", "vector": [14, 2, 0.2911, 0.0127, 2, 0.68, 0.7143, 582, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "self._tree", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tself._tree = ('root', [])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99125:Assign_L24_C2", "label": "self._nodeStack =", "type": "assigned_variable", "loc": [24, 24], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99125:FunctionDef_L17_C1", "vector": [14, 2, 0.3038, 0.0127, 2, 0.68, 0.8571, 841, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "self._nodeStack", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tself._nodeStack = [self._tree]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99125:Assign_L25_C2", "label": "self._tableCnt =", "type": "assigned_variable", "loc": [25, 25], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99125:FunctionDef_L17_C1", "vector": [14, 2, 0.3165, 0.0127, 2, 0.68, 1.0, 402, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "self._tableCnt", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tself._tableCnt = 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99125:FunctionDef_L27_C1", "label": "handle_starttag", "type": "function", "loc": [27, 45], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99125:ClassDef_L16_C0", "vector": [2, 1, 0.4557, 0.2405, 1, 0.35, 0.25, 761, 0, 3, 0, 0, 0, 0, 12], "semantic": {"name": "handle_starttag", "arg_names": ["self", "tag", "attrs"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tdef handle_starttag(self, tag, attrs):\n\t\tif tag.lower() == 'td':\n\t\t\tnewNode = ('td', [])\n\t\t\tself._nodeStack[-1][1].append(newNode)\n\t\t\tself._nodeStack.append(newNode)\n\t\telif tag.lower() == 'tr':\n\t\t\tnewNode = ('tr', [])\n\t\t\tself._nodeStack[-1][1].append(newNode)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99125:If_L28_C2", "label": "if", "type": "if", "loc": [28, 45], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99125:FunctionDef_L27_C1", "vector": [4, 2, 0.462, 0.2278, 2, 0.61, 0.0, 0, 0, 0, 0, 0, 0, 0, 12], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tif tag.lower() == 'td':\n\t\t\tnewNode = ('td', [])\n\t\t\tself._nodeStack[-1][1].append(newNode)\n\t\t\tself._nodeStack.append(newNode)\n\t\telif tag.lower() == 'tr':\n\t\t\tnewNode = ('tr', [])\n\t\t\tself._nodeStack[-1][1].append(newNode)\n\t\t\tself._nodeStack.append(newNode)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99125:Assign_L29_C3", "label": "newNode =", "type": "assigned_variable", "loc": [29, 29], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99125:If_L28_C2", "vector": [14, 3, 0.3671, 0.0127, 3, 0.06, 0.0, 0, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "newNode", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\tnewNode = ('td', [])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99125:Expr_L30_C3", "label": "append()", "type": "expression", "loc": [30, 30], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99125:If_L28_C2", "vector": [8, 3, 0.3797, 0.0127, 3, 0.06, 0.3333, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": "\t\t\tself._nodeStack[-1][1].append(newNode)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99125:Expr_L31_C3", "label": "append()", "type": "expression", "loc": [31, 31], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99125:If_L28_C2", "vector": [8, 3, 0.3924, 0.0127, 3, 0.06, 0.6667, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": "\t\t\tself._nodeStack.append(newNode)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99125:If_L32_C2", "label": "if", "type": "if", "loc": [32, 45], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99125:If_L28_C2", "vector": [4, 3, 0.4873, 0.1772, 3, 0.06, 1.0, 0, 0, 0, 0, 0, 0, 0, 9], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\telif tag.lower() == 'tr':\n\t\t\tnewNode = ('tr', [])\n\t\t\tself._nodeStack[-1][1].append(newNode)\n\t\t\tself._nodeStack.append(newNode)\n\t\telif tag.lower() == 'table':\n\t\t\tself._tableCnt += 1\n\t\t\tnewNode = ('table', [])\n\t\t\tself._nodeStack[-1][1].append(newNode)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99125:Assign_L33_C3", "label": "newNode =", "type": "assigned_variable", "loc": [33, 33], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99125:If_L32_C2", "vector": [14, 4, 0.4177, 0.0127, 4, 0.49, 0.0, 0, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "newNode", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\tnewNode = ('tr', [])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99125:Expr_L34_C3", "label": "append()", "type": "expression", "loc": [34, 34], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99125:If_L32_C2", "vector": [8, 4, 0.4304, 0.0127, 4, 0.49, 0.3333, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": "\t\t\tself._nodeStack[-1][1].append(newNode)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99125:Expr_L35_C3", "label": "append()", "type": "expression", "loc": [35, 35], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99125:If_L32_C2", "vector": [8, 4, 0.443, 0.0127, 4, 0.49, 0.6667, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": "\t\t\tself._nodeStack.append(newNode)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99125:If_L36_C2", "label": "if", "type": "if", "loc": [36, 45], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99125:If_L32_C2", "vector": [4, 4, 0.5127, 0.1266, 4, 0.49, 1.0, 0, 0, 0, 0, 0, 0, 0, 6], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\telif tag.lower() == 'table':\n\t\t\tself._tableCnt += 1\n\t\t\tnewNode = ('table', [])\n\t\t\tself._nodeStack[-1][1].append(newNode)\n\t\t\tself._nodeStack.append(newNode)\n\t\telif tag.lower() == 'span':\n\t\t\tif attrs.has_key('title'):\n\t\t\t\tdata = ('span', 'title', attrs['title'])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99125:Assign_L38_C3", "label": "newNode =", "type": "assigned_variable", "loc": [38, 38], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99125:If_L36_C2", "vector": [14, 5, 0.481, 0.0127, 5, 0.7, 0.0, 0, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "newNode", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\tnewNode = ('table', [])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99125:Expr_L39_C3", "label": "append()", "type": "expression", "loc": [39, 39], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99125:If_L36_C2", "vector": [8, 5, 0.4937, 0.0127, 5, 0.7, 0.3333, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": "\t\t\tself._nodeStack[-1][1].append(newNode)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99125:Expr_L40_C3", "label": "append()", "type": "expression", "loc": [40, 40], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99125:If_L36_C2", "vector": [8, 5, 0.5063, 0.0127, 5, 0.7, 0.6667, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": "\t\t\tself._nodeStack.append(newNode)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99125:If_L41_C2", "label": "if", "type": "if", "loc": [41, 45], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99125:If_L36_C2", "vector": [4, 5, 0.5443, 0.0633, 5, 0.7, 1.0, 0, 0, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\telif tag.lower() == 'span':\n\t\t\tif attrs.has_key('title'):\n\t\t\t\tdata = ('span', 'title', attrs['title'])\n\t\t\t\tif self._nodeStack[-1] != self._tree:\n\t\t\t\t\tself._nodeStack[-1][1].append(data)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99125:If_L42_C3", "label": "if", "type": "if", "loc": [42, 45], "level": 6, "parent": "ajibawa-2023/Python-Code-Large/train/row_99125:If_L41_C2", "vector": [4, 6, 0.5506, 0.0506, 6, 0.24, 0.0, 0, 3, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\tif attrs.has_key('title'):\n\t\t\t\tdata = ('span', 'title', attrs['title'])\n\t\t\t\tif self._nodeStack[-1] != self._tree:\n\t\t\t\t\tself._nodeStack[-1][1].append(data)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99125:Assign_L43_C4", "label": "data =", "type": "assigned_variable", "loc": [43, 43], "level": 7, "parent": "ajibawa-2023/Python-Code-Large/train/row_99125:If_L42_C3", "vector": [14, 7, 0.5443, 0.0127, 7, 0.54, 0.0, 929, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "data", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\t\tdata = ('span', 'title', attrs['title'])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99125:If_L44_C4", "label": "if", "type": "if", "loc": [44, 45], "level": 7, "parent": "ajibawa-2023/Python-Code-Large/train/row_99125:If_L42_C3", "vector": [4, 7, 0.5633, 0.0253, 7, 0.54, 1.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\t\tif self._nodeStack[-1] != self._tree:\n\t\t\t\t\tself._nodeStack[-1][1].append(data)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99125:Expr_L45_C5", "label": "append()", "type": "expression", "loc": [45, 45], "level": 8, "parent": "ajibawa-2023/Python-Code-Large/train/row_99125:If_L44_C4", "vector": [8, 8, 0.5696, 0.0127, 8, 0.12, 0.0, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": "\t\t\t\t\tself._nodeStack[-1][1].append(data)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99125:FunctionDef_L49_C1", "label": "handle_endtag", "type": "function", "loc": [49, 59], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99125:ClassDef_L16_C0", "vector": [2, 1, 0.6835, 0.1392, 1, 0.35, 0.5, 63, 0, 2, 0, 0, 0, 0, 6], "semantic": {"name": "handle_endtag", "arg_names": ["self", "tag"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tdef handle_endtag(self, tag):\n\t\tif tag.lower() == 'td':\n\t\t\t#self._nodeStack[-1].append('/td')\n\t\t\tself._nodeStack.pop()\n\t\telif tag.lower() == 'tr':\n\t\t\t#self._nodeStack[-1].append('/tr')\n\t\t\tself._nodeStack.pop()\n\t\telif tag.lower() == 'table':"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99125:If_L50_C2", "label": "if", "type": "if", "loc": [50, 59], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99125:FunctionDef_L49_C1", "vector": [4, 2, 0.6899, 0.1266, 2, 0.55, 0.0, 0, 0, 0, 0, 0, 0, 0, 6], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tif tag.lower() == 'td':\n\t\t\t#self._nodeStack[-1].append('/td')\n\t\t\tself._nodeStack.pop()\n\t\telif tag.lower() == 'tr':\n\t\t\t#self._nodeStack[-1].append('/tr')\n\t\t\tself._nodeStack.pop()\n\t\telif tag.lower() == 'table':\n\t\t\t#self._nodeStack[-1].append('/table%s'%(self._tableCnt,))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99125:Expr_L52_C3", "label": "pop()", "type": "expression", "loc": [52, 52], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99125:If_L50_C2", "vector": [8, 3, 0.6582, 0.0127, 3, 0.05, 0.0, 969, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "pop", "arg_names": [], "import_names": [], "rhs_call_name": "pop", "annotation": ""}, "snippet": "\t\t\tself._nodeStack.pop()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99125:If_L53_C2", "label": "if", "type": "if", "loc": [53, 59], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99125:If_L50_C2", "vector": [4, 3, 0.7089, 0.0886, 3, 0.05, 1.0, 0, 0, 0, 0, 0, 0, 0, 4], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\telif tag.lower() == 'tr':\n\t\t\t#self._nodeStack[-1].append('/tr')\n\t\t\tself._nodeStack.pop()\n\t\telif tag.lower() == 'table':\n\t\t\t#self._nodeStack[-1].append('/table%s'%(self._tableCnt,))\n\t\t\tself._tableCnt -= 1\n\t\t\tself._nodeStack.pop()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99125:Expr_L55_C3", "label": "pop()", "type": "expression", "loc": [55, 55], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99125:If_L53_C2", "vector": [8, 4, 0.6962, 0.0127, 4, 0.1, 0.0, 969, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "pop", "arg_names": [], "import_names": [], "rhs_call_name": "pop", "annotation": ""}, "snippet": "\t\t\tself._nodeStack.pop()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99125:If_L56_C2", "label": "if", "type": "if", "loc": [56, 59], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99125:If_L53_C2", "vector": [4, 4, 0.7278, 0.0506, 4, 0.1, 1.0, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\telif tag.lower() == 'table':\n\t\t\t#self._nodeStack[-1].append('/table%s'%(self._tableCnt,))\n\t\t\tself._tableCnt -= 1\n\t\t\tself._nodeStack.pop()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99125:Expr_L59_C3", "label": "pop()", "type": "expression", "loc": [59, 59], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99125:If_L56_C2", "vector": [8, 5, 0.7468, 0.0127, 5, 0.05, 0.0, 969, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "pop", "arg_names": [], "import_names": [], "rhs_call_name": "pop", "annotation": ""}, "snippet": "\t\t\tself._nodeStack.pop()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99125:FunctionDef_L61_C1", "label": "handle_data", "type": "function", "loc": [61, 63], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99125:ClassDef_L16_C0", "vector": [2, 1, 0.7848, 0.038, 1, 0.35, 0.75, 645, 0, 2, 0, 0, 0, 0, 1], "semantic": {"name": "handle_data", "arg_names": ["self", "data"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tdef handle_data(self, data):\n\t\tif self._nodeStack[-1] != self._tree:\n\t\t\tself._nodeStack[-1][1].append(data)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99125:If_L62_C2", "label": "if", "type": "if", "loc": [62, 63], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99125:FunctionDef_L61_C1", "vector": [4, 2, 0.7911, 0.0253, 2, 0.96, 0.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tif self._nodeStack[-1] != self._tree:\n\t\t\tself._nodeStack[-1][1].append(data)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99125:Expr_L63_C3", "label": "append()", "type": "expression", "loc": [63, 63], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99125:If_L62_C2", "vector": [8, 3, 0.7975, 0.0127, 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": "\t\t\tself._nodeStack[-1][1].append(data)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99125:FunctionDef_L66_C1", "label": "fetch_tree", "type": "function", "loc": [66, 67], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99125:ClassDef_L16_C0", "vector": [2, 1, 0.8418, 0.0253, 1, 0.35, 1.0, 461, 0, 1, 1, 0, 0, 0, 0], "semantic": {"name": "fetch_tree", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tdef fetch_tree(self):\n\t\treturn self._tree"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99125:Return_L67_C2", "label": "return", "type": "return", "loc": [67, 67], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99125:FunctionDef_L66_C1", "vector": [13, 2, 0.8481, 0.0127, 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._tree"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99125:FunctionDef_L70_C0", "label": "main", "type": "function", "loc": [70, 75], "level": 0, "parent": null, "vector": [2, 0, 0.9177, 0.0759, 0, 0.66, 0.9, 624, 0, 0, 0, 0, 0, 0, 6], "semantic": {"name": "main", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def main():\n\ts = codecs.open(HTML_FILEPATH, 'r', 'utf-8').read()\n\tshp = ScoreHTMLParser()\n\tshp.feed(s)\n\tt = shp.fetch_tree()\n\tprint(t)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99125:Assign_L71_C1", "label": "s = read()", "type": "assigned_variable", "loc": [71, 71], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99125:FunctionDef_L70_C0", "vector": [14, 1, 0.8987, 0.0127, 1, 0.07, 0.0, 553, 3, 0, 0, 0, 453, 10, 2], "semantic": {"name": "s", "arg_names": [], "import_names": [], "rhs_call_name": "read", "annotation": ""}, "snippet": "\ts = codecs.open(HTML_FILEPATH, 'r', 'utf-8').read()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99125:Assign_L72_C1", "label": "shp = ScoreHTMLParser()", "type": "assigned_variable", "loc": [72, 72], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99125:FunctionDef_L70_C0", "vector": [14, 1, 0.9114, 0.0127, 1, 0.07, 0.25, 185, 3, 0, 0, 0, 42, 10, 1], "semantic": {"name": "shp", "arg_names": [], "import_names": [], "rhs_call_name": "ScoreHTMLParser", "annotation": ""}, "snippet": "\tshp = ScoreHTMLParser()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99125:Expr_L73_C1", "label": "feed()", "type": "expression", "loc": [73, 73], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99125:FunctionDef_L70_C0", "vector": [8, 1, 0.9241, 0.0127, 1, 0.07, 0.5, 87, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "feed", "arg_names": [], "import_names": [], "rhs_call_name": "feed", "annotation": ""}, "snippet": "\tshp.feed(s)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99125:Assign_L74_C1", "label": "t = fetch_tree()", "type": "assigned_variable", "loc": [74, 74], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99125:FunctionDef_L70_C0", "vector": [14, 1, 0.9367, 0.0127, 1, 0.07, 0.75, 15, 3, 0, 0, 0, 461, 10, 1], "semantic": {"name": "t", "arg_names": [], "import_names": [], "rhs_call_name": "fetch_tree", "annotation": ""}, "snippet": "\tt = shp.fetch_tree()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99125:Expr_L75_C1", "label": "print()", "type": "expression", "loc": [75, 75], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99125:FunctionDef_L70_C0", "vector": [8, 1, 0.9494, 0.0127, 1, 0.07, 1.0, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": "\tprint(t)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99125:If_L77_C0", "label": "if", "type": "if", "loc": [77, 78], "level": 0, "parent": null, "vector": [4, 0, 0.981, 0.0253, 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\tmain()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99125:Expr_L78_C1", "label": "main()", "type": "expression", "loc": [78, 78], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99125:If_L77_C0", "vector": [8, 1, 0.9873, 0.0127, 1, 0.34, 0.0, 624, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "main", "arg_names": [], "import_names": [], "rhs_call_name": "main", "annotation": ""}, "snippet": "\tmain()"}]
[{"f": "ajibawa-2023/Python-Code-Large/train/row_99125:ClassDef_L16_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99125:FunctionDef_L17_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99125:FunctionDef_L17_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99125:Expr_L18_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99125:FunctionDef_L17_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99125:Assign_L19_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99125:FunctionDef_L17_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99125:Assign_L20_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99125:FunctionDef_L17_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99125:Assign_L21_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99125:FunctionDef_L17_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99125:Assign_L22_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99125:FunctionDef_L17_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99125:Assign_L23_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99125:FunctionDef_L17_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99125:Assign_L24_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99125:FunctionDef_L17_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99125:Assign_L25_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99125:ClassDef_L16_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99125:FunctionDef_L27_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99125:FunctionDef_L27_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99125:If_L28_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99125:If_L28_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99125:Assign_L29_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99125:If_L28_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99125:Expr_L30_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99125:If_L28_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99125:Expr_L31_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99125:If_L28_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99125:If_L32_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99125:If_L32_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99125:Assign_L33_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99125:If_L32_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99125:Expr_L34_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99125:If_L32_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99125:Expr_L35_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99125:If_L32_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99125:If_L36_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99125:If_L36_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99125:Assign_L38_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99125:If_L36_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99125:Expr_L39_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99125:If_L36_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99125:Expr_L40_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99125:If_L36_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99125:If_L41_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99125:If_L41_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99125:If_L42_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99125:If_L42_C3", "t": "ajibawa-2023/Python-Code-Large/train/row_99125:Assign_L43_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99125:If_L42_C3", "t": "ajibawa-2023/Python-Code-Large/train/row_99125:If_L44_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99125:If_L44_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99125:Expr_L45_C5"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99125:ClassDef_L16_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99125:FunctionDef_L49_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99125:FunctionDef_L49_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99125:If_L50_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99125:If_L50_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99125:Expr_L52_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99125:If_L50_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99125:If_L53_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99125:If_L53_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99125:Expr_L55_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99125:If_L53_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99125:If_L56_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99125:If_L56_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99125:Expr_L59_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99125:ClassDef_L16_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99125:FunctionDef_L61_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99125:FunctionDef_L61_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99125:If_L62_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99125:If_L62_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99125:Expr_L63_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99125:ClassDef_L16_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99125:FunctionDef_L66_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99125:FunctionDef_L66_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99125:Return_L67_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99125:FunctionDef_L70_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99125:Assign_L71_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99125:FunctionDef_L70_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99125:Assign_L72_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99125:FunctionDef_L70_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99125:Expr_L73_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99125:FunctionDef_L70_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99125:Assign_L74_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99125:FunctionDef_L70_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99125:Expr_L75_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99125:If_L77_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99125:Expr_L78_C1"}]
#!/usr/bin/env python # coding=utf-8 import datetime class RepeatedRecordException(Exception):pass class ScoreDB: """ Database to storage scores """ def __init__(self, filepath): """ Init class @param filepath: file which to store the database type: unicode @exception IOError if open file error """ self.db = sqlite3.connect(filepath) def _create_tables(self): """ # private """ pass def add_team(self, teamRecord): """ Add a team to the database @param teamRecord - tuple, (enName, sName, cName, nation) @param enName: English name of the team type: unicode @param sName: Simple Chinese name of the team type: unicode @param cName: Complex Chinese name of the team type: unicode @param nation: nation of the team type: unicode @return True if store team successfully @exception raise RepeatedRecordException if the record is already in db """ pass def add_leaguematch(self, leagueMatchRecord): """ Add a league match to the database @param leagueMatchRecord - tuple, (lmName, nation, startDate, endDate) @param lmName: name of the league match, it is necessary type: unicode @param nation: nation of the league match, None if no nation or several nations type: unicode @param startDate: startDate of the league match, it is necessary type: datetime.date @param endDate: endDate of the league match, it is necessary type: datetime.date @return True if store league match successfully @exception raise RepeatedRecordException if the record is already in db """ pass def add_match_score(self, matchScoreRecord): """ Add a match score to the database @param matchScoreRecord - tuple, (masterTeam, guestTeam, leagueMatch, matchDate, matchTime, halfContestScore, wholeContestScore) @param masterTeam: English name of the master team type: unicode @param guestTeam: English name of the guest team type: unicode @param matchDate: date of the match type: datetime.date @param matchTime: time of the match type: datetime.time @param halfConstScore: score of the half contest type: tuple: (m,n) @param wholeConstScore: score of the whole contest type: tuple: (m,n) @return True if store match score successfully @exception raise RepeatedRecordException if the record is already in db """ pass
ajibawa-2023/Python-Code-Large/train/row_99126
15
82
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_99126:Import_L5_C0", "label": "datetime import datetime", "type": "import", "loc": [5, 5], "level": 0, "parent": null, "vector": [1, 0, 0.061, 0.0122, 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_99126:ClassDef_L7_C0", "label": "RepeatedRecordException", "type": "class", "loc": [7, 7], "level": 0, "parent": null, "vector": [3, 0, 0.0854, 0.0122, 0, 0.66, 0.5, 242, 0, 0, 0, 0, 645, 0, 0], "semantic": {"name": "RepeatedRecordException", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class RepeatedRecordException(Exception):pass"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99126:ClassDef_L9_C0", "label": "ScoreDB", "type": "class", "loc": [9, 81], "level": 0, "parent": null, "vector": [3, 0, 0.5488, 0.8902, 0, 0.66, 1.0, 577, 0, 5, 0, 0, 0, 0, 1], "semantic": {"name": "ScoreDB", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class ScoreDB:\n\t\"\"\"\n\tDatabase to storage scores\n\t\"\"\"\n\tdef __init__(self, filepath):\n\t\t\"\"\"\n\t\tInit class\n\t\t@param filepath: file which to store the database"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99126:Expr_L10_C1", "label": "expression", "type": "expression", "loc": [10, 12], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99126:ClassDef_L9_C0", "vector": [8, 1, 0.1341, 0.0366, 1, 0.7, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\"\"\"\n\tDatabase to storage scores\n\t\"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99126:FunctionDef_L13_C1", "label": "__init__", "type": "function", "loc": [13, 20], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99126:ClassDef_L9_C0", "vector": [2, 1, 0.2012, 0.0976, 1, 0.7, 0.2, 555, 0, 2, 0, 0, 0, 0, 1], "semantic": {"name": "__init__", "arg_names": ["self", "filepath"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tdef __init__(self, filepath):\n\t\t\"\"\"\n\t\tInit class\n\t\t@param filepath: file which to store the database\n\t\t type: unicode\n\t\t@exception IOError if open file error\n\t\t\"\"\"\n\t\tself.db = sqlite3.connect(filepath)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99126:Expr_L14_C2", "label": "expression", "type": "expression", "loc": [14, 19], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99126:FunctionDef_L13_C1", "vector": [8, 2, 0.2012, 0.0732, 2, 0.41, 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\tInit class\n\t\t@param filepath: file which to store the database\n\t\t type: unicode\n\t\t@exception IOError if open file error\n\t\t\"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99126:Assign_L20_C2", "label": "self.db = connect()", "type": "assigned_variable", "loc": [20, 20], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99126:FunctionDef_L13_C1", "vector": [14, 2, 0.2439, 0.0122, 2, 0.41, 1.0, 990, 3, 1, 0, 0, 242, 10, 1], "semantic": {"name": "self.db", "arg_names": [], "import_names": [], "rhs_call_name": "connect", "annotation": ""}, "snippet": "\t\tself.db = sqlite3.connect(filepath)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99126:FunctionDef_L22_C1", "label": "_create_tables", "type": "function", "loc": [22, 26], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99126:ClassDef_L9_C0", "vector": [2, 1, 0.2927, 0.061, 1, 0.7, 0.4, 838, 0, 1, 0, 0, 0, 0, 0], "semantic": {"name": "_create_tables", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tdef _create_tables(self):\n\t\t\"\"\"\n\t\t# private\n\t\t\"\"\"\n\t\tpass"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99126:Expr_L23_C2", "label": "expression", "type": "expression", "loc": [23, 25], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99126:FunctionDef_L22_C1", "vector": [8, 2, 0.2927, 0.0366, 2, 0.28, 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\t# private\n\t\t\"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99126:FunctionDef_L28_C1", "label": "add_team", "type": "function", "loc": [28, 43], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99126:ClassDef_L9_C0", "vector": [2, 1, 0.4329, 0.1951, 1, 0.7, 0.6, 513, 0, 2, 0, 0, 0, 0, 0], "semantic": {"name": "add_team", "arg_names": ["self", "teamRecord"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tdef add_team(self, teamRecord):\n\t\t\"\"\"\n\t\tAdd a team to the database\n\t\t@param teamRecord - tuple, (enName, sName, cName, nation)\n\t\t@param enName: English name of the team\n\t\t type: unicode\n\t\t@param sName: Simple Chinese name of the team\n\t\t type: unicode"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99126:Expr_L29_C2", "label": "expression", "type": "expression", "loc": [29, 42], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99126:FunctionDef_L28_C1", "vector": [8, 2, 0.4329, 0.1707, 2, 0.97, 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\tAdd a team to the database\n\t\t@param teamRecord - tuple, (enName, sName, cName, nation)\n\t\t@param enName: English name of the team\n\t\t type: unicode\n\t\t@param sName: Simple Chinese name of the team\n\t\t type: unicode\n\t\t@param cName: Complex Chinese name of the team"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99126:FunctionDef_L45_C1", "label": "add_leaguematch", "type": "function", "loc": [45, 60], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99126:ClassDef_L9_C0", "vector": [2, 1, 0.6402, 0.1951, 1, 0.7, 0.8, 203, 0, 2, 0, 0, 0, 0, 0], "semantic": {"name": "add_leaguematch", "arg_names": ["self", "leagueMatchRecord"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tdef add_leaguematch(self, leagueMatchRecord):\n\t\t\"\"\"\n\t\tAdd a league match to the database\n\t\t@param leagueMatchRecord - tuple, (lmName, nation, startDate, endDate)\n\t\t@param lmName: name of the league match, it is necessary\n\t\t type: unicode\n\t\t@param nation: nation of the league match, None if no nation or several nations\n\t\t type: unicode"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99126:Expr_L46_C2", "label": "expression", "type": "expression", "loc": [46, 59], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99126:FunctionDef_L45_C1", "vector": [8, 2, 0.6402, 0.1707, 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\tAdd a league match to the database\n\t\t@param leagueMatchRecord - tuple, (lmName, nation, startDate, endDate)\n\t\t@param lmName: name of the league match, it is necessary\n\t\t type: unicode\n\t\t@param nation: nation of the league match, None if no nation or several nations\n\t\t type: unicode\n\t\t@param startDate: startDate of the league match, it is necessary"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99126:FunctionDef_L62_C1", "label": "add_match_score", "type": "function", "loc": [62, 81], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99126:ClassDef_L9_C0", "vector": [2, 1, 0.872, 0.2439, 1, 0.7, 1.0, 633, 0, 2, 0, 0, 0, 0, 0], "semantic": {"name": "add_match_score", "arg_names": ["self", "matchScoreRecord"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tdef add_match_score(self, matchScoreRecord):\n\t\t\"\"\"\n\t\tAdd a match score to the database\n\t\t@param matchScoreRecord - tuple, (masterTeam, guestTeam, leagueMatch, matchDate, matchTime, halfContestScore, wholeContestScore)\n\t\t@param masterTeam: English name of the master team\n\t\t type: unicode\n\t\t@param guestTeam: English name of the guest team\n\t\t type: unicode"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99126:Expr_L63_C2", "label": "expression", "type": "expression", "loc": [63, 80], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99126:FunctionDef_L62_C1", "vector": [8, 2, 0.872, 0.2195, 2, 0.24, 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\tAdd a match score to the database\n\t\t@param matchScoreRecord - tuple, (masterTeam, guestTeam, leagueMatch, matchDate, matchTime, halfContestScore, wholeContestScore)\n\t\t@param masterTeam: English name of the master team\n\t\t type: unicode\n\t\t@param guestTeam: English name of the guest team\n\t\t type: unicode\n\t\t@param matchDate: date of the match"}]
[{"f": "ajibawa-2023/Python-Code-Large/train/row_99126:ClassDef_L9_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99126:Expr_L10_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99126:ClassDef_L9_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99126:FunctionDef_L13_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99126:FunctionDef_L13_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99126:Expr_L14_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99126:FunctionDef_L13_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99126:Assign_L20_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99126:ClassDef_L9_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99126:FunctionDef_L22_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99126:FunctionDef_L22_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99126:Expr_L23_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99126:ClassDef_L9_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99126:FunctionDef_L28_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99126:FunctionDef_L28_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99126:Expr_L29_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99126:ClassDef_L9_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99126:FunctionDef_L45_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99126:FunctionDef_L45_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99126:Expr_L46_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99126:ClassDef_L9_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99126:FunctionDef_L62_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99126:FunctionDef_L62_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99126:Expr_L63_C2"}]
#!/usr/bin/env python # coding=utf-8 from urlparse import urljoin from urllib import urlopen from HTMLParser import HTMLParser import os import sys import re import codecs import football_url ''' Created on 2009-3-19 @author: ylb ''' HTML_FILEPATH = r'D:\tmp\yingchao1.htm' OUTPUT_FILE = open(r'D:\tmp\tmp.txt', 'w') class TestHTMPParser(HTMLParser): sys.stdout = OUTPUT_FILE def __init__(self): HTMLParser.__init__(self) self._tbody = 0 self._tr = 0 self._td = 0 self._table = 0 self._tree = ('root', []) self._nodeStack = [self._tree] self._tableCnt = 0 def handle_starttag(self, tag, attrs): if tag.lower() == 'td': newNode = ('td', []) self._nodeStack[-1][1].append(newNode) self._nodeStack.append(newNode) elif tag.lower() == 'tr': newNode = ('tr', []) self._nodeStack[-1][1].append(newNode) self._nodeStack.append(newNode) elif tag.lower() == 'table': self._tableCnt += 1 newNode = ('table', []) self._nodeStack[-1][1].append(newNode) self._nodeStack.append(newNode) def handle_endtag(self, tag): if tag.lower() == 'td': #self._nodeStack[-1].append('/td') self._nodeStack.pop() elif tag.lower() == 'tr': #self._nodeStack[-1].append('/tr') self._nodeStack.pop() elif tag.lower() == 'table': #self._nodeStack[-1].append('/table%s'%(self._tableCnt,)) self._tableCnt -= 1 self._nodeStack.pop() def handle_data(self, data): if self._nodeStack[-1] != self._tree: self._nodeStack[-1][1].append(data) #pass def fetch_tree(self): return self._tree def main(): s = urlopen(urljoin(football_url.siteBaseUrl,football_url.yingchao)).read() s = s.decode('gbk') mp = TestHTMPParser() mp.feed(s) t = mp.fetch_tree() print t if __name__ == '__main__': main()
ajibawa-2023/Python-Code-Large/train/row_99127
56
82
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_99127:ImportFrom_L4_C0", "label": "from urlparse import urljoin", "type": "import", "loc": [4, 4], "level": 0, "parent": null, "vector": [1, 0, 0.0488, 0.0122, 0, 0.66, 0.0, 857, 0, 1, 0, 0, 857, 0, 0], "semantic": {"name": "urlparse", "arg_names": [], "import_names": ["urljoin"], "rhs_call_name": "", "annotation": ""}, "snippet": "from urlparse import urljoin"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99127:ImportFrom_L5_C0", "label": "from urllib import urlopen", "type": "import", "loc": [5, 5], "level": 0, "parent": null, "vector": [1, 0, 0.061, 0.0122, 0, 0.66, 0.0769, 614, 0, 1, 0, 0, 614, 0, 0], "semantic": {"name": "urllib", "arg_names": [], "import_names": ["urlopen"], "rhs_call_name": "", "annotation": ""}, "snippet": "from urllib import urlopen"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99127:ImportFrom_L6_C0", "label": "from HTMLParser import HTMLParser", "type": "import", "loc": [6, 6], "level": 0, "parent": null, "vector": [1, 0, 0.0732, 0.0122, 0, 0.66, 0.1538, 217, 0, 1, 0, 0, 217, 0, 0], "semantic": {"name": "HTMLParser", "arg_names": [], "import_names": ["HTMLParser"], "rhs_call_name": "", "annotation": ""}, "snippet": "from HTMLParser import HTMLParser"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99127:Import_L7_C0", "label": "os import os", "type": "import", "loc": [7, 7], "level": 0, "parent": null, "vector": [1, 0, 0.0854, 0.0122, 0, 0.66, 0.2308, 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_99127:Import_L8_C0", "label": "sys import sys", "type": "import", "loc": [8, 8], "level": 0, "parent": null, "vector": [1, 0, 0.0976, 0.0122, 0, 0.66, 0.3077, 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_99127:Import_L9_C0", "label": "re import re", "type": "import", "loc": [9, 9], "level": 0, "parent": null, "vector": [1, 0, 0.1098, 0.0122, 0, 0.66, 0.3846, 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_99127:Import_L10_C0", "label": "codecs import codecs", "type": "import", "loc": [10, 10], "level": 0, "parent": null, "vector": [1, 0, 0.122, 0.0122, 0, 0.66, 0.4615, 220, 0, 1, 0, 0, 220, 0, 0], "semantic": {"name": "codecs", "arg_names": [], "import_names": ["codecs"], "rhs_call_name": "", "annotation": ""}, "snippet": "import codecs"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99127:Import_L11_C0", "label": "football_url import football_url", "type": "import", "loc": [11, 11], "level": 0, "parent": null, "vector": [1, 0, 0.1341, 0.0122, 0, 0.66, 0.5385, 828, 0, 1, 0, 0, 828, 0, 0], "semantic": {"name": "football_url", "arg_names": [], "import_names": ["football_url"], "rhs_call_name": "", "annotation": ""}, "snippet": "import football_url"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99127:Expr_L13_C0", "label": "expression", "type": "expression", "loc": [13, 17], "level": 0, "parent": null, "vector": [8, 0, 0.1829, 0.061, 0, 0.66, 0.6154, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "'''\nCreated on 2009-3-19\n\n@author: ylb\n'''"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99127:Assign_L19_C0", "label": "HTML_FILEPATH =", "type": "assigned_variable", "loc": [19, 19], "level": 0, "parent": null, "vector": [14, 0, 0.2317, 0.0122, 0, 0.66, 0.6923, 770, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "HTML_FILEPATH", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "HTML_FILEPATH = r'D:\\tmp\\yingchao1.htm'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99127:Assign_L20_C0", "label": "OUTPUT_FILE = open()", "type": "assigned_variable", "loc": [20, 20], "level": 0, "parent": null, "vector": [14, 0, 0.2439, 0.0122, 0, 0.66, 0.7692, 638, 3, 2, 0, 0, 693, 10, 1], "semantic": {"name": "OUTPUT_FILE", "arg_names": [], "import_names": [], "rhs_call_name": "open", "annotation": ""}, "snippet": "OUTPUT_FILE = open(r'D:\\tmp\\tmp.txt', 'w')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99127:ClassDef_L23_C0", "label": "TestHTMPParser", "type": "class", "loc": [23, 69], "level": 0, "parent": null, "vector": [3, 0, 0.561, 0.5732, 0, 0.66, 0.8462, 274, 0, 5, 0, 0, 217, 0, 17], "semantic": {"name": "TestHTMPParser", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class TestHTMPParser(HTMLParser):\n\tsys.stdout = OUTPUT_FILE\n\tdef __init__(self):\n\t\tHTMLParser.__init__(self)\n\t\tself._tbody = 0\n\t\tself._tr = 0\n\t\tself._td = 0\n\t\tself._table = 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99127:Assign_L24_C1", "label": "sys.stdout =", "type": "assigned_variable", "loc": [24, 24], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99127:ClassDef_L23_C0", "vector": [14, 1, 0.2927, 0.0122, 1, 0.94, 0.0, 260, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "sys.stdout", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tsys.stdout = OUTPUT_FILE"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99127:FunctionDef_L25_C1", "label": "__init__", "type": "function", "loc": [25, 33], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99127:ClassDef_L23_C0", "vector": [2, 1, 0.3537, 0.1098, 1, 0.94, 0.2, 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\tHTMLParser.__init__(self)\n\t\tself._tbody = 0\n\t\tself._tr = 0\n\t\tself._td = 0\n\t\tself._table = 0\n\t\tself._tree = ('root', [])\n\t\tself._nodeStack = [self._tree]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99127:Expr_L26_C2", "label": "__init__()", "type": "expression", "loc": [26, 26], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99127:FunctionDef_L25_C1", "vector": [8, 2, 0.3171, 0.0122, 2, 0.06, 0.0, 555, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "__init__", "arg_names": [], "import_names": [], "rhs_call_name": "__init__", "annotation": ""}, "snippet": "\t\tHTMLParser.__init__(self)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99127:Assign_L27_C2", "label": "self._tbody =", "type": "assigned_variable", "loc": [27, 27], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99127:FunctionDef_L25_C1", "vector": [14, 2, 0.3293, 0.0122, 2, 0.06, 0.1429, 345, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "self._tbody", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tself._tbody = 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99127:Assign_L28_C2", "label": "self._tr =", "type": "assigned_variable", "loc": [28, 28], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99127:FunctionDef_L25_C1", "vector": [14, 2, 0.3415, 0.0122, 2, 0.06, 0.2857, 18, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "self._tr", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tself._tr = 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99127:Assign_L29_C2", "label": "self._td =", "type": "assigned_variable", "loc": [29, 29], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99127:FunctionDef_L25_C1", "vector": [14, 2, 0.3537, 0.0122, 2, 0.06, 0.4286, 123, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "self._td", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tself._td = 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99127:Assign_L30_C2", "label": "self._table =", "type": "assigned_variable", "loc": [30, 30], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99127:FunctionDef_L25_C1", "vector": [14, 2, 0.3659, 0.0122, 2, 0.06, 0.5714, 840, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "self._table", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tself._table = 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99127:Assign_L31_C2", "label": "self._tree =", "type": "assigned_variable", "loc": [31, 31], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99127:FunctionDef_L25_C1", "vector": [14, 2, 0.378, 0.0122, 2, 0.06, 0.7143, 582, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "self._tree", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tself._tree = ('root', [])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99127:Assign_L32_C2", "label": "self._nodeStack =", "type": "assigned_variable", "loc": [32, 32], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99127:FunctionDef_L25_C1", "vector": [14, 2, 0.3902, 0.0122, 2, 0.06, 0.8571, 841, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "self._nodeStack", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tself._nodeStack = [self._tree]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99127:Assign_L33_C2", "label": "self._tableCnt =", "type": "assigned_variable", "loc": [33, 33], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99127:FunctionDef_L25_C1", "vector": [14, 2, 0.4024, 0.0122, 2, 0.06, 1.0, 402, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "self._tableCnt", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tself._tableCnt = 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99127:FunctionDef_L35_C1", "label": "handle_starttag", "type": "function", "loc": [35, 48], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99127:ClassDef_L23_C0", "vector": [2, 1, 0.5061, 0.1707, 1, 0.94, 0.4, 761, 0, 3, 0, 0, 0, 0, 9], "semantic": {"name": "handle_starttag", "arg_names": ["self", "tag", "attrs"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tdef handle_starttag(self, tag, attrs):\n\t\tif tag.lower() == 'td':\n\t\t\tnewNode = ('td', [])\n\t\t\tself._nodeStack[-1][1].append(newNode)\n\t\t\tself._nodeStack.append(newNode)\n\t\telif tag.lower() == 'tr':\n\t\t\tnewNode = ('tr', [])\n\t\t\tself._nodeStack[-1][1].append(newNode)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99127:If_L36_C2", "label": "if", "type": "if", "loc": [36, 48], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99127:FunctionDef_L35_C1", "vector": [4, 2, 0.5122, 0.1585, 2, 0.44, 0.0, 0, 0, 0, 0, 0, 0, 0, 9], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tif tag.lower() == 'td':\n\t\t\tnewNode = ('td', [])\n\t\t\tself._nodeStack[-1][1].append(newNode)\n\t\t\tself._nodeStack.append(newNode)\n\t\telif tag.lower() == 'tr':\n\t\t\tnewNode = ('tr', [])\n\t\t\tself._nodeStack[-1][1].append(newNode)\n\t\t\tself._nodeStack.append(newNode)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99127:Assign_L37_C3", "label": "newNode =", "type": "assigned_variable", "loc": [37, 37], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99127:If_L36_C2", "vector": [14, 3, 0.4512, 0.0122, 3, 0.21, 0.0, 0, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "newNode", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\tnewNode = ('td', [])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99127:Expr_L38_C3", "label": "append()", "type": "expression", "loc": [38, 38], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99127:If_L36_C2", "vector": [8, 3, 0.4634, 0.0122, 3, 0.21, 0.3333, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": "\t\t\tself._nodeStack[-1][1].append(newNode)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99127:Expr_L39_C3", "label": "append()", "type": "expression", "loc": [39, 39], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99127:If_L36_C2", "vector": [8, 3, 0.4756, 0.0122, 3, 0.21, 0.6667, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": "\t\t\tself._nodeStack.append(newNode)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99127:If_L40_C2", "label": "if", "type": "if", "loc": [40, 48], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99127:If_L36_C2", "vector": [4, 3, 0.5366, 0.1098, 3, 0.21, 1.0, 0, 0, 0, 0, 0, 0, 0, 6], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\telif tag.lower() == 'tr':\n\t\t\tnewNode = ('tr', [])\n\t\t\tself._nodeStack[-1][1].append(newNode)\n\t\t\tself._nodeStack.append(newNode)\n\t\telif tag.lower() == 'table':\n\t\t\tself._tableCnt += 1\n\t\t\tnewNode = ('table', [])\n\t\t\tself._nodeStack[-1][1].append(newNode)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99127:Assign_L41_C3", "label": "newNode =", "type": "assigned_variable", "loc": [41, 41], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99127:If_L40_C2", "vector": [14, 4, 0.5, 0.0122, 4, 0.15, 0.0, 0, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "newNode", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\tnewNode = ('tr', [])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99127:Expr_L42_C3", "label": "append()", "type": "expression", "loc": [42, 42], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99127:If_L40_C2", "vector": [8, 4, 0.5122, 0.0122, 4, 0.15, 0.3333, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": "\t\t\tself._nodeStack[-1][1].append(newNode)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99127:Expr_L43_C3", "label": "append()", "type": "expression", "loc": [43, 43], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99127:If_L40_C2", "vector": [8, 4, 0.5244, 0.0122, 4, 0.15, 0.6667, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": "\t\t\tself._nodeStack.append(newNode)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99127:If_L44_C2", "label": "if", "type": "if", "loc": [44, 48], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99127:If_L40_C2", "vector": [4, 4, 0.561, 0.061, 4, 0.15, 1.0, 0, 0, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\telif tag.lower() == 'table':\n\t\t\tself._tableCnt += 1\n\t\t\tnewNode = ('table', [])\n\t\t\tself._nodeStack[-1][1].append(newNode)\n\t\t\tself._nodeStack.append(newNode)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99127:Assign_L46_C3", "label": "newNode =", "type": "assigned_variable", "loc": [46, 46], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99127:If_L44_C2", "vector": [14, 5, 0.561, 0.0122, 5, 0.71, 0.0, 0, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "newNode", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\tnewNode = ('table', [])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99127:Expr_L47_C3", "label": "append()", "type": "expression", "loc": [47, 47], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99127:If_L44_C2", "vector": [8, 5, 0.5732, 0.0122, 5, 0.71, 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\tself._nodeStack[-1][1].append(newNode)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99127:Expr_L48_C3", "label": "append()", "type": "expression", "loc": [48, 48], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99127:If_L44_C2", "vector": [8, 5, 0.5854, 0.0122, 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": "\t\t\tself._nodeStack.append(newNode)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99127:FunctionDef_L51_C1", "label": "handle_endtag", "type": "function", "loc": [51, 61], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99127:ClassDef_L23_C0", "vector": [2, 1, 0.6829, 0.1341, 1, 0.94, 0.6, 63, 0, 2, 0, 0, 0, 0, 6], "semantic": {"name": "handle_endtag", "arg_names": ["self", "tag"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tdef handle_endtag(self, tag):\n\t\tif tag.lower() == 'td':\n\t\t\t#self._nodeStack[-1].append('/td')\n\t\t\tself._nodeStack.pop()\n\t\telif tag.lower() == 'tr':\n\t\t\t#self._nodeStack[-1].append('/tr')\n\t\t\tself._nodeStack.pop()\n\t\telif tag.lower() == 'table':"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99127:If_L52_C2", "label": "if", "type": "if", "loc": [52, 61], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99127:FunctionDef_L51_C1", "vector": [4, 2, 0.689, 0.122, 2, 0.67, 0.0, 0, 0, 0, 0, 0, 0, 0, 6], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tif tag.lower() == 'td':\n\t\t\t#self._nodeStack[-1].append('/td')\n\t\t\tself._nodeStack.pop()\n\t\telif tag.lower() == 'tr':\n\t\t\t#self._nodeStack[-1].append('/tr')\n\t\t\tself._nodeStack.pop()\n\t\telif tag.lower() == 'table':\n\t\t\t#self._nodeStack[-1].append('/table%s'%(self._tableCnt,))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99127:Expr_L54_C3", "label": "pop()", "type": "expression", "loc": [54, 54], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99127:If_L52_C2", "vector": [8, 3, 0.6585, 0.0122, 3, 0.02, 0.0, 969, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "pop", "arg_names": [], "import_names": [], "rhs_call_name": "pop", "annotation": ""}, "snippet": "\t\t\tself._nodeStack.pop()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99127:If_L55_C2", "label": "if", "type": "if", "loc": [55, 61], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99127:If_L52_C2", "vector": [4, 3, 0.7073, 0.0854, 3, 0.02, 1.0, 0, 0, 0, 0, 0, 0, 0, 4], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\telif tag.lower() == 'tr':\n\t\t\t#self._nodeStack[-1].append('/tr')\n\t\t\tself._nodeStack.pop()\n\t\telif tag.lower() == 'table':\n\t\t\t#self._nodeStack[-1].append('/table%s'%(self._tableCnt,))\n\t\t\tself._tableCnt -= 1\n\t\t\tself._nodeStack.pop()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99127:Expr_L57_C3", "label": "pop()", "type": "expression", "loc": [57, 57], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99127:If_L55_C2", "vector": [8, 4, 0.6951, 0.0122, 4, 0.54, 0.0, 969, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "pop", "arg_names": [], "import_names": [], "rhs_call_name": "pop", "annotation": ""}, "snippet": "\t\t\tself._nodeStack.pop()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99127:If_L58_C2", "label": "if", "type": "if", "loc": [58, 61], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99127:If_L55_C2", "vector": [4, 4, 0.7256, 0.0488, 4, 0.54, 1.0, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\telif tag.lower() == 'table':\n\t\t\t#self._nodeStack[-1].append('/table%s'%(self._tableCnt,))\n\t\t\tself._tableCnt -= 1\n\t\t\tself._nodeStack.pop()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99127:Expr_L61_C3", "label": "pop()", "type": "expression", "loc": [61, 61], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99127:If_L58_C2", "vector": [8, 5, 0.7439, 0.0122, 5, 0.69, 0.0, 969, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "pop", "arg_names": [], "import_names": [], "rhs_call_name": "pop", "annotation": ""}, "snippet": "\t\t\tself._nodeStack.pop()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99127:FunctionDef_L63_C1", "label": "handle_data", "type": "function", "loc": [63, 65], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99127:ClassDef_L23_C0", "vector": [2, 1, 0.7805, 0.0366, 1, 0.94, 0.8, 645, 0, 2, 0, 0, 0, 0, 1], "semantic": {"name": "handle_data", "arg_names": ["self", "data"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tdef handle_data(self, data):\n\t\tif self._nodeStack[-1] != self._tree:\n\t\t\tself._nodeStack[-1][1].append(data)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99127:If_L64_C2", "label": "if", "type": "if", "loc": [64, 65], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99127:FunctionDef_L63_C1", "vector": [4, 2, 0.7866, 0.0244, 2, 0.99, 0.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tif self._nodeStack[-1] != self._tree:\n\t\t\tself._nodeStack[-1][1].append(data)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99127:Expr_L65_C3", "label": "append()", "type": "expression", "loc": [65, 65], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99127:If_L64_C2", "vector": [8, 3, 0.7927, 0.0122, 3, 0.88, 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._nodeStack[-1][1].append(data)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99127:FunctionDef_L68_C1", "label": "fetch_tree", "type": "function", "loc": [68, 69], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99127:ClassDef_L23_C0", "vector": [2, 1, 0.8354, 0.0244, 1, 0.94, 1.0, 461, 0, 1, 1, 0, 0, 0, 0], "semantic": {"name": "fetch_tree", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tdef fetch_tree(self):\n\t\treturn self._tree"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99127:Return_L69_C2", "label": "return", "type": "return", "loc": [69, 69], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99127:FunctionDef_L68_C1", "vector": [13, 2, 0.8415, 0.0122, 2, 0.8, 0.0, 0, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\treturn self._tree"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99127:FunctionDef_L72_C0", "label": "main", "type": "function", "loc": [72, 78], "level": 0, "parent": null, "vector": [2, 0, 0.9146, 0.0854, 0, 0.66, 0.9231, 624, 0, 0, 0, 0, 0, 0, 8], "semantic": {"name": "main", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def main():\n\ts = urlopen(urljoin(football_url.siteBaseUrl,football_url.yingchao)).read()\n\ts = s.decode('gbk')\n\tmp = TestHTMPParser()\n\tmp.feed(s)\n\tt = mp.fetch_tree()\n\tprint(t)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99127:Assign_L73_C1", "label": "s = read()", "type": "assigned_variable", "loc": [73, 73], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99127:FunctionDef_L72_C0", "vector": [14, 1, 0.8902, 0.0122, 1, 0.84, 0.0, 553, 3, 0, 0, 0, 453, 10, 3], "semantic": {"name": "s", "arg_names": [], "import_names": [], "rhs_call_name": "read", "annotation": ""}, "snippet": "\ts = urlopen(urljoin(football_url.siteBaseUrl,football_url.yingchao)).read()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99127:Assign_L74_C1", "label": "s = decode()", "type": "assigned_variable", "loc": [74, 74], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99127:FunctionDef_L72_C0", "vector": [14, 1, 0.9024, 0.0122, 1, 0.84, 0.2, 553, 3, 1, 0, 0, 528, 10, 1], "semantic": {"name": "s", "arg_names": [], "import_names": [], "rhs_call_name": "decode", "annotation": ""}, "snippet": "\ts = s.decode('gbk')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99127:Assign_L75_C1", "label": "mp = TestHTMPParser()", "type": "assigned_variable", "loc": [75, 75], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99127:FunctionDef_L72_C0", "vector": [14, 1, 0.9146, 0.0122, 1, 0.84, 0.4, 196, 3, 0, 0, 0, 274, 10, 1], "semantic": {"name": "mp", "arg_names": [], "import_names": [], "rhs_call_name": "TestHTMPParser", "annotation": ""}, "snippet": "\tmp = TestHTMPParser()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99127:Expr_L76_C1", "label": "feed()", "type": "expression", "loc": [76, 76], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99127:FunctionDef_L72_C0", "vector": [8, 1, 0.9268, 0.0122, 1, 0.84, 0.6, 87, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "feed", "arg_names": [], "import_names": [], "rhs_call_name": "feed", "annotation": ""}, "snippet": "\tmp.feed(s)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99127:Assign_L77_C1", "label": "t = fetch_tree()", "type": "assigned_variable", "loc": [77, 77], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99127:FunctionDef_L72_C0", "vector": [14, 1, 0.939, 0.0122, 1, 0.84, 0.8, 15, 3, 0, 0, 0, 461, 10, 1], "semantic": {"name": "t", "arg_names": [], "import_names": [], "rhs_call_name": "fetch_tree", "annotation": ""}, "snippet": "\tt = mp.fetch_tree()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99127:Expr_L78_C1", "label": "print()", "type": "expression", "loc": [78, 78], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99127:FunctionDef_L72_C0", "vector": [8, 1, 0.9512, 0.0122, 1, 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": "\tprint(t)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99127:If_L80_C0", "label": "if", "type": "if", "loc": [80, 81], "level": 0, "parent": null, "vector": [4, 0, 0.9817, 0.0244, 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\tmain()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99127:Expr_L81_C1", "label": "main()", "type": "expression", "loc": [81, 81], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99127:If_L80_C0", "vector": [8, 1, 0.9878, 0.0122, 1, 0.99, 0.0, 624, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "main", "arg_names": [], "import_names": [], "rhs_call_name": "main", "annotation": ""}, "snippet": "\tmain()"}]
[{"f": "ajibawa-2023/Python-Code-Large/train/row_99127:ClassDef_L23_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99127:Assign_L24_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99127:ClassDef_L23_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99127:FunctionDef_L25_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99127:FunctionDef_L25_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99127:Expr_L26_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99127:FunctionDef_L25_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99127:Assign_L27_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99127:FunctionDef_L25_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99127:Assign_L28_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99127:FunctionDef_L25_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99127:Assign_L29_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99127:FunctionDef_L25_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99127:Assign_L30_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99127:FunctionDef_L25_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99127:Assign_L31_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99127:FunctionDef_L25_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99127:Assign_L32_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99127:FunctionDef_L25_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99127:Assign_L33_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99127:ClassDef_L23_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99127:FunctionDef_L35_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99127:FunctionDef_L35_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99127:If_L36_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99127:If_L36_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99127:Assign_L37_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99127:If_L36_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99127:Expr_L38_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99127:If_L36_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99127:Expr_L39_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99127:If_L36_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99127:If_L40_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99127:If_L40_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99127:Assign_L41_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99127:If_L40_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99127:Expr_L42_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99127:If_L40_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99127:Expr_L43_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99127:If_L40_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99127:If_L44_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99127:If_L44_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99127:Assign_L46_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99127:If_L44_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99127:Expr_L47_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99127:If_L44_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99127:Expr_L48_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99127:ClassDef_L23_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99127:FunctionDef_L51_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99127:FunctionDef_L51_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99127:If_L52_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99127:If_L52_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99127:Expr_L54_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99127:If_L52_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99127:If_L55_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99127:If_L55_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99127:Expr_L57_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99127:If_L55_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99127:If_L58_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99127:If_L58_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99127:Expr_L61_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99127:ClassDef_L23_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99127:FunctionDef_L63_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99127:FunctionDef_L63_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99127:If_L64_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99127:If_L64_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99127:Expr_L65_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99127:ClassDef_L23_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99127:FunctionDef_L68_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99127:FunctionDef_L68_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99127:Return_L69_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99127:FunctionDef_L72_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99127:Assign_L73_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99127:FunctionDef_L72_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99127:Assign_L74_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99127:FunctionDef_L72_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99127:Assign_L75_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99127:FunctionDef_L72_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99127:Expr_L76_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99127:FunctionDef_L72_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99127:Assign_L77_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99127:FunctionDef_L72_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99127:Expr_L78_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99127:If_L80_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99127:Expr_L81_C1"}]
#!/usr/bin/env python # coding=utf-8 siteBaseUrl = r'http://www.spbo.com/' yingChao = r'data/live.plex?fl=yingchao&p=1' class UrlManager: """ Manage the urls of each league """ def __init__(self): self._baseUrl = siteBaseUrl self._urlsNum = {} self._urlTailPattern = r'data/live.plex?fl=%(league)s&p=%(pagenum)d' self._urlPattern = self._baseUrl + self._urlTailPattern def set_url_num(self, league, num): """ Set the page number of a league @param league: league English name type: string @param num: page number of the league type: int """ self._urlsNum[league] = num def _get_url(self, league, pagenum): urlTail = self._urlPattern % {'league': league, 'pagenum': pagenum} def get_urls(self, league): """ Get the urls of a league. @param league: league English name type: string @return the urls of the league type: tuple of strings @exception raise KeyError if the instance does not contain the league """ pass # TODO def get_leagues(self): """ Get the leagues contained in instance @return English names of leagues type: tuple of strings """ return self_urlsNum.keys() def add_url(self, url): """ Adjust the page number by the given url @param url: url of the score type: string @return if add url and parse successfully @retval True: OK @retval False: Failed """ pass # TODO class UrlContentFetcher: """ Fetch url content with multithread and cache. """ def __init__(self): pass
ajibawa-2023/Python-Code-Large/train/row_99128
24
71
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_99128:Assign_L5_C0", "label": "siteBaseUrl =", "type": "assigned_variable", "loc": [5, 5], "level": 0, "parent": null, "vector": [14, 0, 0.0704, 0.0141, 0, 0.66, 0.0, 575, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "siteBaseUrl", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "siteBaseUrl = r'http://www.spbo.com/'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99128:Assign_L6_C0", "label": "yingChao =", "type": "assigned_variable", "loc": [6, 6], "level": 0, "parent": null, "vector": [14, 0, 0.0845, 0.0141, 0, 0.66, 0.3333, 538, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "yingChao", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "yingChao = r'data/live.plex?fl=yingchao&p=1'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99128:ClassDef_L9_C0", "label": "UrlManager", "type": "class", "loc": [9, 60], "level": 0, "parent": null, "vector": [3, 0, 0.4859, 0.7324, 0, 0.66, 0.6667, 559, 0, 6, 0, 0, 0, 0, 1], "semantic": {"name": "UrlManager", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class UrlManager:\n\t\"\"\"\n\tManage the urls of each league\n\t\"\"\"\n\tdef __init__(self):\n\t\tself._baseUrl = siteBaseUrl\n\t\tself._urlsNum = {}\n\t\tself._urlTailPattern = r'data/live.plex?fl=%(league)s&p=%(pagenum)d'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99128:Expr_L10_C1", "label": "expression", "type": "expression", "loc": [10, 12], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99128:ClassDef_L9_C0", "vector": [8, 1, 0.1549, 0.0423, 1, 0.65, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\"\"\"\n\tManage the urls of each league\n\t\"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99128:FunctionDef_L13_C1", "label": "__init__", "type": "function", "loc": [13, 17], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99128:ClassDef_L9_C0", "vector": [2, 1, 0.2113, 0.0704, 1, 0.65, 0.1667, 555, 0, 1, 0, 0, 0, 0, 0], "semantic": {"name": "__init__", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tdef __init__(self):\n\t\tself._baseUrl = siteBaseUrl\n\t\tself._urlsNum = {}\n\t\tself._urlTailPattern = r'data/live.plex?fl=%(league)s&p=%(pagenum)d'\n\t\tself._urlPattern = self._baseUrl + self._urlTailPattern"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99128:Assign_L14_C2", "label": "self._baseUrl =", "type": "assigned_variable", "loc": [14, 14], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99128:FunctionDef_L13_C1", "vector": [14, 2, 0.1972, 0.0141, 2, 0.76, 0.0, 566, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self._baseUrl", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tself._baseUrl = siteBaseUrl"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99128:Assign_L15_C2", "label": "self._urlsNum =", "type": "assigned_variable", "loc": [15, 15], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99128:FunctionDef_L13_C1", "vector": [14, 2, 0.2113, 0.0141, 2, 0.76, 0.3333, 960, 0, 0, 0, 0, 0, 6, 0], "semantic": {"name": "self._urlsNum", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tself._urlsNum = {}"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99128:Assign_L16_C2", "label": "self._urlTailPattern =", "type": "assigned_variable", "loc": [16, 16], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99128:FunctionDef_L13_C1", "vector": [14, 2, 0.2254, 0.0141, 2, 0.76, 0.6667, 623, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "self._urlTailPattern", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tself._urlTailPattern = r'data/live.plex?fl=%(league)s&p=%(pagenum)d'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99128:Assign_L17_C2", "label": "self._urlPattern =", "type": "assigned_variable", "loc": [17, 17], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99128:FunctionDef_L13_C1", "vector": [14, 2, 0.2394, 0.0141, 2, 0.76, 1.0, 26, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self._urlPattern", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tself._urlPattern = self._baseUrl + self._urlTailPattern"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99128:FunctionDef_L19_C1", "label": "set_url_num", "type": "function", "loc": [19, 27], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99128:ClassDef_L9_C0", "vector": [2, 1, 0.3239, 0.1268, 1, 0.65, 0.3333, 930, 0, 3, 0, 0, 0, 0, 0], "semantic": {"name": "set_url_num", "arg_names": ["self", "league", "num"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tdef set_url_num(self, league, num):\n\t\t\"\"\"\n\t\tSet the page number of a league\n\t\t@param league: league English name\n\t\ttype: string\n\t\t@param num: page number of the league\n\t\ttype: int\n\t\t\"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99128:Expr_L20_C2", "label": "expression", "type": "expression", "loc": [20, 26], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99128:FunctionDef_L19_C1", "vector": [8, 2, 0.3239, 0.0986, 2, 0.79, 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\tSet the page number of a league\n\t\t@param league: league English name\n\t\ttype: string\n\t\t@param num: page number of the league\n\t\ttype: int\n\t\t\"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99128:Assign_L27_C2", "label": "assign", "type": "assigned_variable", "loc": [27, 27], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99128:FunctionDef_L19_C1", "vector": [14, 2, 0.3803, 0.0141, 2, 0.79, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tself._urlsNum[league] = num"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99128:FunctionDef_L29_C1", "label": "_get_url", "type": "function", "loc": [29, 30], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99128:ClassDef_L9_C0", "vector": [2, 1, 0.4155, 0.0282, 1, 0.65, 0.5, 384, 0, 3, 0, 0, 0, 0, 0], "semantic": {"name": "_get_url", "arg_names": ["self", "league", "pagenum"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tdef _get_url(self, league, pagenum):\n\t\turlTail = self._urlPattern % {'league': league, 'pagenum': pagenum}"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99128:Assign_L30_C2", "label": "urlTail =", "type": "assigned_variable", "loc": [30, 30], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99128:FunctionDef_L29_C1", "vector": [14, 2, 0.4225, 0.0141, 2, 0.85, 0.0, 650, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "urlTail", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\turlTail = self._urlPattern % {'league': league, 'pagenum': pagenum}"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99128:FunctionDef_L32_C1", "label": "get_urls", "type": "function", "loc": [32, 41], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99128:ClassDef_L9_C0", "vector": [2, 1, 0.5141, 0.1408, 1, 0.65, 0.6667, 974, 0, 2, 0, 0, 0, 0, 0], "semantic": {"name": "get_urls", "arg_names": ["self", "league"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tdef get_urls(self, league):\n\t\t\"\"\"\n\t\tGet the urls of a league.\n\t\t@param league: league English name\n\t\ttype: string\n\t\t@return the urls of the league\n\t\ttype: tuple of strings\n\t\t@exception raise KeyError if the instance does not contain the league"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99128:Expr_L33_C2", "label": "expression", "type": "expression", "loc": [33, 40], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99128:FunctionDef_L32_C1", "vector": [8, 2, 0.5141, 0.1127, 2, 0.77, 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\tGet the urls of a league.\n\t\t@param league: league English name\n\t\ttype: string\n\t\t@return the urls of the league\n\t\ttype: tuple of strings\n\t\t@exception raise KeyError if the instance does not contain the league\n\t\t\"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99128:FunctionDef_L43_C1", "label": "get_leagues", "type": "function", "loc": [43, 49], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99128:ClassDef_L9_C0", "vector": [2, 1, 0.6479, 0.0986, 1, 0.65, 0.8333, 869, 0, 1, 1, 0, 0, 0, 1], "semantic": {"name": "get_leagues", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tdef get_leagues(self):\n\t\t\"\"\"\n\t\tGet the leagues contained in instance\n\t\t@return English names of leagues\n\t\ttype: tuple of strings\n\t\t\"\"\"\n\t\treturn self_urlsNum.keys()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99128:Expr_L44_C2", "label": "expression", "type": "expression", "loc": [44, 48], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99128:FunctionDef_L43_C1", "vector": [8, 2, 0.6479, 0.0704, 2, 0.65, 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\tGet the leagues contained in instance\n\t\t@return English names of leagues\n\t\ttype: tuple of strings\n\t\t\"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99128:Return_L49_C2", "label": "return", "type": "return", "loc": [49, 49], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99128:FunctionDef_L43_C1", "vector": [13, 2, 0.6901, 0.0141, 2, 0.65, 1.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\treturn self_urlsNum.keys()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99128:FunctionDef_L51_C1", "label": "add_url", "type": "function", "loc": [51, 60], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99128:ClassDef_L9_C0", "vector": [2, 1, 0.7817, 0.1408, 1, 0.65, 1.0, 924, 0, 2, 0, 0, 0, 0, 0], "semantic": {"name": "add_url", "arg_names": ["self", "url"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tdef add_url(self, url):\n\t\t\"\"\"\n\t\tAdjust the page number by the given url\n\t\t@param url: url of the score\n\t\ttype: string\n\t\t@return if add url and parse successfully\n\t\t@retval True: OK\n\t\t@retval False: Failed"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99128:Expr_L52_C2", "label": "expression", "type": "expression", "loc": [52, 59], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99128:FunctionDef_L51_C1", "vector": [8, 2, 0.7817, 0.1127, 2, 0.72, 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\tAdjust the page number by the given url\n\t\t@param url: url of the score\n\t\ttype: string\n\t\t@return if add url and parse successfully\n\t\t@retval True: OK\n\t\t@retval False: Failed\n\t\t\"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99128:ClassDef_L64_C0", "label": "UrlContentFetcher", "type": "class", "loc": [64, 69], "level": 0, "parent": null, "vector": [3, 0, 0.9366, 0.0845, 0, 0.66, 1.0, 849, 0, 1, 0, 0, 0, 0, 0], "semantic": {"name": "UrlContentFetcher", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class UrlContentFetcher:\n\t\"\"\"\n\tFetch url content with multithread and cache.\n\t\"\"\"\n\tdef __init__(self):\n\t\tpass"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99128:Expr_L65_C1", "label": "expression", "type": "expression", "loc": [65, 67], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99128:ClassDef_L64_C0", "vector": [8, 1, 0.9296, 0.0423, 1, 0.09, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\"\"\"\n\tFetch url content with multithread and cache.\n\t\"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99128:FunctionDef_L68_C1", "label": "__init__", "type": "function", "loc": [68, 69], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99128:ClassDef_L64_C0", "vector": [2, 1, 0.9648, 0.0282, 1, 0.09, 1.0, 555, 0, 1, 0, 0, 0, 0, 0], "semantic": {"name": "__init__", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tdef __init__(self):\n\t\tpass"}]
[{"f": "ajibawa-2023/Python-Code-Large/train/row_99128:ClassDef_L9_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99128:Expr_L10_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99128:ClassDef_L9_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99128:FunctionDef_L13_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99128:FunctionDef_L13_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99128:Assign_L14_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99128:FunctionDef_L13_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99128:Assign_L15_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99128:FunctionDef_L13_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99128:Assign_L16_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99128:FunctionDef_L13_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99128:Assign_L17_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99128:ClassDef_L9_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99128:FunctionDef_L19_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99128:FunctionDef_L19_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99128:Expr_L20_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99128:FunctionDef_L19_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99128:Assign_L27_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99128:ClassDef_L9_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99128:FunctionDef_L29_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99128:FunctionDef_L29_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99128:Assign_L30_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99128:ClassDef_L9_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99128:FunctionDef_L32_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99128:FunctionDef_L32_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99128:Expr_L33_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99128:ClassDef_L9_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99128:FunctionDef_L43_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99128:FunctionDef_L43_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99128:Expr_L44_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99128:FunctionDef_L43_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99128:Return_L49_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99128:ClassDef_L9_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99128:FunctionDef_L51_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99128:FunctionDef_L51_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99128:Expr_L52_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99128:ClassDef_L64_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99128:Expr_L65_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99128:ClassDef_L64_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99128:FunctionDef_L68_C1"}]
#!/usr/bin/env python # coding=utf-8 import os import sys import re import codecs import pickle import cPickle from OffsetDump import KiwiDataManager # set log import CheckLog log = CheckLog.get_file_log('VrDicCheck.log') class DicItemParamError(Exception): pass class DicItem: _folder = r'' _kiwiDataManager = None """ """ def __init__(self, linestr, father): self._linestr = linestr self._children = None self._father = father self._kiwiRecord = None self._kiwiFrame = None self._checked = False self._type = None # parse attributes from line string # 'Name PinYin NextLevelId NextLevelInfo Offset VoiceId NextLevelNumber' pat = re.match( \ r'^(\S+)\t([\w ]+)\t(0x[\dA-F]{8})\t(0x[\dA-F]{8})\t(0x[\dA-F]{8})\t(0x[\dA-F]{8})\t(0x[\dA-F]{4})\r\n$', \ self._linestr) if not pat: log.warning(r'<String Match Warning> : %s : %s', self.get_father()['nextLevelId'], self.get_str()[:-2]) log.warning(r'I try to match pinyin with "/"') pat = re.match( \ r'^(\S+)\t([\w /]+)\t(0x[\dA-F]{8})\t(0x[\dA-F]{8})\t(0x[\dA-F]{8})\t(0x[\dA-F]{8})\t(0x[\dA-F]{4})\r\n$', \ self._linestr) if pat: log.warning(r'Try match pinyin with "/" successfully') else: log.warning(r'<String Match Error> : %s : %s', self.get_father()['nextLevelId'], self.get_str()) # remove '\r\n' at the end of each line self._linestr = self._linestr[:-2] if not pat: log.warning(r'<Item Line Format Error> : %s : %s', self.get_father()['nextLevelId'], linestr) raise DicItemParamError() self._name = pat.group(1) self._pinyin = pat.group(2) self._nextLevelId = pat.group(3) self._nextLevelInfo = pat.group(4) self._offset = pat.group(5) self._voiceId = pat.group(6) self._nextLevelNum = pat.group(7) self._attrs = { 1: self._name, 'name': self._name, 2: self._pinyin, 'pinyin':self._pinyin, 3: self._nextLevelId, 'nextLevelId': self._nextLevelId, 4: self._nextLevelInfo, 'nextLevelInfo': self._nextLevelInfo, 5: self._offset, 'offset': self._offset, 6: self._voiceId, 'voiceId': self._voiceId, 7: self._nextLevelNum, 'nextLevelNum': self._nextLevelNum } def get_str(self): return self._linestr def check(self): " Check the item itself only. \n" checker = DicItemChecker(self) r = checker.check() if r: #log.debug(r'<No Error> : %s', self.get_str()) pass else: log.warning(r'<Error> : %s : %s', self.get_father()['nextLevelId'], self.get_str()) return (r, checker) def check_recursively(self): " Check recursively.\n" if self._checked: return True self._checked = True (result, checker) = self.check() # has checked another name of this item, do not to check children if checker.checked_another_name(): return result # check children recursively for child in self.get_children(): if not child.check_recursively(): result = False return result def has_child(self): if self['nextLevelId'] != '0xFFFFFFFF' \ or self['nextLevelInfo'] != '0x00000001' \ or self['nextLevelNum'] != '0x0000': # check all the info should all say ' has next level' if not (self['nextLevelId'] != '0xFFFFFFFF' \ and self['nextLevelInfo'] != '0x00000001' \ and self['nextLevelNum'] != '0x0000'): log.warning('<Has Next Level Not Agreed Error> : %s : %s', self.get_father()['nextLevelId'], self._linestr) return True else: # check all the info should all say ' not have next level' if not (self['nextLevelId'] == '0xFFFFFFFF' \ and self['nextLevelInfo'] == '0x00000001' \ and self['nextLevelNum'] == '0x0000'): log.warning('<Has Next Level Not Agreed Error> : %s : %s', self.get_father()['nextLevelId'], self._linestr) return False def get_father(self): return self._father def get_children(self): if self._children != None: return self._children elif not self.has_child(): return tuple() children_set = [] filename = self['nextLevelId'][2:]+'.txt' filepath = os.path.join(self._folder, filename) # open file and read lines try: fp = codecs.open(filepath,encoding='gbk') lines = fp.readlines() fp.close() except IOError: log.warning(r'<File Open&Read Error> : %s : %s ', self.get_father()['nextLevelId'], self._linestr) return tuple() except UnicodeDecodeError: log.warning(r'<File Encoding Error> : %s : %s : %s', self.get_father()['nextLevelId'], self._linestr, filename) fp.close() return tuple() # parse each line to a DicItem, and add the DicItems to children_set for s in lines: if re.match(r'^\s*$',s): log.warning(r'<File Format Error> : Filename: %s', filename) continue try: dicItem = DicItem(s, self) except DicItemParamError: log.warning(r'<Get Child Error> : %s FileName : %s', self._linestr, filename) continue children_set.append(dicItem) self._children = tuple(children_set) return self._children def __getitem__(self, attr): ' Return a string.\n' return self._attrs[attr] def is_root(self): return False def _fetch_kiwi_record(self): # root, process in DicRootItem #if self.is_root(): # return None f = self.get_father() # root -> province if f.is_root(): kiwiRecords = self._kiwiDataManager.fetch_record(self['name']) return kiwiRecords ff = f.get_father() # root -> province -> city if ff.is_root(): kiwiRecords = self._kiwiDataManager.fetch_record(f['name'], self['name']) return kiwiRecords fff = ff.get_father() # root -> province -> city -> town if fff.is_root(): kiwiRecords = self._kiwiDataManager.fetch_record(ff['name'], f['name'], self['name']) return kiwiRecords ffff = fff.get_father() # root -> province -> city -> town -> road if ffff.is_root(): kiwiRecords = self._kiwiDataManager.fetch_record(fff['name'], ff['name'], f['name'], self['name']) return kiwiRecords # error raise KeyError() def fetch_kiwi_record(self): if self._kiwiRecord != None: return self._kiwiRecord rds = self._fetch_kiwi_record() if len(rds) == 1: return rds[0] for r in rds: if r['offset'] == int(self['offset'], 16): if r['name'] != self['name']: log.error(r'<Fetch Kiwi Record Error> : Same name record error : %s', self.get_str()) self._kiwiRecord = r return r log.warning(r'<Fetch Kiwi Record Error> : %s : %s', self.get_father()['offset'], self['offset']) raise KeyError() def fetch_kiwi_frame(self): if self._kiwiFrame != None: return self._kiwiFrame # root, process in DicRootItem #if self.is_root(): # return None f = self.get_father() # root -> province if f.is_root(): self._kiwiFrame = self._kiwiDataManager.fetch_frame(self['name']) return self._kiwiFrame ff = f.get_father() # root -> province -> city if ff.is_root(): self._kiwiFrame = self._kiwiDataManager.fetch_frame(f['name'], self['name']) return self._kiwiFrame fff = ff.get_father() # root -> province -> city -> town if fff.is_root(): self._kiwiFrame = self._kiwiDataManager.fetch_frame(ff['name'], f['name'], self['name']) return self._kiwiFrame ffff = fff.get_father() # error raise KeyError() def get_type(self): "Return 'Sheng', 'ZhiXiaShi', 'Di', 'Xian', 'QuanYu', 'Lu'\n" if self._type != None: return self._type if not self.has_child(): self._type = 'Lu' return self._type if self.get_father().is_root(): if self['name'] == u'上海市' or self['name'] == u'北京市' or \ self['name'] == u'天津市' or self['name'] == u'重庆市': self._type = 'ZhiXiaShi' else: self._type = 'Sheng' return self._type if self['name'].endswith(u'全域'): self._type = 'QuanYu' return self._type fType = self.get_father().get_type() if fType == 'ZhiXiaShi': self._type = 'Qu' return self._type elif fType == 'Sheng': if len(self.get_children())==0: log.error(r'<Children Len Error> : %s', self.get_str()) if self.get_children()[0].has_child(): self._type = 'Di' return self._type else: self._type = 'Xian' return self._type self._type = 'Xian' return self._type class DicRootItem(DicItem): def __init__(self): linestr = 'China NoPinYin 0x80000001 0x00000000 0x00000000 0x00000000 0x0000\r\n' DicItem.__init__(self, linestr, None) def check(self): pass def check_recursively(self): " Check recursively.\n" if self._checked: return True self._checked = True # check children recursively result = True for child in self.get_children(): if not child.check_recursively(): result = False return result def has_child(self): return True def is_root(self): return True def fetch_kiwi_record(self): return None def fetch_kiwi_frame(self): if self._kiwiFrame != None: return self._kiwiFrame self._kiwiFrame = self._kiwiDataManager.fetch_frame() return self._kiwiFrame def get_type(self): return 'China' class DicItemChecker: """Class to check dictionary item. """ # alphabets that might be found in text. alphabets = set(u'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ') # pinyin should only contains these characters pinyinChars = set(u'abcdefghijklmnopqrstuvwxyz /1234') def __init__(self, dicItem): """ Constructor. """ self._dicItem = dicItem self._children_offset_indexed = None self._checked_another_name = False self._checked = False def check(self, forceCheck = False): """Check dictionary item. """ if self._checked: return True self._checked = True if not forceCheck: try: self._dicItem.fetch_kiwi_record() except KeyError: #log.warning(r'<Check another name> : You should check it manually : %s : %s', self._dicItem.get_father()['nextLevelId'], self._dicItem.get_str()) return self._check_another_name() # check all the items r1 = self._check_1() r2 = self._check_2() r3 = self._check_3() r4 = self._check_4() r5 = self._check_5() r6 = self._check_6() r7 = self._check_7() r8 = self._check_8() r9 = self._check_9() return r1 and r2 and r3 and r4 and r5 and r6 and r7 and r8 and r9 def _check_another_name(self): """Check another name of the dictionary item. """ self._checked_another_name = True for item in self._dicItem.get_father().get_children(): if item['offset'] == self._dicItem['offset']: try: item.fetch_kiwi_record() except KeyError: continue if not self.is_another_name(item, self._dicItem): log.warning(r'<Check Another Name Error> : not another name : %s', self._dicItem.get_str()) return False log.info(r'<Check another name> : %s : %s : %s', self._dicItem.get_father()['nextLevelId'], self._dicItem.get_str(), item.get_str()) return DicItemChecker(item).check(True) log.warning(r'<Check Another Name Error> : %s', self._dicItem.get_str()) return False def is_another_name(self, r1, r2): """Check if r1 is another of r2. """ if r1['nextLevelId'] != r2['nextLevelId'] \ or r1['nextLevelInfo'] != r2['nextLevelInfo'] \ or r1['offset'] != r2['offset'] \ or r1['voiceId'] != r2['voiceId'] \ or r1['nextLevelNum'] != r2['nextLevelNum']: return False elif r1['name'].find(r2['name']) >= 0 or r2['name'].find(r1['name']) >= 0: return True elif r1['name'].find(u'全域') >= 0 and r2['name'].find(u'全域') >= 0: return True else: return False def checked_another_name(self): """Judge if another name has been checked """ return self._checked_another_name; def _check_1(self): """Check the name. """ return True def _check_2(self): """Check pinyin. """ d = self._dicItem r1 = self._check_2_1() r2 = self._check_2_2(); if not r1: log.info(r'<Check_2 Error> Alphabet text but not NoPinYin : %s : %s', self._dicItem.get_father()['nextLevelId'], self._dicItem.get_str()) return False if not r2: log.info(r'<Check_2 Error> Pinyin contains other characters : %s : %s', self._dicItem.get_father()['nextLevelId'], self._dicItem.get_str()) return False return True def _check_3(self): """Check next level id. """ r1 = self._check_3_1() r2 = self._check_3_2() return r1 and r2 def _check_4(self): """Check next level info. """ if not self._dicItem.has_child(): if self._dicItem['nextLevelInfo'] != '0x00000001': log.info(r'<Check_4 Error> next level info : %s : %s', self._dicItem.get_father()['nextLevelId'], self._dicItem.get_str()) return False return True ret = True getb = lambda x,n: bool(x>>n & 1) nextLevelInfo = int(self._dicItem['nextLevelInfo'], 16) bits = tuple(getb(nextLevelInfo, n) for n in range(32)) for n in range(7,32): if bits[n] != False: log.info('<Check_4 Error> next level info : %s', self._dicItem.get_str()) # check bit0 for item in self._dicItem.get_children(): type = item.get_type() if type == 'Sheng' or type == 'ZhiXiaShi': if bits[1] != True or bits[6] == True: log.warning(r'<Check_4 Error> : Sheng/ZhiXiaShi : %s', self._dicItem.get_str()) ret = False elif type == 'Di': if bits[2] != True or bits[6] == True: log.warning(r'<Check_4 Error> next level info : Di : %s', self._dicItem.get_str()) ret = False elif type == 'Xian' or type == 'Qu': if bits[3] != True or bits[6] == True: log.warning(r'<Check_4 Error> next level info : Xian : %s', self._dicItem.get_str()) ret = False elif type == 'Lu': if bits[4] != True: log.warning(r'<Check_4 Error> next level info : Lu : %s', self._dicItem.get_str()) ret = False elif type == 'QuanYu': pass else: raise KeyError() if self._dicItem.get_type() == 'QuanYu': if bits[6] != True: log.warning(r'<Check_4 Error> next level info : QuanYu Road Check Error : %s', self._dicItem.get_str()) ret = False else: if bits[6] == True: log.warning(r'<Check_4 Error> next level info : QuanYu Road Check Error : %s', self._dicItem.get_str()) ret = False return ret def _check_5(self): """Check offset equals to kiwi data. """ if int(self._dicItem['offset'], 16) == \ self._dicItem.fetch_kiwi_record()['offset']: return True else: log.warning(r'<Check_5 Error> offset : %s : %s', self._dicItem.get_father()['nextLevelId'], self._dicItem.get_str()) return False def _check_6(self): """Check voice id. """ voiceId = int(self._dicItem['voiceId'], 16) if voiceId == 0xffffffff: voiceId = 0 kVoiceId = self._dicItem.fetch_kiwi_record()['voiceId'] if voiceId == kVoiceId: return True else: log.warning(r'<Check_6 Error> voice id : %s', self._dicItem.get_str()) return False return True def _check_7(self): """Check the number of next level places. """ num = int(self._dicItem['nextLevelNum'], 16) realNum = num ret = True if not self._dicItem.has_child(): # if num != 0 !! if num != len(self._dicItem.get_children()): ret = False else: realNum = len(set(r['offset'] for r in self._dicItem.get_children())) if num == 0 or realNum == 0 or realNum > num: ret = False try: knum = len(self._dicItem.fetch_kiwi_frame()) except KeyError: knum = 0; if realNum != knum: ret = False if not ret: log.warning(r'<Check_7 Error> next level number : %s', self._dicItem.get_str()) return ret def _check_8(self): """Check replacename, which is already checked. """ return True def _check_9(self): """Check others. """ r1 = self._check_9_1() r2 = self._check_9_2() r3 = self._check_9_3() r4 = self._check_9_4() return r1 and r2 and r3 and r4 def _check_2_1(self): """Check if text has alphabet, then pinyin should be "NoPinYin" """ def has_alphabet(s): for c in s: if c in self.alphabets: return True return False if has_alphabet(self._dicItem['name']): if self._dicItem['pinyin'] != u'NoPinYin': return False return True def _check_2_2(self): """Check characters in pinyin """ pinyin = self._dicItem['pinyin'] if pinyin == 'NoPinYin': return True for c in pinyin: if not c in self.pinyinChars: return False return True def _check_3_1(self): """Check next level id and if next level file exists """ d = self._dicItem try: k = d.fetch_kiwi_record() except: log.warning(r'<Fetch Kiwi Record Error> : %s', d.get_str()) return False nextLevelId = d['nextLevelId'] if not k.has_next_level(): if nextLevelId != '0xFFFFFFFF': log.warning(r'<Check_3_1 - Has Next Level Error> : %s', d.get_str()) # do not return now, go on checking return True else: if nextLevelId == '0xFFFFFFFF': log.warning(r'<Check_3_1 - Has Next Level Error> : %s', d.get_str()) # check file exists filename = nextLevelId[2:]+'.txt' filepath = os.path.join(d._folder, filename) if not os.path.isfile(filepath): # file not exist log.warning(r'<Check_3_1 - File Not Exists Error> : %s', d.get_str()) return False return True def _check_3_2(self): """Check if [next level id] corresponds with higher-level """ d = self._dicItem # road, checked in check_3_1 if not d.has_child(): return True # province type = d.get_type() fId = d.get_father()['nextLevelId'] Id = d['nextLevelId'] ifId = int(fId, 16) iId = int(Id, 16) if fId != '0x80000001': if ifId & iId != ifId or ifId | iId != iId or ifId == iId: log.warning(r'<Check_3_2 Error> : %s', d.get_str()) if type == 'Sheng' or type == 'ZhiXiaShi': if re.match(r'0x8[\dA-F]{2}00000', Id) and Id != '0x80000000': return True else: log.warning(r'<Check_3_2 Error> : Sheng/ZhiXiaShi : %s', d.get_str()) return False elif type == 'Di': if re.match(fId[:5] + r'[\dA-F]{2}000', Id) and Id != fId: return True else: log.warning(r'<Check_3_2 Error> : Di : %s', d.get_str()) return False elif type == 'Xian' or type == 'Qu': if re.match(fId[:7] + r'[\dA-F]{3}', Id) and Id != fId: return True else: log.warning(r'<Check_3_2 Error> : Xian/Qu : %s', d.get_str()) return False elif type == 'QuanYu': if Id[-3:] != '001' or Id == fId: log.warning(r'<Check_3_2 Error> : QuanYu : %s', d.get_str()) return True def _check_9_1(self): """Check if all fields exists in each item. Already checked in DicItem#get_children """ return True def _check_9_2(self): """Check dictionary format. Already checked in DicItem#get_children """ return True def _check_9_3(self): """Check if there are repeated next level info or voice id. Replace names are checked specially. @retval True: no repeated next level id or voice id. @retval False: has repeated next level id or voice id. """ if not self._dicItem.has_child(): return True Rs = self._dicItem.get_children() ret = True for r in Rs: id = r['nextLevelId'] if id == '0xFFFFFFFF': continue sameIdRs = filter(lambda rt:rt['nextLevelId']==id, Rs) if len(sameIdRs) != 1: for r in sameIdRs[1:]: if not self.is_another_name(r, sameIdRs[0]): log.warning(r'<Next Level Has Repeated Id Error> : %s : %s : %d', self._dicItem.get_str(), id, len(sameIdRs)) ret = False for r in Rs: vid = r['voiceId'] if vid == '0xFFFFFFFF': continue sameVidRs = filter(lambda rt:rt['voiceId']==vid, Rs) if len(sameVidRs) != 1: for r in sameVidRs[1:]: if not self.is_another_name(r, sameIdRs[0]): log.warning(r'<Next Level Has Repeated VoiceId Error> : %s : %s : %d', self._dicItem.get_str(), id, len(sameVidRs)) ret = False return ret def _check_9_4(self): """Check if all records in Kiwi exists in dictionary """ ret = True d = self._dicItem k = d.fetch_kiwi_record() nextLevelOffsets = tuple(int(c['offset'], 16) for c in self._dicItem.get_children()) if not k.has_next_level(): if not d.has_child(): return True log.warning(r'<Check_9_4 Error> : %s', d.get_str()) return False for k in d.fetch_kiwi_frame(): if not k['offset'] in nextLevelOffsets: log.warning(r'<Check_9_4 Error> : %s : %x', self._dicItem.get_str(), k['offset']) ret = False return ret
ajibawa-2023/Python-Code-Large/train/row_99129
487
672
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_99129:Import_L4_C0", "label": "os import os", "type": "import", "loc": [4, 4], "level": 0, "parent": null, "vector": [1, 0, 0.006, 0.0015, 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_99129:Import_L5_C0", "label": "sys import sys", "type": "import", "loc": [5, 5], "level": 0, "parent": null, "vector": [1, 0, 0.0074, 0.0015, 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_99129:Import_L6_C0", "label": "re import re", "type": "import", "loc": [6, 6], "level": 0, "parent": null, "vector": [1, 0, 0.0089, 0.0015, 0, 0.66, 0.1667, 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_99129:Import_L7_C0", "label": "codecs import codecs", "type": "import", "loc": [7, 7], "level": 0, "parent": null, "vector": [1, 0, 0.0104, 0.0015, 0, 0.66, 0.25, 220, 0, 1, 0, 0, 220, 0, 0], "semantic": {"name": "codecs", "arg_names": [], "import_names": ["codecs"], "rhs_call_name": "", "annotation": ""}, "snippet": "import codecs"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99129:Import_L8_C0", "label": "pickle import pickle", "type": "import", "loc": [8, 8], "level": 0, "parent": null, "vector": [1, 0, 0.0119, 0.0015, 0, 0.66, 0.3333, 848, 0, 1, 0, 0, 848, 0, 0], "semantic": {"name": "pickle", "arg_names": [], "import_names": ["pickle"], "rhs_call_name": "", "annotation": ""}, "snippet": "import pickle"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99129:Import_L9_C0", "label": "cPickle import cPickle", "type": "import", "loc": [9, 9], "level": 0, "parent": null, "vector": [1, 0, 0.0134, 0.0015, 0, 0.66, 0.4167, 279, 0, 1, 0, 0, 279, 0, 0], "semantic": {"name": "cPickle", "arg_names": [], "import_names": ["cPickle"], "rhs_call_name": "", "annotation": ""}, "snippet": "import cPickle"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99129:ImportFrom_L10_C0", "label": "from OffsetDump import KiwiDataManager", "type": "import", "loc": [10, 10], "level": 0, "parent": null, "vector": [1, 0, 0.0149, 0.0015, 0, 0.66, 0.5, 935, 0, 1, 0, 0, 935, 0, 0], "semantic": {"name": "OffsetDump", "arg_names": [], "import_names": ["KiwiDataManager"], "rhs_call_name": "", "annotation": ""}, "snippet": "from OffsetDump import KiwiDataManager"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99129:Import_L13_C0", "label": "CheckLog import CheckLog", "type": "import", "loc": [13, 13], "level": 0, "parent": null, "vector": [1, 0, 0.0193, 0.0015, 0, 0.66, 0.5833, 11, 0, 1, 0, 0, 11, 0, 0], "semantic": {"name": "CheckLog", "arg_names": [], "import_names": ["CheckLog"], "rhs_call_name": "", "annotation": ""}, "snippet": "import CheckLog"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99129:Assign_L14_C0", "label": "log = get_file_log()", "type": "assigned_variable", "loc": [14, 14], "level": 0, "parent": null, "vector": [14, 0, 0.0208, 0.0015, 0, 0.66, 0.6667, 432, 3, 1, 0, 0, 730, 10, 1], "semantic": {"name": "log", "arg_names": [], "import_names": [], "rhs_call_name": "get_file_log", "annotation": ""}, "snippet": "log = CheckLog.get_file_log('VrDicCheck.log')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99129:ClassDef_L17_C0", "label": "DicItemParamError", "type": "class", "loc": [17, 17], "level": 0, "parent": null, "vector": [3, 0, 0.0253, 0.0015, 0, 0.66, 0.75, 444, 0, 0, 0, 0, 645, 0, 0], "semantic": {"name": "DicItemParamError", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class DicItemParamError(Exception): pass"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99129:ClassDef_L19_C0", "label": "DicItem", "type": "class", "loc": [19, 257], "level": 0, "parent": null, "vector": [3, 0, 0.2054, 0.3557, 0, 0.66, 0.8333, 354, 0, 13, 0, 0, 0, 0, 96], "semantic": {"name": "DicItem", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class DicItem:\n\t_folder = r''\n\t_kiwiDataManager = None\n\t\"\"\" \"\"\"\n\tdef __init__(self, linestr, father):\n\t\tself._linestr = linestr\n\t\tself._children = None\n\t\tself._father = father"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99129:Assign_L20_C1", "label": "_folder =", "type": "assigned_variable", "loc": [20, 20], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99129:ClassDef_L19_C0", "vector": [14, 1, 0.0298, 0.0015, 1, 0.91, 0.0, 793, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "_folder", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t_folder = r''"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99129:Assign_L21_C1", "label": "_kiwiDataManager =", "type": "assigned_variable", "loc": [21, 21], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99129:ClassDef_L19_C0", "vector": [14, 1, 0.0312, 0.0015, 1, 0.91, 0.0667, 753, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "_kiwiDataManager", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t_kiwiDataManager = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99129:Expr_L22_C1", "label": "expression", "type": "expression", "loc": [22, 22], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99129:ClassDef_L19_C0", "vector": [8, 1, 0.0327, 0.0015, 1, 0.91, 0.1333, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\"\"\" \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L23_C1", "label": "__init__", "type": "function", "loc": [23, 66], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99129:ClassDef_L19_C0", "vector": [2, 1, 0.0662, 0.0655, 1, 0.91, 0.2, 555, 0, 3, 0, 0, 0, 0, 20], "semantic": {"name": "__init__", "arg_names": ["self", "linestr", "father"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tdef __init__(self, linestr, father):\n\t\tself._linestr = linestr\n\t\tself._children = None\n\t\tself._father = father\n\t\tself._kiwiRecord = None\n\t\tself._kiwiFrame = None\n\t\tself._checked = False\n\t\tself._type = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99129:Assign_L24_C2", "label": "self._linestr =", "type": "assigned_variable", "loc": [24, 24], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L23_C1", "vector": [14, 2, 0.0357, 0.0015, 2, 0.05, 0.0, 293, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self._linestr", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tself._linestr = linestr"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99129:Assign_L25_C2", "label": "self._children =", "type": "assigned_variable", "loc": [25, 25], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L23_C1", "vector": [14, 2, 0.0372, 0.0015, 2, 0.05, 0.0556, 365, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "self._children", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tself._children = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99129:Assign_L26_C2", "label": "self._father =", "type": "assigned_variable", "loc": [26, 26], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L23_C1", "vector": [14, 2, 0.0387, 0.0015, 2, 0.05, 0.1111, 768, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self._father", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tself._father = father"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99129:Assign_L27_C2", "label": "self._kiwiRecord =", "type": "assigned_variable", "loc": [27, 27], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L23_C1", "vector": [14, 2, 0.0402, 0.0015, 2, 0.05, 0.1667, 493, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "self._kiwiRecord", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tself._kiwiRecord = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99129:Assign_L28_C2", "label": "self._kiwiFrame =", "type": "assigned_variable", "loc": [28, 28], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L23_C1", "vector": [14, 2, 0.0417, 0.0015, 2, 0.05, 0.2222, 577, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "self._kiwiFrame", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tself._kiwiFrame = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99129:Assign_L29_C2", "label": "self._checked =", "type": "assigned_variable", "loc": [29, 29], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L23_C1", "vector": [14, 2, 0.0432, 0.0015, 2, 0.05, 0.2778, 131, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "self._checked", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tself._checked = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99129:Assign_L30_C2", "label": "self._type =", "type": "assigned_variable", "loc": [30, 30], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L23_C1", "vector": [14, 2, 0.0446, 0.0015, 2, 0.05, 0.3333, 313, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "self._type", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tself._type = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99129:Assign_L33_C2", "label": "pat = match()", "type": "assigned_variable", "loc": [33, 35], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L23_C1", "vector": [14, 2, 0.0506, 0.0045, 2, 0.05, 0.3889, 545, 3, 2, 0, 0, 36, 10, 1], "semantic": {"name": "pat", "arg_names": [], "import_names": [], "rhs_call_name": "match", "annotation": ""}, "snippet": "\t\tpat = re.match( \\\n\t\t\t\tr'^(\\S+)\\t([\\w ]+)\\t(0x[\\dA-F]{8})\\t(0x[\\dA-F]{8})\\t(0x[\\dA-F]{8})\\t(0x[\\dA-F]{8})\\t(0x[\\dA-F]{4})\\r\\n$', \\\n\t\t\t\tself._linestr)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L36_C2", "label": "if", "type": "if", "loc": [36, 45], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L23_C1", "vector": [4, 2, 0.0603, 0.0149, 2, 0.05, 0.4444, 0, 0, 0, 0, 0, 0, 0, 9], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tif not pat:\n\t\t\tlog.warning(r'<String Match Warning> : %s : %s', self.get_father()['nextLevelId'], self.get_str()[:-2])\n\t\t\tlog.warning(r'I try to match pinyin with \"/\"')\n\t\t\tpat = re.match( \\\n\t\t\t\tr'^(\\S+)\\t([\\w /]+)\\t(0x[\\dA-F]{8})\\t(0x[\\dA-F]{8})\\t(0x[\\dA-F]{8})\\t(0x[\\dA-F]{8})\\t(0x[\\dA-F]{4})\\r\\n$', \\\n\t\t\t\tself._linestr)\n\t\t\tif pat:\n\t\t\t\tlog.warning(r'Try match pinyin with \"/\" successfully')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99129:Expr_L37_C3", "label": "warning()", "type": "expression", "loc": [37, 37], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L36_C2", "vector": [8, 3, 0.0551, 0.0015, 3, 0.69, 0.0, 320, 3, 3, 0, 0, 0, 0, 3], "semantic": {"name": "warning", "arg_names": [], "import_names": [], "rhs_call_name": "warning", "annotation": ""}, "snippet": "\t\t\tlog.warning(r'<String Match Warning> : %s : %s', self.get_father()['nextLevelId'], self.get_str()[:-2])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99129:Expr_L38_C3", "label": "warning()", "type": "expression", "loc": [38, 38], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L36_C2", "vector": [8, 3, 0.0565, 0.0015, 3, 0.69, 0.3333, 320, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "warning", "arg_names": [], "import_names": [], "rhs_call_name": "warning", "annotation": ""}, "snippet": "\t\t\tlog.warning(r'I try to match pinyin with \"/\"')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99129:Assign_L39_C3", "label": "pat = match()", "type": "assigned_variable", "loc": [39, 41], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L36_C2", "vector": [14, 3, 0.0595, 0.0045, 3, 0.69, 0.6667, 545, 3, 2, 0, 0, 36, 10, 1], "semantic": {"name": "pat", "arg_names": [], "import_names": [], "rhs_call_name": "match", "annotation": ""}, "snippet": "\t\t\tpat = re.match( \\\n\t\t\t\tr'^(\\S+)\\t([\\w /]+)\\t(0x[\\dA-F]{8})\\t(0x[\\dA-F]{8})\\t(0x[\\dA-F]{8})\\t(0x[\\dA-F]{8})\\t(0x[\\dA-F]{4})\\r\\n$', \\\n\t\t\t\tself._linestr)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L42_C3", "label": "if", "type": "if", "loc": [42, 45], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L36_C2", "vector": [4, 3, 0.0647, 0.006, 3, 0.69, 1.0, 0, 2, 0, 0, 0, 0, 0, 4], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\tif pat:\n\t\t\t\tlog.warning(r'Try match pinyin with \"/\" successfully')\n\t\t\telse:\n\t\t\t\tlog.warning(r'<String Match Error> : %s : %s', self.get_father()['nextLevelId'], self.get_str())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99129:Expr_L43_C4", "label": "warning()", "type": "expression", "loc": [43, 43], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L42_C3", "vector": [8, 4, 0.064, 0.0015, 4, 0.61, 0.0, 320, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "warning", "arg_names": [], "import_names": [], "rhs_call_name": "warning", "annotation": ""}, "snippet": "\t\t\t\tlog.warning(r'Try match pinyin with \"/\" successfully')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99129:Expr_L45_C4", "label": "warning()", "type": "expression", "loc": [45, 45], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L42_C3", "vector": [8, 4, 0.067, 0.0015, 4, 0.61, 1.0, 320, 3, 3, 0, 0, 0, 0, 3], "semantic": {"name": "warning", "arg_names": [], "import_names": [], "rhs_call_name": "warning", "annotation": ""}, "snippet": "\t\t\t\tlog.warning(r'<String Match Error> : %s : %s', self.get_father()['nextLevelId'], self.get_str())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99129:Assign_L47_C2", "label": "self._linestr =", "type": "assigned_variable", "loc": [47, 47], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L23_C1", "vector": [14, 2, 0.0699, 0.0015, 2, 0.05, 0.5, 293, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self._linestr", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tself._linestr = self._linestr[:-2]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L48_C2", "label": "if", "type": "if", "loc": [48, 50], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L23_C1", "vector": [4, 2, 0.0729, 0.0045, 2, 0.05, 0.5556, 0, 0, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tif not pat:\n\t\t\tlog.warning(r'<Item Line Format Error> : %s : %s', self.get_father()['nextLevelId'], linestr)\n\t\t\traise DicItemParamError()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99129:Expr_L49_C3", "label": "warning()", "type": "expression", "loc": [49, 49], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L48_C2", "vector": [8, 3, 0.0729, 0.0015, 3, 0.54, 0.0, 320, 3, 3, 0, 0, 0, 0, 2], "semantic": {"name": "warning", "arg_names": [], "import_names": [], "rhs_call_name": "warning", "annotation": ""}, "snippet": "\t\t\tlog.warning(r'<Item Line Format Error> : %s : %s', self.get_father()['nextLevelId'], linestr)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99129:Assign_L51_C2", "label": "self._name = group()", "type": "assigned_variable", "loc": [51, 51], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L23_C1", "vector": [14, 2, 0.0759, 0.0015, 2, 0.05, 0.6111, 257, 3, 1, 0, 0, 43, 10, 1], "semantic": {"name": "self._name", "arg_names": [], "import_names": [], "rhs_call_name": "group", "annotation": ""}, "snippet": "\t\tself._name = pat.group(1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99129:Assign_L52_C2", "label": "self._pinyin = group()", "type": "assigned_variable", "loc": [52, 52], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L23_C1", "vector": [14, 2, 0.0774, 0.0015, 2, 0.05, 0.6667, 711, 3, 1, 0, 0, 43, 10, 1], "semantic": {"name": "self._pinyin", "arg_names": [], "import_names": [], "rhs_call_name": "group", "annotation": ""}, "snippet": "\t\tself._pinyin = pat.group(2)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99129:Assign_L53_C2", "label": "self._nextLevelId = group()", "type": "assigned_variable", "loc": [53, 53], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L23_C1", "vector": [14, 2, 0.0789, 0.0015, 2, 0.05, 0.7222, 657, 3, 1, 0, 0, 43, 10, 1], "semantic": {"name": "self._nextLevelId", "arg_names": [], "import_names": [], "rhs_call_name": "group", "annotation": ""}, "snippet": "\t\tself._nextLevelId = pat.group(3)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99129:Assign_L54_C2", "label": "self._nextLevelInfo = group()", "type": "assigned_variable", "loc": [54, 54], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L23_C1", "vector": [14, 2, 0.0804, 0.0015, 2, 0.05, 0.7778, 222, 3, 1, 0, 0, 43, 10, 1], "semantic": {"name": "self._nextLevelInfo", "arg_names": [], "import_names": [], "rhs_call_name": "group", "annotation": ""}, "snippet": "\t\tself._nextLevelInfo = pat.group(4)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99129:Assign_L55_C2", "label": "self._offset = group()", "type": "assigned_variable", "loc": [55, 55], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L23_C1", "vector": [14, 2, 0.0818, 0.0015, 2, 0.05, 0.8333, 914, 3, 1, 0, 0, 43, 10, 1], "semantic": {"name": "self._offset", "arg_names": [], "import_names": [], "rhs_call_name": "group", "annotation": ""}, "snippet": "\t\tself._offset = pat.group(5)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99129:Assign_L56_C2", "label": "self._voiceId = group()", "type": "assigned_variable", "loc": [56, 56], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L23_C1", "vector": [14, 2, 0.0833, 0.0015, 2, 0.05, 0.8889, 728, 3, 1, 0, 0, 43, 10, 1], "semantic": {"name": "self._voiceId", "arg_names": [], "import_names": [], "rhs_call_name": "group", "annotation": ""}, "snippet": "\t\tself._voiceId = pat.group(6)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99129:Assign_L57_C2", "label": "self._nextLevelNum = group()", "type": "assigned_variable", "loc": [57, 57], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L23_C1", "vector": [14, 2, 0.0848, 0.0015, 2, 0.05, 0.9444, 316, 3, 1, 0, 0, 43, 10, 1], "semantic": {"name": "self._nextLevelNum", "arg_names": [], "import_names": [], "rhs_call_name": "group", "annotation": ""}, "snippet": "\t\tself._nextLevelNum = pat.group(7)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99129:Assign_L58_C2", "label": "self._attrs =", "type": "assigned_variable", "loc": [58, 66], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L23_C1", "vector": [14, 2, 0.0923, 0.0134, 2, 0.05, 1.0, 182, 0, 0, 0, 0, 0, 6, 0], "semantic": {"name": "self._attrs", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tself._attrs = { \n\t\t\t\t1: self._name, 'name': self._name,\n\t\t\t\t2: self._pinyin, 'pinyin':self._pinyin,\n\t\t\t\t3: self._nextLevelId, 'nextLevelId': self._nextLevelId,\n\t\t\t\t4: self._nextLevelInfo, 'nextLevelInfo': self._nextLevelInfo,\n\t\t\t\t5: self._offset, 'offset': self._offset,\n\t\t\t\t6: self._voiceId, 'voiceId': self._voiceId,\n\t\t\t\t7: self._nextLevelNum, 'nextLevelNum': self._nextLevelNum"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L68_C1", "label": "get_str", "type": "function", "loc": [68, 69], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99129:ClassDef_L19_C0", "vector": [2, 1, 0.1019, 0.003, 1, 0.91, 0.2667, 383, 0, 1, 1, 0, 0, 0, 0], "semantic": {"name": "get_str", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tdef get_str(self):\n\t\treturn self._linestr"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99129:Return_L69_C2", "label": "return", "type": "return", "loc": [69, 69], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L68_C1", "vector": [13, 2, 0.1027, 0.0015, 2, 0.8, 0.0, 0, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\treturn self._linestr"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L71_C1", "label": "check", "type": "function", "loc": [71, 80], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99129:ClassDef_L19_C0", "vector": [2, 1, 0.1124, 0.0149, 1, 0.91, 0.3333, 803, 0, 1, 1, 0, 0, 0, 5], "semantic": {"name": "check", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tdef check(self):\n\t\t\" Check the item itself only. \\n\"\n\t\tchecker = DicItemChecker(self)\n\t\tr = checker.check()\n\t\tif r:\n\t\t\t#log.debug(r'<No Error> : %s', self.get_str())\n\t\t\tpass\n\t\telse:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99129:Expr_L72_C2", "label": "expression", "type": "expression", "loc": [72, 72], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L71_C1", "vector": [8, 2, 0.1071, 0.0015, 2, 0.07, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\" Check the item itself only. \\n\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99129:Assign_L73_C2", "label": "checker = DicItemChecker()", "type": "assigned_variable", "loc": [73, 73], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L71_C1", "vector": [14, 2, 0.1086, 0.0015, 2, 0.07, 0.25, 279, 3, 1, 0, 0, 338, 10, 1], "semantic": {"name": "checker", "arg_names": [], "import_names": [], "rhs_call_name": "DicItemChecker", "annotation": ""}, "snippet": "\t\tchecker = DicItemChecker(self)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99129:Assign_L74_C2", "label": "r = check()", "type": "assigned_variable", "loc": [74, 74], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L71_C1", "vector": [14, 2, 0.1101, 0.0015, 2, 0.07, 0.5, 436, 3, 0, 0, 0, 803, 10, 1], "semantic": {"name": "r", "arg_names": [], "import_names": [], "rhs_call_name": "check", "annotation": ""}, "snippet": "\t\tr = checker.check()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L75_C2", "label": "if", "type": "if", "loc": [75, 79], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L71_C1", "vector": [4, 2, 0.1146, 0.0074, 2, 0.07, 0.75, 0, 2, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tif r:\n\t\t\t#log.debug(r'<No Error> : %s', self.get_str())\n\t\t\tpass\n\t\telse:\n\t\t\tlog.warning(r'<Error> : %s : %s', self.get_father()['nextLevelId'], self.get_str())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99129:Expr_L79_C3", "label": "warning()", "type": "expression", "loc": [79, 79], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L75_C2", "vector": [8, 3, 0.1176, 0.0015, 3, 0.99, 0.0, 320, 3, 3, 0, 0, 0, 0, 3], "semantic": {"name": "warning", "arg_names": [], "import_names": [], "rhs_call_name": "warning", "annotation": ""}, "snippet": "\t\t\tlog.warning(r'<Error> : %s : %s', self.get_father()['nextLevelId'], self.get_str())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99129:Return_L80_C2", "label": "return", "type": "return", "loc": [80, 80], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L71_C1", "vector": [13, 2, 0.119, 0.0015, 2, 0.07, 1.0, 0, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\treturn (r, checker)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L82_C1", "label": "check_recursively", "type": "function", "loc": [82, 95], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99129:ClassDef_L19_C0", "vector": [2, 1, 0.1317, 0.0208, 1, 0.91, 0.4, 612, 0, 1, 1, 0, 0, 0, 4], "semantic": {"name": "check_recursively", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tdef check_recursively(self):\n\t\t\" Check recursively.\\n\"\n\t\tif self._checked:\n\t\t\treturn True\n\t\tself._checked = True\n\t\t(result, checker) = self.check()\n\t\t# has checked another name of this item, do not to check children\n\t\tif checker.checked_another_name():"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99129:Expr_L83_C2", "label": "expression", "type": "expression", "loc": [83, 83], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L82_C1", "vector": [8, 2, 0.1235, 0.0015, 2, 0.63, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\" Check recursively.\\n\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L84_C2", "label": "if", "type": "if", "loc": [84, 85], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L82_C1", "vector": [4, 2, 0.1257, 0.003, 2, 0.63, 0.1667, 0, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tif self._checked:\n\t\t\treturn True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99129:Return_L85_C3", "label": "return", "type": "return", "loc": [85, 85], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L84_C2", "vector": [13, 3, 0.1265, 0.0015, 3, 0.56, 0.0, 0, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\treturn True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99129:Assign_L86_C2", "label": "self._checked =", "type": "assigned_variable", "loc": [86, 86], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L82_C1", "vector": [14, 2, 0.128, 0.0015, 2, 0.63, 0.3333, 131, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "self._checked", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tself._checked = True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99129:Assign_L87_C2", "label": "result, checker = check()", "type": "assigned_variable", "loc": [87, 87], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L82_C1", "vector": [14, 2, 0.1295, 0.0015, 2, 0.63, 0.5, 590, 3, 0, 0, 0, 803, 10, 1], "semantic": {"name": "result, checker", "arg_names": [], "import_names": [], "rhs_call_name": "check", "annotation": ""}, "snippet": "\t\t(result, checker) = self.check()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L89_C2", "label": "if", "type": "if", "loc": [89, 90], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L82_C1", "vector": [4, 2, 0.1332, 0.003, 2, 0.63, 0.6667, 0, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tif checker.checked_another_name():\n\t\t\treturn result"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99129:Return_L90_C3", "label": "return", "type": "return", "loc": [90, 90], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L89_C2", "vector": [13, 3, 0.1339, 0.0015, 3, 0.32, 0.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\treturn result"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99129:For_L92_C2", "label": "for child", "type": "for", "loc": [92, 94], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L82_C1", "vector": [6, 2, 0.1384, 0.0045, 2, 0.63, 0.8333, 967, 3, 0, 0, 0, 0, 0, 2], "semantic": {"name": "child", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tfor child in self.get_children():\n\t\t\tif not child.check_recursively():\n\t\t\t\tresult = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L93_C3", "label": "if", "type": "if", "loc": [93, 94], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99129:For_L92_C2", "vector": [4, 3, 0.1391, 0.003, 3, 0.45, 0.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\tif not child.check_recursively():\n\t\t\t\tresult = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99129:Assign_L94_C4", "label": "result =", "type": "assigned_variable", "loc": [94, 94], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L93_C3", "vector": [14, 4, 0.1399, 0.0015, 4, 0.46, 0.0, 51, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "result", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\t\tresult = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99129:Return_L95_C2", "label": "return", "type": "return", "loc": [95, 95], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L82_C1", "vector": [13, 2, 0.1414, 0.0015, 2, 0.63, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\treturn result"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L97_C1", "label": "has_child", "type": "function", "loc": [97, 113], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99129:ClassDef_L19_C0", "vector": [2, 1, 0.1562, 0.0253, 1, 0.91, 0.4667, 817, 0, 1, 1, 0, 0, 0, 4], "semantic": {"name": "has_child", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tdef has_child(self):\n\t\tif self['nextLevelId'] != '0xFFFFFFFF' \\\n\t\t\t\tor self['nextLevelInfo'] != '0x00000001' \\\n\t\t\t\tor self['nextLevelNum'] != '0x0000':\n\t\t\t# check all the info should all say ' has next level'\n\t\t\tif not (self['nextLevelId'] != '0xFFFFFFFF' \\\n\t\t\t\t\tand self['nextLevelInfo'] != '0x00000001' \\\n\t\t\t\t\tand self['nextLevelNum'] != '0x0000'):"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L98_C2", "label": "if", "type": "if", "loc": [98, 113], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L97_C1", "vector": [4, 2, 0.157, 0.0238, 2, 0.53, 0.0, 0, 0, 0, 0, 0, 0, 0, 4], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tif self['nextLevelId'] != '0xFFFFFFFF' \\\n\t\t\t\tor self['nextLevelInfo'] != '0x00000001' \\\n\t\t\t\tor self['nextLevelNum'] != '0x0000':\n\t\t\t# check all the info should all say ' has next level'\n\t\t\tif not (self['nextLevelId'] != '0xFFFFFFFF' \\\n\t\t\t\t\tand self['nextLevelInfo'] != '0x00000001' \\\n\t\t\t\t\tand self['nextLevelNum'] != '0x0000'):\n\t\t\t\tlog.warning('<Has Next Level Not Agreed Error> : %s : %s', self.get_father()['nextLevelId'], self._linestr)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L102_C3", "label": "if", "type": "if", "loc": [102, 105], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L98_C2", "vector": [4, 3, 0.154, 0.006, 3, 0.41, 0.0, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\tif not (self['nextLevelId'] != '0xFFFFFFFF' \\\n\t\t\t\t\tand self['nextLevelInfo'] != '0x00000001' \\\n\t\t\t\t\tand self['nextLevelNum'] != '0x0000'):\n\t\t\t\tlog.warning('<Has Next Level Not Agreed Error> : %s : %s', self.get_father()['nextLevelId'], self._linestr)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99129:Expr_L105_C4", "label": "warning()", "type": "expression", "loc": [105, 105], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L102_C3", "vector": [8, 4, 0.1562, 0.0015, 4, 0.57, 0.0, 320, 3, 3, 0, 0, 0, 0, 2], "semantic": {"name": "warning", "arg_names": [], "import_names": [], "rhs_call_name": "warning", "annotation": ""}, "snippet": "\t\t\t\tlog.warning('<Has Next Level Not Agreed Error> : %s : %s', self.get_father()['nextLevelId'], self._linestr)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99129:Return_L106_C3", "label": "return", "type": "return", "loc": [106, 106], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L98_C2", "vector": [13, 3, 0.1577, 0.0015, 3, 0.41, 0.3333, 0, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\treturn True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L109_C3", "label": "if", "type": "if", "loc": [109, 112], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L98_C2", "vector": [4, 3, 0.1644, 0.006, 3, 0.41, 0.6667, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\tif not (self['nextLevelId'] == '0xFFFFFFFF' \\\n\t\t\t\t\tand self['nextLevelInfo'] == '0x00000001' \\\n\t\t\t\t\tand self['nextLevelNum'] == '0x0000'):\n\t\t\t\tlog.warning('<Has Next Level Not Agreed Error> : %s : %s', self.get_father()['nextLevelId'], self._linestr)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99129:Expr_L112_C4", "label": "warning()", "type": "expression", "loc": [112, 112], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L109_C3", "vector": [8, 4, 0.1667, 0.0015, 4, 0.97, 0.0, 320, 3, 3, 0, 0, 0, 0, 2], "semantic": {"name": "warning", "arg_names": [], "import_names": [], "rhs_call_name": "warning", "annotation": ""}, "snippet": "\t\t\t\tlog.warning('<Has Next Level Not Agreed Error> : %s : %s', self.get_father()['nextLevelId'], self._linestr)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99129:Return_L113_C3", "label": "return", "type": "return", "loc": [113, 113], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L98_C2", "vector": [13, 3, 0.1682, 0.0015, 3, 0.41, 1.0, 0, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\treturn False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L115_C1", "label": "get_father", "type": "function", "loc": [115, 116], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99129:ClassDef_L19_C0", "vector": [2, 1, 0.1719, 0.003, 1, 0.91, 0.5333, 851, 0, 1, 1, 0, 0, 0, 0], "semantic": {"name": "get_father", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tdef get_father(self):\n\t\treturn self._father"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99129:Return_L116_C2", "label": "return", "type": "return", "loc": [116, 116], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L115_C1", "vector": [13, 2, 0.1726, 0.0015, 2, 0.8, 0.0, 0, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\treturn self._father"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L118_C1", "label": "get_children", "type": "function", "loc": [118, 150], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99129:ClassDef_L19_C0", "vector": [2, 1, 0.1994, 0.0491, 1, 0.91, 0.6, 305, 0, 1, 1, 0, 0, 0, 19], "semantic": {"name": "get_children", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tdef get_children(self):\n\t\tif self._children != None:\n\t\t\treturn self._children\n\t\telif not self.has_child():\n\t\t\treturn tuple()\n\t\tchildren_set = []\n\t\tfilename = self['nextLevelId'][2:]+'.txt'\n\t\tfilepath = os.path.join(self._folder, filename)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L119_C2", "label": "if", "type": "if", "loc": [119, 122], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L118_C1", "vector": [4, 2, 0.1793, 0.006, 2, 0.39, 0.0, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tif self._children != None:\n\t\t\treturn self._children\n\t\telif not self.has_child():\n\t\t\treturn tuple()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99129:Return_L120_C3", "label": "return", "type": "return", "loc": [120, 120], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L119_C2", "vector": [13, 3, 0.1786, 0.0015, 3, 0.2, 0.0, 0, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\treturn self._children"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L121_C2", "label": "if", "type": "if", "loc": [121, 122], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L119_C2", "vector": [4, 3, 0.1808, 0.003, 3, 0.2, 1.0, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\telif not self.has_child():\n\t\t\treturn tuple()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99129:Return_L122_C3", "label": "return", "type": "return", "loc": [122, 122], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L121_C2", "vector": [13, 4, 0.1815, 0.0015, 4, 0.34, 0.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\treturn tuple()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99129:Assign_L123_C2", "label": "children_set =", "type": "assigned_variable", "loc": [123, 123], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L118_C1", "vector": [14, 2, 0.183, 0.0015, 2, 0.39, 0.1429, 568, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "children_set", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tchildren_set = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99129:Assign_L124_C2", "label": "filename =", "type": "assigned_variable", "loc": [124, 124], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L118_C1", "vector": [14, 2, 0.1845, 0.0015, 2, 0.39, 0.2857, 275, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "filename", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tfilename = self['nextLevelId'][2:]+'.txt'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99129:Assign_L125_C2", "label": "filepath = join()", "type": "assigned_variable", "loc": [125, 125], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L118_C1", "vector": [14, 2, 0.186, 0.0015, 2, 0.39, 0.4286, 137, 3, 2, 0, 0, 933, 10, 1], "semantic": {"name": "filepath", "arg_names": [], "import_names": [], "rhs_call_name": "join", "annotation": ""}, "snippet": "\t\tfilepath = os.path.join(self._folder, filename)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99129:Try_L127_C2", "label": "try", "type": "try", "loc": [127, 137], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L118_C1", "vector": [7, 2, 0.1964, 0.0164, 2, 0.39, 0.5714, 0, 0, 2, 0, 0, 0, 0, 10], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\ttry:\n\t\t\tfp = codecs.open(filepath,encoding='gbk')\n\t\t\tlines = fp.readlines()\n\t\t\tfp.close()\n\t\texcept IOError:\n\t\t\tlog.warning(r'<File Open&Read Error> : %s : %s ', self.get_father()['nextLevelId'], self._linestr)\n\t\t\treturn tuple()\n\t\texcept UnicodeDecodeError:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99129:Assign_L128_C3", "label": "fp = open()", "type": "assigned_variable", "loc": [128, 128], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99129:Try_L127_C2", "vector": [14, 3, 0.1905, 0.0015, 3, 0.28, 0.0, 392, 3, 2, 0, 0, 693, 10, 1], "semantic": {"name": "fp", "arg_names": [], "import_names": [], "rhs_call_name": "open", "annotation": ""}, "snippet": "\t\t\tfp = codecs.open(filepath,encoding='gbk')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99129:Assign_L129_C3", "label": "lines = readlines()", "type": "assigned_variable", "loc": [129, 129], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99129:Try_L127_C2", "vector": [14, 3, 0.192, 0.0015, 3, 0.28, 0.5, 73, 3, 0, 0, 0, 841, 10, 1], "semantic": {"name": "lines", "arg_names": [], "import_names": [], "rhs_call_name": "readlines", "annotation": ""}, "snippet": "\t\t\tlines = fp.readlines()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99129:Expr_L130_C3", "label": "close()", "type": "expression", "loc": [130, 130], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99129:Try_L127_C2", "vector": [8, 3, 0.1935, 0.0015, 3, 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": "\t\t\tfp.close()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99129:Expr_L132_C3", "label": "warning()", "type": "expression", "loc": [132, 132], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99129:Try_L127_C2", "vector": [8, 3, 0.1964, 0.0015, 3, 0.28, 0.0, 320, 3, 3, 0, 0, 0, 0, 2], "semantic": {"name": "warning", "arg_names": [], "import_names": [], "rhs_call_name": "warning", "annotation": ""}, "snippet": "\t\t\tlog.warning(r'<File Open&Read Error> : %s : %s ', self.get_father()['nextLevelId'], self._linestr)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99129:Return_L133_C3", "label": "return", "type": "return", "loc": [133, 133], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99129:Try_L127_C2", "vector": [13, 3, 0.1979, 0.0015, 3, 0.28, 1.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\treturn tuple()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99129:Expr_L135_C3", "label": "warning()", "type": "expression", "loc": [135, 135], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99129:Try_L127_C2", "vector": [8, 3, 0.2009, 0.0015, 3, 0.28, 0.0, 320, 3, 4, 0, 0, 0, 0, 2], "semantic": {"name": "warning", "arg_names": [], "import_names": [], "rhs_call_name": "warning", "annotation": ""}, "snippet": "\t\t\tlog.warning(r'<File Encoding Error> : %s : %s : %s', self.get_father()['nextLevelId'], self._linestr, filename)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99129:Expr_L136_C3", "label": "close()", "type": "expression", "loc": [136, 136], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99129:Try_L127_C2", "vector": [8, 3, 0.2024, 0.0015, 3, 0.28, 0.5, 77, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "close", "arg_names": [], "import_names": [], "rhs_call_name": "close", "annotation": ""}, "snippet": "\t\t\tfp.close()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99129:Return_L137_C3", "label": "return", "type": "return", "loc": [137, 137], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99129:Try_L127_C2", "vector": [13, 3, 0.2039, 0.0015, 3, 0.28, 1.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\treturn tuple()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99129:For_L139_C2", "label": "for s", "type": "for", "loc": [139, 148], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L118_C1", "vector": [6, 2, 0.2135, 0.0149, 2, 0.39, 0.7143, 553, 2, 0, 0, 0, 0, 0, 5], "semantic": {"name": "s", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tfor s in lines:\n\t\t\tif re.match(r'^\\s*$',s):\n\t\t\t\tlog.warning(r'<File Format Error> : Filename: %s', filename)\n\t\t\t\tcontinue\n\t\t\ttry:\n\t\t\t\tdicItem = DicItem(s, self)\n\t\t\texcept DicItemParamError:\n\t\t\t\tlog.warning(r'<Get Child Error> : %s\tFileName : %s', self._linestr, filename)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L140_C3", "label": "if", "type": "if", "loc": [140, 142], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99129:For_L139_C2", "vector": [4, 3, 0.2098, 0.0045, 3, 0.31, 0.0, 0, 3, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\tif re.match(r'^\\s*$',s):\n\t\t\t\tlog.warning(r'<File Format Error> : Filename: %s', filename)\n\t\t\t\tcontinue"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99129:Expr_L141_C4", "label": "warning()", "type": "expression", "loc": [141, 141], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L140_C3", "vector": [8, 4, 0.2098, 0.0015, 4, 0.78, 0.0, 320, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "warning", "arg_names": [], "import_names": [], "rhs_call_name": "warning", "annotation": ""}, "snippet": "\t\t\t\tlog.warning(r'<File Format Error> : Filename: %s', filename)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99129:Try_L143_C3", "label": "try", "type": "try", "loc": [143, 147], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99129:For_L139_C2", "vector": [7, 3, 0.2158, 0.0074, 3, 0.31, 0.5, 0, 0, 1, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\ttry:\n\t\t\t\tdicItem = DicItem(s, self)\n\t\t\texcept DicItemParamError:\n\t\t\t\tlog.warning(r'<Get Child Error> : %s\tFileName : %s', self._linestr, filename)\n\t\t\t\tcontinue"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99129:Assign_L144_C4", "label": "dicItem = DicItem()", "type": "assigned_variable", "loc": [144, 144], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99129:Try_L143_C3", "vector": [14, 4, 0.2143, 0.0015, 4, 0.28, 0.0, 557, 3, 2, 0, 0, 354, 10, 1], "semantic": {"name": "dicItem", "arg_names": [], "import_names": [], "rhs_call_name": "DicItem", "annotation": ""}, "snippet": "\t\t\t\tdicItem = DicItem(s, self)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99129:Expr_L146_C4", "label": "warning()", "type": "expression", "loc": [146, 146], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99129:Try_L143_C3", "vector": [8, 4, 0.2173, 0.0015, 4, 0.28, 0.0, 320, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "warning", "arg_names": [], "import_names": [], "rhs_call_name": "warning", "annotation": ""}, "snippet": "\t\t\t\tlog.warning(r'<Get Child Error> : %s\tFileName : %s', self._linestr, filename)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99129:Expr_L148_C3", "label": "append()", "type": "expression", "loc": [148, 148], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99129:For_L139_C2", "vector": [8, 3, 0.2202, 0.0015, 3, 0.31, 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\tchildren_set.append(dicItem)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99129:Assign_L149_C2", "label": "self._children = tuple()", "type": "assigned_variable", "loc": [149, 149], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L118_C1", "vector": [14, 2, 0.2217, 0.0015, 2, 0.39, 0.8571, 365, 3, 1, 0, 0, 259, 10, 1], "semantic": {"name": "self._children", "arg_names": [], "import_names": [], "rhs_call_name": "tuple", "annotation": ""}, "snippet": "\t\tself._children = tuple(children_set)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99129:Return_L150_C2", "label": "return", "type": "return", "loc": [150, 150], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L118_C1", "vector": [13, 2, 0.2232, 0.0015, 2, 0.39, 1.0, 0, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\treturn self._children"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L152_C1", "label": "__getitem__", "type": "function", "loc": [152, 154], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99129:ClassDef_L19_C0", "vector": [2, 1, 0.2277, 0.0045, 1, 0.91, 0.6667, 698, 0, 2, 1, 0, 0, 0, 0], "semantic": {"name": "__getitem__", "arg_names": ["self", "attr"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tdef __getitem__(self, attr):\n\t\t' Return a string.\\n'\n\t\treturn self._attrs[attr]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99129:Expr_L153_C2", "label": "expression", "type": "expression", "loc": [153, 153], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L152_C1", "vector": [8, 2, 0.2277, 0.0015, 2, 0.68, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t' Return a string.\\n'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99129:Return_L154_C2", "label": "return", "type": "return", "loc": [154, 154], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L152_C1", "vector": [13, 2, 0.2292, 0.0015, 2, 0.68, 1.0, 0, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\treturn self._attrs[attr]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L156_C1", "label": "is_root", "type": "function", "loc": [156, 157], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99129:ClassDef_L19_C0", "vector": [2, 1, 0.2329, 0.003, 1, 0.91, 0.7333, 748, 0, 1, 1, 0, 0, 0, 0], "semantic": {"name": "is_root", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tdef is_root(self):\n\t\treturn False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99129:Return_L157_C2", "label": "return", "type": "return", "loc": [157, 157], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L156_C1", "vector": [13, 2, 0.2336, 0.0015, 2, 0.58, 0.0, 0, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\treturn False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L159_C1", "label": "_fetch_kiwi_record", "type": "function", "loc": [159, 184], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99129:ClassDef_L19_C0", "vector": [2, 1, 0.2552, 0.0387, 1, 0.91, 0.8, 883, 0, 1, 1, 0, 0, 0, 13], "semantic": {"name": "_fetch_kiwi_record", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tdef _fetch_kiwi_record(self):\n\t\t# root, process in DicRootItem\n\t\t#if self.is_root():\n\t\t#\treturn None\n\t\tf = self.get_father()\n\t\t# root -> province\n\t\tif f.is_root():\n\t\t\tkiwiRecords = self._kiwiDataManager.fetch_record(self['name'])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99129:Assign_L163_C2", "label": "f = get_father()", "type": "assigned_variable", "loc": [163, 163], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L159_C1", "vector": [14, 2, 0.2426, 0.0015, 2, 0.99, 0.0, 899, 3, 0, 0, 0, 851, 10, 1], "semantic": {"name": "f", "arg_names": [], "import_names": [], "rhs_call_name": "get_father", "annotation": ""}, "snippet": "\t\tf = self.get_father()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L165_C2", "label": "if", "type": "if", "loc": [165, 167], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L159_C1", "vector": [4, 2, 0.247, 0.0045, 2, 0.99, 0.1429, 0, 3, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tif f.is_root():\n\t\t\tkiwiRecords = self._kiwiDataManager.fetch_record(self['name'])\n\t\t\treturn kiwiRecords"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99129:Assign_L166_C3", "label": "kiwiRecords = fetch_record()", "type": "assigned_variable", "loc": [166, 166], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L165_C2", "vector": [14, 3, 0.247, 0.0015, 3, 0.92, 0.0, 401, 3, 1, 0, 0, 660, 10, 1], "semantic": {"name": "kiwiRecords", "arg_names": [], "import_names": [], "rhs_call_name": "fetch_record", "annotation": ""}, "snippet": "\t\t\tkiwiRecords = self._kiwiDataManager.fetch_record(self['name'])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99129:Return_L167_C3", "label": "return", "type": "return", "loc": [167, 167], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L165_C2", "vector": [13, 3, 0.2485, 0.0015, 3, 0.92, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\treturn kiwiRecords"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99129:Assign_L168_C2", "label": "ff = get_father()", "type": "assigned_variable", "loc": [168, 168], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L159_C1", "vector": [14, 2, 0.25, 0.0015, 2, 0.99, 0.2857, 411, 3, 0, 0, 0, 851, 10, 1], "semantic": {"name": "ff", "arg_names": [], "import_names": [], "rhs_call_name": "get_father", "annotation": ""}, "snippet": "\t\tff = f.get_father()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L170_C2", "label": "if", "type": "if", "loc": [170, 172], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L159_C1", "vector": [4, 2, 0.2545, 0.0045, 2, 0.99, 0.4286, 0, 3, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tif ff.is_root():\n\t\t\tkiwiRecords = self._kiwiDataManager.fetch_record(f['name'], self['name'])\n\t\t\treturn kiwiRecords"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99129:Assign_L171_C3", "label": "kiwiRecords = fetch_record()", "type": "assigned_variable", "loc": [171, 171], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L170_C2", "vector": [14, 3, 0.2545, 0.0015, 3, 0.61, 0.0, 401, 3, 2, 0, 0, 660, 10, 1], "semantic": {"name": "kiwiRecords", "arg_names": [], "import_names": [], "rhs_call_name": "fetch_record", "annotation": ""}, "snippet": "\t\t\tkiwiRecords = self._kiwiDataManager.fetch_record(f['name'], self['name'])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99129:Return_L172_C3", "label": "return", "type": "return", "loc": [172, 172], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L170_C2", "vector": [13, 3, 0.256, 0.0015, 3, 0.61, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\treturn kiwiRecords"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99129:Assign_L173_C2", "label": "fff = get_father()", "type": "assigned_variable", "loc": [173, 173], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L159_C1", "vector": [14, 2, 0.2574, 0.0015, 2, 0.99, 0.5714, 347, 3, 0, 0, 0, 851, 10, 1], "semantic": {"name": "fff", "arg_names": [], "import_names": [], "rhs_call_name": "get_father", "annotation": ""}, "snippet": "\t\tfff = ff.get_father()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L175_C2", "label": "if", "type": "if", "loc": [175, 177], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L159_C1", "vector": [4, 2, 0.2619, 0.0045, 2, 0.99, 0.7143, 0, 3, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tif fff.is_root():\n\t\t\tkiwiRecords = self._kiwiDataManager.fetch_record(ff['name'], f['name'], self['name'])\n\t\t\treturn kiwiRecords"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99129:Assign_L176_C3", "label": "kiwiRecords = fetch_record()", "type": "assigned_variable", "loc": [176, 176], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L175_C2", "vector": [14, 3, 0.2619, 0.0015, 3, 0.2, 0.0, 401, 3, 3, 0, 0, 660, 10, 1], "semantic": {"name": "kiwiRecords", "arg_names": [], "import_names": [], "rhs_call_name": "fetch_record", "annotation": ""}, "snippet": "\t\t\tkiwiRecords = self._kiwiDataManager.fetch_record(ff['name'], f['name'], self['name'])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99129:Return_L177_C3", "label": "return", "type": "return", "loc": [177, 177], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L175_C2", "vector": [13, 3, 0.2634, 0.0015, 3, 0.2, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\treturn kiwiRecords"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99129:Assign_L178_C2", "label": "ffff = get_father()", "type": "assigned_variable", "loc": [178, 178], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L159_C1", "vector": [14, 2, 0.2649, 0.0015, 2, 0.99, 0.8571, 937, 3, 0, 0, 0, 851, 10, 1], "semantic": {"name": "ffff", "arg_names": [], "import_names": [], "rhs_call_name": "get_father", "annotation": ""}, "snippet": "\t\tffff = fff.get_father()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L180_C2", "label": "if", "type": "if", "loc": [180, 182], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L159_C1", "vector": [4, 2, 0.2693, 0.0045, 2, 0.99, 1.0, 0, 3, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tif ffff.is_root():\n\t\t\tkiwiRecords = self._kiwiDataManager.fetch_record(fff['name'], ff['name'], f['name'], self['name'])\n\t\t\treturn kiwiRecords"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99129:Assign_L181_C3", "label": "kiwiRecords = fetch_record()", "type": "assigned_variable", "loc": [181, 181], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L180_C2", "vector": [14, 3, 0.2693, 0.0015, 3, 0.05, 0.0, 401, 3, 4, 0, 0, 660, 10, 1], "semantic": {"name": "kiwiRecords", "arg_names": [], "import_names": [], "rhs_call_name": "fetch_record", "annotation": ""}, "snippet": "\t\t\tkiwiRecords = self._kiwiDataManager.fetch_record(fff['name'], ff['name'], f['name'], self['name'])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99129:Return_L182_C3", "label": "return", "type": "return", "loc": [182, 182], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L180_C2", "vector": [13, 3, 0.2708, 0.0015, 3, 0.05, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\treturn kiwiRecords"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L186_C1", "label": "fetch_kiwi_record", "type": "function", "loc": [186, 199], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99129:ClassDef_L19_C0", "vector": [2, 1, 0.2865, 0.0208, 1, 0.91, 0.8667, 289, 0, 1, 1, 0, 0, 0, 8], "semantic": {"name": "fetch_kiwi_record", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tdef fetch_kiwi_record(self):\n\t\tif self._kiwiRecord != None:\n\t\t\treturn self._kiwiRecord\n\t\trds = self._fetch_kiwi_record()\n\t\tif len(rds) == 1:\n\t\t\treturn rds[0]\n\t\tfor r in rds:\n\t\t\tif r['offset'] == int(self['offset'], 16):"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L187_C2", "label": "if", "type": "if", "loc": [187, 188], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L186_C1", "vector": [4, 2, 0.279, 0.003, 2, 0.89, 0.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tif self._kiwiRecord != None:\n\t\t\treturn self._kiwiRecord"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99129:Return_L188_C3", "label": "return", "type": "return", "loc": [188, 188], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L187_C2", "vector": [13, 3, 0.2798, 0.0015, 3, 0.81, 0.0, 0, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\treturn self._kiwiRecord"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99129:Assign_L189_C2", "label": "rds = _fetch_kiwi_record()", "type": "assigned_variable", "loc": [189, 189], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L186_C1", "vector": [14, 2, 0.2812, 0.0015, 2, 0.89, 0.25, 985, 3, 0, 0, 0, 883, 10, 1], "semantic": {"name": "rds", "arg_names": [], "import_names": [], "rhs_call_name": "_fetch_kiwi_record", "annotation": ""}, "snippet": "\t\trds = self._fetch_kiwi_record()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L190_C2", "label": "if", "type": "if", "loc": [190, 191], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L186_C1", "vector": [4, 2, 0.2835, 0.003, 2, 0.89, 0.5, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tif len(rds) == 1:\n\t\t\treturn rds[0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99129:Return_L191_C3", "label": "return", "type": "return", "loc": [191, 191], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L190_C2", "vector": [13, 3, 0.2842, 0.0015, 3, 0.05, 0.0, 0, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\treturn rds[0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99129:For_L192_C2", "label": "for r", "type": "for", "loc": [192, 197], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L186_C1", "vector": [6, 2, 0.2894, 0.0089, 2, 0.89, 0.75, 436, 2, 0, 0, 0, 0, 0, 3], "semantic": {"name": "r", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tfor r in rds:\n\t\t\tif r['offset'] == int(self['offset'], 16):\n\t\t\t\tif r['name'] != self['name']:\n\t\t\t\t\tlog.error(r'<Fetch Kiwi Record Error> : Same name record error : %s', self.get_str())\n\t\t\t\tself._kiwiRecord = r\n\t\t\t\treturn r"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L193_C3", "label": "if", "type": "if", "loc": [193, 197], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99129:For_L192_C2", "vector": [4, 3, 0.2902, 0.0074, 3, 0.99, 0.0, 0, 0, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\tif r['offset'] == int(self['offset'], 16):\n\t\t\t\tif r['name'] != self['name']:\n\t\t\t\t\tlog.error(r'<Fetch Kiwi Record Error> : Same name record error : %s', self.get_str())\n\t\t\t\tself._kiwiRecord = r\n\t\t\t\treturn r"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L194_C4", "label": "if", "type": "if", "loc": [194, 195], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L193_C3", "vector": [4, 4, 0.2894, 0.003, 4, 0.6, 0.0, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\t\tif r['name'] != self['name']:\n\t\t\t\t\tlog.error(r'<Fetch Kiwi Record Error> : Same name record error : %s', self.get_str())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99129:Expr_L195_C5", "label": "error()", "type": "expression", "loc": [195, 195], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L194_C4", "vector": [8, 5, 0.2902, 0.0015, 5, 0.0, 0.0, 771, 3, 2, 0, 0, 0, 0, 2], "semantic": {"name": "error", "arg_names": [], "import_names": [], "rhs_call_name": "error", "annotation": ""}, "snippet": "\t\t\t\t\tlog.error(r'<Fetch Kiwi Record Error> : Same name record error : %s', self.get_str())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99129:Assign_L196_C4", "label": "self._kiwiRecord =", "type": "assigned_variable", "loc": [196, 196], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L193_C3", "vector": [14, 4, 0.2917, 0.0015, 4, 0.6, 0.5, 493, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self._kiwiRecord", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\t\tself._kiwiRecord = r"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99129:Return_L197_C4", "label": "return", "type": "return", "loc": [197, 197], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L193_C3", "vector": [13, 4, 0.2932, 0.0015, 4, 0.6, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\t\treturn r"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99129:Expr_L198_C2", "label": "warning()", "type": "expression", "loc": [198, 198], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L186_C1", "vector": [8, 2, 0.2946, 0.0015, 2, 0.89, 1.0, 320, 3, 3, 0, 0, 0, 0, 2], "semantic": {"name": "warning", "arg_names": [], "import_names": [], "rhs_call_name": "warning", "annotation": ""}, "snippet": "\t\tlog.warning(r'<Fetch Kiwi Record Error> : %s : %s', self.get_father()['offset'], self['offset'])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L201_C1", "label": "fetch_kiwi_frame", "type": "function", "loc": [201, 224], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99129:ClassDef_L19_C0", "vector": [2, 1, 0.3162, 0.0357, 1, 0.91, 0.9333, 841, 0, 1, 1, 0, 0, 0, 11], "semantic": {"name": "fetch_kiwi_frame", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tdef fetch_kiwi_frame(self):\n\t\tif self._kiwiFrame != None:\n\t\t\treturn self._kiwiFrame\n\t\t# root, process in DicRootItem\n\t\t#if self.is_root():\n\t\t#\treturn None\n\t\tf = self.get_father()\n\t\t# root -> province"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L202_C2", "label": "if", "type": "if", "loc": [202, 203], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L201_C1", "vector": [4, 2, 0.3013, 0.003, 2, 0.05, 0.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tif self._kiwiFrame != None:\n\t\t\treturn self._kiwiFrame"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99129:Return_L203_C3", "label": "return", "type": "return", "loc": [203, 203], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L202_C2", "vector": [13, 3, 0.3021, 0.0015, 3, 0.53, 0.0, 0, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\treturn self._kiwiFrame"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99129:Assign_L207_C2", "label": "f = get_father()", "type": "assigned_variable", "loc": [207, 207], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L201_C1", "vector": [14, 2, 0.308, 0.0015, 2, 0.05, 0.1429, 899, 3, 0, 0, 0, 851, 10, 1], "semantic": {"name": "f", "arg_names": [], "import_names": [], "rhs_call_name": "get_father", "annotation": ""}, "snippet": "\t\tf = self.get_father()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L209_C2", "label": "if", "type": "if", "loc": [209, 211], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L201_C1", "vector": [4, 2, 0.3125, 0.0045, 2, 0.05, 0.2857, 0, 3, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tif f.is_root():\n\t\t\tself._kiwiFrame = self._kiwiDataManager.fetch_frame(self['name'])\n\t\t\treturn self._kiwiFrame"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99129:Assign_L210_C3", "label": "self._kiwiFrame = fetch_frame()", "type": "assigned_variable", "loc": [210, 210], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L209_C2", "vector": [14, 3, 0.3125, 0.0015, 3, 0.71, 0.0, 577, 3, 1, 0, 0, 254, 10, 1], "semantic": {"name": "self._kiwiFrame", "arg_names": [], "import_names": [], "rhs_call_name": "fetch_frame", "annotation": ""}, "snippet": "\t\t\tself._kiwiFrame = self._kiwiDataManager.fetch_frame(self['name'])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99129:Return_L211_C3", "label": "return", "type": "return", "loc": [211, 211], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L209_C2", "vector": [13, 3, 0.314, 0.0015, 3, 0.71, 1.0, 0, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\treturn self._kiwiFrame"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99129:Assign_L212_C2", "label": "ff = get_father()", "type": "assigned_variable", "loc": [212, 212], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L201_C1", "vector": [14, 2, 0.3155, 0.0015, 2, 0.05, 0.4286, 411, 3, 0, 0, 0, 851, 10, 1], "semantic": {"name": "ff", "arg_names": [], "import_names": [], "rhs_call_name": "get_father", "annotation": ""}, "snippet": "\t\tff = f.get_father()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L214_C2", "label": "if", "type": "if", "loc": [214, 216], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L201_C1", "vector": [4, 2, 0.3199, 0.0045, 2, 0.05, 0.5714, 0, 3, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tif ff.is_root():\n\t\t\tself._kiwiFrame = self._kiwiDataManager.fetch_frame(f['name'], self['name'])\n\t\t\treturn self._kiwiFrame"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99129:Assign_L215_C3", "label": "self._kiwiFrame = fetch_frame()", "type": "assigned_variable", "loc": [215, 215], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L214_C2", "vector": [14, 3, 0.3199, 0.0015, 3, 0.62, 0.0, 577, 3, 2, 0, 0, 254, 10, 1], "semantic": {"name": "self._kiwiFrame", "arg_names": [], "import_names": [], "rhs_call_name": "fetch_frame", "annotation": ""}, "snippet": "\t\t\tself._kiwiFrame = self._kiwiDataManager.fetch_frame(f['name'], self['name'])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99129:Return_L216_C3", "label": "return", "type": "return", "loc": [216, 216], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L214_C2", "vector": [13, 3, 0.3214, 0.0015, 3, 0.62, 1.0, 0, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\treturn self._kiwiFrame"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99129:Assign_L217_C2", "label": "fff = get_father()", "type": "assigned_variable", "loc": [217, 217], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L201_C1", "vector": [14, 2, 0.3229, 0.0015, 2, 0.05, 0.7143, 347, 3, 0, 0, 0, 851, 10, 1], "semantic": {"name": "fff", "arg_names": [], "import_names": [], "rhs_call_name": "get_father", "annotation": ""}, "snippet": "\t\tfff = ff.get_father()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L219_C2", "label": "if", "type": "if", "loc": [219, 221], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L201_C1", "vector": [4, 2, 0.3274, 0.0045, 2, 0.05, 0.8571, 0, 3, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tif fff.is_root():\n\t\t\tself._kiwiFrame = self._kiwiDataManager.fetch_frame(ff['name'], f['name'], self['name'])\n\t\t\treturn self._kiwiFrame"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99129:Assign_L220_C3", "label": "self._kiwiFrame = fetch_frame()", "type": "assigned_variable", "loc": [220, 220], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L219_C2", "vector": [14, 3, 0.3274, 0.0015, 3, 0.91, 0.0, 577, 3, 3, 0, 0, 254, 10, 1], "semantic": {"name": "self._kiwiFrame", "arg_names": [], "import_names": [], "rhs_call_name": "fetch_frame", "annotation": ""}, "snippet": "\t\t\tself._kiwiFrame = self._kiwiDataManager.fetch_frame(ff['name'], f['name'], self['name'])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99129:Return_L221_C3", "label": "return", "type": "return", "loc": [221, 221], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L219_C2", "vector": [13, 3, 0.3289, 0.0015, 3, 0.91, 1.0, 0, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\treturn self._kiwiFrame"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99129:Assign_L222_C2", "label": "ffff = get_father()", "type": "assigned_variable", "loc": [222, 222], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L201_C1", "vector": [14, 2, 0.3304, 0.0015, 2, 0.05, 1.0, 937, 3, 0, 0, 0, 851, 10, 1], "semantic": {"name": "ffff", "arg_names": [], "import_names": [], "rhs_call_name": "get_father", "annotation": ""}, "snippet": "\t\tffff = fff.get_father()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L226_C1", "label": "get_type", "type": "function", "loc": [226, 257], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99129:ClassDef_L19_C0", "vector": [2, 1, 0.3594, 0.0476, 1, 0.91, 1.0, 606, 0, 1, 1, 0, 0, 0, 12], "semantic": {"name": "get_type", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tdef get_type(self):\n\t\t\"Return 'Sheng', 'ZhiXiaShi', 'Di', 'Xian', 'QuanYu', 'Lu'\\n\"\n\t\tif self._type != None:\n\t\t\treturn self._type\n\t\tif not self.has_child():\n\t\t\tself._type = 'Lu'\n\t\t\treturn self._type\n\t\tif self.get_father().is_root():"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99129:Expr_L227_C2", "label": "expression", "type": "expression", "loc": [227, 227], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L226_C1", "vector": [8, 2, 0.3378, 0.0015, 2, 0.18, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\"Return 'Sheng', 'ZhiXiaShi', 'Di', 'Xian', 'QuanYu', 'Lu'\\n\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L228_C2", "label": "if", "type": "if", "loc": [228, 229], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L226_C1", "vector": [4, 2, 0.34, 0.003, 2, 0.18, 0.125, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tif self._type != None:\n\t\t\treturn self._type"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99129:Return_L229_C3", "label": "return", "type": "return", "loc": [229, 229], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L228_C2", "vector": [13, 3, 0.3408, 0.0015, 3, 0.24, 0.0, 0, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\treturn self._type"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L230_C2", "label": "if", "type": "if", "loc": [230, 232], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L226_C1", "vector": [4, 2, 0.3438, 0.0045, 2, 0.18, 0.25, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tif not self.has_child():\n\t\t\tself._type = 'Lu'\n\t\t\treturn self._type"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99129:Assign_L231_C3", "label": "self._type =", "type": "assigned_variable", "loc": [231, 231], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L230_C2", "vector": [14, 3, 0.3438, 0.0015, 3, 0.19, 0.0, 313, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "self._type", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\tself._type = 'Lu'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99129:Return_L232_C3", "label": "return", "type": "return", "loc": [232, 232], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L230_C2", "vector": [13, 3, 0.3452, 0.0015, 3, 0.19, 1.0, 0, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\treturn self._type"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L233_C2", "label": "if", "type": "if", "loc": [233, 239], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L226_C1", "vector": [4, 2, 0.3512, 0.0104, 2, 0.18, 0.375, 0, 3, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tif self.get_father().is_root():\n\t\t\tif self['name'] == u'\u4e0a\u6d77\u5e02' or self['name'] == u'\u5317\u4eac\u5e02' or \\\n\t\t\t\t\tself['name'] == u'\u5929\u6d25\u5e02' or self['name'] == u'\u91cd\u5e86\u5e02':\n\t\t\t\tself._type = 'ZhiXiaShi'\n\t\t\telse:\n\t\t\t\tself._type = 'Sheng'\n\t\t\treturn self._type"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L234_C3", "label": "if", "type": "if", "loc": [234, 238], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L233_C2", "vector": [4, 3, 0.3512, 0.0074, 3, 0.66, 0.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\tif self['name'] == u'\u4e0a\u6d77\u5e02' or self['name'] == u'\u5317\u4eac\u5e02' or \\\n\t\t\t\t\tself['name'] == u'\u5929\u6d25\u5e02' or self['name'] == u'\u91cd\u5e86\u5e02':\n\t\t\t\tself._type = 'ZhiXiaShi'\n\t\t\telse:\n\t\t\t\tself._type = 'Sheng'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99129:Assign_L236_C4", "label": "self._type =", "type": "assigned_variable", "loc": [236, 236], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L234_C3", "vector": [14, 4, 0.3512, 0.0015, 4, 0.5, 0.0, 313, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "self._type", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\t\tself._type = 'ZhiXiaShi'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99129:Assign_L238_C4", "label": "self._type =", "type": "assigned_variable", "loc": [238, 238], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L234_C3", "vector": [14, 4, 0.3542, 0.0015, 4, 0.5, 1.0, 313, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "self._type", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\t\tself._type = 'Sheng'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99129:Return_L239_C3", "label": "return", "type": "return", "loc": [239, 239], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L233_C2", "vector": [13, 3, 0.3557, 0.0015, 3, 0.66, 1.0, 0, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\treturn self._type"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L240_C2", "label": "if", "type": "if", "loc": [240, 242], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L226_C1", "vector": [4, 2, 0.3586, 0.0045, 2, 0.18, 0.5, 0, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tif self['name'].endswith(u'\u5168\u57df'):\n\t\t\tself._type = 'QuanYu'\n\t\t\treturn self._type"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99129:Assign_L241_C3", "label": "self._type =", "type": "assigned_variable", "loc": [241, 241], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L240_C2", "vector": [14, 3, 0.3586, 0.0015, 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": "\t\t\tself._type = 'QuanYu'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99129:Return_L242_C3", "label": "return", "type": "return", "loc": [242, 242], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L240_C2", "vector": [13, 3, 0.3601, 0.0015, 3, 0.73, 1.0, 0, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\treturn self._type"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99129:Assign_L243_C2", "label": "fType = get_type()", "type": "assigned_variable", "loc": [243, 243], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L226_C1", "vector": [14, 2, 0.3616, 0.0015, 2, 0.18, 0.625, 987, 3, 0, 0, 0, 606, 10, 2], "semantic": {"name": "fType", "arg_names": [], "import_names": [], "rhs_call_name": "get_type", "annotation": ""}, "snippet": "\t\tfType = self.get_father().get_type()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L244_C2", "label": "if", "type": "if", "loc": [244, 255], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L226_C1", "vector": [4, 2, 0.3713, 0.0179, 2, 0.18, 0.75, 0, 0, 0, 0, 0, 0, 0, 6], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tif fType == 'ZhiXiaShi':\n\t\t\tself._type = 'Qu'\n\t\t\treturn self._type\n\t\telif fType == 'Sheng':\n\t\t\tif len(self.get_children())==0:\n\t\t\t\tlog.error(r'<Children Len Error> : %s', self.get_str())\n\t\t\tif self.get_children()[0].has_child():\n\t\t\t\tself._type = 'Di'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99129:Assign_L245_C3", "label": "self._type =", "type": "assigned_variable", "loc": [245, 245], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L244_C2", "vector": [14, 3, 0.3646, 0.0015, 3, 0.74, 0.0, 313, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "self._type", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\tself._type = 'Qu'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99129:Return_L246_C3", "label": "return", "type": "return", "loc": [246, 246], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L244_C2", "vector": [13, 3, 0.3661, 0.0015, 3, 0.74, 0.5, 0, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\treturn self._type"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L247_C2", "label": "if", "type": "if", "loc": [247, 255], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L244_C2", "vector": [4, 3, 0.3735, 0.0134, 3, 0.74, 1.0, 0, 0, 0, 0, 0, 0, 0, 6], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\telif fType == 'Sheng':\n\t\t\tif len(self.get_children())==0:\n\t\t\t\tlog.error(r'<Children Len Error> : %s', self.get_str())\n\t\t\tif self.get_children()[0].has_child():\n\t\t\t\tself._type = 'Di'\n\t\t\t\treturn self._type\n\t\t\telse:\n\t\t\t\tself._type = 'Xian'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L248_C3", "label": "if", "type": "if", "loc": [248, 249], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L247_C2", "vector": [4, 4, 0.3698, 0.003, 4, 0.21, 0.0, 0, 0, 0, 0, 0, 0, 0, 4], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\tif len(self.get_children())==0:\n\t\t\t\tlog.error(r'<Children Len Error> : %s', self.get_str())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99129:Expr_L249_C4", "label": "error()", "type": "expression", "loc": [249, 249], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L248_C3", "vector": [8, 5, 0.3705, 0.0015, 5, 0.6, 0.0, 771, 3, 2, 0, 0, 0, 0, 2], "semantic": {"name": "error", "arg_names": [], "import_names": [], "rhs_call_name": "error", "annotation": ""}, "snippet": "\t\t\t\tlog.error(r'<Children Len Error> : %s', self.get_str())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L250_C3", "label": "if", "type": "if", "loc": [250, 255], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L247_C2", "vector": [4, 4, 0.3757, 0.0089, 4, 0.21, 1.0, 0, 3, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\tif self.get_children()[0].has_child():\n\t\t\t\tself._type = 'Di'\n\t\t\t\treturn self._type\n\t\t\telse:\n\t\t\t\tself._type = 'Xian'\n\t\t\t\treturn self._type"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99129:Assign_L251_C4", "label": "self._type =", "type": "assigned_variable", "loc": [251, 251], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L250_C3", "vector": [14, 5, 0.3735, 0.0015, 5, 0.79, 0.0, 313, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "self._type", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\t\tself._type = 'Di'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99129:Return_L252_C4", "label": "return", "type": "return", "loc": [252, 252], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L250_C3", "vector": [13, 5, 0.375, 0.0015, 5, 0.79, 0.3333, 0, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\t\treturn self._type"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99129:Assign_L254_C4", "label": "self._type =", "type": "assigned_variable", "loc": [254, 254], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L250_C3", "vector": [14, 5, 0.378, 0.0015, 5, 0.79, 0.6667, 313, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "self._type", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\t\tself._type = 'Xian'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99129:Return_L255_C4", "label": "return", "type": "return", "loc": [255, 255], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L250_C3", "vector": [13, 5, 0.3795, 0.0015, 5, 0.79, 1.0, 0, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\t\treturn self._type"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99129:Assign_L256_C2", "label": "self._type =", "type": "assigned_variable", "loc": [256, 256], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L226_C1", "vector": [14, 2, 0.381, 0.0015, 2, 0.18, 0.875, 313, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "self._type", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tself._type = 'Xian'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99129:Return_L257_C2", "label": "return", "type": "return", "loc": [257, 257], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L226_C1", "vector": [13, 2, 0.3824, 0.0015, 2, 0.18, 1.0, 0, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\treturn self._type"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99129:ClassDef_L260_C0", "label": "DicRootItem", "type": "class", "loc": [260, 296], "level": 0, "parent": null, "vector": [3, 0, 0.4137, 0.0551, 0, 0.66, 0.9167, 896, 0, 8, 0, 0, 354, 0, 4], "semantic": {"name": "DicRootItem", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class DicRootItem(DicItem):\n\tdef __init__(self):\n\t\tlinestr = 'China\tNoPinYin\t0x80000001\t0x00000000\t0x00000000\t0x00000000\t0x0000\\r\\n'\n\t\tDicItem.__init__(self, linestr, None)\n\t\t\n\tdef check(self):\n\t\tpass\n\t"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L261_C1", "label": "__init__", "type": "function", "loc": [261, 263], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99129:ClassDef_L260_C0", "vector": [2, 1, 0.3899, 0.0045, 1, 0.43, 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\tlinestr = 'China\tNoPinYin\t0x80000001\t0x00000000\t0x00000000\t0x00000000\t0x0000\\r\\n'\n\t\tDicItem.__init__(self, linestr, None)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99129:Assign_L262_C2", "label": "linestr =", "type": "assigned_variable", "loc": [262, 262], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L261_C1", "vector": [14, 2, 0.3899, 0.0015, 2, 0.98, 0.0, 501, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "linestr", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tlinestr = 'China\tNoPinYin\t0x80000001\t0x00000000\t0x00000000\t0x00000000\t0x0000\\r\\n'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99129:Expr_L263_C2", "label": "__init__()", "type": "expression", "loc": [263, 263], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L261_C1", "vector": [8, 2, 0.3914, 0.0015, 2, 0.98, 1.0, 555, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "__init__", "arg_names": [], "import_names": [], "rhs_call_name": "__init__", "annotation": ""}, "snippet": "\t\tDicItem.__init__(self, linestr, None)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L265_C1", "label": "check", "type": "function", "loc": [265, 266], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99129:ClassDef_L260_C0", "vector": [2, 1, 0.3951, 0.003, 1, 0.43, 0.1429, 803, 0, 1, 0, 0, 0, 0, 0], "semantic": {"name": "check", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tdef check(self):\n\t\tpass"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L268_C1", "label": "check_recursively", "type": "function", "loc": [268, 278], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99129:ClassDef_L260_C0", "vector": [2, 1, 0.4062, 0.0164, 1, 0.43, 0.2857, 612, 0, 1, 1, 0, 0, 0, 2], "semantic": {"name": "check_recursively", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tdef check_recursively(self):\n\t\t\" Check recursively.\\n\"\n\t\tif self._checked:\n\t\t\treturn True\n\t\tself._checked = True\n\t\t# check children recursively\n\t\tresult = True\n\t\tfor child in self.get_children():"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99129:Expr_L269_C2", "label": "expression", "type": "expression", "loc": [269, 269], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L268_C1", "vector": [8, 2, 0.4003, 0.0015, 2, 0.61, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\" Check recursively.\\n\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L270_C2", "label": "if", "type": "if", "loc": [270, 271], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L268_C1", "vector": [4, 2, 0.4025, 0.003, 2, 0.61, 0.2, 0, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tif self._checked:\n\t\t\treturn True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99129:Return_L271_C3", "label": "return", "type": "return", "loc": [271, 271], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L270_C2", "vector": [13, 3, 0.4033, 0.0015, 3, 0.14, 0.0, 0, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\treturn True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99129:Assign_L272_C2", "label": "self._checked =", "type": "assigned_variable", "loc": [272, 272], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L268_C1", "vector": [14, 2, 0.4048, 0.0015, 2, 0.61, 0.4, 131, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "self._checked", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tself._checked = True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99129:Assign_L274_C2", "label": "result =", "type": "assigned_variable", "loc": [274, 274], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L268_C1", "vector": [14, 2, 0.4077, 0.0015, 2, 0.61, 0.6, 51, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "result", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tresult = True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99129:For_L275_C2", "label": "for child", "type": "for", "loc": [275, 277], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L268_C1", "vector": [6, 2, 0.4107, 0.0045, 2, 0.61, 0.8, 967, 3, 0, 0, 0, 0, 0, 2], "semantic": {"name": "child", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tfor child in self.get_children():\n\t\t\tif not child.check_recursively():\n\t\t\t\tresult = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L276_C3", "label": "if", "type": "if", "loc": [276, 277], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99129:For_L275_C2", "vector": [4, 3, 0.4115, 0.003, 3, 0.23, 0.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\tif not child.check_recursively():\n\t\t\t\tresult = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99129:Assign_L277_C4", "label": "result =", "type": "assigned_variable", "loc": [277, 277], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L276_C3", "vector": [14, 4, 0.4122, 0.0015, 4, 0.71, 0.0, 51, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "result", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\t\tresult = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99129:Return_L278_C2", "label": "return", "type": "return", "loc": [278, 278], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L268_C1", "vector": [13, 2, 0.4137, 0.0015, 2, 0.61, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\treturn result"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L280_C1", "label": "has_child", "type": "function", "loc": [280, 281], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99129:ClassDef_L260_C0", "vector": [2, 1, 0.4174, 0.003, 1, 0.43, 0.4286, 817, 0, 1, 1, 0, 0, 0, 0], "semantic": {"name": "has_child", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tdef has_child(self):\n\t\treturn True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99129:Return_L281_C2", "label": "return", "type": "return", "loc": [281, 281], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L280_C1", "vector": [13, 2, 0.4182, 0.0015, 2, 0.53, 0.0, 0, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\treturn True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L283_C1", "label": "is_root", "type": "function", "loc": [283, 284], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99129:ClassDef_L260_C0", "vector": [2, 1, 0.4219, 0.003, 1, 0.43, 0.5714, 748, 0, 1, 1, 0, 0, 0, 0], "semantic": {"name": "is_root", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tdef is_root(self):\n\t\treturn True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99129:Return_L284_C2", "label": "return", "type": "return", "loc": [284, 284], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L283_C1", "vector": [13, 2, 0.4226, 0.0015, 2, 0.92, 0.0, 0, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\treturn True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L286_C1", "label": "fetch_kiwi_record", "type": "function", "loc": [286, 287], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99129:ClassDef_L260_C0", "vector": [2, 1, 0.4263, 0.003, 1, 0.43, 0.7143, 289, 0, 1, 1, 0, 0, 0, 0], "semantic": {"name": "fetch_kiwi_record", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tdef fetch_kiwi_record(self):\n\t\treturn None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99129:Return_L287_C2", "label": "return", "type": "return", "loc": [287, 287], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L286_C1", "vector": [13, 2, 0.4271, 0.0015, 2, 0.91, 0.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_99129:FunctionDef_L289_C1", "label": "fetch_kiwi_frame", "type": "function", "loc": [289, 293], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99129:ClassDef_L260_C0", "vector": [2, 1, 0.433, 0.0074, 1, 0.43, 0.8571, 841, 0, 1, 1, 0, 0, 0, 1], "semantic": {"name": "fetch_kiwi_frame", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tdef fetch_kiwi_frame(self):\n\t\tif self._kiwiFrame != None:\n\t\t\treturn self._kiwiFrame\n\t\tself._kiwiFrame = self._kiwiDataManager.fetch_frame()\n\t\treturn self._kiwiFrame"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L290_C2", "label": "if", "type": "if", "loc": [290, 291], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L289_C1", "vector": [4, 2, 0.4323, 0.003, 2, 0.76, 0.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tif self._kiwiFrame != None:\n\t\t\treturn self._kiwiFrame"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99129:Return_L291_C3", "label": "return", "type": "return", "loc": [291, 291], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L290_C2", "vector": [13, 3, 0.433, 0.0015, 3, 0.58, 0.0, 0, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\treturn self._kiwiFrame"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99129:Assign_L292_C2", "label": "self._kiwiFrame = fetch_frame()", "type": "assigned_variable", "loc": [292, 292], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L289_C1", "vector": [14, 2, 0.4345, 0.0015, 2, 0.76, 0.5, 577, 3, 0, 0, 0, 254, 10, 1], "semantic": {"name": "self._kiwiFrame", "arg_names": [], "import_names": [], "rhs_call_name": "fetch_frame", "annotation": ""}, "snippet": "\t\tself._kiwiFrame = self._kiwiDataManager.fetch_frame()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99129:Return_L293_C2", "label": "return", "type": "return", "loc": [293, 293], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L289_C1", "vector": [13, 2, 0.436, 0.0015, 2, 0.76, 1.0, 0, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\treturn self._kiwiFrame"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L295_C1", "label": "get_type", "type": "function", "loc": [295, 296], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99129:ClassDef_L260_C0", "vector": [2, 1, 0.4397, 0.003, 1, 0.43, 1.0, 606, 0, 1, 1, 0, 0, 0, 0], "semantic": {"name": "get_type", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tdef get_type(self):\n\t\treturn 'China'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99129:Return_L296_C2", "label": "return", "type": "return", "loc": [296, 296], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L295_C1", "vector": [13, 2, 0.4405, 0.0015, 2, 0.32, 0.0, 0, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\treturn 'China'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99129:ClassDef_L299_C0", "label": "DicItemChecker", "type": "class", "loc": [299, 671], "level": 0, "parent": null, "vector": [3, 0, 0.7217, 0.5551, 0, 0.66, 1.0, 338, 0, 23, 0, 0, 0, 0, 99], "semantic": {"name": "DicItemChecker", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class DicItemChecker:\n\t\"\"\"Class to check dictionary item. \n\t\"\"\"\n\t# alphabets that might be found in text.\n\talphabets = set(u'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ\uff41\uff42\uff43\uff44\uff45\uff46\uff47\uff48\uff49\uff4a\uff4b\uff4c\uff4d\uff4e\uff4f\uff50\uff51\uff52\uff53\uff54\uff55\uff56\uff57\uff58\uff59\uff5a\uff21\uff22\uff23\uff24\uff25\uff26\uff27\uff28\uff29\uff2a\uff2b\uff2c\uff2d\uff2e\uff2f\uff30\uff31\uff32\uff33\uff34\uff35\uff36\uff37\uff38\uff39\uff3a')\n\t# pinyin should only contains these characters\n\tpinyinChars = set(u'abcdefghijklmnopqrstuvwxyz /1234')\n\t"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99129:Expr_L300_C1", "label": "expression", "type": "expression", "loc": [300, 301], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99129:ClassDef_L299_C0", "vector": [8, 1, 0.4472, 0.003, 1, 0.91, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\"\"\"Class to check dictionary item. \n\t\"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99129:Assign_L303_C1", "label": "alphabets = set()", "type": "assigned_variable", "loc": [303, 303], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99129:ClassDef_L299_C0", "vector": [14, 1, 0.4509, 0.0015, 1, 0.91, 0.0417, 87, 3, 1, 0, 0, 21, 10, 1], "semantic": {"name": "alphabets", "arg_names": [], "import_names": [], "rhs_call_name": "set", "annotation": ""}, "snippet": "\talphabets = set(u'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ\uff41\uff42\uff43\uff44\uff45\uff46\uff47\uff48\uff49\uff4a\uff4b\uff4c\uff4d\uff4e\uff4f\uff50\uff51\uff52\uff53\uff54\uff55\uff56\uff57\uff58\uff59\uff5a\uff21\uff22\uff23\uff24\uff25\uff26\uff27\uff28\uff29\uff2a\uff2b\uff2c\uff2d\uff2e\uff2f\uff30\uff31\uff32\uff33\uff34\uff35\uff36\uff37\uff38\uff39\uff3a')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99129:Assign_L305_C1", "label": "pinyinChars = set()", "type": "assigned_variable", "loc": [305, 305], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99129:ClassDef_L299_C0", "vector": [14, 1, 0.4539, 0.0015, 1, 0.91, 0.0833, 473, 3, 1, 0, 0, 21, 10, 1], "semantic": {"name": "pinyinChars", "arg_names": [], "import_names": [], "rhs_call_name": "set", "annotation": ""}, "snippet": "\tpinyinChars = set(u'abcdefghijklmnopqrstuvwxyz /1234')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L307_C1", "label": "__init__", "type": "function", "loc": [307, 313], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99129:ClassDef_L299_C0", "vector": [2, 1, 0.4613, 0.0104, 1, 0.91, 0.125, 555, 0, 2, 0, 0, 0, 0, 0], "semantic": {"name": "__init__", "arg_names": ["self", "dicItem"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tdef __init__(self, dicItem):\n\t\t\"\"\" Constructor.\n\t\t\"\"\"\n\t\tself._dicItem = dicItem\n\t\tself._children_offset_indexed = None\n\t\tself._checked_another_name = False\n\t\tself._checked = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99129:Expr_L308_C2", "label": "expression", "type": "expression", "loc": [308, 309], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L307_C1", "vector": [8, 2, 0.4591, 0.003, 2, 0.62, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\"\"\" Constructor.\n\t\t\"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99129:Assign_L310_C2", "label": "self._dicItem =", "type": "assigned_variable", "loc": [310, 310], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L307_C1", "vector": [14, 2, 0.4613, 0.0015, 2, 0.62, 0.25, 78, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self._dicItem", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tself._dicItem = dicItem"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99129:Assign_L311_C2", "label": "self._children_offset_indexed =", "type": "assigned_variable", "loc": [311, 311], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L307_C1", "vector": [14, 2, 0.4628, 0.0015, 2, 0.62, 0.5, 899, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "self._children_offset_indexed", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tself._children_offset_indexed = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99129:Assign_L312_C2", "label": "self._checked_another_name =", "type": "assigned_variable", "loc": [312, 312], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L307_C1", "vector": [14, 2, 0.4643, 0.0015, 2, 0.62, 0.75, 455, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "self._checked_another_name", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tself._checked_another_name = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99129:Assign_L313_C2", "label": "self._checked =", "type": "assigned_variable", "loc": [313, 313], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L307_C1", "vector": [14, 2, 0.4658, 0.0015, 2, 0.62, 1.0, 131, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "self._checked", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tself._checked = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L315_C1", "label": "check", "type": "function", "loc": [315, 337], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99129:ClassDef_L299_C0", "vector": [2, 1, 0.4851, 0.0342, 1, 0.91, 0.1667, 803, 0, 2, 1, 0, 0, 0, 11], "semantic": {"name": "check", "arg_names": ["self", "forceCheck"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tdef check(self, forceCheck = False):\n\t\t\"\"\"Check dictionary item.\n\t\t\"\"\"\n\t\tif self._checked:\n\t\t\treturn True\n\t\tself._checked = True\n\t\tif not forceCheck:\n\t\t\ttry:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99129:Expr_L316_C2", "label": "expression", "type": "expression", "loc": [316, 317], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L315_C1", "vector": [8, 2, 0.471, 0.003, 2, 0.67, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\"\"\"Check dictionary item.\n\t\t\"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L318_C2", "label": "if", "type": "if", "loc": [318, 319], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L315_C1", "vector": [4, 2, 0.474, 0.003, 2, 0.67, 0.0769, 0, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tif self._checked:\n\t\t\treturn True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99129:Return_L319_C3", "label": "return", "type": "return", "loc": [319, 319], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L318_C2", "vector": [13, 3, 0.4747, 0.0015, 3, 0.93, 0.0, 0, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\treturn True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99129:Assign_L320_C2", "label": "self._checked =", "type": "assigned_variable", "loc": [320, 320], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L315_C1", "vector": [14, 2, 0.4762, 0.0015, 2, 0.67, 0.1538, 131, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "self._checked", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tself._checked = True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L321_C2", "label": "if", "type": "if", "loc": [321, 326], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L315_C1", "vector": [4, 2, 0.4814, 0.0089, 2, 0.67, 0.2308, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tif not forceCheck:\n\t\t\ttry:\n\t\t\t\tself._dicItem.fetch_kiwi_record()\n\t\t\texcept KeyError:\n\t\t\t\t#log.warning(r'<Check another name> : You should check it manually : %s : %s', self._dicItem.get_father()['nextLevelId'], self._dicItem.get_str())\n\t\t\t\treturn self._check_another_name()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99129:Try_L322_C3", "label": "try", "type": "try", "loc": [322, 326], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L321_C2", "vector": [7, 3, 0.4821, 0.0074, 3, 0.14, 0.0, 0, 0, 1, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\ttry:\n\t\t\t\tself._dicItem.fetch_kiwi_record()\n\t\t\texcept KeyError:\n\t\t\t\t#log.warning(r'<Check another name> : You should check it manually : %s : %s', self._dicItem.get_father()['nextLevelId'], self._dicItem.get_str())\n\t\t\t\treturn self._check_another_name()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99129:Expr_L323_C4", "label": "fetch_kiwi_record()", "type": "expression", "loc": [323, 323], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99129:Try_L322_C3", "vector": [8, 4, 0.4807, 0.0015, 4, 0.85, 0.0, 289, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "fetch_kiwi_record", "arg_names": [], "import_names": [], "rhs_call_name": "fetch_kiwi_record", "annotation": ""}, "snippet": "\t\t\t\tself._dicItem.fetch_kiwi_record()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99129:Return_L326_C4", "label": "return", "type": "return", "loc": [326, 326], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99129:Try_L322_C3", "vector": [13, 4, 0.4851, 0.0015, 4, 0.85, 0.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\t\treturn self._check_another_name()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99129:Assign_L328_C2", "label": "r1 = _check_1()", "type": "assigned_variable", "loc": [328, 328], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L315_C1", "vector": [14, 2, 0.4881, 0.0015, 2, 0.67, 0.3077, 648, 3, 0, 0, 0, 388, 10, 1], "semantic": {"name": "r1", "arg_names": [], "import_names": [], "rhs_call_name": "_check_1", "annotation": ""}, "snippet": "\t\tr1 = self._check_1()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99129:Assign_L329_C2", "label": "r2 = _check_2()", "type": "assigned_variable", "loc": [329, 329], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L315_C1", "vector": [14, 2, 0.4896, 0.0015, 2, 0.67, 0.3846, 959, 3, 0, 0, 0, 203, 10, 1], "semantic": {"name": "r2", "arg_names": [], "import_names": [], "rhs_call_name": "_check_2", "annotation": ""}, "snippet": "\t\tr2 = self._check_2()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99129:Assign_L330_C2", "label": "r3 = _check_3()", "type": "assigned_variable", "loc": [330, 330], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L315_C1", "vector": [14, 2, 0.4911, 0.0015, 2, 0.67, 0.4615, 837, 3, 0, 0, 0, 180, 10, 1], "semantic": {"name": "r3", "arg_names": [], "import_names": [], "rhs_call_name": "_check_3", "annotation": ""}, "snippet": "\t\tr3 = self._check_3()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99129:Assign_L331_C2", "label": "r4 = _check_4()", "type": "assigned_variable", "loc": [331, 331], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L315_C1", "vector": [14, 2, 0.4926, 0.0015, 2, 0.67, 0.5385, 470, 3, 0, 0, 0, 390, 10, 1], "semantic": {"name": "r4", "arg_names": [], "import_names": [], "rhs_call_name": "_check_4", "annotation": ""}, "snippet": "\t\tr4 = self._check_4()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99129:Assign_L332_C2", "label": "r5 = _check_5()", "type": "assigned_variable", "loc": [332, 332], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L315_C1", "vector": [14, 2, 0.494, 0.0015, 2, 0.67, 0.6154, 759, 3, 0, 0, 0, 692, 10, 1], "semantic": {"name": "r5", "arg_names": [], "import_names": [], "rhs_call_name": "_check_5", "annotation": ""}, "snippet": "\t\tr5 = self._check_5()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99129:Assign_L333_C2", "label": "r6 = _check_6()", "type": "assigned_variable", "loc": [333, 333], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L315_C1", "vector": [14, 2, 0.4955, 0.0015, 2, 0.67, 0.6923, 327, 3, 0, 0, 0, 30, 10, 1], "semantic": {"name": "r6", "arg_names": [], "import_names": [], "rhs_call_name": "_check_6", "annotation": ""}, "snippet": "\t\tr6 = self._check_6()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99129:Assign_L334_C2", "label": "r7 = _check_7()", "type": "assigned_variable", "loc": [334, 334], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L315_C1", "vector": [14, 2, 0.497, 0.0015, 2, 0.67, 0.7692, 592, 3, 0, 0, 0, 377, 10, 1], "semantic": {"name": "r7", "arg_names": [], "import_names": [], "rhs_call_name": "_check_7", "annotation": ""}, "snippet": "\t\tr7 = self._check_7()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99129:Assign_L335_C2", "label": "r8 = _check_8()", "type": "assigned_variable", "loc": [335, 335], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L315_C1", "vector": [14, 2, 0.4985, 0.0015, 2, 0.67, 0.8462, 578, 3, 0, 0, 0, 183, 10, 1], "semantic": {"name": "r8", "arg_names": [], "import_names": [], "rhs_call_name": "_check_8", "annotation": ""}, "snippet": "\t\tr8 = self._check_8()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99129:Assign_L336_C2", "label": "r9 = _check_9()", "type": "assigned_variable", "loc": [336, 336], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L315_C1", "vector": [14, 2, 0.5, 0.0015, 2, 0.67, 0.9231, 377, 3, 0, 0, 0, 92, 10, 1], "semantic": {"name": "r9", "arg_names": [], "import_names": [], "rhs_call_name": "_check_9", "annotation": ""}, "snippet": "\t\tr9 = self._check_9()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99129:Return_L337_C2", "label": "return", "type": "return", "loc": [337, 337], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L315_C1", "vector": [13, 2, 0.5015, 0.0015, 2, 0.67, 1.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\treturn r1 and r2 and r3 and r4 and r5 and r6 and r7 and r8 and r9\t"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L339_C1", "label": "_check_another_name", "type": "function", "loc": [339, 358], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99129:ClassDef_L299_C0", "vector": [2, 1, 0.5186, 0.0298, 1, 0.91, 0.2083, 9, 0, 1, 1, 0, 0, 0, 14], "semantic": {"name": "_check_another_name", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tdef _check_another_name(self):\n\t\t\"\"\"Check another name of the dictionary item.\n\t\t\"\"\"\n\t\tself._checked_another_name = True\n\t\tfor item in self._dicItem.get_father().get_children():\n\t\t\tif item['offset'] == self._dicItem['offset']:\n\t\t\t\ttry:\n\t\t\t\t\titem.fetch_kiwi_record()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99129:Expr_L340_C2", "label": "expression", "type": "expression", "loc": [340, 341], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L339_C1", "vector": [8, 2, 0.5067, 0.003, 2, 0.44, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\"\"\"Check another name of the dictionary item.\n\t\t\"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99129:Assign_L342_C2", "label": "self._checked_another_name =", "type": "assigned_variable", "loc": [342, 342], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L339_C1", "vector": [14, 2, 0.5089, 0.0015, 2, 0.44, 0.25, 455, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "self._checked_another_name", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tself._checked_another_name = True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99129:For_L343_C2", "label": "for item", "type": "for", "loc": [343, 356], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L339_C1", "vector": [6, 2, 0.5201, 0.0208, 2, 0.44, 0.5, 434, 3, 0, 0, 0, 0, 0, 12], "semantic": {"name": "item", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tfor item in self._dicItem.get_father().get_children():\n\t\t\tif item['offset'] == self._dicItem['offset']:\n\t\t\t\ttry:\n\t\t\t\t\titem.fetch_kiwi_record()\n\t\t\t\texcept KeyError:\n\t\t\t\t\tcontinue\n\t\t\t\tif not self.is_another_name(item, self._dicItem):\n\t\t\t\t\tlog.warning(r'<Check Another Name Error> : not another name : %s', self._dicItem.get_str())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L344_C3", "label": "if", "type": "if", "loc": [344, 356], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99129:For_L343_C2", "vector": [4, 3, 0.5208, 0.0193, 3, 0.18, 0.0, 0, 0, 0, 0, 0, 0, 0, 10], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\tif item['offset'] == self._dicItem['offset']:\n\t\t\t\ttry:\n\t\t\t\t\titem.fetch_kiwi_record()\n\t\t\t\texcept KeyError:\n\t\t\t\t\tcontinue\n\t\t\t\tif not self.is_another_name(item, self._dicItem):\n\t\t\t\t\tlog.warning(r'<Check Another Name Error> : not another name : %s', self._dicItem.get_str())\n\t\t\t\t\treturn False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99129:Try_L345_C4", "label": "try", "type": "try", "loc": [345, 348], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L344_C3", "vector": [7, 4, 0.5156, 0.006, 4, 0.17, 0.0, 0, 0, 1, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\t\ttry:\n\t\t\t\t\titem.fetch_kiwi_record()\n\t\t\t\texcept KeyError:\n\t\t\t\t\tcontinue"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99129:Expr_L346_C5", "label": "fetch_kiwi_record()", "type": "expression", "loc": [346, 346], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99129:Try_L345_C4", "vector": [8, 5, 0.5149, 0.0015, 5, 0.74, 0.0, 289, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "fetch_kiwi_record", "arg_names": [], "import_names": [], "rhs_call_name": "fetch_kiwi_record", "annotation": ""}, "snippet": "\t\t\t\t\titem.fetch_kiwi_record()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L349_C4", "label": "if", "type": "if", "loc": [349, 351], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L344_C3", "vector": [4, 4, 0.5208, 0.0045, 4, 0.17, 0.3333, 0, 0, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\t\tif not self.is_another_name(item, self._dicItem):\n\t\t\t\t\tlog.warning(r'<Check Another Name Error> : not another name : %s', self._dicItem.get_str())\n\t\t\t\t\treturn False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99129:Expr_L350_C5", "label": "warning()", "type": "expression", "loc": [350, 350], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L349_C4", "vector": [8, 5, 0.5208, 0.0015, 5, 0.7, 0.0, 320, 3, 2, 0, 0, 0, 0, 2], "semantic": {"name": "warning", "arg_names": [], "import_names": [], "rhs_call_name": "warning", "annotation": ""}, "snippet": "\t\t\t\t\tlog.warning(r'<Check Another Name Error> : not another name : %s', self._dicItem.get_str())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99129:Return_L351_C5", "label": "return", "type": "return", "loc": [351, 351], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L349_C4", "vector": [13, 5, 0.5223, 0.0015, 5, 0.7, 1.0, 0, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\t\t\treturn False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99129:Expr_L352_C4", "label": "info()", "type": "expression", "loc": [352, 355], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L344_C3", "vector": [8, 4, 0.526, 0.006, 4, 0.17, 0.6667, 730, 3, 4, 0, 0, 0, 0, 4], "semantic": {"name": "info", "arg_names": [], "import_names": [], "rhs_call_name": "info", "annotation": ""}, "snippet": "\t\t\t\tlog.info(r'<Check another name> : %s : %s : %s', \n\t\t\t\t\t\tself._dicItem.get_father()['nextLevelId'], \n\t\t\t\t\t\tself._dicItem.get_str(),\n\t\t\t\t\t\titem.get_str())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99129:Return_L356_C4", "label": "return", "type": "return", "loc": [356, 356], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L344_C3", "vector": [13, 4, 0.5298, 0.0015, 4, 0.17, 1.0, 0, 3, 0, 0, 0, 0, 10, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\t\treturn DicItemChecker(item).check(True)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99129:Expr_L357_C2", "label": "warning()", "type": "expression", "loc": [357, 357], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L339_C1", "vector": [8, 2, 0.5312, 0.0015, 2, 0.44, 0.75, 320, 3, 2, 0, 0, 0, 0, 2], "semantic": {"name": "warning", "arg_names": [], "import_names": [], "rhs_call_name": "warning", "annotation": ""}, "snippet": "\t\tlog.warning(r'<Check Another Name Error> : %s', self._dicItem.get_str())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99129:Return_L358_C2", "label": "return", "type": "return", "loc": [358, 358], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L339_C1", "vector": [13, 2, 0.5327, 0.0015, 2, 0.44, 1.0, 0, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\treturn False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L360_C1", "label": "is_another_name", "type": "function", "loc": [360, 374], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99129:ClassDef_L299_C0", "vector": [2, 1, 0.5461, 0.0223, 1, 0.91, 0.25, 363, 0, 3, 1, 0, 0, 0, 4], "semantic": {"name": "is_another_name", "arg_names": ["self", "r1", "r2"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tdef is_another_name(self, r1, r2):\n\t\t\"\"\"Check if r1 is another of r2.\n\t\t\"\"\"\n\t\tif r1['nextLevelId'] != r2['nextLevelId'] \\\n\t\t\t\tor r1['nextLevelInfo'] != r2['nextLevelInfo'] \\\n\t\t\t\tor r1['offset'] != r2['offset'] \\\n\t\t\t\tor r1['voiceId'] != r2['voiceId'] \\\n\t\t\t\tor r1['nextLevelNum'] != r2['nextLevelNum']:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99129:Expr_L361_C2", "label": "expression", "type": "expression", "loc": [361, 362], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L360_C1", "vector": [8, 2, 0.5379, 0.003, 2, 0.78, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\"\"\"Check if r1 is another of r2.\n\t\t\"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L363_C2", "label": "if", "type": "if", "loc": [363, 374], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L360_C1", "vector": [4, 2, 0.5484, 0.0179, 2, 0.78, 1.0, 0, 0, 0, 0, 0, 0, 0, 4], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tif r1['nextLevelId'] != r2['nextLevelId'] \\\n\t\t\t\tor r1['nextLevelInfo'] != r2['nextLevelInfo'] \\\n\t\t\t\tor r1['offset'] != r2['offset'] \\\n\t\t\t\tor r1['voiceId'] != r2['voiceId'] \\\n\t\t\t\tor r1['nextLevelNum'] != r2['nextLevelNum']:\n\t\t\treturn False\n\t\telif r1['name'].find(r2['name']) >= 0 or r2['name'].find(r1['name']) >= 0:\n\t\t\treturn True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99129:Return_L368_C3", "label": "return", "type": "return", "loc": [368, 368], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L363_C2", "vector": [13, 3, 0.5476, 0.0015, 3, 0.33, 0.0, 0, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\treturn False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L369_C2", "label": "if", "type": "if", "loc": [369, 374], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L363_C2", "vector": [4, 3, 0.5528, 0.0089, 3, 0.33, 1.0, 0, 0, 0, 0, 0, 0, 0, 4], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\telif r1['name'].find(r2['name']) >= 0 or r2['name'].find(r1['name']) >= 0:\n\t\t\treturn True\n\t\telif r1['name'].find(u'\u5168\u57df') >= 0 and r2['name'].find(u'\u5168\u57df') >= 0:\n\t\t\treturn True\n\t\telse:\n\t\t\treturn False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99129:Return_L370_C3", "label": "return", "type": "return", "loc": [370, 370], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L369_C2", "vector": [13, 4, 0.5506, 0.0015, 4, 0.17, 0.0, 0, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\treturn True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L371_C2", "label": "if", "type": "if", "loc": [371, 374], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L369_C2", "vector": [4, 4, 0.5543, 0.006, 4, 0.17, 1.0, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\telif r1['name'].find(u'\u5168\u57df') >= 0 and r2['name'].find(u'\u5168\u57df') >= 0:\n\t\t\treturn True\n\t\telse:\n\t\t\treturn False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99129:Return_L372_C3", "label": "return", "type": "return", "loc": [372, 372], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L371_C2", "vector": [13, 5, 0.5536, 0.0015, 5, 0.03, 0.0, 0, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\treturn True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99129:Return_L374_C3", "label": "return", "type": "return", "loc": [374, 374], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L371_C2", "vector": [13, 5, 0.5565, 0.0015, 5, 0.03, 1.0, 0, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\treturn False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L376_C1", "label": "checked_another_name", "type": "function", "loc": [376, 379], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99129:ClassDef_L299_C0", "vector": [2, 1, 0.5618, 0.006, 1, 0.91, 0.2917, 724, 0, 1, 1, 0, 0, 0, 0], "semantic": {"name": "checked_another_name", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tdef checked_another_name(self):\n\t\t\"\"\"Judge if another name has been checked\n\t\t\"\"\"\n\t\treturn self._checked_another_name;"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99129:Expr_L377_C2", "label": "expression", "type": "expression", "loc": [377, 378], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L376_C1", "vector": [8, 2, 0.5618, 0.003, 2, 0.29, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\"\"\"Judge if another name has been checked\n\t\t\"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99129:Return_L379_C2", "label": "return", "type": "return", "loc": [379, 379], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L376_C1", "vector": [13, 2, 0.564, 0.0015, 2, 0.29, 1.0, 0, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\treturn self._checked_another_name;"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L381_C1", "label": "_check_1", "type": "function", "loc": [381, 384], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99129:ClassDef_L299_C0", "vector": [2, 1, 0.5692, 0.006, 1, 0.91, 0.3333, 388, 0, 1, 1, 0, 0, 0, 0], "semantic": {"name": "_check_1", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tdef _check_1(self):\n\t\t\"\"\"Check the name.\n\t\t\"\"\"\n\t\treturn True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99129:Expr_L382_C2", "label": "expression", "type": "expression", "loc": [382, 383], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L381_C1", "vector": [8, 2, 0.5692, 0.003, 2, 0.77, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\"\"\"Check the name.\n\t\t\"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99129:Return_L384_C2", "label": "return", "type": "return", "loc": [384, 384], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L381_C1", "vector": [13, 2, 0.5714, 0.0015, 2, 0.77, 1.0, 0, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\treturn True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L386_C1", "label": "_check_2", "type": "function", "loc": [386, 398], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99129:ClassDef_L299_C0", "vector": [2, 1, 0.5833, 0.0193, 1, 0.91, 0.375, 203, 0, 1, 1, 0, 0, 0, 8], "semantic": {"name": "_check_2", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tdef _check_2(self):\n\t\t\"\"\"Check pinyin.\n\t\t\"\"\"\n\t\td = self._dicItem\n\t\tr1 = self._check_2_1()\n\t\tr2 = self._check_2_2();\n\t\tif not r1:\n\t\t\tlog.info(r'<Check_2 Error> Alphabet text but not NoPinYin : %s : %s', self._dicItem.get_father()['nextLevelId'], self._dicItem.get_str())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99129:Expr_L387_C2", "label": "expression", "type": "expression", "loc": [387, 388], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L386_C1", "vector": [8, 2, 0.5766, 0.003, 2, 0.26, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\"\"\"Check pinyin.\n\t\t\"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99129:Assign_L389_C2", "label": "d =", "type": "assigned_variable", "loc": [389, 389], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L386_C1", "vector": [14, 2, 0.5789, 0.0015, 2, 0.26, 0.1667, 355, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "d", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\td = self._dicItem"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99129:Assign_L390_C2", "label": "r1 = _check_2_1()", "type": "assigned_variable", "loc": [390, 390], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L386_C1", "vector": [14, 2, 0.5804, 0.0015, 2, 0.26, 0.3333, 648, 3, 0, 0, 0, 474, 10, 1], "semantic": {"name": "r1", "arg_names": [], "import_names": [], "rhs_call_name": "_check_2_1", "annotation": ""}, "snippet": "\t\tr1 = self._check_2_1()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99129:Assign_L391_C2", "label": "r2 = _check_2_2()", "type": "assigned_variable", "loc": [391, 391], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L386_C1", "vector": [14, 2, 0.5818, 0.0015, 2, 0.26, 0.5, 959, 3, 0, 0, 0, 16, 10, 1], "semantic": {"name": "r2", "arg_names": [], "import_names": [], "rhs_call_name": "_check_2_2", "annotation": ""}, "snippet": "\t\tr2 = self._check_2_2();"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L392_C2", "label": "if", "type": "if", "loc": [392, 394], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L386_C1", "vector": [4, 2, 0.5848, 0.0045, 2, 0.26, 0.6667, 0, 0, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tif not r1:\n\t\t\tlog.info(r'<Check_2 Error> Alphabet text but not NoPinYin : %s : %s', self._dicItem.get_father()['nextLevelId'], self._dicItem.get_str())\n\t\t\treturn False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99129:Expr_L393_C3", "label": "info()", "type": "expression", "loc": [393, 393], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L392_C2", "vector": [8, 3, 0.5848, 0.0015, 3, 0.27, 0.0, 730, 3, 3, 0, 0, 0, 0, 3], "semantic": {"name": "info", "arg_names": [], "import_names": [], "rhs_call_name": "info", "annotation": ""}, "snippet": "\t\t\tlog.info(r'<Check_2 Error> Alphabet text but not NoPinYin : %s : %s', self._dicItem.get_father()['nextLevelId'], self._dicItem.get_str())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99129:Return_L394_C3", "label": "return", "type": "return", "loc": [394, 394], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L392_C2", "vector": [13, 3, 0.5863, 0.0015, 3, 0.27, 1.0, 0, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\treturn False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L395_C2", "label": "if", "type": "if", "loc": [395, 397], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L386_C1", "vector": [4, 2, 0.5893, 0.0045, 2, 0.26, 0.8333, 0, 0, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tif not r2:\n\t\t\tlog.info(r'<Check_2 Error> Pinyin contains other characters : %s : %s', self._dicItem.get_father()['nextLevelId'], self._dicItem.get_str())\n\t\t\treturn False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99129:Expr_L396_C3", "label": "info()", "type": "expression", "loc": [396, 396], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L395_C2", "vector": [8, 3, 0.5893, 0.0015, 3, 0.52, 0.0, 730, 3, 3, 0, 0, 0, 0, 3], "semantic": {"name": "info", "arg_names": [], "import_names": [], "rhs_call_name": "info", "annotation": ""}, "snippet": "\t\t\tlog.info(r'<Check_2 Error> Pinyin contains other characters : %s : %s', self._dicItem.get_father()['nextLevelId'], self._dicItem.get_str())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99129:Return_L397_C3", "label": "return", "type": "return", "loc": [397, 397], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L395_C2", "vector": [13, 3, 0.5908, 0.0015, 3, 0.52, 1.0, 0, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\treturn False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99129:Return_L398_C2", "label": "return", "type": "return", "loc": [398, 398], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L386_C1", "vector": [13, 2, 0.5923, 0.0015, 2, 0.26, 1.0, 0, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\treturn True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L400_C1", "label": "_check_3", "type": "function", "loc": [400, 405], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99129:ClassDef_L299_C0", "vector": [2, 1, 0.599, 0.0089, 1, 0.91, 0.4167, 180, 0, 1, 1, 0, 0, 0, 2], "semantic": {"name": "_check_3", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tdef _check_3(self):\n\t\t\"\"\"Check next level id.\n\t\t\"\"\"\n\t\tr1 = self._check_3_1()\n\t\tr2 = self._check_3_2()\n\t\treturn r1 and r2"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99129:Expr_L401_C2", "label": "expression", "type": "expression", "loc": [401, 402], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L400_C1", "vector": [8, 2, 0.5975, 0.003, 2, 0.5, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\"\"\"Check next level id.\n\t\t\"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99129:Assign_L403_C2", "label": "r1 = _check_3_1()", "type": "assigned_variable", "loc": [403, 403], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L400_C1", "vector": [14, 2, 0.5997, 0.0015, 2, 0.5, 0.3333, 648, 3, 0, 0, 0, 620, 10, 1], "semantic": {"name": "r1", "arg_names": [], "import_names": [], "rhs_call_name": "_check_3_1", "annotation": ""}, "snippet": "\t\tr1 = self._check_3_1()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99129:Assign_L404_C2", "label": "r2 = _check_3_2()", "type": "assigned_variable", "loc": [404, 404], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L400_C1", "vector": [14, 2, 0.6012, 0.0015, 2, 0.5, 0.6667, 959, 3, 0, 0, 0, 777, 10, 1], "semantic": {"name": "r2", "arg_names": [], "import_names": [], "rhs_call_name": "_check_3_2", "annotation": ""}, "snippet": "\t\tr2 = self._check_3_2()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99129:Return_L405_C2", "label": "return", "type": "return", "loc": [405, 405], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L400_C1", "vector": [13, 2, 0.6027, 0.0015, 2, 0.5, 1.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\treturn r1 and r2"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L407_C1", "label": "_check_4", "type": "function", "loc": [407, 454], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99129:ClassDef_L299_C0", "vector": [2, 1, 0.6406, 0.0714, 1, 0.91, 0.4583, 390, 0, 1, 1, 0, 0, 0, 28], "semantic": {"name": "_check_4", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tdef _check_4(self):\n\t\t\"\"\"Check next level info.\n\t\t\"\"\"\n\t\tif not self._dicItem.has_child():\n\t\t\tif self._dicItem['nextLevelInfo'] != '0x00000001':\n\t\t\t\tlog.info(r'<Check_4 Error> next level info : %s : %s', self._dicItem.get_father()['nextLevelId'], self._dicItem.get_str())\n\t\t\t\treturn False\n\t\t\treturn True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99129:Expr_L408_C2", "label": "expression", "type": "expression", "loc": [408, 409], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L407_C1", "vector": [8, 2, 0.6079, 0.003, 2, 0.76, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\"\"\"Check next level info.\n\t\t\"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L410_C2", "label": "if", "type": "if", "loc": [410, 414], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L407_C1", "vector": [4, 2, 0.6131, 0.0074, 2, 0.76, 0.1111, 0, 0, 0, 0, 0, 0, 0, 4], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tif not self._dicItem.has_child():\n\t\t\tif self._dicItem['nextLevelInfo'] != '0x00000001':\n\t\t\t\tlog.info(r'<Check_4 Error> next level info : %s : %s', self._dicItem.get_father()['nextLevelId'], self._dicItem.get_str())\n\t\t\t\treturn False\n\t\t\treturn True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L411_C3", "label": "if", "type": "if", "loc": [411, 413], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L410_C2", "vector": [4, 3, 0.6131, 0.0045, 3, 0.53, 0.0, 0, 0, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\tif self._dicItem['nextLevelInfo'] != '0x00000001':\n\t\t\t\tlog.info(r'<Check_4 Error> next level info : %s : %s', self._dicItem.get_father()['nextLevelId'], self._dicItem.get_str())\n\t\t\t\treturn False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99129:Expr_L412_C4", "label": "info()", "type": "expression", "loc": [412, 412], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L411_C3", "vector": [8, 4, 0.6131, 0.0015, 4, 0.91, 0.0, 730, 3, 3, 0, 0, 0, 0, 3], "semantic": {"name": "info", "arg_names": [], "import_names": [], "rhs_call_name": "info", "annotation": ""}, "snippet": "\t\t\t\tlog.info(r'<Check_4 Error> next level info : %s : %s', self._dicItem.get_father()['nextLevelId'], self._dicItem.get_str())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99129:Return_L413_C4", "label": "return", "type": "return", "loc": [413, 413], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L411_C3", "vector": [13, 4, 0.6146, 0.0015, 4, 0.91, 1.0, 0, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\t\treturn False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99129:Return_L414_C3", "label": "return", "type": "return", "loc": [414, 414], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L410_C2", "vector": [13, 3, 0.6161, 0.0015, 3, 0.53, 1.0, 0, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\treturn True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99129:Assign_L416_C2", "label": "ret =", "type": "assigned_variable", "loc": [416, 416], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L407_C1", "vector": [14, 2, 0.619, 0.0015, 2, 0.76, 0.2222, 501, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "ret", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tret = True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99129:Assign_L417_C2", "label": "getb =", "type": "assigned_variable", "loc": [417, 417], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L407_C1", "vector": [14, 2, 0.6205, 0.0015, 2, 0.76, 0.3333, 459, 9, 0, 0, 0, 0, 0, 1], "semantic": {"name": "getb", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tgetb = lambda x,n: bool(x>>n & 1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99129:Assign_L418_C2", "label": "nextLevelInfo = int()", "type": "assigned_variable", "loc": [418, 418], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L407_C1", "vector": [14, 2, 0.622, 0.0015, 2, 0.76, 0.4444, 34, 3, 2, 0, 0, 901, 10, 1], "semantic": {"name": "nextLevelInfo", "arg_names": [], "import_names": [], "rhs_call_name": "int", "annotation": ""}, "snippet": "\t\tnextLevelInfo = int(self._dicItem['nextLevelInfo'], 16)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99129:Assign_L419_C2", "label": "bits = tuple()", "type": "assigned_variable", "loc": [419, 419], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L407_C1", "vector": [14, 2, 0.6235, 0.0015, 2, 0.76, 0.5556, 593, 3, 1, 0, 0, 259, 10, 3], "semantic": {"name": "bits", "arg_names": [], "import_names": [], "rhs_call_name": "tuple", "annotation": ""}, "snippet": "\t\tbits = tuple(getb(nextLevelInfo, n) for n in range(32))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99129:For_L420_C2", "label": "for n", "type": "for", "loc": [420, 422], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L407_C1", "vector": [6, 2, 0.6265, 0.0045, 2, 0.76, 0.6667, 773, 3, 0, 0, 0, 0, 0, 3], "semantic": {"name": "n", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tfor n in range(7,32):\n\t\t\tif bits[n] != False:\n\t\t\t\tlog.info('<Check_4 Error> next level info : %s', self._dicItem.get_str())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L421_C3", "label": "if", "type": "if", "loc": [421, 422], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99129:For_L420_C2", "vector": [4, 3, 0.6272, 0.003, 3, 0.66, 0.0, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\tif bits[n] != False:\n\t\t\t\tlog.info('<Check_4 Error> next level info : %s', self._dicItem.get_str())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99129:Expr_L422_C4", "label": "info()", "type": "expression", "loc": [422, 422], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L421_C3", "vector": [8, 4, 0.628, 0.0015, 4, 0.53, 0.0, 730, 3, 2, 0, 0, 0, 0, 2], "semantic": {"name": "info", "arg_names": [], "import_names": [], "rhs_call_name": "info", "annotation": ""}, "snippet": "\t\t\t\tlog.info('<Check_4 Error> next level info : %s', self._dicItem.get_str())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99129:For_L424_C2", "label": "for item", "type": "for", "loc": [424, 445], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L407_C1", "vector": [6, 2, 0.6466, 0.0327, 2, 0.76, 0.7778, 434, 3, 0, 0, 0, 0, 0, 11], "semantic": {"name": "item", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tfor item in self._dicItem.get_children():\n\t\t\ttype = item.get_type()\n\t\t\tif type == 'Sheng' or type == 'ZhiXiaShi':\n\t\t\t\tif bits[1] != True or bits[6] == True:\n\t\t\t\t\tlog.warning(r'<Check_4 Error> : Sheng/ZhiXiaShi : %s', self._dicItem.get_str())\n\t\t\t\t\tret = False\n\t\t\telif type == 'Di':\n\t\t\t\tif bits[2] != True or bits[6] == True:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99129:Assign_L425_C3", "label": "type = get_type()", "type": "assigned_variable", "loc": [425, 425], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99129:For_L424_C2", "vector": [14, 3, 0.6324, 0.0015, 3, 0.71, 0.0, 801, 3, 0, 0, 0, 606, 10, 1], "semantic": {"name": "type", "arg_names": [], "import_names": [], "rhs_call_name": "get_type", "annotation": ""}, "snippet": "\t\t\ttype = item.get_type()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L426_C3", "label": "if", "type": "if", "loc": [426, 445], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99129:For_L424_C2", "vector": [4, 3, 0.6481, 0.0298, 3, 0.71, 1.0, 0, 0, 0, 0, 0, 0, 0, 9], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\tif type == 'Sheng' or type == 'ZhiXiaShi':\n\t\t\t\tif bits[1] != True or bits[6] == True:\n\t\t\t\t\tlog.warning(r'<Check_4 Error> : Sheng/ZhiXiaShi : %s', self._dicItem.get_str())\n\t\t\t\t\tret = False\n\t\t\telif type == 'Di':\n\t\t\t\tif bits[2] != True or bits[6] == True:\n\t\t\t\t\tlog.warning(r'<Check_4 Error> next level info : Di : %s', self._dicItem.get_str())\n\t\t\t\t\tret = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L427_C4", "label": "if", "type": "if", "loc": [427, 429], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L426_C3", "vector": [4, 4, 0.6369, 0.0045, 4, 0.22, 0.0, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\t\tif bits[1] != True or bits[6] == True:\n\t\t\t\t\tlog.warning(r'<Check_4 Error> : Sheng/ZhiXiaShi : %s', self._dicItem.get_str())\n\t\t\t\t\tret = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99129:Expr_L428_C5", "label": "warning()", "type": "expression", "loc": [428, 428], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L427_C4", "vector": [8, 5, 0.6369, 0.0015, 5, 0.09, 0.0, 320, 3, 2, 0, 0, 0, 0, 2], "semantic": {"name": "warning", "arg_names": [], "import_names": [], "rhs_call_name": "warning", "annotation": ""}, "snippet": "\t\t\t\t\tlog.warning(r'<Check_4 Error> : Sheng/ZhiXiaShi : %s', self._dicItem.get_str())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99129:Assign_L429_C5", "label": "ret =", "type": "assigned_variable", "loc": [429, 429], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L427_C4", "vector": [14, 5, 0.6384, 0.0015, 5, 0.09, 1.0, 501, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "ret", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\t\t\tret = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L430_C3", "label": "if", "type": "if", "loc": [430, 445], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L426_C3", "vector": [4, 4, 0.651, 0.0238, 4, 0.22, 1.0, 0, 0, 0, 0, 0, 0, 0, 7], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\telif type == 'Di':\n\t\t\t\tif bits[2] != True or bits[6] == True:\n\t\t\t\t\tlog.warning(r'<Check_4 Error> next level info : Di : %s', self._dicItem.get_str())\n\t\t\t\t\tret = False\n\t\t\telif type == 'Xian' or type == 'Qu':\n\t\t\t\tif bits[3] != True or bits[6] == True:\n\t\t\t\t\tlog.warning(r'<Check_4 Error> next level info : Xian : %s', self._dicItem.get_str())\n\t\t\t\t\tret = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L431_C4", "label": "if", "type": "if", "loc": [431, 433], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L430_C3", "vector": [4, 5, 0.6429, 0.0045, 5, 0.78, 0.0, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\t\tif bits[2] != True or bits[6] == True:\n\t\t\t\t\tlog.warning(r'<Check_4 Error> next level info : Di : %s', self._dicItem.get_str())\n\t\t\t\t\tret = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99129:Expr_L432_C5", "label": "warning()", "type": "expression", "loc": [432, 432], "level": 6, "parent": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L431_C4", "vector": [8, 6, 0.6429, 0.0015, 6, 0.2, 0.0, 320, 3, 2, 0, 0, 0, 0, 2], "semantic": {"name": "warning", "arg_names": [], "import_names": [], "rhs_call_name": "warning", "annotation": ""}, "snippet": "\t\t\t\t\tlog.warning(r'<Check_4 Error> next level info : Di : %s', self._dicItem.get_str())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99129:Assign_L433_C5", "label": "ret =", "type": "assigned_variable", "loc": [433, 433], "level": 6, "parent": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L431_C4", "vector": [14, 6, 0.6443, 0.0015, 6, 0.2, 1.0, 501, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "ret", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\t\t\tret = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L434_C3", "label": "if", "type": "if", "loc": [434, 445], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L430_C3", "vector": [4, 5, 0.654, 0.0179, 5, 0.78, 1.0, 0, 0, 0, 0, 0, 0, 0, 5], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\telif type == 'Xian' or type == 'Qu':\n\t\t\t\tif bits[3] != True or bits[6] == True:\n\t\t\t\t\tlog.warning(r'<Check_4 Error> next level info : Xian : %s', self._dicItem.get_str())\n\t\t\t\t\tret = False\n\t\t\telif type == 'Lu':\n\t\t\t\tif bits[4] != True:\n\t\t\t\t\tlog.warning(r'<Check_4 Error> next level info : Lu : %s', self._dicItem.get_str())\n\t\t\t\t\tret = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L435_C4", "label": "if", "type": "if", "loc": [435, 437], "level": 6, "parent": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L434_C3", "vector": [4, 6, 0.6488, 0.0045, 6, 0.17, 0.0, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\t\tif bits[3] != True or bits[6] == True:\n\t\t\t\t\tlog.warning(r'<Check_4 Error> next level info : Xian : %s', self._dicItem.get_str())\n\t\t\t\t\tret = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99129:Expr_L436_C5", "label": "warning()", "type": "expression", "loc": [436, 436], "level": 7, "parent": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L435_C4", "vector": [8, 7, 0.6488, 0.0015, 7, 0.34, 0.0, 320, 3, 2, 0, 0, 0, 0, 2], "semantic": {"name": "warning", "arg_names": [], "import_names": [], "rhs_call_name": "warning", "annotation": ""}, "snippet": "\t\t\t\t\tlog.warning(r'<Check_4 Error> next level info : Xian : %s', self._dicItem.get_str())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99129:Assign_L437_C5", "label": "ret =", "type": "assigned_variable", "loc": [437, 437], "level": 7, "parent": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L435_C4", "vector": [14, 7, 0.6503, 0.0015, 7, 0.34, 1.0, 501, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "ret", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\t\t\tret = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L438_C3", "label": "if", "type": "if", "loc": [438, 445], "level": 6, "parent": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L434_C3", "vector": [4, 6, 0.657, 0.0119, 6, 0.17, 1.0, 0, 0, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\telif type == 'Lu':\n\t\t\t\tif bits[4] != True:\n\t\t\t\t\tlog.warning(r'<Check_4 Error> next level info : Lu : %s', self._dicItem.get_str())\n\t\t\t\t\tret = False\n\t\t\telif type == 'QuanYu':\n\t\t\t\tpass\n\t\t\telse:\n\t\t\t\traise KeyError()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L439_C4", "label": "if", "type": "if", "loc": [439, 441], "level": 7, "parent": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L438_C3", "vector": [4, 7, 0.6548, 0.0045, 7, 0.48, 0.0, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\t\tif bits[4] != True:\n\t\t\t\t\tlog.warning(r'<Check_4 Error> next level info : Lu : %s', self._dicItem.get_str())\n\t\t\t\t\tret = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99129:Expr_L440_C5", "label": "warning()", "type": "expression", "loc": [440, 440], "level": 8, "parent": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L439_C4", "vector": [8, 8, 0.6548, 0.0015, 8, 0.04, 0.0, 320, 3, 2, 0, 0, 0, 0, 2], "semantic": {"name": "warning", "arg_names": [], "import_names": [], "rhs_call_name": "warning", "annotation": ""}, "snippet": "\t\t\t\t\tlog.warning(r'<Check_4 Error> next level info : Lu : %s', self._dicItem.get_str())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99129:Assign_L441_C5", "label": "ret =", "type": "assigned_variable", "loc": [441, 441], "level": 8, "parent": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L439_C4", "vector": [14, 8, 0.6562, 0.0015, 8, 0.04, 1.0, 501, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "ret", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\t\t\tret = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L442_C3", "label": "if", "type": "if", "loc": [442, 445], "level": 7, "parent": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L438_C3", "vector": [4, 7, 0.66, 0.006, 7, 0.48, 1.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\telif type == 'QuanYu':\n\t\t\t\tpass\n\t\t\telse:\n\t\t\t\traise KeyError()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L446_C2", "label": "if", "type": "if", "loc": [446, 453], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L407_C1", "vector": [4, 2, 0.6689, 0.0119, 2, 0.76, 0.8889, 0, 0, 0, 0, 0, 0, 0, 5], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tif self._dicItem.get_type() == 'QuanYu':\n\t\t\tif bits[6] != True:\n\t\t\t\tlog.warning(r'<Check_4 Error> next level info : QuanYu Road Check Error : %s', self._dicItem.get_str())\n\t\t\t\tret = False\n\t\telse:\n\t\t\tif bits[6] == True:\n\t\t\t\tlog.warning(r'<Check_4 Error> next level info : QuanYu Road Check Error : %s', self._dicItem.get_str())\n\t\t\t\tret = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L447_C3", "label": "if", "type": "if", "loc": [447, 449], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L446_C2", "vector": [4, 3, 0.6667, 0.0045, 3, 0.87, 0.0, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\tif bits[6] != True:\n\t\t\t\tlog.warning(r'<Check_4 Error> next level info : QuanYu Road Check Error : %s', self._dicItem.get_str())\n\t\t\t\tret = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99129:Expr_L448_C4", "label": "warning()", "type": "expression", "loc": [448, 448], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L447_C3", "vector": [8, 4, 0.6667, 0.0015, 4, 0.29, 0.0, 320, 3, 2, 0, 0, 0, 0, 2], "semantic": {"name": "warning", "arg_names": [], "import_names": [], "rhs_call_name": "warning", "annotation": ""}, "snippet": "\t\t\t\tlog.warning(r'<Check_4 Error> next level info : QuanYu Road Check Error : %s', self._dicItem.get_str())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99129:Assign_L449_C4", "label": "ret =", "type": "assigned_variable", "loc": [449, 449], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L447_C3", "vector": [14, 4, 0.6682, 0.0015, 4, 0.29, 1.0, 501, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "ret", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\t\tret = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L451_C3", "label": "if", "type": "if", "loc": [451, 453], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L446_C2", "vector": [4, 3, 0.6726, 0.0045, 3, 0.87, 1.0, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\tif bits[6] == True:\n\t\t\t\tlog.warning(r'<Check_4 Error> next level info : QuanYu Road Check Error : %s', self._dicItem.get_str())\n\t\t\t\tret = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99129:Expr_L452_C4", "label": "warning()", "type": "expression", "loc": [452, 452], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L451_C3", "vector": [8, 4, 0.6726, 0.0015, 4, 0.71, 0.0, 320, 3, 2, 0, 0, 0, 0, 2], "semantic": {"name": "warning", "arg_names": [], "import_names": [], "rhs_call_name": "warning", "annotation": ""}, "snippet": "\t\t\t\tlog.warning(r'<Check_4 Error> next level info : QuanYu Road Check Error : %s', self._dicItem.get_str())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99129:Assign_L453_C4", "label": "ret =", "type": "assigned_variable", "loc": [453, 453], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L451_C3", "vector": [14, 4, 0.6741, 0.0015, 4, 0.71, 1.0, 501, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "ret", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\t\tret = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99129:Return_L454_C2", "label": "return", "type": "return", "loc": [454, 454], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L407_C1", "vector": [13, 2, 0.6756, 0.0015, 2, 0.76, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\treturn ret"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L456_C1", "label": "_check_5", "type": "function", "loc": [456, 464], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99129:ClassDef_L299_C0", "vector": [2, 1, 0.6845, 0.0134, 1, 0.91, 0.5, 692, 0, 1, 1, 0, 0, 0, 5], "semantic": {"name": "_check_5", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tdef _check_5(self):\n\t\t\"\"\"Check offset equals to kiwi data.\n\t\t\"\"\"\n\t\tif int(self._dicItem['offset'], 16) == \\\n\t\t\t\tself._dicItem.fetch_kiwi_record()['offset']:\n\t\t\treturn True\n\t\telse:\n\t\t\tlog.warning(r'<Check_5 Error> offset : %s : %s', self._dicItem.get_father()['nextLevelId'], self._dicItem.get_str())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99129:Expr_L457_C2", "label": "expression", "type": "expression", "loc": [457, 458], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L456_C1", "vector": [8, 2, 0.6808, 0.003, 2, 0.85, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\"\"\"Check offset equals to kiwi data.\n\t\t\"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L459_C2", "label": "if", "type": "if", "loc": [459, 464], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L456_C1", "vector": [4, 2, 0.6868, 0.0089, 2, 0.85, 1.0, 0, 0, 0, 0, 0, 0, 0, 5], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tif int(self._dicItem['offset'], 16) == \\\n\t\t\t\tself._dicItem.fetch_kiwi_record()['offset']:\n\t\t\treturn True\n\t\telse:\n\t\t\tlog.warning(r'<Check_5 Error> offset : %s : %s', self._dicItem.get_father()['nextLevelId'], self._dicItem.get_str())\n\t\t\treturn False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99129:Return_L461_C3", "label": "return", "type": "return", "loc": [461, 461], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L459_C2", "vector": [13, 3, 0.686, 0.0015, 3, 0.85, 0.0, 0, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\treturn True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99129:Expr_L463_C3", "label": "warning()", "type": "expression", "loc": [463, 463], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L459_C2", "vector": [8, 3, 0.689, 0.0015, 3, 0.85, 0.5, 320, 3, 3, 0, 0, 0, 0, 3], "semantic": {"name": "warning", "arg_names": [], "import_names": [], "rhs_call_name": "warning", "annotation": ""}, "snippet": "\t\t\tlog.warning(r'<Check_5 Error> offset : %s : %s', self._dicItem.get_father()['nextLevelId'], self._dicItem.get_str())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99129:Return_L464_C3", "label": "return", "type": "return", "loc": [464, 464], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L459_C2", "vector": [13, 3, 0.6905, 0.0015, 3, 0.85, 1.0, 0, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\treturn False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L466_C1", "label": "_check_6", "type": "function", "loc": [466, 478], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99129:ClassDef_L299_C0", "vector": [2, 1, 0.7024, 0.0193, 1, 0.91, 0.5417, 30, 0, 1, 1, 0, 0, 0, 4], "semantic": {"name": "_check_6", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tdef _check_6(self):\n\t\t\"\"\"Check voice id.\n\t\t\"\"\"\n\t\tvoiceId = int(self._dicItem['voiceId'], 16)\n\t\tif voiceId == 0xffffffff:\n\t\t\tvoiceId = 0\n\t\tkVoiceId = self._dicItem.fetch_kiwi_record()['voiceId']\n\t\tif voiceId == kVoiceId:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99129:Expr_L467_C2", "label": "expression", "type": "expression", "loc": [467, 468], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L466_C1", "vector": [8, 2, 0.6957, 0.003, 2, 0.48, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\"\"\"Check voice id.\n\t\t\"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99129:Assign_L469_C2", "label": "voiceId = int()", "type": "assigned_variable", "loc": [469, 469], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L466_C1", "vector": [14, 2, 0.6979, 0.0015, 2, 0.48, 0.2, 3, 3, 2, 0, 0, 901, 10, 1], "semantic": {"name": "voiceId", "arg_names": [], "import_names": [], "rhs_call_name": "int", "annotation": ""}, "snippet": "\t\tvoiceId = int(self._dicItem['voiceId'], 16)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L470_C2", "label": "if", "type": "if", "loc": [470, 471], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L466_C1", "vector": [4, 2, 0.7001, 0.003, 2, 0.48, 0.4, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tif voiceId == 0xffffffff:\n\t\t\tvoiceId = 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99129:Assign_L471_C3", "label": "voiceId =", "type": "assigned_variable", "loc": [471, 471], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L470_C2", "vector": [14, 3, 0.7009, 0.0015, 3, 0.95, 0.0, 3, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "voiceId", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\tvoiceId = 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99129:Assign_L472_C2", "label": "kVoiceId =", "type": "assigned_variable", "loc": [472, 472], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L466_C1", "vector": [14, 2, 0.7024, 0.0015, 2, 0.48, 0.6, 192, 6, 0, 0, 0, 0, 0, 1], "semantic": {"name": "kVoiceId", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tkVoiceId = self._dicItem.fetch_kiwi_record()['voiceId']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L473_C2", "label": "if", "type": "if", "loc": [473, 477], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L466_C1", "vector": [4, 2, 0.7068, 0.0074, 2, 0.48, 0.8, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tif voiceId == kVoiceId:\n\t\t\treturn True\n\t\telse:\n\t\t\tlog.warning(r'<Check_6 Error> voice id : %s', self._dicItem.get_str())\n\t\t\treturn False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99129:Return_L474_C3", "label": "return", "type": "return", "loc": [474, 474], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L473_C2", "vector": [13, 3, 0.7054, 0.0015, 3, 0.55, 0.0, 0, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\treturn True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99129:Expr_L476_C3", "label": "warning()", "type": "expression", "loc": [476, 476], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L473_C2", "vector": [8, 3, 0.7083, 0.0015, 3, 0.55, 0.5, 320, 3, 2, 0, 0, 0, 0, 2], "semantic": {"name": "warning", "arg_names": [], "import_names": [], "rhs_call_name": "warning", "annotation": ""}, "snippet": "\t\t\tlog.warning(r'<Check_6 Error> voice id : %s', self._dicItem.get_str())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99129:Return_L477_C3", "label": "return", "type": "return", "loc": [477, 477], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L473_C2", "vector": [13, 3, 0.7098, 0.0015, 3, 0.55, 1.0, 0, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\treturn False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99129:Return_L478_C2", "label": "return", "type": "return", "loc": [478, 478], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L466_C1", "vector": [13, 2, 0.7113, 0.0015, 2, 0.48, 1.0, 0, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\treturn True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L480_C1", "label": "_check_7", "type": "function", "loc": [480, 502], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99129:ClassDef_L299_C0", "vector": [2, 1, 0.7307, 0.0342, 1, 0.91, 0.5833, 377, 0, 1, 1, 0, 0, 0, 11], "semantic": {"name": "_check_7", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tdef _check_7(self):\n\t\t\"\"\"Check the number of next level places.\n\t\t\"\"\"\n\t\tnum = int(self._dicItem['nextLevelNum'], 16)\n\t\trealNum = num\n\t\tret = True\n\t\tif not self._dicItem.has_child():\n\t\t\t# if num != 0 !!"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99129:Expr_L481_C2", "label": "expression", "type": "expression", "loc": [481, 482], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L480_C1", "vector": [8, 2, 0.7165, 0.003, 2, 0.05, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\"\"\"Check the number of next level places.\n\t\t\"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99129:Assign_L483_C2", "label": "num = int()", "type": "assigned_variable", "loc": [483, 483], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L480_C1", "vector": [14, 2, 0.7188, 0.0015, 2, 0.05, 0.125, 328, 3, 2, 0, 0, 901, 10, 1], "semantic": {"name": "num", "arg_names": [], "import_names": [], "rhs_call_name": "int", "annotation": ""}, "snippet": "\t\tnum = int(self._dicItem['nextLevelNum'], 16)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99129:Assign_L484_C2", "label": "realNum =", "type": "assigned_variable", "loc": [484, 484], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L480_C1", "vector": [14, 2, 0.7202, 0.0015, 2, 0.05, 0.25, 821, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "realNum", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\trealNum = num"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99129:Assign_L485_C2", "label": "ret =", "type": "assigned_variable", "loc": [485, 485], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L480_C1", "vector": [14, 2, 0.7217, 0.0015, 2, 0.05, 0.375, 501, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "ret", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tret = True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L486_C2", "label": "if", "type": "if", "loc": [486, 493], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L480_C1", "vector": [4, 2, 0.7284, 0.0119, 2, 0.05, 0.5, 0, 0, 0, 0, 0, 0, 0, 6], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tif not self._dicItem.has_child():\n\t\t\t# if num != 0 !!\n\t\t\tif num != len(self._dicItem.get_children()):\n\t\t\t\tret = False\n\t\telse:\n\t\t\trealNum = len(set(r['offset'] for r in self._dicItem.get_children()))\n\t\t\tif num == 0 or realNum == 0 or realNum > num:\n\t\t\t\tret = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L488_C3", "label": "if", "type": "if", "loc": [488, 489], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L486_C2", "vector": [4, 3, 0.7269, 0.003, 3, 0.92, 0.0, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\tif num != len(self._dicItem.get_children()):\n\t\t\t\tret = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99129:Assign_L489_C4", "label": "ret =", "type": "assigned_variable", "loc": [489, 489], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L488_C3", "vector": [14, 4, 0.7277, 0.0015, 4, 0.41, 0.0, 501, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "ret", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\t\tret = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99129:Assign_L491_C3", "label": "realNum = len()", "type": "assigned_variable", "loc": [491, 491], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L486_C2", "vector": [14, 3, 0.7307, 0.0015, 3, 0.92, 0.5, 821, 3, 1, 0, 0, 890, 10, 3], "semantic": {"name": "realNum", "arg_names": [], "import_names": [], "rhs_call_name": "len", "annotation": ""}, "snippet": "\t\t\trealNum = len(set(r['offset'] for r in self._dicItem.get_children()))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L492_C3", "label": "if", "type": "if", "loc": [492, 493], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L486_C2", "vector": [4, 3, 0.7329, 0.003, 3, 0.92, 1.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\tif num == 0 or realNum == 0 or realNum > num:\n\t\t\t\tret = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99129:Assign_L493_C4", "label": "ret =", "type": "assigned_variable", "loc": [493, 493], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L492_C3", "vector": [14, 4, 0.7336, 0.0015, 4, 0.76, 0.0, 501, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "ret", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\t\tret = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99129:Try_L494_C2", "label": "try", "type": "try", "loc": [494, 497], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L480_C1", "vector": [7, 2, 0.7374, 0.006, 2, 0.05, 0.625, 0, 0, 1, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\ttry:\n\t\t\tknum = len(self._dicItem.fetch_kiwi_frame())\n\t\texcept KeyError:\n\t\t\tknum = 0;"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99129:Assign_L495_C3", "label": "knum = len()", "type": "assigned_variable", "loc": [495, 495], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99129:Try_L494_C2", "vector": [14, 3, 0.7366, 0.0015, 3, 0.07, 0.0, 340, 3, 1, 0, 0, 890, 10, 2], "semantic": {"name": "knum", "arg_names": [], "import_names": [], "rhs_call_name": "len", "annotation": ""}, "snippet": "\t\t\tknum = len(self._dicItem.fetch_kiwi_frame())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99129:Assign_L497_C3", "label": "knum =", "type": "assigned_variable", "loc": [497, 497], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99129:Try_L494_C2", "vector": [14, 3, 0.7396, 0.0015, 3, 0.07, 0.0, 340, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "knum", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\tknum = 0;"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L498_C2", "label": "if", "type": "if", "loc": [498, 499], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L480_C1", "vector": [4, 2, 0.7418, 0.003, 2, 0.05, 0.75, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tif realNum != knum:\n\t\t\tret = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99129:Assign_L499_C3", "label": "ret =", "type": "assigned_variable", "loc": [499, 499], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L498_C2", "vector": [14, 3, 0.7426, 0.0015, 3, 0.4, 0.0, 501, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "ret", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\tret = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L500_C2", "label": "if", "type": "if", "loc": [500, 501], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L480_C1", "vector": [4, 2, 0.7448, 0.003, 2, 0.05, 0.875, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tif not ret:\n\t\t\tlog.warning(r'<Check_7 Error> next level number : %s', self._dicItem.get_str())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99129:Expr_L501_C3", "label": "warning()", "type": "expression", "loc": [501, 501], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L500_C2", "vector": [8, 3, 0.7455, 0.0015, 3, 0.83, 0.0, 320, 3, 2, 0, 0, 0, 0, 2], "semantic": {"name": "warning", "arg_names": [], "import_names": [], "rhs_call_name": "warning", "annotation": ""}, "snippet": "\t\t\tlog.warning(r'<Check_7 Error> next level number : %s', self._dicItem.get_str())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99129:Return_L502_C2", "label": "return", "type": "return", "loc": [502, 502], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L480_C1", "vector": [13, 2, 0.747, 0.0015, 2, 0.05, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\treturn ret"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L504_C1", "label": "_check_8", "type": "function", "loc": [504, 507], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99129:ClassDef_L299_C0", "vector": [2, 1, 0.7522, 0.006, 1, 0.91, 0.625, 183, 0, 1, 1, 0, 0, 0, 0], "semantic": {"name": "_check_8", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tdef _check_8(self):\n\t\t\"\"\"Check replacename, which is already checked.\n\t\t\"\"\"\n\t\treturn True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99129:Expr_L505_C2", "label": "expression", "type": "expression", "loc": [505, 506], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L504_C1", "vector": [8, 2, 0.7522, 0.003, 2, 0.74, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\"\"\"Check replacename, which is already checked.\n\t\t\"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99129:Return_L507_C2", "label": "return", "type": "return", "loc": [507, 507], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L504_C1", "vector": [13, 2, 0.7545, 0.0015, 2, 0.74, 1.0, 0, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\treturn True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L509_C1", "label": "_check_9", "type": "function", "loc": [509, 516], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99129:ClassDef_L299_C0", "vector": [2, 1, 0.7626, 0.0119, 1, 0.91, 0.6667, 92, 0, 1, 1, 0, 0, 0, 4], "semantic": {"name": "_check_9", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tdef _check_9(self):\n\t\t\"\"\"Check others.\n\t\t\"\"\"\n\t\tr1 = self._check_9_1()\n\t\tr2 = self._check_9_2()\n\t\tr3 = self._check_9_3()\n\t\tr4 = self._check_9_4()\n\t\treturn r1 and r2 and r3 and r4"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99129:Expr_L510_C2", "label": "expression", "type": "expression", "loc": [510, 511], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L509_C1", "vector": [8, 2, 0.7597, 0.003, 2, 0.87, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\"\"\"Check others.\n\t\t\"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99129:Assign_L512_C2", "label": "r1 = _check_9_1()", "type": "assigned_variable", "loc": [512, 512], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L509_C1", "vector": [14, 2, 0.7619, 0.0015, 2, 0.87, 0.2, 648, 3, 0, 0, 0, 729, 10, 1], "semantic": {"name": "r1", "arg_names": [], "import_names": [], "rhs_call_name": "_check_9_1", "annotation": ""}, "snippet": "\t\tr1 = self._check_9_1()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99129:Assign_L513_C2", "label": "r2 = _check_9_2()", "type": "assigned_variable", "loc": [513, 513], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L509_C1", "vector": [14, 2, 0.7634, 0.0015, 2, 0.87, 0.4, 959, 3, 0, 0, 0, 83, 10, 1], "semantic": {"name": "r2", "arg_names": [], "import_names": [], "rhs_call_name": "_check_9_2", "annotation": ""}, "snippet": "\t\tr2 = self._check_9_2()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99129:Assign_L514_C2", "label": "r3 = _check_9_3()", "type": "assigned_variable", "loc": [514, 514], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L509_C1", "vector": [14, 2, 0.7649, 0.0015, 2, 0.87, 0.6, 837, 3, 0, 0, 0, 249, 10, 1], "semantic": {"name": "r3", "arg_names": [], "import_names": [], "rhs_call_name": "_check_9_3", "annotation": ""}, "snippet": "\t\tr3 = self._check_9_3()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99129:Assign_L515_C2", "label": "r4 = _check_9_4()", "type": "assigned_variable", "loc": [515, 515], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L509_C1", "vector": [14, 2, 0.7664, 0.0015, 2, 0.87, 0.8, 470, 3, 0, 0, 0, 811, 10, 1], "semantic": {"name": "r4", "arg_names": [], "import_names": [], "rhs_call_name": "_check_9_4", "annotation": ""}, "snippet": "\t\tr4 = self._check_9_4()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99129:Return_L516_C2", "label": "return", "type": "return", "loc": [516, 516], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L509_C1", "vector": [13, 2, 0.7679, 0.0015, 2, 0.87, 1.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\treturn r1 and r2 and r3 and r4"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L518_C1", "label": "_check_2_1", "type": "function", "loc": [518, 529], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99129:ClassDef_L299_C0", "vector": [2, 1, 0.779, 0.0179, 1, 0.91, 0.7083, 474, 0, 1, 1, 0, 0, 0, 1], "semantic": {"name": "_check_2_1", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tdef _check_2_1(self):\n\t\t\"\"\"Check if text has alphabet, then pinyin should be \"NoPinYin\"\n\t\t\"\"\"\n\t\tdef has_alphabet(s):\n\t\t\tfor c in s:\n\t\t\t\tif c in self.alphabets:\n\t\t\t\t\treturn True\n\t\t\treturn False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99129:Expr_L519_C2", "label": "expression", "type": "expression", "loc": [519, 520], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L518_C1", "vector": [8, 2, 0.7731, 0.003, 2, 0.67, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\"\"\"Check if text has alphabet, then pinyin should be \"NoPinYin\"\n\t\t\"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L521_C2", "label": "has_alphabet", "type": "function", "loc": [521, 525], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L518_C1", "vector": [2, 2, 0.7783, 0.0074, 2, 0.67, 0.3333, 135, 0, 1, 1, 0, 0, 0, 0], "semantic": {"name": "has_alphabet", "arg_names": ["s"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tdef has_alphabet(s):\n\t\t\tfor c in s:\n\t\t\t\tif c in self.alphabets:\n\t\t\t\t\treturn True\n\t\t\treturn False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99129:For_L522_C3", "label": "for c", "type": "for", "loc": [522, 524], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L521_C2", "vector": [6, 3, 0.7783, 0.0045, 3, 0.55, 0.0, 411, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "c", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\tfor c in s:\n\t\t\t\tif c in self.alphabets:\n\t\t\t\t\treturn True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L523_C4", "label": "if", "type": "if", "loc": [523, 524], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99129:For_L522_C3", "vector": [4, 4, 0.779, 0.003, 4, 0.11, 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 c in self.alphabets:\n\t\t\t\t\treturn True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99129:Return_L524_C5", "label": "return", "type": "return", "loc": [524, 524], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L523_C4", "vector": [13, 5, 0.7798, 0.0015, 5, 0.92, 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\treturn True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99129:Return_L525_C3", "label": "return", "type": "return", "loc": [525, 525], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L521_C2", "vector": [13, 3, 0.7812, 0.0015, 3, 0.55, 1.0, 0, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\treturn False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L526_C2", "label": "if", "type": "if", "loc": [526, 528], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L518_C1", "vector": [4, 2, 0.7842, 0.0045, 2, 0.67, 0.6667, 0, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tif has_alphabet(self._dicItem['name']):\n\t\t\tif self._dicItem['pinyin'] != u'NoPinYin':\n\t\t\t\treturn False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L527_C3", "label": "if", "type": "if", "loc": [527, 528], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L526_C2", "vector": [4, 3, 0.785, 0.003, 3, 0.21, 0.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\tif self._dicItem['pinyin'] != u'NoPinYin':\n\t\t\t\treturn False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99129:Return_L528_C4", "label": "return", "type": "return", "loc": [528, 528], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L527_C3", "vector": [13, 4, 0.7857, 0.0015, 4, 0.89, 0.0, 0, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\t\treturn False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99129:Return_L529_C2", "label": "return", "type": "return", "loc": [529, 529], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L518_C1", "vector": [13, 2, 0.7872, 0.0015, 2, 0.67, 1.0, 0, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\treturn True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L531_C1", "label": "_check_2_2", "type": "function", "loc": [531, 540], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99129:ClassDef_L299_C0", "vector": [2, 1, 0.7969, 0.0149, 1, 0.91, 0.75, 16, 0, 1, 1, 0, 0, 0, 0], "semantic": {"name": "_check_2_2", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tdef _check_2_2(self):\n\t\t\"\"\"Check characters in pinyin\n\t\t\"\"\"\n\t\tpinyin = self._dicItem['pinyin']\n\t\tif pinyin == 'NoPinYin':\n\t\t\treturn True\n\t\tfor c in pinyin:\n\t\t\tif not c in self.pinyinChars:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99129:Expr_L532_C2", "label": "expression", "type": "expression", "loc": [532, 533], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L531_C1", "vector": [8, 2, 0.7924, 0.003, 2, 0.54, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\"\"\"Check characters in pinyin\n\t\t\"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99129:Assign_L534_C2", "label": "pinyin =", "type": "assigned_variable", "loc": [534, 534], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L531_C1", "vector": [14, 2, 0.7946, 0.0015, 2, 0.54, 0.25, 546, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "pinyin", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tpinyin = self._dicItem['pinyin']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L535_C2", "label": "if", "type": "if", "loc": [535, 536], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L531_C1", "vector": [4, 2, 0.7969, 0.003, 2, 0.54, 0.5, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tif pinyin == 'NoPinYin':\n\t\t\treturn True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99129:Return_L536_C3", "label": "return", "type": "return", "loc": [536, 536], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L535_C2", "vector": [13, 3, 0.7976, 0.0015, 3, 0.8, 0.0, 0, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\treturn True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99129:For_L537_C2", "label": "for c", "type": "for", "loc": [537, 539], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L531_C1", "vector": [6, 2, 0.8006, 0.0045, 2, 0.54, 0.75, 411, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "c", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tfor c in pinyin:\n\t\t\tif not c in self.pinyinChars:\n\t\t\t\treturn False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L538_C3", "label": "if", "type": "if", "loc": [538, 539], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99129:For_L537_C2", "vector": [4, 3, 0.8013, 0.003, 3, 0.9, 0.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\tif not c in self.pinyinChars:\n\t\t\t\treturn False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99129:Return_L539_C4", "label": "return", "type": "return", "loc": [539, 539], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L538_C3", "vector": [13, 4, 0.8021, 0.0015, 4, 0.78, 0.0, 0, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\t\treturn False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99129:Return_L540_C2", "label": "return", "type": "return", "loc": [540, 540], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L531_C1", "vector": [13, 2, 0.8036, 0.0015, 2, 0.54, 1.0, 0, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\treturn True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L542_C1", "label": "_check_3_1", "type": "function", "loc": [542, 568], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99129:ClassDef_L299_C0", "vector": [2, 1, 0.8259, 0.0402, 1, 0.91, 0.7917, 620, 0, 1, 1, 0, 0, 0, 12], "semantic": {"name": "_check_3_1", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tdef _check_3_1(self):\n\t\t\"\"\"Check next level id and if next level file exists\n\t\t\"\"\"\n\t\td = self._dicItem\n\t\ttry:\n\t\t\tk = d.fetch_kiwi_record()\n\t\texcept:\n\t\t\tlog.warning(r'<Fetch Kiwi Record Error> : %s', d.get_str())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99129:Expr_L543_C2", "label": "expression", "type": "expression", "loc": [543, 544], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L542_C1", "vector": [8, 2, 0.8088, 0.003, 2, 0.15, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\"\"\"Check next level id and if next level file exists\n\t\t\"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99129:Assign_L545_C2", "label": "d =", "type": "assigned_variable", "loc": [545, 545], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L542_C1", "vector": [14, 2, 0.811, 0.0015, 2, 0.15, 0.125, 355, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "d", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\td = self._dicItem"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99129:Try_L546_C2", "label": "try", "type": "try", "loc": [546, 550], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L542_C1", "vector": [7, 2, 0.8155, 0.0074, 2, 0.15, 0.25, 0, 0, 1, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\ttry:\n\t\t\tk = d.fetch_kiwi_record()\n\t\texcept:\n\t\t\tlog.warning(r'<Fetch Kiwi Record Error> : %s', d.get_str())\n\t\t\treturn False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99129:Assign_L547_C3", "label": "k = fetch_kiwi_record()", "type": "assigned_variable", "loc": [547, 547], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99129:Try_L546_C2", "vector": [14, 3, 0.814, 0.0015, 3, 0.31, 0.0, 954, 3, 0, 0, 0, 289, 10, 1], "semantic": {"name": "k", "arg_names": [], "import_names": [], "rhs_call_name": "fetch_kiwi_record", "annotation": ""}, "snippet": "\t\t\tk = d.fetch_kiwi_record()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99129:Expr_L549_C3", "label": "warning()", "type": "expression", "loc": [549, 549], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99129:Try_L546_C2", "vector": [8, 3, 0.817, 0.0015, 3, 0.31, 0.0, 320, 3, 2, 0, 0, 0, 0, 2], "semantic": {"name": "warning", "arg_names": [], "import_names": [], "rhs_call_name": "warning", "annotation": ""}, "snippet": "\t\t\tlog.warning(r'<Fetch Kiwi Record Error> : %s', d.get_str())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99129:Return_L550_C3", "label": "return", "type": "return", "loc": [550, 550], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99129:Try_L546_C2", "vector": [13, 3, 0.8185, 0.0015, 3, 0.31, 1.0, 0, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\treturn False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99129:Assign_L551_C2", "label": "nextLevelId =", "type": "assigned_variable", "loc": [551, 551], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L542_C1", "vector": [14, 2, 0.8199, 0.0015, 2, 0.15, 0.375, 915, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "nextLevelId", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tnextLevelId = d['nextLevelId']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L552_C2", "label": "if", "type": "if", "loc": [552, 559], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L542_C1", "vector": [4, 2, 0.8266, 0.0119, 2, 0.15, 0.5, 0, 0, 0, 0, 0, 0, 0, 5], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tif not k.has_next_level():\n\t\t\tif nextLevelId != '0xFFFFFFFF':\n\t\t\t\tlog.warning(r'<Check_3_1 - Has Next Level Error> : %s', d.get_str())\n\t\t\t\t# do not return now, go on checking\n\t\t\treturn True\n\t\telse:\n\t\t\tif nextLevelId == '0xFFFFFFFF':\n\t\t\t\tlog.warning(r'<Check_3_1 - Has Next Level Error> : %s', d.get_str())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L553_C3", "label": "if", "type": "if", "loc": [553, 554], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L552_C2", "vector": [4, 3, 0.8237, 0.003, 3, 0.69, 0.0, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\tif nextLevelId != '0xFFFFFFFF':\n\t\t\t\tlog.warning(r'<Check_3_1 - Has Next Level Error> : %s', d.get_str())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99129:Expr_L554_C4", "label": "warning()", "type": "expression", "loc": [554, 554], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L553_C3", "vector": [8, 4, 0.8244, 0.0015, 4, 0.11, 0.0, 320, 3, 2, 0, 0, 0, 0, 2], "semantic": {"name": "warning", "arg_names": [], "import_names": [], "rhs_call_name": "warning", "annotation": ""}, "snippet": "\t\t\t\tlog.warning(r'<Check_3_1 - Has Next Level Error> : %s', d.get_str())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99129:Return_L556_C3", "label": "return", "type": "return", "loc": [556, 556], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L552_C2", "vector": [13, 3, 0.8274, 0.0015, 3, 0.69, 0.5, 0, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\treturn True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L558_C3", "label": "if", "type": "if", "loc": [558, 559], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L552_C2", "vector": [4, 3, 0.8311, 0.003, 3, 0.69, 1.0, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\tif nextLevelId == '0xFFFFFFFF':\n\t\t\t\tlog.warning(r'<Check_3_1 - Has Next Level Error> : %s', d.get_str())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99129:Expr_L559_C4", "label": "warning()", "type": "expression", "loc": [559, 559], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L558_C3", "vector": [8, 4, 0.8318, 0.0015, 4, 0.3, 0.0, 320, 3, 2, 0, 0, 0, 0, 2], "semantic": {"name": "warning", "arg_names": [], "import_names": [], "rhs_call_name": "warning", "annotation": ""}, "snippet": "\t\t\t\tlog.warning(r'<Check_3_1 - Has Next Level Error> : %s', d.get_str())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99129:Assign_L562_C2", "label": "filename =", "type": "assigned_variable", "loc": [562, 562], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L542_C1", "vector": [14, 2, 0.8363, 0.0015, 2, 0.15, 0.625, 275, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "filename", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tfilename = nextLevelId[2:]+'.txt'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99129:Assign_L563_C2", "label": "filepath = join()", "type": "assigned_variable", "loc": [563, 563], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L542_C1", "vector": [14, 2, 0.8378, 0.0015, 2, 0.15, 0.75, 137, 3, 2, 0, 0, 933, 10, 1], "semantic": {"name": "filepath", "arg_names": [], "import_names": [], "rhs_call_name": "join", "annotation": ""}, "snippet": "\t\tfilepath = os.path.join(d._folder, filename)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L564_C2", "label": "if", "type": "if", "loc": [564, 567], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L542_C1", "vector": [4, 2, 0.8415, 0.006, 2, 0.15, 0.875, 0, 0, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tif not os.path.isfile(filepath):\n\t\t\t# file not exist\n\t\t\tlog.warning(r'<Check_3_1 - File Not Exists Error> : %s', d.get_str())\n\t\t\treturn False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99129:Expr_L566_C3", "label": "warning()", "type": "expression", "loc": [566, 566], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L564_C2", "vector": [8, 3, 0.8423, 0.0015, 3, 0.22, 0.0, 320, 3, 2, 0, 0, 0, 0, 2], "semantic": {"name": "warning", "arg_names": [], "import_names": [], "rhs_call_name": "warning", "annotation": ""}, "snippet": "\t\t\tlog.warning(r'<Check_3_1 - File Not Exists Error> : %s', d.get_str())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99129:Return_L567_C3", "label": "return", "type": "return", "loc": [567, 567], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L564_C2", "vector": [13, 3, 0.8438, 0.0015, 3, 0.22, 1.0, 0, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\treturn False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99129:Return_L568_C2", "label": "return", "type": "return", "loc": [568, 568], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L542_C1", "vector": [13, 2, 0.8452, 0.0015, 2, 0.15, 1.0, 0, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\treturn True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L570_C1", "label": "_check_3_2", "type": "function", "loc": [570, 609], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99129:ClassDef_L299_C0", "vector": [2, 1, 0.8772, 0.0595, 1, 0.91, 0.8333, 777, 0, 1, 1, 0, 0, 0, 18], "semantic": {"name": "_check_3_2", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tdef _check_3_2(self):\n\t\t\"\"\"Check if [next level id] corresponds with higher-level\n\t\t\"\"\"\n\t\td = self._dicItem\n\t\t# road, checked in check_3_1\n\t\tif not d.has_child():\n\t\t\treturn True\n\t\t# province"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99129:Expr_L571_C2", "label": "expression", "type": "expression", "loc": [571, 572], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L570_C1", "vector": [8, 2, 0.8504, 0.003, 2, 0.81, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\"\"\"Check if [next level id] corresponds with higher-level\n\t\t\"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99129:Assign_L573_C2", "label": "d =", "type": "assigned_variable", "loc": [573, 573], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L570_C1", "vector": [14, 2, 0.8527, 0.0015, 2, 0.81, 0.1111, 355, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "d", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\td = self._dicItem"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L575_C2", "label": "if", "type": "if", "loc": [575, 576], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L570_C1", "vector": [4, 2, 0.8564, 0.003, 2, 0.81, 0.2222, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tif not d.has_child():\n\t\t\treturn True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99129:Return_L576_C3", "label": "return", "type": "return", "loc": [576, 576], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L575_C2", "vector": [13, 3, 0.8571, 0.0015, 3, 0.48, 0.0, 0, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\treturn True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99129:Assign_L578_C2", "label": "type = get_type()", "type": "assigned_variable", "loc": [578, 578], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L570_C1", "vector": [14, 2, 0.8601, 0.0015, 2, 0.81, 0.3333, 801, 3, 0, 0, 0, 606, 10, 1], "semantic": {"name": "type", "arg_names": [], "import_names": [], "rhs_call_name": "get_type", "annotation": ""}, "snippet": "\t\ttype = d.get_type()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99129:Assign_L579_C2", "label": "fId =", "type": "assigned_variable", "loc": [579, 579], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L570_C1", "vector": [14, 2, 0.8616, 0.0015, 2, 0.81, 0.4444, 450, 6, 0, 0, 0, 0, 0, 1], "semantic": {"name": "fId", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tfId = d.get_father()['nextLevelId']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99129:Assign_L580_C2", "label": "Id =", "type": "assigned_variable", "loc": [580, 580], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L570_C1", "vector": [14, 2, 0.8631, 0.0015, 2, 0.81, 0.5556, 779, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "Id", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tId = d['nextLevelId']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99129:Assign_L582_C2", "label": "ifId = int()", "type": "assigned_variable", "loc": [582, 582], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L570_C1", "vector": [14, 2, 0.8661, 0.0015, 2, 0.81, 0.6667, 189, 3, 2, 0, 0, 901, 10, 1], "semantic": {"name": "ifId", "arg_names": [], "import_names": [], "rhs_call_name": "int", "annotation": ""}, "snippet": "\t\tifId = int(fId, 16)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99129:Assign_L583_C2", "label": "iId = int()", "type": "assigned_variable", "loc": [583, 583], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L570_C1", "vector": [14, 2, 0.8676, 0.0015, 2, 0.81, 0.7778, 64, 3, 2, 0, 0, 901, 10, 1], "semantic": {"name": "iId", "arg_names": [], "import_names": [], "rhs_call_name": "int", "annotation": ""}, "snippet": "\t\tiId = int(Id, 16)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L584_C2", "label": "if", "type": "if", "loc": [584, 586], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L570_C1", "vector": [4, 2, 0.8705, 0.0045, 2, 0.81, 0.8889, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tif fId != '0x80000001':\n\t\t\tif ifId & iId != ifId or ifId | iId != iId or ifId == iId:\n\t\t\t\tlog.warning(r'<Check_3_2 Error> : %s', d.get_str())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L585_C3", "label": "if", "type": "if", "loc": [585, 586], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L584_C2", "vector": [4, 3, 0.8713, 0.003, 3, 0.45, 0.0, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\tif ifId & iId != ifId or ifId | iId != iId or ifId == iId:\n\t\t\t\tlog.warning(r'<Check_3_2 Error> : %s', d.get_str())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99129:Expr_L586_C4", "label": "warning()", "type": "expression", "loc": [586, 586], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L585_C3", "vector": [8, 4, 0.872, 0.0015, 4, 0.38, 0.0, 320, 3, 2, 0, 0, 0, 0, 2], "semantic": {"name": "warning", "arg_names": [], "import_names": [], "rhs_call_name": "warning", "annotation": ""}, "snippet": "\t\t\t\tlog.warning(r'<Check_3_2 Error> : %s', d.get_str())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L588_C2", "label": "if", "type": "if", "loc": [588, 609], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L570_C1", "vector": [4, 2, 0.8906, 0.0327, 2, 0.81, 1.0, 0, 0, 0, 0, 0, 0, 0, 11], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tif type == 'Sheng' or type == 'ZhiXiaShi':\n\t\t\tif re.match(r'0x8[\\dA-F]{2}00000', Id) and Id != '0x80000000':\n\t\t\t\treturn True\n\t\t\telse:\n\t\t\t\tlog.warning(r'<Check_3_2 Error> : Sheng/ZhiXiaShi : %s', d.get_str())\n\t\t\t\treturn False\n\t\telif type == 'Di':\n\t\t\tif re.match(fId[:5] + r'[\\dA-F]{2}000', Id) and Id != fId:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L589_C3", "label": "if", "type": "if", "loc": [589, 593], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L588_C2", "vector": [4, 3, 0.8795, 0.0074, 3, 0.34, 0.0, 0, 0, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\tif re.match(r'0x8[\\dA-F]{2}00000', Id) and Id != '0x80000000':\n\t\t\t\treturn True\n\t\t\telse:\n\t\t\t\tlog.warning(r'<Check_3_2 Error> : Sheng/ZhiXiaShi : %s', d.get_str())\n\t\t\t\treturn False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99129:Return_L590_C4", "label": "return", "type": "return", "loc": [590, 590], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L589_C3", "vector": [13, 4, 0.878, 0.0015, 4, 0.75, 0.0, 0, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\t\treturn True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99129:Expr_L592_C4", "label": "warning()", "type": "expression", "loc": [592, 592], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L589_C3", "vector": [8, 4, 0.881, 0.0015, 4, 0.75, 0.5, 320, 3, 2, 0, 0, 0, 0, 2], "semantic": {"name": "warning", "arg_names": [], "import_names": [], "rhs_call_name": "warning", "annotation": ""}, "snippet": "\t\t\t\tlog.warning(r'<Check_3_2 Error> : Sheng/ZhiXiaShi : %s', d.get_str())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99129:Return_L593_C4", "label": "return", "type": "return", "loc": [593, 593], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L589_C3", "vector": [13, 4, 0.8824, 0.0015, 4, 0.75, 1.0, 0, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\t\treturn False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L594_C2", "label": "if", "type": "if", "loc": [594, 609], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L588_C2", "vector": [4, 3, 0.8951, 0.0238, 3, 0.34, 1.0, 0, 0, 0, 0, 0, 0, 0, 8], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\telif type == 'Di':\n\t\t\tif re.match(fId[:5] + r'[\\dA-F]{2}000', Id) and Id != fId:\n\t\t\t\treturn True\n\t\t\telse:\n\t\t\t\tlog.warning(r'<Check_3_2 Error> : Di : %s', d.get_str())\n\t\t\t\treturn False\n\t\telif type == 'Xian' or type == 'Qu':\n\t\t\tif re.match(fId[:7] + r'[\\dA-F]{3}', Id) and Id != fId:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L595_C3", "label": "if", "type": "if", "loc": [595, 599], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L594_C2", "vector": [4, 4, 0.8884, 0.0074, 4, 0.37, 0.0, 0, 0, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\tif re.match(fId[:5] + r'[\\dA-F]{2}000', Id) and Id != fId:\n\t\t\t\treturn True\n\t\t\telse:\n\t\t\t\tlog.warning(r'<Check_3_2 Error> : Di : %s', d.get_str())\n\t\t\t\treturn False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99129:Return_L596_C4", "label": "return", "type": "return", "loc": [596, 596], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L595_C3", "vector": [13, 5, 0.8869, 0.0015, 5, 0.86, 0.0, 0, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\t\treturn True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99129:Expr_L598_C4", "label": "warning()", "type": "expression", "loc": [598, 598], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L595_C3", "vector": [8, 5, 0.8899, 0.0015, 5, 0.86, 0.5, 320, 3, 2, 0, 0, 0, 0, 2], "semantic": {"name": "warning", "arg_names": [], "import_names": [], "rhs_call_name": "warning", "annotation": ""}, "snippet": "\t\t\t\tlog.warning(r'<Check_3_2 Error> : Di : %s', d.get_str())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99129:Return_L599_C4", "label": "return", "type": "return", "loc": [599, 599], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L595_C3", "vector": [13, 5, 0.8914, 0.0015, 5, 0.86, 1.0, 0, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\t\treturn False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L600_C2", "label": "if", "type": "if", "loc": [600, 609], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L594_C2", "vector": [4, 4, 0.8996, 0.0149, 4, 0.37, 1.0, 0, 0, 0, 0, 0, 0, 0, 5], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\telif type == 'Xian' or type == 'Qu':\n\t\t\tif re.match(fId[:7] + r'[\\dA-F]{3}', Id) and Id != fId:\n\t\t\t\treturn True\n\t\t\telse:\n\t\t\t\tlog.warning(r'<Check_3_2 Error> : Xian/Qu : %s', d.get_str())\n\t\t\t\treturn False\n\t\telif type == 'QuanYu':\n\t\t\tif Id[-3:] != '001' or Id == fId:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L601_C3", "label": "if", "type": "if", "loc": [601, 605], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L600_C2", "vector": [4, 5, 0.8973, 0.0074, 5, 0.97, 0.0, 0, 0, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\tif re.match(fId[:7] + r'[\\dA-F]{3}', Id) and Id != fId:\n\t\t\t\treturn True\n\t\t\telse:\n\t\t\t\tlog.warning(r'<Check_3_2 Error> : Xian/Qu : %s', d.get_str())\n\t\t\t\treturn False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99129:Return_L602_C4", "label": "return", "type": "return", "loc": [602, 602], "level": 6, "parent": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L601_C3", "vector": [13, 6, 0.8958, 0.0015, 6, 0.46, 0.0, 0, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\t\treturn True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99129:Expr_L604_C4", "label": "warning()", "type": "expression", "loc": [604, 604], "level": 6, "parent": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L601_C3", "vector": [8, 6, 0.8988, 0.0015, 6, 0.46, 0.5, 320, 3, 2, 0, 0, 0, 0, 2], "semantic": {"name": "warning", "arg_names": [], "import_names": [], "rhs_call_name": "warning", "annotation": ""}, "snippet": "\t\t\t\tlog.warning(r'<Check_3_2 Error> : Xian/Qu : %s', d.get_str())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99129:Return_L605_C4", "label": "return", "type": "return", "loc": [605, 605], "level": 6, "parent": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L601_C3", "vector": [13, 6, 0.9003, 0.0015, 6, 0.46, 1.0, 0, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\t\treturn False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L606_C2", "label": "if", "type": "if", "loc": [606, 609], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L600_C2", "vector": [4, 5, 0.904, 0.006, 5, 0.97, 1.0, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\telif type == 'QuanYu':\n\t\t\tif Id[-3:] != '001' or Id == fId:\n\t\t\t\tlog.warning(r'<Check_3_2 Error> : QuanYu : %s', d.get_str())\n\t\t\treturn True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L607_C3", "label": "if", "type": "if", "loc": [607, 608], "level": 6, "parent": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L606_C2", "vector": [4, 6, 0.904, 0.003, 6, 0.94, 0.0, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\tif Id[-3:] != '001' or Id == fId:\n\t\t\t\tlog.warning(r'<Check_3_2 Error> : QuanYu : %s', d.get_str())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99129:Expr_L608_C4", "label": "warning()", "type": "expression", "loc": [608, 608], "level": 7, "parent": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L607_C3", "vector": [8, 7, 0.9048, 0.0015, 7, 0.75, 0.0, 320, 3, 2, 0, 0, 0, 0, 2], "semantic": {"name": "warning", "arg_names": [], "import_names": [], "rhs_call_name": "warning", "annotation": ""}, "snippet": "\t\t\t\tlog.warning(r'<Check_3_2 Error> : QuanYu : %s', d.get_str())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99129:Return_L609_C3", "label": "return", "type": "return", "loc": [609, 609], "level": 6, "parent": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L606_C2", "vector": [13, 6, 0.9062, 0.0015, 6, 0.94, 1.0, 0, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\treturn True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L611_C1", "label": "_check_9_1", "type": "function", "loc": [611, 615], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99129:ClassDef_L299_C0", "vector": [2, 1, 0.9122, 0.0074, 1, 0.91, 0.875, 729, 0, 1, 1, 0, 0, 0, 0], "semantic": {"name": "_check_9_1", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tdef _check_9_1(self):\n\t\t\"\"\"Check if all fields exists in each item.\n\t\tAlready checked in DicItem#get_children\n\t\t\"\"\"\n\t\treturn True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99129:Expr_L612_C2", "label": "expression", "type": "expression", "loc": [612, 614], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L611_C1", "vector": [8, 2, 0.9122, 0.0045, 2, 0.72, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\"\"\"Check if all fields exists in each item.\n\t\tAlready checked in DicItem#get_children\n\t\t\"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99129:Return_L615_C2", "label": "return", "type": "return", "loc": [615, 615], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L611_C1", "vector": [13, 2, 0.9152, 0.0015, 2, 0.72, 1.0, 0, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\treturn True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L617_C1", "label": "_check_9_2", "type": "function", "loc": [617, 621], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99129:ClassDef_L299_C0", "vector": [2, 1, 0.9211, 0.0074, 1, 0.91, 0.9167, 83, 0, 1, 1, 0, 0, 0, 0], "semantic": {"name": "_check_9_2", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tdef _check_9_2(self):\n\t\t\"\"\"Check dictionary format.\n\t\tAlready checked in DicItem#get_children\n\t\t\"\"\"\n\t\treturn True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99129:Expr_L618_C2", "label": "expression", "type": "expression", "loc": [618, 620], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L617_C1", "vector": [8, 2, 0.9211, 0.0045, 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\"\"\"Check dictionary format.\n\t\tAlready checked in DicItem#get_children\n\t\t\"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99129:Return_L621_C2", "label": "return", "type": "return", "loc": [621, 621], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L617_C1", "vector": [13, 2, 0.9241, 0.0015, 2, 0.92, 1.0, 0, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\treturn True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L623_C1", "label": "_check_9_3", "type": "function", "loc": [623, 653], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99129:ClassDef_L299_C0", "vector": [2, 1, 0.9494, 0.0461, 1, 0.91, 0.9583, 249, 0, 1, 1, 0, 0, 0, 14], "semantic": {"name": "_check_9_3", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tdef _check_9_3(self):\n\t\t\"\"\"Check if there are repeated next level info or voice id.\n\t\tReplace names are checked specially.\n\t\t@retval True: no repeated next level id or voice id.\n\t\t@retval False: has repeated next level id or voice id.\n\t\t\"\"\"\n\t\tif not self._dicItem.has_child():\n\t\t\treturn True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99129:Expr_L624_C2", "label": "expression", "type": "expression", "loc": [624, 628], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L623_C1", "vector": [8, 2, 0.9315, 0.0074, 2, 0.05, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\"\"\"Check if there are repeated next level info or voice id.\n\t\tReplace names are checked specially.\n\t\t@retval True: no repeated next level id or voice id.\n\t\t@retval False: has repeated next level id or voice id.\n\t\t\"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L629_C2", "label": "if", "type": "if", "loc": [629, 630], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L623_C1", "vector": [4, 2, 0.9368, 0.003, 2, 0.05, 0.1667, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tif not self._dicItem.has_child():\n\t\t\treturn True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99129:Return_L630_C3", "label": "return", "type": "return", "loc": [630, 630], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L629_C2", "vector": [13, 3, 0.9375, 0.0015, 3, 0.54, 0.0, 0, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\treturn True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99129:Assign_L631_C2", "label": "Rs = get_children()", "type": "assigned_variable", "loc": [631, 631], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L623_C1", "vector": [14, 2, 0.939, 0.0015, 2, 0.05, 0.3333, 925, 3, 0, 0, 0, 305, 10, 1], "semantic": {"name": "Rs", "arg_names": [], "import_names": [], "rhs_call_name": "get_children", "annotation": ""}, "snippet": "\t\tRs = self._dicItem.get_children()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99129:Assign_L632_C2", "label": "ret =", "type": "assigned_variable", "loc": [632, 632], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L623_C1", "vector": [14, 2, 0.9405, 0.0015, 2, 0.05, 0.5, 501, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "ret", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tret = True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99129:For_L633_C2", "label": "for r", "type": "for", "loc": [633, 642], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L623_C1", "vector": [6, 2, 0.9487, 0.0149, 2, 0.05, 0.6667, 436, 2, 0, 0, 0, 0, 0, 6], "semantic": {"name": "r", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tfor r in Rs:\n\t\t\tid = r['nextLevelId']\n\t\t\tif id == '0xFFFFFFFF':\n\t\t\t\tcontinue\n\t\t\tsameIdRs = filter(lambda rt:rt['nextLevelId']==id, Rs)\n\t\t\tif len(sameIdRs) != 1:\n\t\t\t\tfor r in sameIdRs[1:]:\n\t\t\t\t\tif not self.is_another_name(r, sameIdRs[0]):"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99129:Assign_L634_C3", "label": "id =", "type": "assigned_variable", "loc": [634, 634], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99129:For_L633_C2", "vector": [14, 3, 0.9435, 0.0015, 3, 0.7, 0.0, 941, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "id", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\tid = r['nextLevelId']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L635_C3", "label": "if", "type": "if", "loc": [635, 636], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99129:For_L633_C2", "vector": [4, 3, 0.9457, 0.003, 3, 0.7, 0.3333, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\tif id == '0xFFFFFFFF':\n\t\t\t\tcontinue"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99129:Assign_L637_C3", "label": "sameIdRs = filter()", "type": "assigned_variable", "loc": [637, 637], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99129:For_L633_C2", "vector": [14, 3, 0.9479, 0.0015, 3, 0.7, 0.6667, 994, 3, 2, 0, 0, 526, 10, 1], "semantic": {"name": "sameIdRs", "arg_names": [], "import_names": [], "rhs_call_name": "filter", "annotation": ""}, "snippet": "\t\t\tsameIdRs = filter(lambda rt:rt['nextLevelId']==id, Rs)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L638_C3", "label": "if", "type": "if", "loc": [638, 642], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99129:For_L633_C2", "vector": [4, 3, 0.9524, 0.0074, 3, 0.7, 1.0, 0, 0, 0, 0, 0, 0, 0, 5], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\tif len(sameIdRs) != 1:\n\t\t\t\tfor r in sameIdRs[1:]:\n\t\t\t\t\tif not self.is_another_name(r, sameIdRs[0]):\n\t\t\t\t\t\tlog.warning(r'<Next Level Has Repeated Id Error> : %s : %s : %d', self._dicItem.get_str(), id, len(sameIdRs))\n\t\t\t\t\t\tret = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99129:For_L639_C4", "label": "for r", "type": "for", "loc": [639, 642], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L638_C3", "vector": [6, 4, 0.9531, 0.006, 4, 0.84, 0.0, 436, 6, 0, 0, 0, 0, 0, 4], "semantic": {"name": "r", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\t\tfor r in sameIdRs[1:]:\n\t\t\t\t\tif not self.is_another_name(r, sameIdRs[0]):\n\t\t\t\t\t\tlog.warning(r'<Next Level Has Repeated Id Error> : %s : %s : %d', self._dicItem.get_str(), id, len(sameIdRs))\n\t\t\t\t\t\tret = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L640_C5", "label": "if", "type": "if", "loc": [640, 642], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99129:For_L639_C4", "vector": [4, 5, 0.9539, 0.0045, 5, 0.73, 0.0, 0, 0, 0, 0, 0, 0, 0, 4], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\t\t\tif not self.is_another_name(r, sameIdRs[0]):\n\t\t\t\t\t\tlog.warning(r'<Next Level Has Repeated Id Error> : %s : %s : %d', self._dicItem.get_str(), id, len(sameIdRs))\n\t\t\t\t\t\tret = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99129:Expr_L641_C6", "label": "warning()", "type": "expression", "loc": [641, 641], "level": 6, "parent": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L640_C5", "vector": [8, 6, 0.9539, 0.0015, 6, 0.01, 0.0, 320, 3, 4, 0, 0, 0, 0, 3], "semantic": {"name": "warning", "arg_names": [], "import_names": [], "rhs_call_name": "warning", "annotation": ""}, "snippet": "\t\t\t\t\t\tlog.warning(r'<Next Level Has Repeated Id Error> : %s : %s : %d', self._dicItem.get_str(), id, len(sameIdRs))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99129:Assign_L642_C6", "label": "ret =", "type": "assigned_variable", "loc": [642, 642], "level": 6, "parent": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L640_C5", "vector": [14, 6, 0.9554, 0.0015, 6, 0.01, 1.0, 501, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "ret", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\t\t\t\tret = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99129:For_L643_C2", "label": "for r", "type": "for", "loc": [643, 652], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L623_C1", "vector": [6, 2, 0.9635, 0.0149, 2, 0.05, 0.8333, 436, 2, 0, 0, 0, 0, 0, 6], "semantic": {"name": "r", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tfor r in Rs:\n\t\t\tvid = r['voiceId']\n\t\t\tif vid == '0xFFFFFFFF':\n\t\t\t\tcontinue\n\t\t\tsameVidRs = filter(lambda rt:rt['voiceId']==vid, Rs)\n\t\t\tif len(sameVidRs) != 1:\n\t\t\t\tfor r in sameVidRs[1:]:\n\t\t\t\t\tif not self.is_another_name(r, sameIdRs[0]):"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99129:Assign_L644_C3", "label": "vid =", "type": "assigned_variable", "loc": [644, 644], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99129:For_L643_C2", "vector": [14, 3, 0.9583, 0.0015, 3, 0.07, 0.0, 980, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "vid", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\tvid = r['voiceId']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L645_C3", "label": "if", "type": "if", "loc": [645, 646], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99129:For_L643_C2", "vector": [4, 3, 0.9606, 0.003, 3, 0.07, 0.3333, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\tif vid == '0xFFFFFFFF':\n\t\t\t\tcontinue"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99129:Assign_L647_C3", "label": "sameVidRs = filter()", "type": "assigned_variable", "loc": [647, 647], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99129:For_L643_C2", "vector": [14, 3, 0.9628, 0.0015, 3, 0.07, 0.6667, 991, 3, 2, 0, 0, 526, 10, 1], "semantic": {"name": "sameVidRs", "arg_names": [], "import_names": [], "rhs_call_name": "filter", "annotation": ""}, "snippet": "\t\t\tsameVidRs = filter(lambda rt:rt['voiceId']==vid, Rs)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L648_C3", "label": "if", "type": "if", "loc": [648, 652], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99129:For_L643_C2", "vector": [4, 3, 0.9673, 0.0074, 3, 0.07, 1.0, 0, 0, 0, 0, 0, 0, 0, 5], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\tif len(sameVidRs) != 1:\n\t\t\t\tfor r in sameVidRs[1:]:\n\t\t\t\t\tif not self.is_another_name(r, sameIdRs[0]):\n\t\t\t\t\t\tlog.warning(r'<Next Level Has Repeated VoiceId Error> : %s : %s : %d', self._dicItem.get_str(), id, len(sameVidRs))\n\t\t\t\t\t\tret = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99129:For_L649_C4", "label": "for r", "type": "for", "loc": [649, 652], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L648_C3", "vector": [6, 4, 0.968, 0.006, 4, 0.82, 0.0, 436, 6, 0, 0, 0, 0, 0, 4], "semantic": {"name": "r", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\t\tfor r in sameVidRs[1:]:\n\t\t\t\t\tif not self.is_another_name(r, sameIdRs[0]):\n\t\t\t\t\t\tlog.warning(r'<Next Level Has Repeated VoiceId Error> : %s : %s : %d', self._dicItem.get_str(), id, len(sameVidRs))\n\t\t\t\t\t\tret = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L650_C5", "label": "if", "type": "if", "loc": [650, 652], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99129:For_L649_C4", "vector": [4, 5, 0.9688, 0.0045, 5, 0.68, 0.0, 0, 0, 0, 0, 0, 0, 0, 4], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\t\t\tif not self.is_another_name(r, sameIdRs[0]):\n\t\t\t\t\t\tlog.warning(r'<Next Level Has Repeated VoiceId Error> : %s : %s : %d', self._dicItem.get_str(), id, len(sameVidRs))\n\t\t\t\t\t\tret = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99129:Expr_L651_C6", "label": "warning()", "type": "expression", "loc": [651, 651], "level": 6, "parent": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L650_C5", "vector": [8, 6, 0.9688, 0.0015, 6, 0.02, 0.0, 320, 3, 4, 0, 0, 0, 0, 3], "semantic": {"name": "warning", "arg_names": [], "import_names": [], "rhs_call_name": "warning", "annotation": ""}, "snippet": "\t\t\t\t\t\tlog.warning(r'<Next Level Has Repeated VoiceId Error> : %s : %s : %d', self._dicItem.get_str(), id, len(sameVidRs))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99129:Assign_L652_C6", "label": "ret =", "type": "assigned_variable", "loc": [652, 652], "level": 6, "parent": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L650_C5", "vector": [14, 6, 0.9702, 0.0015, 6, 0.02, 1.0, 501, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "ret", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\t\t\t\tret = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99129:Return_L653_C2", "label": "return", "type": "return", "loc": [653, 653], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L623_C1", "vector": [13, 2, 0.9717, 0.0015, 2, 0.05, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\treturn ret"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L655_C1", "label": "_check_9_4", "type": "function", "loc": [655, 671], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99129:ClassDef_L299_C0", "vector": [2, 1, 0.9866, 0.0253, 1, 0.91, 1.0, 811, 0, 1, 1, 0, 0, 0, 11], "semantic": {"name": "_check_9_4", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tdef _check_9_4(self):\n\t\t\"\"\"Check if all records in Kiwi exists in dictionary\n\t\t\"\"\"\n\t\tret = True\n\t\td = self._dicItem\n\t\tk = d.fetch_kiwi_record()\n\t\tnextLevelOffsets = tuple(int(c['offset'], 16) for c in self._dicItem.get_children()) \n\t\tif not k.has_next_level():"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99129:Expr_L656_C2", "label": "expression", "type": "expression", "loc": [656, 657], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L655_C1", "vector": [8, 2, 0.9769, 0.003, 2, 0.81, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\"\"\"Check if all records in Kiwi exists in dictionary\n\t\t\"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99129:Assign_L658_C2", "label": "ret =", "type": "assigned_variable", "loc": [658, 658], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L655_C1", "vector": [14, 2, 0.9792, 0.0015, 2, 0.81, 0.1429, 501, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "ret", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tret = True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99129:Assign_L659_C2", "label": "d =", "type": "assigned_variable", "loc": [659, 659], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L655_C1", "vector": [14, 2, 0.9807, 0.0015, 2, 0.81, 0.2857, 355, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "d", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\td = self._dicItem"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99129:Assign_L660_C2", "label": "k = fetch_kiwi_record()", "type": "assigned_variable", "loc": [660, 660], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L655_C1", "vector": [14, 2, 0.9821, 0.0015, 2, 0.81, 0.4286, 954, 3, 0, 0, 0, 289, 10, 1], "semantic": {"name": "k", "arg_names": [], "import_names": [], "rhs_call_name": "fetch_kiwi_record", "annotation": ""}, "snippet": "\t\tk = d.fetch_kiwi_record()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99129:Assign_L661_C2", "label": "nextLevelOffsets = tuple()", "type": "assigned_variable", "loc": [661, 661], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L655_C1", "vector": [14, 2, 0.9836, 0.0015, 2, 0.81, 0.5714, 688, 3, 1, 0, 0, 259, 10, 3], "semantic": {"name": "nextLevelOffsets", "arg_names": [], "import_names": [], "rhs_call_name": "tuple", "annotation": ""}, "snippet": "\t\tnextLevelOffsets = tuple(int(c['offset'], 16) for c in self._dicItem.get_children()) "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L662_C2", "label": "if", "type": "if", "loc": [662, 666], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L655_C1", "vector": [4, 2, 0.9881, 0.0074, 2, 0.81, 0.7143, 0, 0, 0, 0, 0, 0, 0, 4], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tif not k.has_next_level():\n\t\t\tif not d.has_child():\n\t\t\t\treturn True\n\t\t\tlog.warning(r'<Check_9_4 Error> : %s', d.get_str())\n\t\t\treturn False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L663_C3", "label": "if", "type": "if", "loc": [663, 664], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L662_C2", "vector": [4, 3, 0.9874, 0.003, 3, 0.42, 0.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\tif not d.has_child():\n\t\t\t\treturn True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99129:Return_L664_C4", "label": "return", "type": "return", "loc": [664, 664], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L663_C3", "vector": [13, 4, 0.9881, 0.0015, 4, 0.46, 0.0, 0, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\t\treturn True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99129:Expr_L665_C3", "label": "warning()", "type": "expression", "loc": [665, 665], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L662_C2", "vector": [8, 3, 0.9896, 0.0015, 3, 0.42, 0.5, 320, 3, 2, 0, 0, 0, 0, 2], "semantic": {"name": "warning", "arg_names": [], "import_names": [], "rhs_call_name": "warning", "annotation": ""}, "snippet": "\t\t\tlog.warning(r'<Check_9_4 Error> : %s', d.get_str())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99129:Return_L666_C3", "label": "return", "type": "return", "loc": [666, 666], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L662_C2", "vector": [13, 3, 0.9911, 0.0015, 3, 0.42, 1.0, 0, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\treturn False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99129:For_L667_C2", "label": "for k", "type": "for", "loc": [667, 670], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L655_C1", "vector": [6, 2, 0.9948, 0.006, 2, 0.81, 0.8571, 954, 3, 0, 0, 0, 0, 0, 3], "semantic": {"name": "k", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tfor k in d.fetch_kiwi_frame():\n\t\t\tif not k['offset'] in nextLevelOffsets:\n\t\t\t\tlog.warning(r'<Check_9_4 Error> : %s : %x', self._dicItem.get_str(), k['offset'])\n\t\t\t\tret = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L668_C3", "label": "if", "type": "if", "loc": [668, 670], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99129:For_L667_C2", "vector": [4, 3, 0.9955, 0.0045, 3, 0.98, 0.0, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\tif not k['offset'] in nextLevelOffsets:\n\t\t\t\tlog.warning(r'<Check_9_4 Error> : %s : %x', self._dicItem.get_str(), k['offset'])\n\t\t\t\tret = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99129:Expr_L669_C4", "label": "warning()", "type": "expression", "loc": [669, 669], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L668_C3", "vector": [8, 4, 0.9955, 0.0015, 4, 0.85, 0.0, 320, 3, 3, 0, 0, 0, 0, 2], "semantic": {"name": "warning", "arg_names": [], "import_names": [], "rhs_call_name": "warning", "annotation": ""}, "snippet": "\t\t\t\tlog.warning(r'<Check_9_4 Error> : %s : %x', self._dicItem.get_str(), k['offset'])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99129:Assign_L670_C4", "label": "ret =", "type": "assigned_variable", "loc": [670, 670], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L668_C3", "vector": [14, 4, 0.997, 0.0015, 4, 0.85, 1.0, 501, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "ret", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\t\tret = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99129:Return_L671_C2", "label": "return", "type": "return", "loc": [671, 671], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L655_C1", "vector": [13, 2, 0.9985, 0.0015, 2, 0.81, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\treturn ret"}]
[{"f": "ajibawa-2023/Python-Code-Large/train/row_99129:ClassDef_L19_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99129:Assign_L20_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99129:ClassDef_L19_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99129:Assign_L21_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99129:ClassDef_L19_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99129:Expr_L22_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99129:ClassDef_L19_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L23_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L23_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99129:Assign_L24_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L23_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99129:Assign_L25_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L23_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99129:Assign_L26_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L23_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99129:Assign_L27_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L23_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99129:Assign_L28_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L23_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99129:Assign_L29_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L23_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99129:Assign_L30_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L23_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99129:Assign_L33_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L23_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L36_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L36_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99129:Expr_L37_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L36_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99129:Expr_L38_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L36_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99129:Assign_L39_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L36_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L42_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L42_C3", "t": "ajibawa-2023/Python-Code-Large/train/row_99129:Expr_L43_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L42_C3", "t": "ajibawa-2023/Python-Code-Large/train/row_99129:Expr_L45_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L23_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99129:Assign_L47_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L23_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L48_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L48_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99129:Expr_L49_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L23_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99129:Assign_L51_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L23_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99129:Assign_L52_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L23_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99129:Assign_L53_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L23_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99129:Assign_L54_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L23_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99129:Assign_L55_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L23_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99129:Assign_L56_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L23_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99129:Assign_L57_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L23_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99129:Assign_L58_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99129:ClassDef_L19_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L68_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L68_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99129:Return_L69_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99129:ClassDef_L19_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L71_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L71_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99129:Expr_L72_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L71_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99129:Assign_L73_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L71_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99129:Assign_L74_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L71_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L75_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L75_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99129:Expr_L79_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L71_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99129:Return_L80_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99129:ClassDef_L19_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L82_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L82_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99129:Expr_L83_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L82_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L84_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L84_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99129:Return_L85_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L82_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99129:Assign_L86_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L82_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99129:Assign_L87_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L82_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L89_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L89_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99129:Return_L90_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L82_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99129:For_L92_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99129:For_L92_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L93_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L93_C3", "t": "ajibawa-2023/Python-Code-Large/train/row_99129:Assign_L94_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L82_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99129:Return_L95_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99129:ClassDef_L19_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L97_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L97_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L98_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L98_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L102_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L102_C3", "t": "ajibawa-2023/Python-Code-Large/train/row_99129:Expr_L105_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L98_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99129:Return_L106_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L98_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L109_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L109_C3", "t": "ajibawa-2023/Python-Code-Large/train/row_99129:Expr_L112_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L98_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99129:Return_L113_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99129:ClassDef_L19_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L115_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L115_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99129:Return_L116_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99129:ClassDef_L19_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L118_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L118_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L119_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L119_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99129:Return_L120_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L119_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L121_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L121_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99129:Return_L122_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L118_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99129:Assign_L123_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L118_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99129:Assign_L124_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L118_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99129:Assign_L125_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L118_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99129:Try_L127_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99129:Try_L127_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99129:Assign_L128_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99129:Try_L127_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99129:Assign_L129_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99129:Try_L127_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99129:Expr_L130_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99129:Try_L127_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99129:Expr_L132_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99129:Try_L127_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99129:Return_L133_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99129:Try_L127_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99129:Expr_L135_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99129:Try_L127_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99129:Expr_L136_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99129:Try_L127_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99129:Return_L137_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L118_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99129:For_L139_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99129:For_L139_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L140_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L140_C3", "t": "ajibawa-2023/Python-Code-Large/train/row_99129:Expr_L141_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99129:For_L139_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99129:Try_L143_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99129:Try_L143_C3", "t": "ajibawa-2023/Python-Code-Large/train/row_99129:Assign_L144_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99129:Try_L143_C3", "t": "ajibawa-2023/Python-Code-Large/train/row_99129:Expr_L146_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99129:For_L139_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99129:Expr_L148_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L118_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99129:Assign_L149_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L118_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99129:Return_L150_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99129:ClassDef_L19_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L152_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L152_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99129:Expr_L153_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L152_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99129:Return_L154_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99129:ClassDef_L19_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L156_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L156_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99129:Return_L157_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99129:ClassDef_L19_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L159_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L159_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99129:Assign_L163_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L159_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L165_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L165_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99129:Assign_L166_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L165_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99129:Return_L167_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L159_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99129:Assign_L168_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L159_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L170_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L170_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99129:Assign_L171_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L170_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99129:Return_L172_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L159_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99129:Assign_L173_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L159_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L175_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L175_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99129:Assign_L176_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L175_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99129:Return_L177_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L159_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99129:Assign_L178_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L159_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L180_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L180_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99129:Assign_L181_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L180_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99129:Return_L182_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99129:ClassDef_L19_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L186_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L186_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L187_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L187_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99129:Return_L188_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L186_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99129:Assign_L189_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L186_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L190_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L190_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99129:Return_L191_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L186_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99129:For_L192_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99129:For_L192_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L193_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L193_C3", "t": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L194_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L194_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99129:Expr_L195_C5"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L193_C3", "t": "ajibawa-2023/Python-Code-Large/train/row_99129:Assign_L196_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L193_C3", "t": "ajibawa-2023/Python-Code-Large/train/row_99129:Return_L197_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L186_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99129:Expr_L198_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99129:ClassDef_L19_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L201_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L201_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L202_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L202_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99129:Return_L203_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L201_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99129:Assign_L207_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L201_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L209_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L209_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99129:Assign_L210_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L209_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99129:Return_L211_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L201_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99129:Assign_L212_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L201_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L214_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L214_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99129:Assign_L215_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L214_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99129:Return_L216_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L201_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99129:Assign_L217_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L201_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L219_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L219_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99129:Assign_L220_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L219_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99129:Return_L221_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L201_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99129:Assign_L222_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99129:ClassDef_L19_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L226_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L226_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99129:Expr_L227_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L226_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L228_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L228_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99129:Return_L229_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L226_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L230_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L230_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99129:Assign_L231_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L230_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99129:Return_L232_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L226_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L233_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L233_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L234_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L234_C3", "t": "ajibawa-2023/Python-Code-Large/train/row_99129:Assign_L236_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L234_C3", "t": "ajibawa-2023/Python-Code-Large/train/row_99129:Assign_L238_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L233_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99129:Return_L239_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L226_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L240_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L240_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99129:Assign_L241_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L240_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99129:Return_L242_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L226_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99129:Assign_L243_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L226_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L244_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L244_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99129:Assign_L245_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L244_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99129:Return_L246_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L244_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L247_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L247_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L248_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L248_C3", "t": "ajibawa-2023/Python-Code-Large/train/row_99129:Expr_L249_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L247_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L250_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L250_C3", "t": "ajibawa-2023/Python-Code-Large/train/row_99129:Assign_L251_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L250_C3", "t": "ajibawa-2023/Python-Code-Large/train/row_99129:Return_L252_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L250_C3", "t": "ajibawa-2023/Python-Code-Large/train/row_99129:Assign_L254_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L250_C3", "t": "ajibawa-2023/Python-Code-Large/train/row_99129:Return_L255_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L226_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99129:Assign_L256_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L226_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99129:Return_L257_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99129:ClassDef_L260_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L261_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L261_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99129:Assign_L262_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L261_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99129:Expr_L263_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99129:ClassDef_L260_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L265_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99129:ClassDef_L260_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L268_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L268_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99129:Expr_L269_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L268_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L270_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L270_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99129:Return_L271_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L268_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99129:Assign_L272_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L268_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99129:Assign_L274_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L268_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99129:For_L275_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99129:For_L275_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L276_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L276_C3", "t": "ajibawa-2023/Python-Code-Large/train/row_99129:Assign_L277_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L268_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99129:Return_L278_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99129:ClassDef_L260_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L280_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L280_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99129:Return_L281_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99129:ClassDef_L260_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L283_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L283_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99129:Return_L284_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99129:ClassDef_L260_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L286_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L286_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99129:Return_L287_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99129:ClassDef_L260_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L289_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L289_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L290_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L290_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99129:Return_L291_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L289_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99129:Assign_L292_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L289_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99129:Return_L293_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99129:ClassDef_L260_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L295_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L295_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99129:Return_L296_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99129:ClassDef_L299_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99129:Expr_L300_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99129:ClassDef_L299_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99129:Assign_L303_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99129:ClassDef_L299_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99129:Assign_L305_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99129:ClassDef_L299_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L307_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L307_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99129:Expr_L308_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L307_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99129:Assign_L310_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L307_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99129:Assign_L311_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L307_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99129:Assign_L312_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L307_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99129:Assign_L313_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99129:ClassDef_L299_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L315_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L315_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99129:Expr_L316_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L315_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L318_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L318_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99129:Return_L319_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L315_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99129:Assign_L320_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L315_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L321_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L321_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99129:Try_L322_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99129:Try_L322_C3", "t": "ajibawa-2023/Python-Code-Large/train/row_99129:Expr_L323_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99129:Try_L322_C3", "t": "ajibawa-2023/Python-Code-Large/train/row_99129:Return_L326_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L315_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99129:Assign_L328_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L315_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99129:Assign_L329_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L315_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99129:Assign_L330_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L315_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99129:Assign_L331_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L315_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99129:Assign_L332_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L315_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99129:Assign_L333_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L315_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99129:Assign_L334_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L315_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99129:Assign_L335_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L315_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99129:Assign_L336_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L315_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99129:Return_L337_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99129:ClassDef_L299_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L339_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L339_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99129:Expr_L340_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L339_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99129:Assign_L342_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L339_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99129:For_L343_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99129:For_L343_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L344_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L344_C3", "t": "ajibawa-2023/Python-Code-Large/train/row_99129:Try_L345_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99129:Try_L345_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99129:Expr_L346_C5"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L344_C3", "t": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L349_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L349_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99129:Expr_L350_C5"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L349_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99129:Return_L351_C5"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L344_C3", "t": "ajibawa-2023/Python-Code-Large/train/row_99129:Expr_L352_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L344_C3", "t": "ajibawa-2023/Python-Code-Large/train/row_99129:Return_L356_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L339_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99129:Expr_L357_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L339_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99129:Return_L358_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99129:ClassDef_L299_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L360_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L360_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99129:Expr_L361_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L360_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L363_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L363_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99129:Return_L368_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L363_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L369_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L369_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99129:Return_L370_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L369_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L371_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L371_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99129:Return_L372_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L371_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99129:Return_L374_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99129:ClassDef_L299_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L376_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L376_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99129:Expr_L377_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L376_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99129:Return_L379_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99129:ClassDef_L299_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L381_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L381_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99129:Expr_L382_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L381_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99129:Return_L384_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99129:ClassDef_L299_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L386_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L386_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99129:Expr_L387_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L386_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99129:Assign_L389_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L386_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99129:Assign_L390_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L386_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99129:Assign_L391_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L386_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L392_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L392_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99129:Expr_L393_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L392_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99129:Return_L394_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L386_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L395_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L395_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99129:Expr_L396_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L395_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99129:Return_L397_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L386_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99129:Return_L398_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99129:ClassDef_L299_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L400_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L400_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99129:Expr_L401_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L400_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99129:Assign_L403_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L400_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99129:Assign_L404_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L400_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99129:Return_L405_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99129:ClassDef_L299_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L407_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L407_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99129:Expr_L408_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L407_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L410_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L410_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L411_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L411_C3", "t": "ajibawa-2023/Python-Code-Large/train/row_99129:Expr_L412_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L411_C3", "t": "ajibawa-2023/Python-Code-Large/train/row_99129:Return_L413_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L410_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99129:Return_L414_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L407_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99129:Assign_L416_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L407_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99129:Assign_L417_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L407_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99129:Assign_L418_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L407_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99129:Assign_L419_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L407_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99129:For_L420_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99129:For_L420_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L421_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L421_C3", "t": "ajibawa-2023/Python-Code-Large/train/row_99129:Expr_L422_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L407_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99129:For_L424_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99129:For_L424_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99129:Assign_L425_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99129:For_L424_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L426_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L426_C3", "t": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L427_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L427_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99129:Expr_L428_C5"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L427_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99129:Assign_L429_C5"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L426_C3", "t": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L430_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L430_C3", "t": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L431_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L431_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99129:Expr_L432_C5"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L431_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99129:Assign_L433_C5"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L430_C3", "t": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L434_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L434_C3", "t": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L435_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L435_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99129:Expr_L436_C5"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L435_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99129:Assign_L437_C5"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L434_C3", "t": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L438_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L438_C3", "t": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L439_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L439_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99129:Expr_L440_C5"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L439_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99129:Assign_L441_C5"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L438_C3", "t": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L442_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L407_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L446_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L446_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L447_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L447_C3", "t": "ajibawa-2023/Python-Code-Large/train/row_99129:Expr_L448_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L447_C3", "t": "ajibawa-2023/Python-Code-Large/train/row_99129:Assign_L449_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L446_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L451_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L451_C3", "t": "ajibawa-2023/Python-Code-Large/train/row_99129:Expr_L452_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L451_C3", "t": "ajibawa-2023/Python-Code-Large/train/row_99129:Assign_L453_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L407_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99129:Return_L454_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99129:ClassDef_L299_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L456_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L456_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99129:Expr_L457_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L456_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L459_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L459_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99129:Return_L461_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L459_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99129:Expr_L463_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L459_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99129:Return_L464_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99129:ClassDef_L299_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L466_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L466_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99129:Expr_L467_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L466_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99129:Assign_L469_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L466_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L470_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L470_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99129:Assign_L471_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L466_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99129:Assign_L472_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L466_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L473_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L473_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99129:Return_L474_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L473_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99129:Expr_L476_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L473_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99129:Return_L477_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L466_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99129:Return_L478_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99129:ClassDef_L299_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L480_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L480_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99129:Expr_L481_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L480_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99129:Assign_L483_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L480_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99129:Assign_L484_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L480_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99129:Assign_L485_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L480_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L486_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L486_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L488_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L488_C3", "t": "ajibawa-2023/Python-Code-Large/train/row_99129:Assign_L489_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L486_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99129:Assign_L491_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L486_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L492_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L492_C3", "t": "ajibawa-2023/Python-Code-Large/train/row_99129:Assign_L493_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L480_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99129:Try_L494_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99129:Try_L494_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99129:Assign_L495_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99129:Try_L494_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99129:Assign_L497_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L480_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L498_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L498_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99129:Assign_L499_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L480_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L500_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L500_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99129:Expr_L501_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L480_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99129:Return_L502_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99129:ClassDef_L299_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L504_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L504_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99129:Expr_L505_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L504_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99129:Return_L507_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99129:ClassDef_L299_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L509_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L509_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99129:Expr_L510_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L509_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99129:Assign_L512_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L509_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99129:Assign_L513_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L509_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99129:Assign_L514_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L509_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99129:Assign_L515_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L509_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99129:Return_L516_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99129:ClassDef_L299_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L518_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L518_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99129:Expr_L519_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L518_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L521_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L521_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99129:For_L522_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99129:For_L522_C3", "t": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L523_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L523_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99129:Return_L524_C5"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L521_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99129:Return_L525_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L518_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L526_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L526_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L527_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L527_C3", "t": "ajibawa-2023/Python-Code-Large/train/row_99129:Return_L528_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L518_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99129:Return_L529_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99129:ClassDef_L299_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L531_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L531_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99129:Expr_L532_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L531_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99129:Assign_L534_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L531_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L535_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L535_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99129:Return_L536_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L531_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99129:For_L537_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99129:For_L537_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L538_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L538_C3", "t": "ajibawa-2023/Python-Code-Large/train/row_99129:Return_L539_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L531_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99129:Return_L540_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99129:ClassDef_L299_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L542_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L542_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99129:Expr_L543_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L542_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99129:Assign_L545_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L542_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99129:Try_L546_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99129:Try_L546_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99129:Assign_L547_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99129:Try_L546_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99129:Expr_L549_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99129:Try_L546_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99129:Return_L550_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L542_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99129:Assign_L551_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L542_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L552_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L552_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L553_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L553_C3", "t": "ajibawa-2023/Python-Code-Large/train/row_99129:Expr_L554_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L552_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99129:Return_L556_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L552_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L558_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L558_C3", "t": "ajibawa-2023/Python-Code-Large/train/row_99129:Expr_L559_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L542_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99129:Assign_L562_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L542_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99129:Assign_L563_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L542_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L564_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L564_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99129:Expr_L566_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L564_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99129:Return_L567_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L542_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99129:Return_L568_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99129:ClassDef_L299_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L570_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L570_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99129:Expr_L571_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L570_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99129:Assign_L573_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L570_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L575_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L575_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99129:Return_L576_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L570_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99129:Assign_L578_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L570_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99129:Assign_L579_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L570_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99129:Assign_L580_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L570_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99129:Assign_L582_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L570_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99129:Assign_L583_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L570_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L584_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L584_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L585_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L585_C3", "t": "ajibawa-2023/Python-Code-Large/train/row_99129:Expr_L586_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L570_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L588_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L588_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L589_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L589_C3", "t": "ajibawa-2023/Python-Code-Large/train/row_99129:Return_L590_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L589_C3", "t": "ajibawa-2023/Python-Code-Large/train/row_99129:Expr_L592_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L589_C3", "t": "ajibawa-2023/Python-Code-Large/train/row_99129:Return_L593_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L588_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L594_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L594_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L595_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L595_C3", "t": "ajibawa-2023/Python-Code-Large/train/row_99129:Return_L596_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L595_C3", "t": "ajibawa-2023/Python-Code-Large/train/row_99129:Expr_L598_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L595_C3", "t": "ajibawa-2023/Python-Code-Large/train/row_99129:Return_L599_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L594_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L600_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L600_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L601_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L601_C3", "t": "ajibawa-2023/Python-Code-Large/train/row_99129:Return_L602_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L601_C3", "t": "ajibawa-2023/Python-Code-Large/train/row_99129:Expr_L604_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L601_C3", "t": "ajibawa-2023/Python-Code-Large/train/row_99129:Return_L605_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L600_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L606_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L606_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L607_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L607_C3", "t": "ajibawa-2023/Python-Code-Large/train/row_99129:Expr_L608_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L606_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99129:Return_L609_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99129:ClassDef_L299_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L611_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L611_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99129:Expr_L612_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L611_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99129:Return_L615_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99129:ClassDef_L299_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L617_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L617_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99129:Expr_L618_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L617_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99129:Return_L621_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99129:ClassDef_L299_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L623_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L623_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99129:Expr_L624_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L623_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L629_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L629_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99129:Return_L630_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L623_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99129:Assign_L631_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L623_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99129:Assign_L632_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L623_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99129:For_L633_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99129:For_L633_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99129:Assign_L634_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99129:For_L633_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L635_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99129:For_L633_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99129:Assign_L637_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99129:For_L633_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L638_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L638_C3", "t": "ajibawa-2023/Python-Code-Large/train/row_99129:For_L639_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99129:For_L639_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L640_C5"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L640_C5", "t": "ajibawa-2023/Python-Code-Large/train/row_99129:Expr_L641_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L640_C5", "t": "ajibawa-2023/Python-Code-Large/train/row_99129:Assign_L642_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L623_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99129:For_L643_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99129:For_L643_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99129:Assign_L644_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99129:For_L643_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L645_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99129:For_L643_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99129:Assign_L647_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99129:For_L643_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L648_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L648_C3", "t": "ajibawa-2023/Python-Code-Large/train/row_99129:For_L649_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99129:For_L649_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L650_C5"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L650_C5", "t": "ajibawa-2023/Python-Code-Large/train/row_99129:Expr_L651_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L650_C5", "t": "ajibawa-2023/Python-Code-Large/train/row_99129:Assign_L652_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L623_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99129:Return_L653_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99129:ClassDef_L299_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L655_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L655_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99129:Expr_L656_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L655_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99129:Assign_L658_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L655_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99129:Assign_L659_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L655_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99129:Assign_L660_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L655_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99129:Assign_L661_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L655_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L662_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L662_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L663_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L663_C3", "t": "ajibawa-2023/Python-Code-Large/train/row_99129:Return_L664_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L662_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99129:Expr_L665_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L662_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99129:Return_L666_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L655_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99129:For_L667_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99129:For_L667_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L668_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L668_C3", "t": "ajibawa-2023/Python-Code-Large/train/row_99129:Expr_L669_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99129:If_L668_C3", "t": "ajibawa-2023/Python-Code-Large/train/row_99129:Assign_L670_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99129:FunctionDef_L655_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99129:Return_L671_C2"}]
#!/usr/bin/env python # coding=utf-8 import os import sys import re import codecs import logging import pyExcelerator as pE xlsFileName = r'D:\ylb_work\data\je609_japan.xls' headFileName = r'D:\ylb_work\data\waveID_Japan.h' logFileName = r'makeconst_Japan.log' sheets = range(1,6) startLineNo = 9 maxLineNo = 10000 def init_log(): logger = logging.getLogger() hdlr = logging.FileHandler(logFileName) formatter = logging.Formatter('%(asctime)s %(levelname)s:: %(message)s') hdlr.setFormatter(formatter) logger.addHandler(hdlr) logger.setLevel(logging.INFO) logger.info('\n\n\n\n\n') return logger logf = init_log() def check_line(s, lino): for row in range(6): if not s.has_key((lino, row)): return False return True def write_header(xlsfn, fnout): xls = pE.parse_xls(xlsfn) fout = codecs.open(fnout, 'w', 'utf-8') for s in sheets: lcount = 0 stc = xls[s][1] fout.write('\n\n\n' + r'// ' + xls[s][0] + '\n') for lino in range(startLineNo, maxLineNo+1): if check_line(stc, lino): lcount = lcount + 1 line = 'const DWORD %s = \t%s;\t\t// %s \n' % (stc[(lino,2)], stc[(lino,1)], stc[(lino,3)], ) fout.write(line) logf.info('Sheet(%s) has %d constants. ', xls[s][0], lcount) def main(): write_header(xlsFileName, headFileName) if __name__ == '__main__': main()
ajibawa-2023/Python-Code-Large/train/row_99130
44
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_99130:Import_L4_C0", "label": "os import os", "type": "import", "loc": [4, 4], "level": 0, "parent": null, "vector": [1, 0, 0.0656, 0.0164, 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_99130:Import_L5_C0", "label": "sys import sys", "type": "import", "loc": [5, 5], "level": 0, "parent": null, "vector": [1, 0, 0.082, 0.0164, 0, 0.66, 0.0588, 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_99130:Import_L6_C0", "label": "re import re", "type": "import", "loc": [6, 6], "level": 0, "parent": null, "vector": [1, 0, 0.0984, 0.0164, 0, 0.66, 0.1176, 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_99130:Import_L7_C0", "label": "codecs import codecs", "type": "import", "loc": [7, 7], "level": 0, "parent": null, "vector": [1, 0, 0.1148, 0.0164, 0, 0.66, 0.1765, 220, 0, 1, 0, 0, 220, 0, 0], "semantic": {"name": "codecs", "arg_names": [], "import_names": ["codecs"], "rhs_call_name": "", "annotation": ""}, "snippet": "import codecs"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99130:Import_L8_C0", "label": "logging import logging", "type": "import", "loc": [8, 8], "level": 0, "parent": null, "vector": [1, 0, 0.1311, 0.0164, 0, 0.66, 0.2353, 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_99130:Import_L9_C0", "label": "pyExcelerator import pE", "type": "import", "loc": [9, 9], "level": 0, "parent": null, "vector": [1, 0, 0.1475, 0.0164, 0, 0.66, 0.2941, 173, 0, 1, 0, 0, 173, 0, 0], "semantic": {"name": "pyExcelerator", "arg_names": [], "import_names": ["pE"], "rhs_call_name": "", "annotation": ""}, "snippet": "import pyExcelerator as pE"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99130:Assign_L12_C0", "label": "xlsFileName =", "type": "assigned_variable", "loc": [12, 12], "level": 0, "parent": null, "vector": [14, 0, 0.1967, 0.0164, 0, 0.66, 0.3529, 5, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "xlsFileName", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "xlsFileName = r'D:\\ylb_work\\data\\je609_japan.xls'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99130:Assign_L13_C0", "label": "headFileName =", "type": "assigned_variable", "loc": [13, 13], "level": 0, "parent": null, "vector": [14, 0, 0.2131, 0.0164, 0, 0.66, 0.4118, 717, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "headFileName", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "headFileName = r'D:\\ylb_work\\data\\waveID_Japan.h'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99130:Assign_L14_C0", "label": "logFileName =", "type": "assigned_variable", "loc": [14, 14], "level": 0, "parent": null, "vector": [14, 0, 0.2295, 0.0164, 0, 0.66, 0.4706, 181, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "logFileName", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "logFileName = r'makeconst_Japan.log'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99130:Assign_L17_C0", "label": "sheets = range()", "type": "assigned_variable", "loc": [17, 17], "level": 0, "parent": null, "vector": [14, 0, 0.2787, 0.0164, 0, 0.66, 0.5294, 653, 3, 2, 0, 0, 816, 10, 1], "semantic": {"name": "sheets", "arg_names": [], "import_names": [], "rhs_call_name": "range", "annotation": ""}, "snippet": "sheets = range(1,6)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99130:Assign_L18_C0", "label": "startLineNo =", "type": "assigned_variable", "loc": [18, 18], "level": 0, "parent": null, "vector": [14, 0, 0.2951, 0.0164, 0, 0.66, 0.5882, 561, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "startLineNo", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "startLineNo = 9"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99130:Assign_L19_C0", "label": "maxLineNo =", "type": "assigned_variable", "loc": [19, 19], "level": 0, "parent": null, "vector": [14, 0, 0.3115, 0.0164, 0, 0.66, 0.6471, 540, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "maxLineNo", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "maxLineNo = 10000"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99130:FunctionDef_L21_C0", "label": "init_log", "type": "function", "loc": [21, 29], "level": 0, "parent": null, "vector": [2, 0, 0.4098, 0.1475, 0, 0.66, 0.7059, 377, 0, 0, 1, 0, 0, 0, 7], "semantic": {"name": "init_log", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def init_log():\n logger = logging.getLogger()\n hdlr = logging.FileHandler(logFileName)\n formatter = logging.Formatter('%(asctime)s %(levelname)s:: %(message)s')\n hdlr.setFormatter(formatter)\n logger.addHandler(hdlr)\n logger.setLevel(logging.INFO)\n logger.info('\\n\\n\\n\\n\\n')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99130:Assign_L22_C4", "label": "logger = getLogger()", "type": "assigned_variable", "loc": [22, 22], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99130:FunctionDef_L21_C0", "vector": [14, 1, 0.3607, 0.0164, 1, 0.9, 0.0, 532, 3, 0, 0, 0, 71, 10, 1], "semantic": {"name": "logger", "arg_names": [], "import_names": [], "rhs_call_name": "getLogger", "annotation": ""}, "snippet": " logger = logging.getLogger()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99130:Assign_L23_C4", "label": "hdlr = FileHandler()", "type": "assigned_variable", "loc": [23, 23], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99130:FunctionDef_L21_C0", "vector": [14, 1, 0.377, 0.0164, 1, 0.9, 0.1429, 149, 3, 1, 0, 0, 306, 10, 1], "semantic": {"name": "hdlr", "arg_names": [], "import_names": [], "rhs_call_name": "FileHandler", "annotation": ""}, "snippet": " hdlr = logging.FileHandler(logFileName)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99130:Assign_L24_C4", "label": "formatter = Formatter()", "type": "assigned_variable", "loc": [24, 24], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99130:FunctionDef_L21_C0", "vector": [14, 1, 0.3934, 0.0164, 1, 0.9, 0.2857, 791, 3, 1, 0, 0, 766, 10, 1], "semantic": {"name": "formatter", "arg_names": [], "import_names": [], "rhs_call_name": "Formatter", "annotation": ""}, "snippet": " formatter = logging.Formatter('%(asctime)s %(levelname)s:: %(message)s')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99130:Expr_L25_C4", "label": "setFormatter()", "type": "expression", "loc": [25, 25], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99130:FunctionDef_L21_C0", "vector": [8, 1, 0.4098, 0.0164, 1, 0.9, 0.4286, 948, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "setFormatter", "arg_names": [], "import_names": [], "rhs_call_name": "setFormatter", "annotation": ""}, "snippet": " hdlr.setFormatter(formatter)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99130:Expr_L26_C4", "label": "addHandler()", "type": "expression", "loc": [26, 26], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99130:FunctionDef_L21_C0", "vector": [8, 1, 0.4262, 0.0164, 1, 0.9, 0.5714, 255, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "addHandler", "arg_names": [], "import_names": [], "rhs_call_name": "addHandler", "annotation": ""}, "snippet": " logger.addHandler(hdlr)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99130:Expr_L27_C4", "label": "setLevel()", "type": "expression", "loc": [27, 27], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99130:FunctionDef_L21_C0", "vector": [8, 1, 0.4426, 0.0164, 1, 0.9, 0.7143, 810, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "setLevel", "arg_names": [], "import_names": [], "rhs_call_name": "setLevel", "annotation": ""}, "snippet": " logger.setLevel(logging.INFO)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99130:Expr_L28_C4", "label": "info()", "type": "expression", "loc": [28, 28], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99130:FunctionDef_L21_C0", "vector": [8, 1, 0.459, 0.0164, 1, 0.9, 0.8571, 730, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "info", "arg_names": [], "import_names": [], "rhs_call_name": "info", "annotation": ""}, "snippet": " logger.info('\\n\\n\\n\\n\\n')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99130:Return_L29_C4", "label": "return", "type": "return", "loc": [29, 29], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99130:FunctionDef_L21_C0", "vector": [13, 1, 0.4754, 0.0164, 1, 0.9, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return logger"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99130:Assign_L30_C0", "label": "logf = init_log()", "type": "assigned_variable", "loc": [30, 30], "level": 0, "parent": null, "vector": [14, 0, 0.4918, 0.0164, 0, 0.66, 0.7647, 204, 3, 0, 0, 0, 377, 10, 1], "semantic": {"name": "logf", "arg_names": [], "import_names": [], "rhs_call_name": "init_log", "annotation": ""}, "snippet": "logf = init_log()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99130:FunctionDef_L32_C0", "label": "check_line", "type": "function", "loc": [32, 36], "level": 0, "parent": null, "vector": [2, 0, 0.5574, 0.082, 0, 0.66, 0.8235, 281, 0, 2, 1, 0, 0, 0, 2], "semantic": {"name": "check_line", "arg_names": ["s", "lino"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def check_line(s, lino):\n\tfor row in range(6):\n\t\tif not s.has_key((lino, row)):\n\t\t\treturn False\n\treturn True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99130:For_L33_C1", "label": "for row", "type": "for", "loc": [33, 35], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99130:FunctionDef_L32_C0", "vector": [6, 1, 0.5574, 0.0492, 1, 0.43, 0.0, 767, 3, 0, 0, 0, 0, 0, 2], "semantic": {"name": "row", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tfor row in range(6):\n\t\tif not s.has_key((lino, row)):\n\t\t\treturn False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99130:If_L34_C2", "label": "if", "type": "if", "loc": [34, 35], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99130:For_L33_C1", "vector": [4, 2, 0.5656, 0.0328, 2, 0.54, 0.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tif not s.has_key((lino, row)):\n\t\t\treturn False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99130:Return_L35_C3", "label": "return", "type": "return", "loc": [35, 35], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99130:If_L34_C2", "vector": [13, 3, 0.5738, 0.0164, 3, 0.55, 0.0, 0, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\treturn False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99130:Return_L36_C1", "label": "return", "type": "return", "loc": [36, 36], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99130:FunctionDef_L32_C0", "vector": [13, 1, 0.5902, 0.0164, 1, 0.43, 1.0, 0, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\treturn True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99130:FunctionDef_L39_C0", "label": "write_header", "type": "function", "loc": [39, 51], "level": 0, "parent": null, "vector": [2, 0, 0.7377, 0.2131, 0, 0.66, 0.8824, 152, 0, 2, 0, 0, 0, 0, 7], "semantic": {"name": "write_header", "arg_names": ["xlsfn", "fnout"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def write_header(xlsfn, fnout):\n\txls = pE.parse_xls(xlsfn)\n\tfout = codecs.open(fnout, 'w', 'utf-8')\n\tfor s in sheets:\n\t\tlcount = 0\n\t\tstc = xls[s][1]\n\t\tfout.write('\\n\\n\\n' + r'// ' + xls[s][0] + '\\n')\n\t\tfor lino in range(startLineNo, maxLineNo+1):"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99130:Assign_L40_C1", "label": "xls = parse_xls()", "type": "assigned_variable", "loc": [40, 40], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99130:FunctionDef_L39_C0", "vector": [14, 1, 0.6557, 0.0164, 1, 0.73, 0.0, 421, 3, 1, 0, 0, 508, 10, 1], "semantic": {"name": "xls", "arg_names": [], "import_names": [], "rhs_call_name": "parse_xls", "annotation": ""}, "snippet": "\txls = pE.parse_xls(xlsfn)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99130:Assign_L41_C1", "label": "fout = open()", "type": "assigned_variable", "loc": [41, 41], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99130:FunctionDef_L39_C0", "vector": [14, 1, 0.6721, 0.0164, 1, 0.73, 0.5, 190, 3, 3, 0, 0, 693, 10, 1], "semantic": {"name": "fout", "arg_names": [], "import_names": [], "rhs_call_name": "open", "annotation": ""}, "snippet": "\tfout = codecs.open(fnout, 'w', 'utf-8')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99130:For_L42_C1", "label": "for s", "type": "for", "loc": [42, 51], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99130:FunctionDef_L39_C0", "vector": [6, 1, 0.7623, 0.1639, 1, 0.73, 1.0, 553, 2, 0, 0, 0, 0, 0, 5], "semantic": {"name": "s", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tfor s in sheets:\n\t\tlcount = 0\n\t\tstc = xls[s][1]\n\t\tfout.write('\\n\\n\\n' + r'// ' + xls[s][0] + '\\n')\n\t\tfor lino in range(startLineNo, maxLineNo+1):\n\t\t\tif check_line(stc, lino):\n\t\t\t\tlcount = lcount + 1\n\t\t\t\tline = 'const DWORD %s = \\t%s;\\t\\t// %s \\n' % (stc[(lino,2)], stc[(lino,1)], stc[(lino,3)], )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99130:Assign_L43_C2", "label": "lcount =", "type": "assigned_variable", "loc": [43, 43], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99130:For_L42_C1", "vector": [14, 2, 0.7049, 0.0164, 2, 0.79, 0.0, 711, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "lcount", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tlcount = 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99130:Assign_L44_C2", "label": "stc =", "type": "assigned_variable", "loc": [44, 44], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99130:For_L42_C1", "vector": [14, 2, 0.7213, 0.0164, 2, 0.79, 0.25, 140, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "stc", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tstc = xls[s][1]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99130:Expr_L45_C2", "label": "write()", "type": "expression", "loc": [45, 45], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99130:For_L42_C1", "vector": [8, 2, 0.7377, 0.0164, 2, 0.79, 0.5, 837, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "write", "arg_names": [], "import_names": [], "rhs_call_name": "write", "annotation": ""}, "snippet": "\t\tfout.write('\\n\\n\\n' + r'// ' + xls[s][0] + '\\n')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99130:For_L46_C2", "label": "for lino", "type": "for", "loc": [46, 50], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99130:For_L42_C1", "vector": [6, 2, 0.7869, 0.082, 2, 0.79, 0.75, 8, 3, 0, 0, 0, 0, 0, 3], "semantic": {"name": "lino", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tfor lino in range(startLineNo, maxLineNo+1):\n\t\t\tif check_line(stc, lino):\n\t\t\t\tlcount = lcount + 1\n\t\t\t\tline = 'const DWORD %s = \\t%s;\\t\\t// %s \\n' % (stc[(lino,2)], stc[(lino,1)], stc[(lino,3)], )\n\t\t\t\tfout.write(line)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99130:If_L47_C3", "label": "if", "type": "if", "loc": [47, 50], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99130:For_L46_C2", "vector": [4, 3, 0.7951, 0.0656, 3, 0.15, 0.0, 0, 3, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\tif check_line(stc, lino):\n\t\t\t\tlcount = lcount + 1\n\t\t\t\tline = 'const DWORD %s = \\t%s;\\t\\t// %s \\n' % (stc[(lino,2)], stc[(lino,1)], stc[(lino,3)], )\n\t\t\t\tfout.write(line)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99130:Assign_L48_C4", "label": "lcount =", "type": "assigned_variable", "loc": [48, 48], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99130:If_L47_C3", "vector": [14, 4, 0.7869, 0.0164, 4, 0.75, 0.0, 711, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "lcount", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\t\tlcount = lcount + 1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99130:Assign_L49_C4", "label": "line =", "type": "assigned_variable", "loc": [49, 49], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99130:If_L47_C3", "vector": [14, 4, 0.8033, 0.0164, 4, 0.75, 0.5, 373, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "line", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\t\tline = 'const DWORD %s = \\t%s;\\t\\t// %s \\n' % (stc[(lino,2)], stc[(lino,1)], stc[(lino,3)], )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99130:Expr_L50_C4", "label": "write()", "type": "expression", "loc": [50, 50], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99130:If_L47_C3", "vector": [8, 4, 0.8197, 0.0164, 4, 0.75, 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\t\tfout.write(line)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99130:Expr_L51_C2", "label": "info()", "type": "expression", "loc": [51, 51], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99130:For_L42_C1", "vector": [8, 2, 0.8361, 0.0164, 2, 0.79, 1.0, 730, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "info", "arg_names": [], "import_names": [], "rhs_call_name": "info", "annotation": ""}, "snippet": "\t\tlogf.info('Sheet(%s) has %d constants. ', xls[s][0], lcount)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99130:FunctionDef_L54_C0", "label": "main", "type": "function", "loc": [54, 55], "level": 0, "parent": null, "vector": [2, 0, 0.8934, 0.0328, 0, 0.66, 0.9412, 624, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "main", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def main():\n\twrite_header(xlsFileName, headFileName)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99130:Expr_L55_C1", "label": "write_header()", "type": "expression", "loc": [55, 55], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99130:FunctionDef_L54_C0", "vector": [8, 1, 0.9016, 0.0164, 1, 0.47, 0.0, 152, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "write_header", "arg_names": [], "import_names": [], "rhs_call_name": "write_header", "annotation": ""}, "snippet": "\twrite_header(xlsFileName, headFileName)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99130:If_L57_C0", "label": "if", "type": "if", "loc": [57, 58], "level": 0, "parent": null, "vector": [4, 0, 0.9426, 0.0328, 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\tmain()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99130:Expr_L58_C1", "label": "main()", "type": "expression", "loc": [58, 58], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99130:If_L57_C0", "vector": [8, 1, 0.9508, 0.0164, 1, 0.66, 0.0, 624, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "main", "arg_names": [], "import_names": [], "rhs_call_name": "main", "annotation": ""}, "snippet": "\tmain()"}]
[{"f": "ajibawa-2023/Python-Code-Large/train/row_99130:FunctionDef_L21_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99130:Assign_L22_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99130:FunctionDef_L21_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99130:Assign_L23_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99130:FunctionDef_L21_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99130:Assign_L24_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99130:FunctionDef_L21_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99130:Expr_L25_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99130:FunctionDef_L21_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99130:Expr_L26_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99130:FunctionDef_L21_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99130:Expr_L27_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99130:FunctionDef_L21_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99130:Expr_L28_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99130:FunctionDef_L21_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99130:Return_L29_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99130:FunctionDef_L32_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99130:For_L33_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99130:For_L33_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99130:If_L34_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99130:If_L34_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99130:Return_L35_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99130:FunctionDef_L32_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99130:Return_L36_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99130:FunctionDef_L39_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99130:Assign_L40_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99130:FunctionDef_L39_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99130:Assign_L41_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99130:FunctionDef_L39_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99130:For_L42_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99130:For_L42_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99130:Assign_L43_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99130:For_L42_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99130:Assign_L44_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99130:For_L42_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99130:Expr_L45_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99130:For_L42_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99130:For_L46_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99130:For_L46_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99130:If_L47_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99130:If_L47_C3", "t": "ajibawa-2023/Python-Code-Large/train/row_99130:Assign_L48_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99130:If_L47_C3", "t": "ajibawa-2023/Python-Code-Large/train/row_99130:Assign_L49_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99130:If_L47_C3", "t": "ajibawa-2023/Python-Code-Large/train/row_99130:Expr_L50_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99130:For_L42_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99130:Expr_L51_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99130:FunctionDef_L54_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99130:Expr_L55_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99130:If_L57_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99130:Expr_L58_C1"}]
#!/usr/bin/python import os ###################################################################### # Question 1: See the demo*.jpg files in this directory ###################################################################### ###################################################################### # Question 2: The interface for the dot module: ###################################################################### def newDot(): return 'digraph g {\n\tordering = out\n' # dot dotInsert(), not void dotInsert(); A little ugly here :-) def dotInsert(d, fr, to, info = None): d = d + '\t' + '"' + fr + '"'+ ' -> ' + '"' + to + '"' if info != None: d = d + ' [label="%s"];\n' % info else: d = d + ';\n' return d def dotToJpg(d, fileName): d = d + '}\n' # Don't forget d need a '}' to terminate! f = open(fileName + '.dot', 'w') f.write(d) f.close() cmd = 'dot -Tjpg %s.dot -o %s.jpg' % (fileName, fileName) os.system(cmd) ###################################################################### # Question 3: Extensible "tree" ADT ###################################################################### def visit(x): print 'Now visiting ' + x class newTree: def __init__(self): self.vertex = {} def treeInsertVertex(self, v): self.vertex[v] = {} def treeInsertEdge(self, fr, to): self.vertex[fr][to] = None def treeInsertEdgeInfo(self, fr, to, info): self.vertex[fr][to] = info def treeToJpg(self, fileName): self.d = newDot() for x in sorted(self.vertex): for y in sorted(self.vertex[x]): self.d = dotInsert(self.d, x, y, self.vertex[x][y]) dotToJpg(self.d, fileName) def treePreOrder(self, root, visit): visit(root) for x in sorted(self.vertex[root]): self.treePreOrder(x, visit) def treeInOrder(self, root, visit): if len(self.vertex[root]) == 0: visit(root) else: self.treeInOrder(sorted(self.vertex[root])[0], visit) visit(root) for x in sorted(self.vertex[root])[1:]: self.treeInOrder(x, visit) def treePostOrder(self, root, visit): for x in sorted(self.vertex[root]): self.treePostOrder(x, visit) visit(root) def treeLevelOrder(self, root, visit): queue = [root] while len(queue) > 0: n = queue.pop(0) visit(n) for x in sorted(self.vertex[n]): queue.append(x) ###################################################################### # Question 4: Extensible "graph" ADT ###################################################################### class newGraph: def __init__(self): self.vertex = {} def graphInsertVertex(self, v): self.vertex[v] = {} def graphInsertEdge(self, fr, to): self.vertex[fr][to] = None def graphInsertEdgeInfo(self, fr, to, info): self.vertex[fr][to] = info def graphToJpg(self, fileName): self.d = newDot() for x in self.vertex: for y in self.vertex[x]: self.d = dotInsert(self.d, x, y, self.vertex[x][y]) dotToJpg(self.d, fileName) def dfs(self, start, visit): visit(start) self.visited.append(start) for x in sorted(self.vertex[start]): if x not in self.visited: self.dfs(x, visit) def graphDfs(self, start, visit): self.visited = [] self.dfs(start, visit) for x in sorted(self.vertex): if x not in self.visited: self.dfs(x, visit) def bfs(self, start, visit): queue = [start] while len(queue) > 0: n = queue.pop(0) if n not in self.visited: visit(n) self.visited.append(n) for x in sorted(self.vertex[n]): if x not in self.visited: queue.append(x) def graphBfs(self, start, visit): self.visited = [] self.bfs(start, visit) for x in sorted(self.vertex): if x not in self.visited: self.bfs(x, visit) ###################################################################### # Let's take two examples: ###################################################################### tn = 'sample_tree' t = newTree() t.treeInsertVertex('1') t.treeInsertVertex('2') t.treeInsertVertex('3') t.treeInsertEdgeInfo('1', '2', 'son') t.treeInsertEdgeInfo('1', '3', 'daughter') print 'Generating %s.dot and %s.jpg...' % (tn, tn), t.treeToJpg(tn) print 'Done.' print 'Visit the tree in %s.jpg in PreOrder:' % tn t.treePreOrder('1', visit) print 'Visit the tree in %s.jpg in InOrder:' % tn t.treeInOrder('1', visit) print 'Visit the tree in %s.jpg in PostOrder:' % tn t.treePostOrder('1', visit) print 'Visit the tree in %s.jpg in LevelOrder:' % tn t.treeLevelOrder('1', visit) print '----------------------------------------------------------------------' gn = 'sample_graph' g = newGraph() g.graphInsertVertex('1') g.graphInsertVertex('2') g.graphInsertVertex('3') g.graphInsertVertex('4') g.graphInsertVertex('5') g.graphInsertVertex('6') g.graphInsertEdge('1', '2') g.graphInsertEdge('1', '4') g.graphInsertEdge('2', '5') g.graphInsertEdge('5', '4') g.graphInsertEdge('4', '2') g.graphInsertEdge('3', '5') g.graphInsertEdge('3', '6') g.graphInsertEdge('6', '6') print 'Generating %s.dot and %s.jpg...' % (gn, gn), g.graphToJpg(gn) print 'Done.' print 'Visit the tree in %s.jpg in Dfs:' % gn g.graphDfs('1', visit) print 'Visit the tree in %s.jpg in Bfs:' % gn g.graphBfs('1', visit) raw_input('\nPress enter to exit')
ajibawa-2023/Python-Code-Large/train/row_99131
141
174
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_99131:Import_L3_C0", "label": "os import os", "type": "import", "loc": [3, 3], "level": 0, "parent": null, "vector": [1, 0, 0.0172, 0.0057, 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_99131:FunctionDef_L13_C0", "label": "newDot", "type": "function", "loc": [13, 14], "level": 0, "parent": null, "vector": [2, 0, 0.0776, 0.0115, 0, 0.66, 0.0204, 280, 0, 0, 1, 0, 0, 0, 0], "semantic": {"name": "newDot", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def newDot():\n return 'digraph g {\\n\\tordering = out\\n'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99131:Return_L14_C4", "label": "return", "type": "return", "loc": [14, 14], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99131:FunctionDef_L13_C0", "vector": [13, 1, 0.0805, 0.0057, 1, 0.61, 0.0, 0, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return 'digraph g {\\n\\tordering = out\\n'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99131:FunctionDef_L16_C0", "label": "dotInsert", "type": "function", "loc": [16, 22], "level": 0, "parent": null, "vector": [2, 0, 0.1092, 0.0402, 0, 0.66, 0.0408, 933, 0, 4, 1, 0, 0, 0, 0], "semantic": {"name": "dotInsert", "arg_names": ["d", "fr", "to", "info"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def dotInsert(d, fr, to, info = None):\n d = d + '\\t' + '\"' + fr + '\"'+ ' -> ' + '\"' + to + '\"'\n if info != None:\n d = d + ' [label=\"%s\"];\\n' % info\n else:\n d = d + ';\\n'\n return d"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99131:Assign_L17_C4", "label": "d =", "type": "assigned_variable", "loc": [17, 17], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99131:FunctionDef_L16_C0", "vector": [14, 1, 0.0977, 0.0057, 1, 0.73, 0.0, 355, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "d", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " d = d + '\\t' + '\"' + fr + '\"'+ ' -> ' + '\"' + to + '\"'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99131:If_L18_C4", "label": "if", "type": "if", "loc": [18, 21], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99131:FunctionDef_L16_C0", "vector": [4, 1, 0.1121, 0.023, 1, 0.73, 0.5, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if info != None:\n d = d + ' [label=\"%s\"];\\n' % info\n else:\n d = d + ';\\n'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99131:Assign_L19_C8", "label": "d =", "type": "assigned_variable", "loc": [19, 19], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99131:If_L18_C4", "vector": [14, 2, 0.1092, 0.0057, 2, 0.13, 0.0, 355, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "d", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " d = d + ' [label=\"%s\"];\\n' % info"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99131:Assign_L21_C8", "label": "d =", "type": "assigned_variable", "loc": [21, 21], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99131:If_L18_C4", "vector": [14, 2, 0.1207, 0.0057, 2, 0.13, 1.0, 355, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "d", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " d = d + ';\\n'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99131:Return_L22_C4", "label": "return", "type": "return", "loc": [22, 22], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99131:FunctionDef_L16_C0", "vector": [13, 1, 0.1264, 0.0057, 1, 0.73, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return d"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99131:FunctionDef_L23_C0", "label": "dotToJpg", "type": "function", "loc": [23, 29], "level": 0, "parent": null, "vector": [2, 0, 0.1494, 0.0402, 0, 0.66, 0.0612, 622, 0, 2, 0, 0, 0, 0, 4], "semantic": {"name": "dotToJpg", "arg_names": ["d", "fileName"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def dotToJpg(d, fileName):\n d = d + '}\\n' # Don't forget d need a '}' to terminate!\n f = open(fileName + '.dot', 'w')\n f.write(d)\n f.close()\n cmd = 'dot -Tjpg %s.dot -o %s.jpg' % (fileName, fileName)\n os.system(cmd)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99131:Assign_L24_C4", "label": "d =", "type": "assigned_variable", "loc": [24, 24], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99131:FunctionDef_L23_C0", "vector": [14, 1, 0.1379, 0.0057, 1, 0.91, 0.0, 355, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "d", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " d = d + '}\\n' # Don't forget d need a '}' to terminate!"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99131:Assign_L25_C4", "label": "f = open()", "type": "assigned_variable", "loc": [25, 25], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99131:FunctionDef_L23_C0", "vector": [14, 1, 0.1437, 0.0057, 1, 0.91, 0.2, 899, 3, 2, 0, 0, 693, 10, 1], "semantic": {"name": "f", "arg_names": [], "import_names": [], "rhs_call_name": "open", "annotation": ""}, "snippet": " f = open(fileName + '.dot', 'w')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99131:Expr_L26_C4", "label": "write()", "type": "expression", "loc": [26, 26], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99131:FunctionDef_L23_C0", "vector": [8, 1, 0.1494, 0.0057, 1, 0.91, 0.4, 837, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "write", "arg_names": [], "import_names": [], "rhs_call_name": "write", "annotation": ""}, "snippet": " f.write(d)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99131:Expr_L27_C4", "label": "close()", "type": "expression", "loc": [27, 27], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99131:FunctionDef_L23_C0", "vector": [8, 1, 0.1552, 0.0057, 1, 0.91, 0.6, 77, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "close", "arg_names": [], "import_names": [], "rhs_call_name": "close", "annotation": ""}, "snippet": " f.close()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99131:Assign_L28_C4", "label": "cmd =", "type": "assigned_variable", "loc": [28, 28], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99131:FunctionDef_L23_C0", "vector": [14, 1, 0.1609, 0.0057, 1, 0.91, 0.8, 604, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "cmd", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " cmd = 'dot -Tjpg %s.dot -o %s.jpg' % (fileName, fileName)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99131:Expr_L29_C4", "label": "system()", "type": "expression", "loc": [29, 29], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99131:FunctionDef_L23_C0", "vector": [8, 1, 0.1667, 0.0057, 1, 0.91, 1.0, 856, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "system", "arg_names": [], "import_names": [], "rhs_call_name": "system", "annotation": ""}, "snippet": " os.system(cmd)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99131:FunctionDef_L35_C0", "label": "visit", "type": "function", "loc": [35, 36], "level": 0, "parent": null, "vector": [2, 0, 0.204, 0.0115, 0, 0.66, 0.0816, 694, 0, 1, 0, 0, 0, 0, 1], "semantic": {"name": "visit", "arg_names": ["x"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def visit(x):\n print('Now visiting ' + x)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99131:Expr_L36_C4", "label": "print()", "type": "expression", "loc": [36, 36], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99131:FunctionDef_L35_C0", "vector": [8, 1, 0.2069, 0.0057, 1, 0.74, 0.0, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('Now visiting ' + x)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99131:ClassDef_L38_C0", "label": "newTree", "type": "class", "loc": [38, 75], "level": 0, "parent": null, "vector": [3, 0, 0.3247, 0.2184, 0, 0.66, 0.102, 768, 0, 9, 0, 0, 0, 0, 23], "semantic": {"name": "newTree", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class newTree:\n def __init__(self):\n self.vertex = {}\n def treeInsertVertex(self, v):\n self.vertex[v] = {}\n def treeInsertEdge(self, fr, to):\n self.vertex[fr][to] = None\n def treeInsertEdgeInfo(self, fr, to, info):"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99131:FunctionDef_L39_C4", "label": "__init__", "type": "function", "loc": [39, 40], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99131:ClassDef_L38_C0", "vector": [2, 1, 0.227, 0.0115, 1, 0.99, 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.vertex = {}"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99131:Assign_L40_C8", "label": "self.vertex =", "type": "assigned_variable", "loc": [40, 40], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99131:FunctionDef_L39_C4", "vector": [14, 2, 0.2299, 0.0057, 2, 0.01, 0.0, 529, 0, 0, 0, 0, 0, 6, 0], "semantic": {"name": "self.vertex", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.vertex = {}"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99131:FunctionDef_L41_C4", "label": "treeInsertVertex", "type": "function", "loc": [41, 42], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99131:ClassDef_L38_C0", "vector": [2, 1, 0.2385, 0.0115, 1, 0.99, 0.125, 964, 0, 2, 0, 0, 0, 0, 0], "semantic": {"name": "treeInsertVertex", "arg_names": ["self", "v"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def treeInsertVertex(self, v):\n self.vertex[v] = {}"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99131:Assign_L42_C8", "label": "assign", "type": "assigned_variable", "loc": [42, 42], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99131:FunctionDef_L41_C4", "vector": [14, 2, 0.2414, 0.0057, 2, 0.98, 0.0, 0, 0, 0, 0, 0, 0, 6, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.vertex[v] = {}"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99131:FunctionDef_L43_C4", "label": "treeInsertEdge", "type": "function", "loc": [43, 44], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99131:ClassDef_L38_C0", "vector": [2, 1, 0.25, 0.0115, 1, 0.99, 0.25, 574, 0, 3, 0, 0, 0, 0, 0], "semantic": {"name": "treeInsertEdge", "arg_names": ["self", "fr", "to"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def treeInsertEdge(self, fr, to):\n self.vertex[fr][to] = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99131:Assign_L44_C8", "label": "assign", "type": "assigned_variable", "loc": [44, 44], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99131:FunctionDef_L43_C4", "vector": [14, 2, 0.2529, 0.0057, 2, 0.07, 0.0, 0, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.vertex[fr][to] = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99131:FunctionDef_L45_C4", "label": "treeInsertEdgeInfo", "type": "function", "loc": [45, 46], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99131:ClassDef_L38_C0", "vector": [2, 1, 0.2615, 0.0115, 1, 0.99, 0.375, 585, 0, 4, 0, 0, 0, 0, 0], "semantic": {"name": "treeInsertEdgeInfo", "arg_names": ["self", "fr", "to", "info"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def treeInsertEdgeInfo(self, fr, to, info):\n self.vertex[fr][to] = info"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99131:Assign_L46_C8", "label": "assign", "type": "assigned_variable", "loc": [46, 46], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99131:FunctionDef_L45_C4", "vector": [14, 2, 0.2644, 0.0057, 2, 0.21, 0.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.vertex[fr][to] = info"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99131:FunctionDef_L47_C4", "label": "treeToJpg", "type": "function", "loc": [47, 52], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99131:ClassDef_L38_C0", "vector": [2, 1, 0.2845, 0.0345, 1, 0.99, 0.5, 219, 0, 2, 0, 0, 0, 0, 5], "semantic": {"name": "treeToJpg", "arg_names": ["self", "fileName"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def treeToJpg(self, fileName):\n self.d = newDot()\n for x in sorted(self.vertex):\n for y in sorted(self.vertex[x]):\n self.d = dotInsert(self.d, x, y, self.vertex[x][y])\n dotToJpg(self.d, fileName)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99131:Assign_L48_C8", "label": "self.d = newDot()", "type": "assigned_variable", "loc": [48, 48], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99131:FunctionDef_L47_C4", "vector": [14, 2, 0.2759, 0.0057, 2, 0.14, 0.0, 745, 3, 0, 0, 0, 280, 10, 1], "semantic": {"name": "self.d", "arg_names": [], "import_names": [], "rhs_call_name": "newDot", "annotation": ""}, "snippet": " self.d = newDot()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99131:For_L49_C8", "label": "for x", "type": "for", "loc": [49, 51], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99131:FunctionDef_L47_C4", "vector": [6, 2, 0.2874, 0.0172, 2, 0.14, 0.5, 190, 3, 0, 0, 0, 0, 0, 3], "semantic": {"name": "x", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for x in sorted(self.vertex):\n for y in sorted(self.vertex[x]):\n self.d = dotInsert(self.d, x, y, self.vertex[x][y])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99131:For_L50_C12", "label": "for y", "type": "for", "loc": [50, 51], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99131:For_L49_C8", "vector": [6, 3, 0.2902, 0.0115, 3, 0.29, 0.0, 304, 3, 0, 0, 0, 0, 0, 2], "semantic": {"name": "y", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for y in sorted(self.vertex[x]):\n self.d = dotInsert(self.d, x, y, self.vertex[x][y])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99131:Assign_L51_C16", "label": "self.d = dotInsert()", "type": "assigned_variable", "loc": [51, 51], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99131:For_L50_C12", "vector": [14, 4, 0.2931, 0.0057, 4, 0.8, 0.0, 745, 3, 4, 0, 0, 933, 10, 1], "semantic": {"name": "self.d", "arg_names": [], "import_names": [], "rhs_call_name": "dotInsert", "annotation": ""}, "snippet": " self.d = dotInsert(self.d, x, y, self.vertex[x][y])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99131:Expr_L52_C8", "label": "dotToJpg()", "type": "expression", "loc": [52, 52], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99131:FunctionDef_L47_C4", "vector": [8, 2, 0.2989, 0.0057, 2, 0.14, 1.0, 622, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "dotToJpg", "arg_names": [], "import_names": [], "rhs_call_name": "dotToJpg", "annotation": ""}, "snippet": " dotToJpg(self.d, fileName)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99131:FunctionDef_L53_C4", "label": "treePreOrder", "type": "function", "loc": [53, 56], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99131:ClassDef_L38_C0", "vector": [2, 1, 0.3132, 0.023, 1, 0.99, 0.625, 295, 0, 3, 0, 0, 0, 0, 3], "semantic": {"name": "treePreOrder", "arg_names": ["self", "root", "visit"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def treePreOrder(self, root, visit):\n visit(root)\n for x in sorted(self.vertex[root]):\n self.treePreOrder(x, visit)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99131:Expr_L54_C8", "label": "visit()", "type": "expression", "loc": [54, 54], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99131:FunctionDef_L53_C4", "vector": [8, 2, 0.3103, 0.0057, 2, 0.96, 0.0, 694, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "visit", "arg_names": [], "import_names": [], "rhs_call_name": "visit", "annotation": ""}, "snippet": " visit(root)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99131:For_L55_C8", "label": "for x", "type": "for", "loc": [55, 56], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99131:FunctionDef_L53_C4", "vector": [6, 2, 0.319, 0.0115, 2, 0.96, 1.0, 190, 3, 0, 0, 0, 0, 0, 2], "semantic": {"name": "x", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for x in sorted(self.vertex[root]):\n self.treePreOrder(x, visit)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99131:Expr_L56_C12", "label": "treePreOrder()", "type": "expression", "loc": [56, 56], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99131:For_L55_C8", "vector": [8, 3, 0.3218, 0.0057, 3, 0.82, 0.0, 295, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "treePreOrder", "arg_names": [], "import_names": [], "rhs_call_name": "treePreOrder", "annotation": ""}, "snippet": " self.treePreOrder(x, visit)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99131:FunctionDef_L57_C4", "label": "treeInOrder", "type": "function", "loc": [57, 64], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99131:ClassDef_L38_C0", "vector": [2, 1, 0.3477, 0.046, 1, 0.99, 0.75, 699, 0, 3, 0, 0, 0, 0, 7], "semantic": {"name": "treeInOrder", "arg_names": ["self", "root", "visit"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def treeInOrder(self, root, visit):\n if len(self.vertex[root]) == 0:\n visit(root)\n else:\n self.treeInOrder(sorted(self.vertex[root])[0], visit)\n visit(root)\n for x in sorted(self.vertex[root])[1:]:\n self.treeInOrder(x, visit)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99131:If_L58_C8", "label": "if", "type": "if", "loc": [58, 64], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99131:FunctionDef_L57_C4", "vector": [4, 2, 0.3506, 0.0402, 2, 0.7, 0.0, 0, 0, 0, 0, 0, 0, 0, 7], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if len(self.vertex[root]) == 0:\n visit(root)\n else:\n self.treeInOrder(sorted(self.vertex[root])[0], visit)\n visit(root)\n for x in sorted(self.vertex[root])[1:]:\n self.treeInOrder(x, visit)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99131:Expr_L59_C12", "label": "visit()", "type": "expression", "loc": [59, 59], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99131:If_L58_C8", "vector": [8, 3, 0.3391, 0.0057, 3, 0.15, 0.0, 694, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "visit", "arg_names": [], "import_names": [], "rhs_call_name": "visit", "annotation": ""}, "snippet": " visit(root)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99131:Expr_L61_C12", "label": "treeInOrder()", "type": "expression", "loc": [61, 61], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99131:If_L58_C8", "vector": [8, 3, 0.3506, 0.0057, 3, 0.15, 0.3333, 699, 3, 2, 0, 0, 0, 0, 2], "semantic": {"name": "treeInOrder", "arg_names": [], "import_names": [], "rhs_call_name": "treeInOrder", "annotation": ""}, "snippet": " self.treeInOrder(sorted(self.vertex[root])[0], visit)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99131:Expr_L62_C12", "label": "visit()", "type": "expression", "loc": [62, 62], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99131:If_L58_C8", "vector": [8, 3, 0.3563, 0.0057, 3, 0.15, 0.6667, 694, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "visit", "arg_names": [], "import_names": [], "rhs_call_name": "visit", "annotation": ""}, "snippet": " visit(root)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99131:For_L63_C12", "label": "for x", "type": "for", "loc": [63, 64], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99131:If_L58_C8", "vector": [6, 3, 0.3649, 0.0115, 3, 0.15, 1.0, 190, 6, 0, 0, 0, 0, 0, 2], "semantic": {"name": "x", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for x in sorted(self.vertex[root])[1:]:\n self.treeInOrder(x, visit)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99131:Expr_L64_C16", "label": "treeInOrder()", "type": "expression", "loc": [64, 64], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99131:For_L63_C12", "vector": [8, 4, 0.3678, 0.0057, 4, 0.55, 0.0, 699, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "treeInOrder", "arg_names": [], "import_names": [], "rhs_call_name": "treeInOrder", "annotation": ""}, "snippet": " self.treeInOrder(x, visit)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99131:FunctionDef_L65_C4", "label": "treePostOrder", "type": "function", "loc": [65, 68], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99131:ClassDef_L38_C0", "vector": [2, 1, 0.3822, 0.023, 1, 0.99, 0.875, 330, 0, 3, 0, 0, 0, 0, 3], "semantic": {"name": "treePostOrder", "arg_names": ["self", "root", "visit"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def treePostOrder(self, root, visit):\n for x in sorted(self.vertex[root]):\n self.treePostOrder(x, visit)\n visit(root)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99131:For_L66_C8", "label": "for x", "type": "for", "loc": [66, 67], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99131:FunctionDef_L65_C4", "vector": [6, 2, 0.3822, 0.0115, 2, 0.35, 0.0, 190, 3, 0, 0, 0, 0, 0, 2], "semantic": {"name": "x", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for x in sorted(self.vertex[root]):\n self.treePostOrder(x, visit)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99131:Expr_L67_C12", "label": "treePostOrder()", "type": "expression", "loc": [67, 67], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99131:For_L66_C8", "vector": [8, 3, 0.3851, 0.0057, 3, 0.27, 0.0, 330, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "treePostOrder", "arg_names": [], "import_names": [], "rhs_call_name": "treePostOrder", "annotation": ""}, "snippet": " self.treePostOrder(x, visit)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99131:Expr_L68_C8", "label": "visit()", "type": "expression", "loc": [68, 68], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99131:FunctionDef_L65_C4", "vector": [8, 2, 0.3908, 0.0057, 2, 0.35, 1.0, 694, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "visit", "arg_names": [], "import_names": [], "rhs_call_name": "visit", "annotation": ""}, "snippet": " visit(root)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99131:FunctionDef_L69_C4", "label": "treeLevelOrder", "type": "function", "loc": [69, 75], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99131:ClassDef_L38_C0", "vector": [2, 1, 0.4138, 0.0402, 1, 0.99, 1.0, 996, 0, 3, 0, 0, 0, 0, 5], "semantic": {"name": "treeLevelOrder", "arg_names": ["self", "root", "visit"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def treeLevelOrder(self, root, visit):\n queue = [root]\n while len(queue) > 0:\n n = queue.pop(0)\n visit(n)\n for x in sorted(self.vertex[n]):\n queue.append(x)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99131:Assign_L70_C8", "label": "queue =", "type": "assigned_variable", "loc": [70, 70], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99131:FunctionDef_L69_C4", "vector": [14, 2, 0.4023, 0.0057, 2, 0.81, 0.0, 325, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "queue", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " queue = [root]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99131:While_L71_C8", "label": "while", "type": "while", "loc": [71, 75], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99131:FunctionDef_L69_C4", "vector": [5, 2, 0.4195, 0.0287, 2, 0.81, 1.0, 0, 0, 0, 0, 0, 0, 0, 5], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " while len(queue) > 0:\n n = queue.pop(0)\n visit(n)\n for x in sorted(self.vertex[n]):\n queue.append(x)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99131:Assign_L72_C12", "label": "n = pop()", "type": "assigned_variable", "loc": [72, 72], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99131:While_L71_C8", "vector": [14, 3, 0.4138, 0.0057, 3, 0.79, 0.0, 773, 3, 1, 0, 0, 969, 10, 1], "semantic": {"name": "n", "arg_names": [], "import_names": [], "rhs_call_name": "pop", "annotation": ""}, "snippet": " n = queue.pop(0)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99131:Expr_L73_C12", "label": "visit()", "type": "expression", "loc": [73, 73], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99131:While_L71_C8", "vector": [8, 3, 0.4195, 0.0057, 3, 0.79, 0.5, 694, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "visit", "arg_names": [], "import_names": [], "rhs_call_name": "visit", "annotation": ""}, "snippet": " visit(n)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99131:For_L74_C12", "label": "for x", "type": "for", "loc": [74, 75], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99131:While_L71_C8", "vector": [6, 3, 0.4282, 0.0115, 3, 0.79, 1.0, 190, 3, 0, 0, 0, 0, 0, 2], "semantic": {"name": "x", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for x in sorted(self.vertex[n]):\n queue.append(x)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99131:Expr_L75_C16", "label": "append()", "type": "expression", "loc": [75, 75], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99131:For_L74_C12", "vector": [8, 4, 0.431, 0.0057, 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": " queue.append(x)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99131:ClassDef_L81_C0", "label": "newGraph", "type": "class", "loc": [81, 123], "level": 0, "parent": null, "vector": [3, 0, 0.5862, 0.2471, 0, 0.66, 0.1224, 755, 0, 9, 0, 0, 0, 0, 19], "semantic": {"name": "newGraph", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class newGraph:\n def __init__(self):\n self.vertex = {}\n def graphInsertVertex(self, v):\n self.vertex[v] = {}\n def graphInsertEdge(self, fr, to):\n self.vertex[fr][to] = None\n def graphInsertEdgeInfo(self, fr, to, info):"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99131:FunctionDef_L82_C4", "label": "__init__", "type": "function", "loc": [82, 83], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99131:ClassDef_L81_C0", "vector": [2, 1, 0.4741, 0.0115, 1, 0.62, 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.vertex = {}"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99131:Assign_L83_C8", "label": "self.vertex =", "type": "assigned_variable", "loc": [83, 83], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99131:FunctionDef_L82_C4", "vector": [14, 2, 0.477, 0.0057, 2, 0.9, 0.0, 529, 0, 0, 0, 0, 0, 6, 0], "semantic": {"name": "self.vertex", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.vertex = {}"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99131:FunctionDef_L84_C4", "label": "graphInsertVertex", "type": "function", "loc": [84, 85], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99131:ClassDef_L81_C0", "vector": [2, 1, 0.4856, 0.0115, 1, 0.62, 0.125, 823, 0, 2, 0, 0, 0, 0, 0], "semantic": {"name": "graphInsertVertex", "arg_names": ["self", "v"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def graphInsertVertex(self, v):\n self.vertex[v] = {}"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99131:Assign_L85_C8", "label": "assign", "type": "assigned_variable", "loc": [85, 85], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99131:FunctionDef_L84_C4", "vector": [14, 2, 0.4885, 0.0057, 2, 0.48, 0.0, 0, 0, 0, 0, 0, 0, 6, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.vertex[v] = {}"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99131:FunctionDef_L86_C4", "label": "graphInsertEdge", "type": "function", "loc": [86, 87], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99131:ClassDef_L81_C0", "vector": [2, 1, 0.4971, 0.0115, 1, 0.62, 0.25, 954, 0, 3, 0, 0, 0, 0, 0], "semantic": {"name": "graphInsertEdge", "arg_names": ["self", "fr", "to"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def graphInsertEdge(self, fr, to):\n self.vertex[fr][to] = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99131:Assign_L87_C8", "label": "assign", "type": "assigned_variable", "loc": [87, 87], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99131:FunctionDef_L86_C4", "vector": [14, 2, 0.5, 0.0057, 2, 0.13, 0.0, 0, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.vertex[fr][to] = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99131:FunctionDef_L88_C4", "label": "graphInsertEdgeInfo", "type": "function", "loc": [88, 89], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99131:ClassDef_L81_C0", "vector": [2, 1, 0.5086, 0.0115, 1, 0.62, 0.375, 255, 0, 4, 0, 0, 0, 0, 0], "semantic": {"name": "graphInsertEdgeInfo", "arg_names": ["self", "fr", "to", "info"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def graphInsertEdgeInfo(self, fr, to, info):\n self.vertex[fr][to] = info"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99131:Assign_L89_C8", "label": "assign", "type": "assigned_variable", "loc": [89, 89], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99131:FunctionDef_L88_C4", "vector": [14, 2, 0.5115, 0.0057, 2, 0.3, 0.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.vertex[fr][to] = info"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99131:FunctionDef_L90_C4", "label": "graphToJpg", "type": "function", "loc": [90, 95], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99131:ClassDef_L81_C0", "vector": [2, 1, 0.5316, 0.0345, 1, 0.62, 0.5, 49, 0, 2, 0, 0, 0, 0, 3], "semantic": {"name": "graphToJpg", "arg_names": ["self", "fileName"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def graphToJpg(self, fileName):\n self.d = newDot()\n for x in self.vertex:\n for y in self.vertex[x]:\n self.d = dotInsert(self.d, x, y, self.vertex[x][y])\n dotToJpg(self.d, fileName)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99131:Assign_L91_C8", "label": "self.d = newDot()", "type": "assigned_variable", "loc": [91, 91], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99131:FunctionDef_L90_C4", "vector": [14, 2, 0.523, 0.0057, 2, 0.34, 0.0, 745, 3, 0, 0, 0, 280, 10, 1], "semantic": {"name": "self.d", "arg_names": [], "import_names": [], "rhs_call_name": "newDot", "annotation": ""}, "snippet": " self.d = newDot()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99131:For_L92_C8", "label": "for x", "type": "for", "loc": [92, 94], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99131:FunctionDef_L90_C4", "vector": [6, 2, 0.5345, 0.0172, 2, 0.34, 0.5, 190, 7, 0, 0, 0, 0, 0, 1], "semantic": {"name": "x", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for x in self.vertex:\n for y in self.vertex[x]:\n self.d = dotInsert(self.d, x, y, self.vertex[x][y])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99131:For_L93_C12", "label": "for y", "type": "for", "loc": [93, 94], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99131:For_L92_C8", "vector": [6, 3, 0.5374, 0.0115, 3, 0.95, 0.0, 304, 6, 0, 0, 0, 0, 0, 1], "semantic": {"name": "y", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for y in self.vertex[x]:\n self.d = dotInsert(self.d, x, y, self.vertex[x][y])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99131:Assign_L94_C16", "label": "self.d = dotInsert()", "type": "assigned_variable", "loc": [94, 94], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99131:For_L93_C12", "vector": [14, 4, 0.5402, 0.0057, 4, 0.43, 0.0, 745, 3, 4, 0, 0, 933, 10, 1], "semantic": {"name": "self.d", "arg_names": [], "import_names": [], "rhs_call_name": "dotInsert", "annotation": ""}, "snippet": " self.d = dotInsert(self.d, x, y, self.vertex[x][y])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99131:Expr_L95_C8", "label": "dotToJpg()", "type": "expression", "loc": [95, 95], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99131:FunctionDef_L90_C4", "vector": [8, 2, 0.546, 0.0057, 2, 0.34, 1.0, 622, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "dotToJpg", "arg_names": [], "import_names": [], "rhs_call_name": "dotToJpg", "annotation": ""}, "snippet": " dotToJpg(self.d, fileName)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99131:FunctionDef_L96_C4", "label": "dfs", "type": "function", "loc": [96, 101], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99131:ClassDef_L81_C0", "vector": [2, 1, 0.5661, 0.0345, 1, 0.62, 0.625, 323, 0, 3, 0, 0, 0, 0, 4], "semantic": {"name": "dfs", "arg_names": ["self", "start", "visit"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def dfs(self, start, visit):\n visit(start)\n self.visited.append(start)\n for x in sorted(self.vertex[start]):\n if x not in self.visited:\n self.dfs(x, visit)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99131:Expr_L97_C8", "label": "visit()", "type": "expression", "loc": [97, 97], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99131:FunctionDef_L96_C4", "vector": [8, 2, 0.5575, 0.0057, 2, 0.95, 0.0, 694, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "visit", "arg_names": [], "import_names": [], "rhs_call_name": "visit", "annotation": ""}, "snippet": " visit(start)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99131:Expr_L98_C8", "label": "append()", "type": "expression", "loc": [98, 98], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99131:FunctionDef_L96_C4", "vector": [8, 2, 0.5632, 0.0057, 2, 0.95, 0.5, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " self.visited.append(start)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99131:For_L99_C8", "label": "for x", "type": "for", "loc": [99, 101], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99131:FunctionDef_L96_C4", "vector": [6, 2, 0.5747, 0.0172, 2, 0.95, 1.0, 190, 3, 0, 0, 0, 0, 0, 2], "semantic": {"name": "x", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for x in sorted(self.vertex[start]):\n if x not in self.visited:\n self.dfs(x, visit)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99131:If_L100_C12", "label": "if", "type": "if", "loc": [100, 101], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99131:For_L99_C8", "vector": [4, 3, 0.5776, 0.0115, 3, 0.06, 0.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if x not in self.visited:\n self.dfs(x, visit)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99131:Expr_L101_C16", "label": "dfs()", "type": "expression", "loc": [101, 101], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99131:If_L100_C12", "vector": [8, 4, 0.5805, 0.0057, 4, 0.66, 0.0, 323, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "dfs", "arg_names": [], "import_names": [], "rhs_call_name": "dfs", "annotation": ""}, "snippet": " self.dfs(x, visit)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99131:FunctionDef_L102_C4", "label": "graphDfs", "type": "function", "loc": [102, 107], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99131:ClassDef_L81_C0", "vector": [2, 1, 0.6006, 0.0345, 1, 0.62, 0.75, 150, 0, 3, 0, 0, 0, 0, 3], "semantic": {"name": "graphDfs", "arg_names": ["self", "start", "visit"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def graphDfs(self, start, visit):\n self.visited = []\n self.dfs(start, visit)\n for x in sorted(self.vertex):\n if x not in self.visited:\n self.dfs(x, visit)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99131:Assign_L103_C8", "label": "self.visited =", "type": "assigned_variable", "loc": [103, 103], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99131:FunctionDef_L102_C4", "vector": [14, 2, 0.592, 0.0057, 2, 0.86, 0.0, 112, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "self.visited", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.visited = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99131:Expr_L104_C8", "label": "dfs()", "type": "expression", "loc": [104, 104], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99131:FunctionDef_L102_C4", "vector": [8, 2, 0.5977, 0.0057, 2, 0.86, 0.5, 323, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "dfs", "arg_names": [], "import_names": [], "rhs_call_name": "dfs", "annotation": ""}, "snippet": " self.dfs(start, visit)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99131:For_L105_C8", "label": "for x", "type": "for", "loc": [105, 107], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99131:FunctionDef_L102_C4", "vector": [6, 2, 0.6092, 0.0172, 2, 0.86, 1.0, 190, 3, 0, 0, 0, 0, 0, 2], "semantic": {"name": "x", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for x in sorted(self.vertex):\n if x not in self.visited:\n self.dfs(x, visit)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99131:If_L106_C12", "label": "if", "type": "if", "loc": [106, 107], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99131:For_L105_C8", "vector": [4, 3, 0.6121, 0.0115, 3, 0.29, 0.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if x not in self.visited:\n self.dfs(x, visit)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99131:Expr_L107_C16", "label": "dfs()", "type": "expression", "loc": [107, 107], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99131:If_L106_C12", "vector": [8, 4, 0.6149, 0.0057, 4, 0.43, 0.0, 323, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "dfs", "arg_names": [], "import_names": [], "rhs_call_name": "dfs", "annotation": ""}, "snippet": " self.dfs(x, visit)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99131:FunctionDef_L108_C4", "label": "bfs", "type": "function", "loc": [108, 117], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99131:ClassDef_L81_C0", "vector": [2, 1, 0.6466, 0.0575, 1, 0.62, 0.875, 20, 0, 3, 0, 0, 0, 0, 6], "semantic": {"name": "bfs", "arg_names": ["self", "start", "visit"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def bfs(self, start, visit):\n queue = [start]\n while len(queue) > 0:\n n = queue.pop(0)\n if n not in self.visited:\n visit(n)\n self.visited.append(n)\n for x in sorted(self.vertex[n]):"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99131:Assign_L109_C8", "label": "queue =", "type": "assigned_variable", "loc": [109, 109], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99131:FunctionDef_L108_C4", "vector": [14, 2, 0.6264, 0.0057, 2, 0.31, 0.0, 325, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "queue", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " queue = [start]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99131:While_L110_C8", "label": "while", "type": "while", "loc": [110, 117], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99131:FunctionDef_L108_C4", "vector": [5, 2, 0.6523, 0.046, 2, 0.31, 1.0, 0, 0, 0, 0, 0, 0, 0, 6], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " while len(queue) > 0:\n n = queue.pop(0)\n if n not in self.visited:\n visit(n)\n self.visited.append(n)\n for x in sorted(self.vertex[n]):\n if x not in self.visited:\n queue.append(x)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99131:Assign_L111_C12", "label": "n = pop()", "type": "assigned_variable", "loc": [111, 111], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99131:While_L110_C8", "vector": [14, 3, 0.6379, 0.0057, 3, 0.32, 0.0, 773, 3, 1, 0, 0, 969, 10, 1], "semantic": {"name": "n", "arg_names": [], "import_names": [], "rhs_call_name": "pop", "annotation": ""}, "snippet": " n = queue.pop(0)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99131:If_L112_C12", "label": "if", "type": "if", "loc": [112, 114], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99131:While_L110_C8", "vector": [4, 3, 0.6494, 0.0172, 3, 0.32, 0.5, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if n not in self.visited:\n visit(n)\n self.visited.append(n)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99131:Expr_L113_C16", "label": "visit()", "type": "expression", "loc": [113, 113], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99131:If_L112_C12", "vector": [8, 4, 0.6494, 0.0057, 4, 0.43, 0.0, 694, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "visit", "arg_names": [], "import_names": [], "rhs_call_name": "visit", "annotation": ""}, "snippet": " visit(n)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99131:Expr_L114_C16", "label": "append()", "type": "expression", "loc": [114, 114], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99131:If_L112_C12", "vector": [8, 4, 0.6552, 0.0057, 4, 0.43, 1.0, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " self.visited.append(n)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99131:For_L115_C12", "label": "for x", "type": "for", "loc": [115, 117], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99131:While_L110_C8", "vector": [6, 3, 0.6667, 0.0172, 3, 0.32, 1.0, 190, 3, 0, 0, 0, 0, 0, 2], "semantic": {"name": "x", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for x in sorted(self.vertex[n]):\n if x not in self.visited:\n queue.append(x)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99131:If_L116_C16", "label": "if", "type": "if", "loc": [116, 117], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99131:For_L115_C12", "vector": [4, 4, 0.6695, 0.0115, 4, 0.88, 0.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if x not in self.visited:\n queue.append(x)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99131:Expr_L117_C20", "label": "append()", "type": "expression", "loc": [117, 117], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99131:If_L116_C16", "vector": [8, 5, 0.6724, 0.0057, 5, 0.49, 0.0, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " queue.append(x)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99131:FunctionDef_L118_C4", "label": "graphBfs", "type": "function", "loc": [118, 123], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99131:ClassDef_L81_C0", "vector": [2, 1, 0.6925, 0.0345, 1, 0.62, 1.0, 857, 0, 3, 0, 0, 0, 0, 3], "semantic": {"name": "graphBfs", "arg_names": ["self", "start", "visit"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def graphBfs(self, start, visit):\n self.visited = []\n self.bfs(start, visit)\n for x in sorted(self.vertex):\n if x not in self.visited:\n self.bfs(x, visit)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99131:Assign_L119_C8", "label": "self.visited =", "type": "assigned_variable", "loc": [119, 119], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99131:FunctionDef_L118_C4", "vector": [14, 2, 0.6839, 0.0057, 2, 0.99, 0.0, 112, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "self.visited", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.visited = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99131:Expr_L120_C8", "label": "bfs()", "type": "expression", "loc": [120, 120], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99131:FunctionDef_L118_C4", "vector": [8, 2, 0.6897, 0.0057, 2, 0.99, 0.5, 20, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "bfs", "arg_names": [], "import_names": [], "rhs_call_name": "bfs", "annotation": ""}, "snippet": " self.bfs(start, visit)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99131:For_L121_C8", "label": "for x", "type": "for", "loc": [121, 123], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99131:FunctionDef_L118_C4", "vector": [6, 2, 0.7011, 0.0172, 2, 0.99, 1.0, 190, 3, 0, 0, 0, 0, 0, 2], "semantic": {"name": "x", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for x in sorted(self.vertex):\n if x not in self.visited:\n self.bfs(x, visit)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99131:If_L122_C12", "label": "if", "type": "if", "loc": [122, 123], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99131:For_L121_C8", "vector": [4, 3, 0.704, 0.0115, 3, 0.26, 0.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if x not in self.visited:\n self.bfs(x, visit)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99131:Expr_L123_C16", "label": "bfs()", "type": "expression", "loc": [123, 123], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99131:If_L122_C12", "vector": [8, 4, 0.7069, 0.0057, 4, 0.58, 0.0, 20, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "bfs", "arg_names": [], "import_names": [], "rhs_call_name": "bfs", "annotation": ""}, "snippet": " self.bfs(x, visit)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99131:Assign_L129_C0", "label": "tn =", "type": "assigned_variable", "loc": [129, 129], "level": 0, "parent": null, "vector": [14, 0, 0.7414, 0.0057, 0, 0.66, 0.1429, 87, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "tn", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "tn = 'sample_tree'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99131:Assign_L130_C0", "label": "t = newTree()", "type": "assigned_variable", "loc": [130, 130], "level": 0, "parent": null, "vector": [14, 0, 0.7471, 0.0057, 0, 0.66, 0.1633, 15, 3, 0, 0, 0, 768, 10, 1], "semantic": {"name": "t", "arg_names": [], "import_names": [], "rhs_call_name": "newTree", "annotation": ""}, "snippet": "t = newTree()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99131:Expr_L131_C0", "label": "treeInsertVertex()", "type": "expression", "loc": [131, 131], "level": 0, "parent": null, "vector": [8, 0, 0.7529, 0.0057, 0, 0.66, 0.1837, 964, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "treeInsertVertex", "arg_names": [], "import_names": [], "rhs_call_name": "treeInsertVertex", "annotation": ""}, "snippet": "t.treeInsertVertex('1')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99131:Expr_L132_C0", "label": "treeInsertVertex()", "type": "expression", "loc": [132, 132], "level": 0, "parent": null, "vector": [8, 0, 0.7586, 0.0057, 0, 0.66, 0.2041, 964, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "treeInsertVertex", "arg_names": [], "import_names": [], "rhs_call_name": "treeInsertVertex", "annotation": ""}, "snippet": "t.treeInsertVertex('2')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99131:Expr_L133_C0", "label": "treeInsertVertex()", "type": "expression", "loc": [133, 133], "level": 0, "parent": null, "vector": [8, 0, 0.7644, 0.0057, 0, 0.66, 0.2245, 964, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "treeInsertVertex", "arg_names": [], "import_names": [], "rhs_call_name": "treeInsertVertex", "annotation": ""}, "snippet": "t.treeInsertVertex('3')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99131:Expr_L134_C0", "label": "treeInsertEdgeInfo()", "type": "expression", "loc": [134, 134], "level": 0, "parent": null, "vector": [8, 0, 0.7701, 0.0057, 0, 0.66, 0.2449, 585, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "treeInsertEdgeInfo", "arg_names": [], "import_names": [], "rhs_call_name": "treeInsertEdgeInfo", "annotation": ""}, "snippet": "t.treeInsertEdgeInfo('1', '2', 'son')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99131:Expr_L135_C0", "label": "treeInsertEdgeInfo()", "type": "expression", "loc": [135, 135], "level": 0, "parent": null, "vector": [8, 0, 0.7759, 0.0057, 0, 0.66, 0.2653, 585, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "treeInsertEdgeInfo", "arg_names": [], "import_names": [], "rhs_call_name": "treeInsertEdgeInfo", "annotation": ""}, "snippet": "t.treeInsertEdgeInfo('1', '3', 'daughter')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99131:Expr_L136_C0", "label": "print()", "type": "expression", "loc": [136, 136], "level": 0, "parent": null, "vector": [8, 0, 0.7816, 0.0057, 0, 0.66, 0.2857, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": "print('Generating %s.dot and %s.jpg...' % (tn, tn),)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99131:Expr_L137_C0", "label": "treeToJpg()", "type": "expression", "loc": [137, 137], "level": 0, "parent": null, "vector": [8, 0, 0.7874, 0.0057, 0, 0.66, 0.3061, 219, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "treeToJpg", "arg_names": [], "import_names": [], "rhs_call_name": "treeToJpg", "annotation": ""}, "snippet": "t.treeToJpg(tn)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99131:Expr_L138_C0", "label": "print()", "type": "expression", "loc": [138, 138], "level": 0, "parent": null, "vector": [8, 0, 0.7931, 0.0057, 0, 0.66, 0.3265, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": "print('Done.')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99131:Expr_L139_C0", "label": "print()", "type": "expression", "loc": [139, 139], "level": 0, "parent": null, "vector": [8, 0, 0.7989, 0.0057, 0, 0.66, 0.3469, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": "print('Visit the tree in %s.jpg in PreOrder:' % tn)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99131:Expr_L140_C0", "label": "treePreOrder()", "type": "expression", "loc": [140, 140], "level": 0, "parent": null, "vector": [8, 0, 0.8046, 0.0057, 0, 0.66, 0.3673, 295, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "treePreOrder", "arg_names": [], "import_names": [], "rhs_call_name": "treePreOrder", "annotation": ""}, "snippet": "t.treePreOrder('1', visit)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99131:Expr_L141_C0", "label": "print()", "type": "expression", "loc": [141, 141], "level": 0, "parent": null, "vector": [8, 0, 0.8103, 0.0057, 0, 0.66, 0.3878, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": "print('Visit the tree in %s.jpg in InOrder:' % tn)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99131:Expr_L142_C0", "label": "treeInOrder()", "type": "expression", "loc": [142, 142], "level": 0, "parent": null, "vector": [8, 0, 0.8161, 0.0057, 0, 0.66, 0.4082, 699, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "treeInOrder", "arg_names": [], "import_names": [], "rhs_call_name": "treeInOrder", "annotation": ""}, "snippet": "t.treeInOrder('1', visit)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99131:Expr_L143_C0", "label": "print()", "type": "expression", "loc": [143, 143], "level": 0, "parent": null, "vector": [8, 0, 0.8218, 0.0057, 0, 0.66, 0.4286, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": "print('Visit the tree in %s.jpg in PostOrder:' % tn)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99131:Expr_L144_C0", "label": "treePostOrder()", "type": "expression", "loc": [144, 144], "level": 0, "parent": null, "vector": [8, 0, 0.8276, 0.0057, 0, 0.66, 0.449, 330, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "treePostOrder", "arg_names": [], "import_names": [], "rhs_call_name": "treePostOrder", "annotation": ""}, "snippet": "t.treePostOrder('1', visit)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99131:Expr_L145_C0", "label": "print()", "type": "expression", "loc": [145, 145], "level": 0, "parent": null, "vector": [8, 0, 0.8333, 0.0057, 0, 0.66, 0.4694, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": "print('Visit the tree in %s.jpg in LevelOrder:' % tn)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99131:Expr_L146_C0", "label": "treeLevelOrder()", "type": "expression", "loc": [146, 146], "level": 0, "parent": null, "vector": [8, 0, 0.8391, 0.0057, 0, 0.66, 0.4898, 996, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "treeLevelOrder", "arg_names": [], "import_names": [], "rhs_call_name": "treeLevelOrder", "annotation": ""}, "snippet": "t.treeLevelOrder('1', visit)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99131:Expr_L148_C0", "label": "print()", "type": "expression", "loc": [148, 148], "level": 0, "parent": null, "vector": [8, 0, 0.8506, 0.0057, 0, 0.66, 0.5102, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": "print('----------------------------------------------------------------------')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99131:Assign_L150_C0", "label": "gn =", "type": "assigned_variable", "loc": [150, 150], "level": 0, "parent": null, "vector": [14, 0, 0.8621, 0.0057, 0, 0.66, 0.5306, 885, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "gn", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "gn = 'sample_graph'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99131:Assign_L151_C0", "label": "g = newGraph()", "type": "assigned_variable", "loc": [151, 151], "level": 0, "parent": null, "vector": [14, 0, 0.8678, 0.0057, 0, 0.66, 0.551, 384, 3, 0, 0, 0, 755, 10, 1], "semantic": {"name": "g", "arg_names": [], "import_names": [], "rhs_call_name": "newGraph", "annotation": ""}, "snippet": "g = newGraph()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99131:Expr_L152_C0", "label": "graphInsertVertex()", "type": "expression", "loc": [152, 152], "level": 0, "parent": null, "vector": [8, 0, 0.8736, 0.0057, 0, 0.66, 0.5714, 823, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "graphInsertVertex", "arg_names": [], "import_names": [], "rhs_call_name": "graphInsertVertex", "annotation": ""}, "snippet": "g.graphInsertVertex('1')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99131:Expr_L153_C0", "label": "graphInsertVertex()", "type": "expression", "loc": [153, 153], "level": 0, "parent": null, "vector": [8, 0, 0.8793, 0.0057, 0, 0.66, 0.5918, 823, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "graphInsertVertex", "arg_names": [], "import_names": [], "rhs_call_name": "graphInsertVertex", "annotation": ""}, "snippet": "g.graphInsertVertex('2')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99131:Expr_L154_C0", "label": "graphInsertVertex()", "type": "expression", "loc": [154, 154], "level": 0, "parent": null, "vector": [8, 0, 0.8851, 0.0057, 0, 0.66, 0.6122, 823, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "graphInsertVertex", "arg_names": [], "import_names": [], "rhs_call_name": "graphInsertVertex", "annotation": ""}, "snippet": "g.graphInsertVertex('3')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99131:Expr_L155_C0", "label": "graphInsertVertex()", "type": "expression", "loc": [155, 155], "level": 0, "parent": null, "vector": [8, 0, 0.8908, 0.0057, 0, 0.66, 0.6327, 823, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "graphInsertVertex", "arg_names": [], "import_names": [], "rhs_call_name": "graphInsertVertex", "annotation": ""}, "snippet": "g.graphInsertVertex('4')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99131:Expr_L156_C0", "label": "graphInsertVertex()", "type": "expression", "loc": [156, 156], "level": 0, "parent": null, "vector": [8, 0, 0.8966, 0.0057, 0, 0.66, 0.6531, 823, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "graphInsertVertex", "arg_names": [], "import_names": [], "rhs_call_name": "graphInsertVertex", "annotation": ""}, "snippet": "g.graphInsertVertex('5')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99131:Expr_L157_C0", "label": "graphInsertVertex()", "type": "expression", "loc": [157, 157], "level": 0, "parent": null, "vector": [8, 0, 0.9023, 0.0057, 0, 0.66, 0.6735, 823, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "graphInsertVertex", "arg_names": [], "import_names": [], "rhs_call_name": "graphInsertVertex", "annotation": ""}, "snippet": "g.graphInsertVertex('6')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99131:Expr_L158_C0", "label": "graphInsertEdge()", "type": "expression", "loc": [158, 158], "level": 0, "parent": null, "vector": [8, 0, 0.908, 0.0057, 0, 0.66, 0.6939, 954, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "graphInsertEdge", "arg_names": [], "import_names": [], "rhs_call_name": "graphInsertEdge", "annotation": ""}, "snippet": "g.graphInsertEdge('1', '2')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99131:Expr_L159_C0", "label": "graphInsertEdge()", "type": "expression", "loc": [159, 159], "level": 0, "parent": null, "vector": [8, 0, 0.9138, 0.0057, 0, 0.66, 0.7143, 954, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "graphInsertEdge", "arg_names": [], "import_names": [], "rhs_call_name": "graphInsertEdge", "annotation": ""}, "snippet": "g.graphInsertEdge('1', '4')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99131:Expr_L160_C0", "label": "graphInsertEdge()", "type": "expression", "loc": [160, 160], "level": 0, "parent": null, "vector": [8, 0, 0.9195, 0.0057, 0, 0.66, 0.7347, 954, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "graphInsertEdge", "arg_names": [], "import_names": [], "rhs_call_name": "graphInsertEdge", "annotation": ""}, "snippet": "g.graphInsertEdge('2', '5')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99131:Expr_L161_C0", "label": "graphInsertEdge()", "type": "expression", "loc": [161, 161], "level": 0, "parent": null, "vector": [8, 0, 0.9253, 0.0057, 0, 0.66, 0.7551, 954, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "graphInsertEdge", "arg_names": [], "import_names": [], "rhs_call_name": "graphInsertEdge", "annotation": ""}, "snippet": "g.graphInsertEdge('5', '4')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99131:Expr_L162_C0", "label": "graphInsertEdge()", "type": "expression", "loc": [162, 162], "level": 0, "parent": null, "vector": [8, 0, 0.931, 0.0057, 0, 0.66, 0.7755, 954, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "graphInsertEdge", "arg_names": [], "import_names": [], "rhs_call_name": "graphInsertEdge", "annotation": ""}, "snippet": "g.graphInsertEdge('4', '2')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99131:Expr_L163_C0", "label": "graphInsertEdge()", "type": "expression", "loc": [163, 163], "level": 0, "parent": null, "vector": [8, 0, 0.9368, 0.0057, 0, 0.66, 0.7959, 954, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "graphInsertEdge", "arg_names": [], "import_names": [], "rhs_call_name": "graphInsertEdge", "annotation": ""}, "snippet": "g.graphInsertEdge('3', '5')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99131:Expr_L164_C0", "label": "graphInsertEdge()", "type": "expression", "loc": [164, 164], "level": 0, "parent": null, "vector": [8, 0, 0.9425, 0.0057, 0, 0.66, 0.8163, 954, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "graphInsertEdge", "arg_names": [], "import_names": [], "rhs_call_name": "graphInsertEdge", "annotation": ""}, "snippet": "g.graphInsertEdge('3', '6')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99131:Expr_L165_C0", "label": "graphInsertEdge()", "type": "expression", "loc": [165, 165], "level": 0, "parent": null, "vector": [8, 0, 0.9483, 0.0057, 0, 0.66, 0.8367, 954, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "graphInsertEdge", "arg_names": [], "import_names": [], "rhs_call_name": "graphInsertEdge", "annotation": ""}, "snippet": "g.graphInsertEdge('6', '6')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99131:Expr_L166_C0", "label": "print()", "type": "expression", "loc": [166, 166], "level": 0, "parent": null, "vector": [8, 0, 0.954, 0.0057, 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('Generating %s.dot and %s.jpg...' % (gn, gn),)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99131:Expr_L167_C0", "label": "graphToJpg()", "type": "expression", "loc": [167, 167], "level": 0, "parent": null, "vector": [8, 0, 0.9598, 0.0057, 0, 0.66, 0.8776, 49, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "graphToJpg", "arg_names": [], "import_names": [], "rhs_call_name": "graphToJpg", "annotation": ""}, "snippet": "g.graphToJpg(gn)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99131:Expr_L168_C0", "label": "print()", "type": "expression", "loc": [168, 168], "level": 0, "parent": null, "vector": [8, 0, 0.9655, 0.0057, 0, 0.66, 0.898, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": "print('Done.')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99131:Expr_L169_C0", "label": "print()", "type": "expression", "loc": [169, 169], "level": 0, "parent": null, "vector": [8, 0, 0.9713, 0.0057, 0, 0.66, 0.9184, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": "print('Visit the tree in %s.jpg in Dfs:' % gn)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99131:Expr_L170_C0", "label": "graphDfs()", "type": "expression", "loc": [170, 170], "level": 0, "parent": null, "vector": [8, 0, 0.977, 0.0057, 0, 0.66, 0.9388, 150, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "graphDfs", "arg_names": [], "import_names": [], "rhs_call_name": "graphDfs", "annotation": ""}, "snippet": "g.graphDfs('1', visit)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99131:Expr_L171_C0", "label": "print()", "type": "expression", "loc": [171, 171], "level": 0, "parent": null, "vector": [8, 0, 0.9828, 0.0057, 0, 0.66, 0.9592, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": "print('Visit the tree in %s.jpg in Bfs:' % gn)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99131:Expr_L172_C0", "label": "graphBfs()", "type": "expression", "loc": [172, 172], "level": 0, "parent": null, "vector": [8, 0, 0.9885, 0.0057, 0, 0.66, 0.9796, 857, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "graphBfs", "arg_names": [], "import_names": [], "rhs_call_name": "graphBfs", "annotation": ""}, "snippet": "g.graphBfs('1', visit)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99131:Expr_L174_C0", "label": "raw_input()", "type": "expression", "loc": [174, 174], "level": 0, "parent": null, "vector": [8, 0, 1.0, 0.0057, 0, 0.66, 1.0, 821, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "raw_input", "arg_names": [], "import_names": [], "rhs_call_name": "raw_input", "annotation": ""}, "snippet": "raw_input('\\nPress enter to exit')"}]
[{"f": "ajibawa-2023/Python-Code-Large/train/row_99131:FunctionDef_L13_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99131:Return_L14_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99131:FunctionDef_L16_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99131:Assign_L17_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99131:FunctionDef_L16_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99131:If_L18_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99131:If_L18_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99131:Assign_L19_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99131:If_L18_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99131:Assign_L21_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99131:FunctionDef_L16_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99131:Return_L22_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99131:FunctionDef_L23_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99131:Assign_L24_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99131:FunctionDef_L23_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99131:Assign_L25_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99131:FunctionDef_L23_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99131:Expr_L26_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99131:FunctionDef_L23_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99131:Expr_L27_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99131:FunctionDef_L23_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99131:Assign_L28_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99131:FunctionDef_L23_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99131:Expr_L29_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99131:FunctionDef_L35_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99131:Expr_L36_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99131:ClassDef_L38_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99131:FunctionDef_L39_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99131:FunctionDef_L39_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99131:Assign_L40_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99131:ClassDef_L38_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99131:FunctionDef_L41_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99131:FunctionDef_L41_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99131:Assign_L42_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99131:ClassDef_L38_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99131:FunctionDef_L43_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99131:FunctionDef_L43_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99131:Assign_L44_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99131:ClassDef_L38_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99131:FunctionDef_L45_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99131:FunctionDef_L45_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99131:Assign_L46_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99131:ClassDef_L38_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99131:FunctionDef_L47_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99131:FunctionDef_L47_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99131:Assign_L48_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99131:FunctionDef_L47_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99131:For_L49_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99131:For_L49_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99131:For_L50_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99131:For_L50_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99131:Assign_L51_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99131:FunctionDef_L47_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99131:Expr_L52_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99131:ClassDef_L38_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99131:FunctionDef_L53_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99131:FunctionDef_L53_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99131:Expr_L54_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99131:FunctionDef_L53_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99131:For_L55_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99131:For_L55_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99131:Expr_L56_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99131:ClassDef_L38_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99131:FunctionDef_L57_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99131:FunctionDef_L57_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99131:If_L58_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99131:If_L58_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99131:Expr_L59_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99131:If_L58_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99131:Expr_L61_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99131:If_L58_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99131:Expr_L62_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99131:If_L58_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99131:For_L63_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99131:For_L63_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99131:Expr_L64_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99131:ClassDef_L38_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99131:FunctionDef_L65_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99131:FunctionDef_L65_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99131:For_L66_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99131:For_L66_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99131:Expr_L67_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99131:FunctionDef_L65_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99131:Expr_L68_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99131:ClassDef_L38_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99131:FunctionDef_L69_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99131:FunctionDef_L69_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99131:Assign_L70_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99131:FunctionDef_L69_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99131:While_L71_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99131:While_L71_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99131:Assign_L72_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99131:While_L71_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99131:Expr_L73_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99131:While_L71_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99131:For_L74_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99131:For_L74_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99131:Expr_L75_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99131:ClassDef_L81_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99131:FunctionDef_L82_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99131:FunctionDef_L82_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99131:Assign_L83_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99131:ClassDef_L81_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99131:FunctionDef_L84_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99131:FunctionDef_L84_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99131:Assign_L85_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99131:ClassDef_L81_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99131:FunctionDef_L86_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99131:FunctionDef_L86_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99131:Assign_L87_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99131:ClassDef_L81_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99131:FunctionDef_L88_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99131:FunctionDef_L88_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99131:Assign_L89_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99131:ClassDef_L81_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99131:FunctionDef_L90_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99131:FunctionDef_L90_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99131:Assign_L91_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99131:FunctionDef_L90_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99131:For_L92_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99131:For_L92_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99131:For_L93_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99131:For_L93_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99131:Assign_L94_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99131:FunctionDef_L90_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99131:Expr_L95_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99131:ClassDef_L81_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99131:FunctionDef_L96_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99131:FunctionDef_L96_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99131:Expr_L97_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99131:FunctionDef_L96_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99131:Expr_L98_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99131:FunctionDef_L96_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99131:For_L99_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99131:For_L99_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99131:If_L100_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99131:If_L100_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99131:Expr_L101_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99131:ClassDef_L81_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99131:FunctionDef_L102_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99131:FunctionDef_L102_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99131:Assign_L103_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99131:FunctionDef_L102_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99131:Expr_L104_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99131:FunctionDef_L102_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99131:For_L105_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99131:For_L105_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99131:If_L106_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99131:If_L106_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99131:Expr_L107_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99131:ClassDef_L81_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99131:FunctionDef_L108_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99131:FunctionDef_L108_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99131:Assign_L109_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99131:FunctionDef_L108_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99131:While_L110_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99131:While_L110_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99131:Assign_L111_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99131:While_L110_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99131:If_L112_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99131:If_L112_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99131:Expr_L113_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99131:If_L112_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99131:Expr_L114_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99131:While_L110_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99131:For_L115_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99131:For_L115_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99131:If_L116_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99131:If_L116_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99131:Expr_L117_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99131:ClassDef_L81_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99131:FunctionDef_L118_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99131:FunctionDef_L118_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99131:Assign_L119_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99131:FunctionDef_L118_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99131:Expr_L120_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99131:FunctionDef_L118_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99131:For_L121_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99131:For_L121_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99131:If_L122_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99131:If_L122_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99131:Expr_L123_C16"}]
#!/usr/bin/env python # coding=utf-8 import os import sys import re import time import struct def print_data_file(filename): # file struct fileStruct = {'Version': '', # Date (year, month, day, hour, minute, second, ms) 'Date': (), 'Declaration': '', 'OffsetToData': 0, 'Records': {} } f = open(filename, 'rb') fileStruct['Version'] = f.read(4) def BCD2N(c): return int(hex(ord(c))[2:]) b8s = map(BCD2N, f.read(8)) fileStruct['Date'] = (b8s[0]*100 + b8s[1],) + tuple(b8s[2:]) fileStruct['Declaration'] = f.read(4) def BIN2DW(s): return struct.unpack('>I', s)[0] def B2N(s): return struct.unpack('>B', s)[0] rn = BIN2DW(f.read(4)) offset = BIN2DW(f.read(4)) assert(offset == 24) fileStruct['OffsetToData'] = offset # print print('Data Version: %(Version)s' % fileStruct) print('Data Created Date: %d-%d-%d %d:%d:%d %d*10ms' % fileStruct['Date']) print('Data Declaration: %(Declaration)s' % fileStruct) print('MultiESR Data Record Number: %d' % (rn,)) print('Offset to MulESR Data: %(OffsetToData)d' % fileStruct) print('') ids = [] offsets = [] for n in range(rn): ids.append(BIN2DW(f.read(4))) offsets.append(BIN2DW(f.read(4))) for n in range(rn): id = ids[n] offset = offsets[n] f.seek(offset) recordSize = B2N(f.read(1)) strNum = B2N(f.read(1)) ss = f.read(recordSize - 1) assert(ss[-1] == '\0') ss = ss[:-1] strs = ss.split(' / ') assert(len(strs) == strNum) assert(not fileStruct['Records'].has_key(id)) fileStruct['Records'][id] = tuple(strs) # print print('MultiESR Data Record No.%d' % (n+1,)) print('MultESR Data Record ID: %d' % (id,)) print('Offset to MultESR Data: %d' % (offset,)) print('ESR Number: %d' % (strNum,)) for nn in range(strNum): print('ESR1: %s' % (strs[nn],)) print('') def main(): if len(sys.argv) != 2: print('Usage:') print('MltPhonemeView.py inputfile') return print_data_file(sys.argv[1]) if __name__ == '__main__': main()
ajibawa-2023/Python-Code-Large/train/row_99132
57
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_99132:Import_L5_C0", "label": "os import os", "type": "import", "loc": [5, 5], "level": 0, "parent": null, "vector": [1, 0, 0.0588, 0.0118, 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_99132:Import_L6_C0", "label": "sys import sys", "type": "import", "loc": [6, 6], "level": 0, "parent": null, "vector": [1, 0, 0.0706, 0.0118, 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_99132:Import_L7_C0", "label": "re import re", "type": "import", "loc": [7, 7], "level": 0, "parent": null, "vector": [1, 0, 0.0824, 0.0118, 0, 0.66, 0.2857, 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_99132:Import_L8_C0", "label": "time import time", "type": "import", "loc": [8, 8], "level": 0, "parent": null, "vector": [1, 0, 0.0941, 0.0118, 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_99132:Import_L9_C0", "label": "struct import struct", "type": "import", "loc": [9, 9], "level": 0, "parent": null, "vector": [1, 0, 0.1059, 0.0118, 0, 0.66, 0.5714, 399, 0, 1, 0, 0, 399, 0, 0], "semantic": {"name": "struct", "arg_names": [], "import_names": ["struct"], "rhs_call_name": "", "annotation": ""}, "snippet": "import struct"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99132:FunctionDef_L12_C0", "label": "print_data_file", "type": "function", "loc": [12, 72], "level": 0, "parent": null, "vector": [2, 0, 0.4941, 0.7176, 0, 0.66, 0.7143, 814, 0, 1, 1, 0, 0, 0, 46], "semantic": {"name": "print_data_file", "arg_names": ["filename"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def print_data_file(filename):\n\t# file struct\n\tfileStruct = {'Version': '',\n\t\t\t# Date (year, month, day, hour, minute, second, ms)\n\t\t\t'Date': (),\n\t\t\t'Declaration': '',\n\t\t\t'OffsetToData': 0,\n\t\t\t'Records': {}"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99132:Assign_L14_C1", "label": "fileStruct =", "type": "assigned_variable", "loc": [14, 20], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99132:FunctionDef_L12_C0", "vector": [14, 1, 0.2, 0.0824, 1, 0.63, 0.0, 758, 0, 0, 0, 0, 0, 6, 0], "semantic": {"name": "fileStruct", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tfileStruct = {'Version': '',\n\t\t\t# Date (year, month, day, hour, minute, second, ms)\n\t\t\t'Date': (),\n\t\t\t'Declaration': '',\n\t\t\t'OffsetToData': 0,\n\t\t\t'Records': {}\n\t\t\t}"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99132:Assign_L21_C1", "label": "f = open()", "type": "assigned_variable", "loc": [21, 21], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99132:FunctionDef_L12_C0", "vector": [14, 1, 0.2471, 0.0118, 1, 0.63, 0.0476, 899, 3, 2, 0, 0, 693, 10, 1], "semantic": {"name": "f", "arg_names": [], "import_names": [], "rhs_call_name": "open", "annotation": ""}, "snippet": "\tf = open(filename, 'rb')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99132:Assign_L22_C1", "label": " = read()", "type": "assigned_variable", "loc": [22, 22], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99132:FunctionDef_L12_C0", "vector": [14, 1, 0.2588, 0.0118, 1, 0.63, 0.0952, 0, 3, 1, 0, 0, 453, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "read", "annotation": ""}, "snippet": "\tfileStruct['Version'] = f.read(4)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99132:FunctionDef_L23_C1", "label": "BCD2N", "type": "function", "loc": [23, 24], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99132:FunctionDef_L12_C0", "vector": [2, 1, 0.2765, 0.0235, 1, 0.63, 0.1429, 175, 0, 1, 1, 0, 0, 0, 3], "semantic": {"name": "BCD2N", "arg_names": ["c"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tdef BCD2N(c):\n\t\treturn int(hex(ord(c))[2:])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99132:Return_L24_C2", "label": "return", "type": "return", "loc": [24, 24], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99132:FunctionDef_L23_C1", "vector": [13, 2, 0.2824, 0.0118, 2, 0.12, 0.0, 0, 3, 0, 0, 0, 0, 10, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\treturn int(hex(ord(c))[2:])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99132:Assign_L25_C1", "label": "b8s = map()", "type": "assigned_variable", "loc": [25, 25], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99132:FunctionDef_L12_C0", "vector": [14, 1, 0.2941, 0.0118, 1, 0.63, 0.1905, 318, 3, 2, 0, 0, 53, 10, 2], "semantic": {"name": "b8s", "arg_names": [], "import_names": [], "rhs_call_name": "map", "annotation": ""}, "snippet": "\tb8s = map(BCD2N, f.read(8))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99132:Assign_L26_C1", "label": "assign", "type": "assigned_variable", "loc": [26, 26], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99132:FunctionDef_L12_C0", "vector": [14, 1, 0.3059, 0.0118, 1, 0.63, 0.2381, 0, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tfileStruct['Date'] = (b8s[0]*100 + b8s[1],) + tuple(b8s[2:])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99132:Assign_L27_C1", "label": " = read()", "type": "assigned_variable", "loc": [27, 27], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99132:FunctionDef_L12_C0", "vector": [14, 1, 0.3176, 0.0118, 1, 0.63, 0.2857, 0, 3, 1, 0, 0, 453, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "read", "annotation": ""}, "snippet": "\tfileStruct['Declaration'] = f.read(4)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99132:FunctionDef_L28_C1", "label": "BIN2DW", "type": "function", "loc": [28, 29], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99132:FunctionDef_L12_C0", "vector": [2, 1, 0.3353, 0.0235, 1, 0.63, 0.3333, 607, 0, 1, 1, 0, 0, 0, 1], "semantic": {"name": "BIN2DW", "arg_names": ["s"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tdef BIN2DW(s):\n\t\treturn struct.unpack('>I', s)[0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99132:Return_L29_C2", "label": "return", "type": "return", "loc": [29, 29], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99132:FunctionDef_L28_C1", "vector": [13, 2, 0.3412, 0.0118, 2, 0.09, 0.0, 0, 6, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\treturn struct.unpack('>I', s)[0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99132:FunctionDef_L30_C1", "label": "B2N", "type": "function", "loc": [30, 31], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99132:FunctionDef_L12_C0", "vector": [2, 1, 0.3588, 0.0235, 1, 0.63, 0.381, 744, 0, 1, 1, 0, 0, 0, 1], "semantic": {"name": "B2N", "arg_names": ["s"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tdef B2N(s):\n\t\treturn struct.unpack('>B', s)[0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99132:Return_L31_C2", "label": "return", "type": "return", "loc": [31, 31], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99132:FunctionDef_L30_C1", "vector": [13, 2, 0.3647, 0.0118, 2, 0.01, 0.0, 0, 6, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\treturn struct.unpack('>B', s)[0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99132:Assign_L32_C1", "label": "rn = BIN2DW()", "type": "assigned_variable", "loc": [32, 32], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99132:FunctionDef_L12_C0", "vector": [14, 1, 0.3765, 0.0118, 1, 0.63, 0.4286, 583, 3, 1, 0, 0, 607, 10, 2], "semantic": {"name": "rn", "arg_names": [], "import_names": [], "rhs_call_name": "BIN2DW", "annotation": ""}, "snippet": "\trn = BIN2DW(f.read(4))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99132:Assign_L33_C1", "label": "offset = BIN2DW()", "type": "assigned_variable", "loc": [33, 33], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99132:FunctionDef_L12_C0", "vector": [14, 1, 0.3882, 0.0118, 1, 0.63, 0.4762, 132, 3, 1, 0, 0, 607, 10, 2], "semantic": {"name": "offset", "arg_names": [], "import_names": [], "rhs_call_name": "BIN2DW", "annotation": ""}, "snippet": "\toffset = BIN2DW(f.read(4))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99132:Assign_L35_C1", "label": "assign", "type": "assigned_variable", "loc": [35, 35], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99132:FunctionDef_L12_C0", "vector": [14, 1, 0.4118, 0.0118, 1, 0.63, 0.5238, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tfileStruct['OffsetToData'] = offset"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99132:Expr_L38_C1", "label": "print()", "type": "expression", "loc": [38, 38], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99132:FunctionDef_L12_C0", "vector": [8, 1, 0.4471, 0.0118, 1, 0.63, 0.5714, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": "\tprint('Data Version: %(Version)s' % fileStruct)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99132:Expr_L39_C1", "label": "print()", "type": "expression", "loc": [39, 39], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99132:FunctionDef_L12_C0", "vector": [8, 1, 0.4588, 0.0118, 1, 0.63, 0.619, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": "\tprint('Data Created Date: %d-%d-%d %d:%d:%d %d*10ms' % fileStruct['Date'])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99132:Expr_L40_C1", "label": "print()", "type": "expression", "loc": [40, 40], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99132:FunctionDef_L12_C0", "vector": [8, 1, 0.4706, 0.0118, 1, 0.63, 0.6667, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": "\tprint('Data Declaration: %(Declaration)s' % fileStruct)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99132:Expr_L41_C1", "label": "print()", "type": "expression", "loc": [41, 41], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99132:FunctionDef_L12_C0", "vector": [8, 1, 0.4824, 0.0118, 1, 0.63, 0.7143, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": "\tprint('MultiESR Data Record Number: %d' % (rn,))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99132:Expr_L42_C1", "label": "print()", "type": "expression", "loc": [42, 42], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99132:FunctionDef_L12_C0", "vector": [8, 1, 0.4941, 0.0118, 1, 0.63, 0.7619, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": "\tprint('Offset to MulESR Data: %(OffsetToData)d' % fileStruct)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99132:Expr_L43_C1", "label": "print()", "type": "expression", "loc": [43, 43], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99132:FunctionDef_L12_C0", "vector": [8, 1, 0.5059, 0.0118, 1, 0.63, 0.8095, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": "\tprint('')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99132:Assign_L45_C1", "label": "ids =", "type": "assigned_variable", "loc": [45, 45], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99132:FunctionDef_L12_C0", "vector": [14, 1, 0.5294, 0.0118, 1, 0.63, 0.8571, 202, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "ids", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tids = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99132:Assign_L46_C1", "label": "offsets =", "type": "assigned_variable", "loc": [46, 46], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99132:FunctionDef_L12_C0", "vector": [14, 1, 0.5412, 0.0118, 1, 0.63, 0.9048, 559, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "offsets", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\toffsets = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99132:For_L47_C1", "label": "for n", "type": "for", "loc": [47, 49], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99132:FunctionDef_L12_C0", "vector": [6, 1, 0.5647, 0.0353, 1, 0.63, 0.9524, 773, 3, 0, 0, 0, 0, 0, 7], "semantic": {"name": "n", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tfor n in range(rn):\n\t\tids.append(BIN2DW(f.read(4)))\n\t\toffsets.append(BIN2DW(f.read(4)))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99132:Expr_L48_C2", "label": "append()", "type": "expression", "loc": [48, 48], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99132:For_L47_C1", "vector": [8, 2, 0.5647, 0.0118, 2, 0.25, 0.0, 243, 3, 1, 0, 0, 0, 0, 3], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": "\t\tids.append(BIN2DW(f.read(4)))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99132:Expr_L49_C2", "label": "append()", "type": "expression", "loc": [49, 49], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99132:For_L47_C1", "vector": [8, 2, 0.5765, 0.0118, 2, 0.25, 1.0, 243, 3, 1, 0, 0, 0, 0, 3], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": "\t\toffsets.append(BIN2DW(f.read(4)))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99132:For_L50_C1", "label": "for n", "type": "for", "loc": [50, 72], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99132:FunctionDef_L12_C0", "vector": [6, 1, 0.7176, 0.2706, 1, 0.63, 1.0, 773, 3, 0, 0, 0, 0, 0, 18], "semantic": {"name": "n", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tfor n in range(rn):\n\t\tid = ids[n]\n\t\toffset = offsets[n]\n\t\tf.seek(offset)\n\t\trecordSize = B2N(f.read(1))\n\t\tstrNum = B2N(f.read(1))\n\t\tss = f.read(recordSize - 1)\n\t\tassert(ss[-1] == '\\0')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99132:Assign_L51_C2", "label": "id =", "type": "assigned_variable", "loc": [51, 51], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99132:For_L50_C1", "vector": [14, 2, 0.6, 0.0118, 2, 0.58, 0.0, 941, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "id", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tid = ids[n]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99132:Assign_L52_C2", "label": "offset =", "type": "assigned_variable", "loc": [52, 52], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99132:For_L50_C1", "vector": [14, 2, 0.6118, 0.0118, 2, 0.58, 0.0714, 132, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "offset", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\toffset = offsets[n]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99132:Expr_L53_C2", "label": "seek()", "type": "expression", "loc": [53, 53], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99132:For_L50_C1", "vector": [8, 2, 0.6235, 0.0118, 2, 0.58, 0.1429, 66, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "seek", "arg_names": [], "import_names": [], "rhs_call_name": "seek", "annotation": ""}, "snippet": "\t\tf.seek(offset)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99132:Assign_L54_C2", "label": "recordSize = B2N()", "type": "assigned_variable", "loc": [54, 54], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99132:For_L50_C1", "vector": [14, 2, 0.6353, 0.0118, 2, 0.58, 0.2143, 342, 3, 1, 0, 0, 744, 10, 2], "semantic": {"name": "recordSize", "arg_names": [], "import_names": [], "rhs_call_name": "B2N", "annotation": ""}, "snippet": "\t\trecordSize = B2N(f.read(1))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99132:Assign_L55_C2", "label": "strNum = B2N()", "type": "assigned_variable", "loc": [55, 55], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99132:For_L50_C1", "vector": [14, 2, 0.6471, 0.0118, 2, 0.58, 0.2857, 921, 3, 1, 0, 0, 744, 10, 2], "semantic": {"name": "strNum", "arg_names": [], "import_names": [], "rhs_call_name": "B2N", "annotation": ""}, "snippet": "\t\tstrNum = B2N(f.read(1))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99132:Assign_L56_C2", "label": "ss = read()", "type": "assigned_variable", "loc": [56, 56], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99132:For_L50_C1", "vector": [14, 2, 0.6588, 0.0118, 2, 0.58, 0.3571, 582, 3, 1, 0, 0, 453, 10, 1], "semantic": {"name": "ss", "arg_names": [], "import_names": [], "rhs_call_name": "read", "annotation": ""}, "snippet": "\t\tss = f.read(recordSize - 1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99132:Assign_L58_C2", "label": "ss =", "type": "assigned_variable", "loc": [58, 58], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99132:For_L50_C1", "vector": [14, 2, 0.6824, 0.0118, 2, 0.58, 0.4286, 582, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "ss", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tss = ss[:-1]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99132:Assign_L59_C2", "label": "strs = split()", "type": "assigned_variable", "loc": [59, 59], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99132:For_L50_C1", "vector": [14, 2, 0.6941, 0.0118, 2, 0.58, 0.5, 370, 3, 1, 0, 0, 908, 10, 1], "semantic": {"name": "strs", "arg_names": [], "import_names": [], "rhs_call_name": "split", "annotation": ""}, "snippet": "\t\tstrs = ss.split(' / ')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99132:Assign_L63_C2", "label": " = tuple()", "type": "assigned_variable", "loc": [63, 63], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99132:For_L50_C1", "vector": [14, 2, 0.7412, 0.0118, 2, 0.58, 0.5714, 0, 3, 1, 0, 0, 259, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "tuple", "annotation": ""}, "snippet": "\t\tfileStruct['Records'][id] = tuple(strs)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99132:Expr_L66_C2", "label": "print()", "type": "expression", "loc": [66, 66], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99132:For_L50_C1", "vector": [8, 2, 0.7765, 0.0118, 2, 0.58, 0.6429, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": "\t\tprint('MultiESR Data Record No.%d' % (n+1,))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99132:Expr_L67_C2", "label": "print()", "type": "expression", "loc": [67, 67], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99132:For_L50_C1", "vector": [8, 2, 0.7882, 0.0118, 2, 0.58, 0.7143, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": "\t\tprint('MultESR Data Record ID: %d' % (id,))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99132:Expr_L68_C2", "label": "print()", "type": "expression", "loc": [68, 68], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99132:For_L50_C1", "vector": [8, 2, 0.8, 0.0118, 2, 0.58, 0.7857, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": "\t\tprint('Offset to MultESR Data: %d' % (offset,))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99132:Expr_L69_C2", "label": "print()", "type": "expression", "loc": [69, 69], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99132:For_L50_C1", "vector": [8, 2, 0.8118, 0.0118, 2, 0.58, 0.8571, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": "\t\tprint('ESR Number: %d' % (strNum,))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99132:For_L70_C2", "label": "for nn", "type": "for", "loc": [70, 71], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99132:For_L50_C1", "vector": [6, 2, 0.8294, 0.0235, 2, 0.58, 0.9286, 313, 3, 0, 0, 0, 0, 0, 2], "semantic": {"name": "nn", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tfor nn in range(strNum):\n\t\t\tprint('ESR1: %s' % (strs[nn],))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99132:Expr_L71_C3", "label": "print()", "type": "expression", "loc": [71, 71], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99132:For_L70_C2", "vector": [8, 3, 0.8353, 0.0118, 3, 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": "\t\t\tprint('ESR1: %s' % (strs[nn],))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99132:Expr_L72_C2", "label": "print()", "type": "expression", "loc": [72, 72], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99132:For_L50_C1", "vector": [8, 2, 0.8471, 0.0118, 2, 0.58, 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('')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99132:FunctionDef_L75_C0", "label": "main", "type": "function", "loc": [75, 80], "level": 0, "parent": null, "vector": [2, 0, 0.9118, 0.0706, 0, 0.66, 0.8571, 624, 0, 0, 0, 0, 0, 0, 4], "semantic": {"name": "main", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def main():\n\tif len(sys.argv) != 2:\n\t\tprint('Usage:')\n\t\tprint('MltPhonemeView.py inputfile')\n\t\treturn\n\tprint_data_file(sys.argv[1])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99132:If_L76_C1", "label": "if", "type": "if", "loc": [76, 79], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99132:FunctionDef_L75_C0", "vector": [4, 1, 0.9118, 0.0471, 1, 0.33, 0.0, 0, 0, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tif len(sys.argv) != 2:\n\t\tprint('Usage:')\n\t\tprint('MltPhonemeView.py inputfile')\n\t\treturn"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99132:Expr_L77_C2", "label": "print()", "type": "expression", "loc": [77, 77], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99132:If_L76_C1", "vector": [8, 2, 0.9059, 0.0118, 2, 0.38, 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('Usage:')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99132:Expr_L78_C2", "label": "print()", "type": "expression", "loc": [78, 78], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99132:If_L76_C1", "vector": [8, 2, 0.9176, 0.0118, 2, 0.38, 0.5, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": "\t\tprint('MltPhonemeView.py inputfile')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99132:Return_L79_C2", "label": "return", "type": "return", "loc": [79, 79], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99132:If_L76_C1", "vector": [13, 2, 0.9294, 0.0118, 2, 0.38, 1.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\treturn"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99132:Expr_L80_C1", "label": "print_data_file()", "type": "expression", "loc": [80, 80], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99132:FunctionDef_L75_C0", "vector": [8, 1, 0.9412, 0.0118, 1, 0.33, 1.0, 814, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print_data_file", "arg_names": [], "import_names": [], "rhs_call_name": "print_data_file", "annotation": ""}, "snippet": "\tprint_data_file(sys.argv[1])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99132:If_L82_C0", "label": "if", "type": "if", "loc": [82, 83], "level": 0, "parent": null, "vector": [4, 0, 0.9706, 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\tmain()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99132:Expr_L83_C1", "label": "main()", "type": "expression", "loc": [83, 83], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99132:If_L82_C0", "vector": [8, 1, 0.9765, 0.0118, 1, 0.94, 0.0, 624, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "main", "arg_names": [], "import_names": [], "rhs_call_name": "main", "annotation": ""}, "snippet": "\tmain()"}]
[{"f": "ajibawa-2023/Python-Code-Large/train/row_99132:FunctionDef_L12_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99132:Assign_L14_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99132:FunctionDef_L12_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99132:Assign_L21_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99132:FunctionDef_L12_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99132:Assign_L22_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99132:FunctionDef_L12_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99132:FunctionDef_L23_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99132:FunctionDef_L23_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99132:Return_L24_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99132:FunctionDef_L12_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99132:Assign_L25_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99132:FunctionDef_L12_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99132:Assign_L26_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99132:FunctionDef_L12_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99132:Assign_L27_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99132:FunctionDef_L12_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99132:FunctionDef_L28_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99132:FunctionDef_L28_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99132:Return_L29_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99132:FunctionDef_L12_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99132:FunctionDef_L30_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99132:FunctionDef_L30_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99132:Return_L31_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99132:FunctionDef_L12_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99132:Assign_L32_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99132:FunctionDef_L12_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99132:Assign_L33_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99132:FunctionDef_L12_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99132:Assign_L35_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99132:FunctionDef_L12_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99132:Expr_L38_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99132:FunctionDef_L12_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99132:Expr_L39_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99132:FunctionDef_L12_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99132:Expr_L40_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99132:FunctionDef_L12_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99132:Expr_L41_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99132:FunctionDef_L12_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99132:Expr_L42_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99132:FunctionDef_L12_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99132:Expr_L43_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99132:FunctionDef_L12_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99132:Assign_L45_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99132:FunctionDef_L12_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99132:Assign_L46_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99132:FunctionDef_L12_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99132:For_L47_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99132:For_L47_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99132:Expr_L48_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99132:For_L47_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99132:Expr_L49_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99132:FunctionDef_L12_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99132:For_L50_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99132:For_L50_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99132:Assign_L51_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99132:For_L50_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99132:Assign_L52_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99132:For_L50_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99132:Expr_L53_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99132:For_L50_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99132:Assign_L54_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99132:For_L50_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99132:Assign_L55_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99132:For_L50_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99132:Assign_L56_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99132:For_L50_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99132:Assign_L58_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99132:For_L50_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99132:Assign_L59_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99132:For_L50_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99132:Assign_L63_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99132:For_L50_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99132:Expr_L66_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99132:For_L50_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99132:Expr_L67_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99132:For_L50_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99132:Expr_L68_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99132:For_L50_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99132:Expr_L69_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99132:For_L50_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99132:For_L70_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99132:For_L70_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99132:Expr_L71_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99132:For_L50_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99132:Expr_L72_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99132:FunctionDef_L75_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99132:If_L76_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99132:If_L76_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99132:Expr_L77_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99132:If_L76_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99132:Expr_L78_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99132:If_L76_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99132:Return_L79_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99132:FunctionDef_L75_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99132:Expr_L80_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99132:If_L82_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99132:Expr_L83_C1"}]
#!/usr/bin/env jython # coding=utf-8 import os import sys import re import logging import glob import codecs # set log logFileName = 'CheckLoopbackResult.log' def init_log(): logger = logging.getLogger() hdlr = logging.FileHandler(logFileName) formatter = logging.Formatter('%(asctime)s %(levelname)s:: %(message)s') hdlr.setFormatter(formatter) logger.addHandler(hdlr) logger.setLevel(logging.INFO) return logger log = init_log() class ItemParseError(Exception): pass class DicItem: def __init__(self, linestr): while linestr[-1].isspace(): linestr = linestr[:-1] self._linestr = linestr # parse attributes from line string # 'Name PinYin NextLevelId NextLevelInfo Offset VoiceId NextLevelNumber' pat = re.match( \ r'^(\S+)\t([\w /]+)\t(0x[\dA-F]{8})\t(0x[\dA-F]{8})\t(0x[\dA-F]{8})\t(0x[\dA-F]{8})\t(0x[\dA-F]{4})\s*$', \ self._linestr) if not pat: log.warning(r'<DicItem Line Format Error> : %s', self._linestr) raise ItemParseError() self._name = pat.group(1) self._pinyin = pat.group(2) self._nextLevelId = pat.group(3) self._nextLevelInfo = pat.group(4) self._offset = pat.group(5) self._voiceId = pat.group(6) self._nextLevelNum = pat.group(7) #self._attrs = { #1: self._name, 'name': self._name, #2: self._pinyin, 'pinyin':self._pinyin, #3: self._nextLevelId, 'nextLevelId': self._nextLevelId, #4: self._nextLevelInfo, 'nextLevelInfo': self._nextLevelInfo, #5: self._offset, 'offset': self._offset, #6: self._voiceId, 'voiceId': self._voiceId, #7: self._nextLevelNum, 'nextLevelNum': self._nextLevelNum #} def get_str(self): return self._linestr #@staticmethod def _get_from_file(fn): lns = codecs.open(fn, 'r', 'gbk').readlines() #return tuple(DicItem(ln) for ln in lns) return tuple(map(lambda line:DicItem(line), lns)) get_from_file = staticmethod (_get_from_file) def __getitem__(self, attr): ' Return a string.\n' #return self._attrs[attr] return self.__dict__['_' + attr] class VrResultItem: def __init__(self, linestr): while linestr[-1].isspace(): linestr = linestr[:-1] self._linestr = linestr; #pat = re.match( \ #r'^(\S+)\t(\S+)\t(.+\])\s(0x[\dA-F]{8})\t(0x[\dA-F]{8})\t(0x[\dA-F]{8})\t(0x[\dA-F]{8})\t(0x[\dA-F]{8})\s*$', \ #self._linestr) pat = re.search( \ r'(\S+)\t(.+\])\s(0x[\dA-F]{8})\t(0x[\dA-F]{8})\t(0x[\dA-F]{8})\t(0x[\dA-F]{8})\t(0x[\dA-F]{8})\s*$', \ self._linestr) if not pat: log.warning(r'<VrResultItem Line Format Error> : %s', self._linestr) raise ItemParseError() #self._name = pat.group(1) self._vrName = pat.group(1) self._dicId = pat.group(3) self._nextLevelId = pat.group(4) self._nextLevelInfo = pat.group(5) self._offset = pat.group(6) self._voiceId = pat.group(7) def get_str(self): return self._linestr #@staticmethod def _get_from_file(fn): lns = codecs.open(fn, 'r', 'gbk').readlines() #return tuple(DicItem(ln) for ln in lns[4:]) return tuple(map(lambda line:VrResultItem(line), lns[4:])) get_from_file = staticmethod(_get_from_file) def __getitem__(self, attr): ' Return a string.\n' #return self._attrs[attr] return self.__dict__['_' + attr] def compare_vr_result(dicIds, folder): ret = [] for dicId in dicIds: ret.append(compare_vr_dic(dicId, folder)) return ret def compare_vr_dic(dicId, folder): allRight = True allWrong = True dicItems = DicItem.get_from_file(os.path.join(folder, dicId+'.txt')) vrRIs = VrResultItem.get_from_file(os.path.join(folder, dicId+'.out.txt')) if len(dicItems) != len(vrRIs) or len(dicItems) == 0: log.warning('<VR Length Error> : %s', dic) raise Exception() for n in range(len(dicItems)): itm = dicItems[n] vrt = vrRIs[n] if vrt['vrName'] != itm['name'] or \ vrt['dicId'] != '0x' + dicId or \ vrt['nextLevelId'] != itm['nextLevelId'] or \ vrt['nextLevelInfo'] != itm['nextLevelInfo'] or \ vrt['offset'] != itm['offset'] or \ vrt['voiceId'] != itm['voiceId'] : log.warning('<VR Error> : 0x%s : %d : %s : %s', dicId, len(dicItems), itm.get_str(), vrt.get_str()) allRight = False else: allWrong = False if allRight and not allWrong: return 'OK' elif not allRight and not allWrong: return 'NotGood' elif not allRight and allWrong: return 'Failed' else: raise Exception() def main(): if len(sys.argv) != 2: print('Usage:') print('python CheckLoopbackResult.py [ResultFolder]') sys.exit(0) folder = sys.argv[1] fns = tuple(os.path.split(p)[1] for p in glob.glob(os.path.join(folder, '????????.txt'))) #dicIds = tuple(fn[:8] for fn in fns) dicIds = tuple(map(lambda s:s[:8], fns)) cr = compare_vr_result(dicIds, folder) fo = open('Result.txt', 'w') for n in range(len(dicIds)): print >> fo, '%s\t%s' % (dicIds[n], cr[n]) fo.close() if __name__ == '__main__': main()
ajibawa-2023/Python-Code-Large/train/row_99133
104
164
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_99133:Import_L4_C0", "label": "os import os", "type": "import", "loc": [4, 4], "level": 0, "parent": null, "vector": [1, 0, 0.0244, 0.0061, 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_99133:Import_L5_C0", "label": "sys import sys", "type": "import", "loc": [5, 5], "level": 0, "parent": null, "vector": [1, 0, 0.0305, 0.0061, 0, 0.66, 0.0667, 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_99133:Import_L6_C0", "label": "re import re", "type": "import", "loc": [6, 6], "level": 0, "parent": null, "vector": [1, 0, 0.0366, 0.0061, 0, 0.66, 0.1333, 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_99133:Import_L7_C0", "label": "logging import logging", "type": "import", "loc": [7, 7], "level": 0, "parent": null, "vector": [1, 0, 0.0427, 0.0061, 0, 0.66, 0.2, 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_99133:Import_L8_C0", "label": "glob import glob", "type": "import", "loc": [8, 8], "level": 0, "parent": null, "vector": [1, 0, 0.0488, 0.0061, 0, 0.66, 0.2667, 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_99133:Import_L9_C0", "label": "codecs import codecs", "type": "import", "loc": [9, 9], "level": 0, "parent": null, "vector": [1, 0, 0.0549, 0.0061, 0, 0.66, 0.3333, 220, 0, 1, 0, 0, 220, 0, 0], "semantic": {"name": "codecs", "arg_names": [], "import_names": ["codecs"], "rhs_call_name": "", "annotation": ""}, "snippet": "import codecs"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99133:Assign_L12_C0", "label": "logFileName =", "type": "assigned_variable", "loc": [12, 12], "level": 0, "parent": null, "vector": [14, 0, 0.0732, 0.0061, 0, 0.66, 0.4, 181, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "logFileName", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "logFileName = 'CheckLoopbackResult.log'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99133:FunctionDef_L13_C0", "label": "init_log", "type": "function", "loc": [13, 20], "level": 0, "parent": null, "vector": [2, 0, 0.1006, 0.0488, 0, 0.66, 0.4667, 377, 0, 0, 1, 0, 0, 0, 6], "semantic": {"name": "init_log", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def init_log():\n logger = logging.getLogger()\n hdlr = logging.FileHandler(logFileName)\n formatter = logging.Formatter('%(asctime)s %(levelname)s:: %(message)s')\n hdlr.setFormatter(formatter)\n logger.addHandler(hdlr)\n logger.setLevel(logging.INFO)\n return logger"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99133:Assign_L14_C4", "label": "logger = getLogger()", "type": "assigned_variable", "loc": [14, 14], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99133:FunctionDef_L13_C0", "vector": [14, 1, 0.0854, 0.0061, 1, 0.35, 0.0, 532, 3, 0, 0, 0, 71, 10, 1], "semantic": {"name": "logger", "arg_names": [], "import_names": [], "rhs_call_name": "getLogger", "annotation": ""}, "snippet": " logger = logging.getLogger()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99133:Assign_L15_C4", "label": "hdlr = FileHandler()", "type": "assigned_variable", "loc": [15, 15], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99133:FunctionDef_L13_C0", "vector": [14, 1, 0.0915, 0.0061, 1, 0.35, 0.1667, 149, 3, 1, 0, 0, 306, 10, 1], "semantic": {"name": "hdlr", "arg_names": [], "import_names": [], "rhs_call_name": "FileHandler", "annotation": ""}, "snippet": " hdlr = logging.FileHandler(logFileName)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99133:Assign_L16_C4", "label": "formatter = Formatter()", "type": "assigned_variable", "loc": [16, 16], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99133:FunctionDef_L13_C0", "vector": [14, 1, 0.0976, 0.0061, 1, 0.35, 0.3333, 791, 3, 1, 0, 0, 766, 10, 1], "semantic": {"name": "formatter", "arg_names": [], "import_names": [], "rhs_call_name": "Formatter", "annotation": ""}, "snippet": " formatter = logging.Formatter('%(asctime)s %(levelname)s:: %(message)s')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99133:Expr_L17_C4", "label": "setFormatter()", "type": "expression", "loc": [17, 17], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99133:FunctionDef_L13_C0", "vector": [8, 1, 0.1037, 0.0061, 1, 0.35, 0.5, 948, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "setFormatter", "arg_names": [], "import_names": [], "rhs_call_name": "setFormatter", "annotation": ""}, "snippet": " hdlr.setFormatter(formatter)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99133:Expr_L18_C4", "label": "addHandler()", "type": "expression", "loc": [18, 18], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99133:FunctionDef_L13_C0", "vector": [8, 1, 0.1098, 0.0061, 1, 0.35, 0.6667, 255, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "addHandler", "arg_names": [], "import_names": [], "rhs_call_name": "addHandler", "annotation": ""}, "snippet": " logger.addHandler(hdlr)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99133:Expr_L19_C4", "label": "setLevel()", "type": "expression", "loc": [19, 19], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99133:FunctionDef_L13_C0", "vector": [8, 1, 0.1159, 0.0061, 1, 0.35, 0.8333, 810, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "setLevel", "arg_names": [], "import_names": [], "rhs_call_name": "setLevel", "annotation": ""}, "snippet": " logger.setLevel(logging.INFO)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99133:Return_L20_C4", "label": "return", "type": "return", "loc": [20, 20], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99133:FunctionDef_L13_C0", "vector": [13, 1, 0.122, 0.0061, 1, 0.35, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return logger"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99133:Assign_L22_C0", "label": "log = init_log()", "type": "assigned_variable", "loc": [22, 22], "level": 0, "parent": null, "vector": [14, 0, 0.1341, 0.0061, 0, 0.66, 0.5333, 432, 3, 0, 0, 0, 377, 10, 1], "semantic": {"name": "log", "arg_names": [], "import_names": [], "rhs_call_name": "init_log", "annotation": ""}, "snippet": "log = init_log()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99133:ClassDef_L24_C0", "label": "ItemParseError", "type": "class", "loc": [24, 24], "level": 0, "parent": null, "vector": [3, 0, 0.1463, 0.0061, 0, 0.66, 0.6, 691, 0, 0, 0, 0, 645, 0, 0], "semantic": {"name": "ItemParseError", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class ItemParseError(Exception): pass"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99133:ClassDef_L26_C0", "label": "DicItem", "type": "class", "loc": [26, 69], "level": 0, "parent": null, "vector": [3, 0, 0.2896, 0.2683, 0, 0.66, 0.6667, 354, 0, 4, 0, 0, 0, 0, 17], "semantic": {"name": "DicItem", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class DicItem:\n\tdef __init__(self, linestr):\n\t\twhile linestr[-1].isspace():\n\t\t\tlinestr = linestr[:-1]\n\t\tself._linestr = linestr\n\t\t# parse attributes from line string\n\t\t# 'Name\tPinYin\tNextLevelId\tNextLevelInfo\tOffset VoiceId\tNextLevelNumber'\n\t\tpat = re.match( \\"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99133:FunctionDef_L27_C1", "label": "__init__", "type": "function", "loc": [27, 45], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99133:ClassDef_L26_C0", "vector": [2, 1, 0.2195, 0.1159, 1, 0.83, 0.0, 555, 0, 2, 0, 0, 0, 0, 11], "semantic": {"name": "__init__", "arg_names": ["self", "linestr"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tdef __init__(self, linestr):\n\t\twhile linestr[-1].isspace():\n\t\t\tlinestr = linestr[:-1]\n\t\tself._linestr = linestr\n\t\t# parse attributes from line string\n\t\t# 'Name\tPinYin\tNextLevelId\tNextLevelInfo\tOffset VoiceId\tNextLevelNumber'\n\t\tpat = re.match( \\\n\t\t\tr'^(\\S+)\\t([\\w /]+)\\t(0x[\\dA-F]{8})\\t(0x[\\dA-F]{8})\\t(0x[\\dA-F]{8})\\t(0x[\\dA-F]{8})\\t(0x[\\dA-F]{4})\\s*$', \\"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99133:While_L28_C2", "label": "while", "type": "while", "loc": [28, 29], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99133:FunctionDef_L27_C1", "vector": [5, 2, 0.1738, 0.0122, 2, 0.03, 0.0, 0, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\twhile linestr[-1].isspace():\n\t\t\tlinestr = linestr[:-1]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99133:Assign_L29_C3", "label": "linestr =", "type": "assigned_variable", "loc": [29, 29], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99133:While_L28_C2", "vector": [14, 3, 0.1768, 0.0061, 3, 0.46, 0.0, 501, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "linestr", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\tlinestr = linestr[:-1]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99133:Assign_L30_C2", "label": "self._linestr =", "type": "assigned_variable", "loc": [30, 30], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99133:FunctionDef_L27_C1", "vector": [14, 2, 0.1829, 0.0061, 2, 0.03, 0.1, 293, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self._linestr", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tself._linestr = linestr"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99133:Assign_L33_C2", "label": "pat = match()", "type": "assigned_variable", "loc": [33, 35], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99133:FunctionDef_L27_C1", "vector": [14, 2, 0.2073, 0.0183, 2, 0.03, 0.2, 545, 3, 2, 0, 0, 36, 10, 1], "semantic": {"name": "pat", "arg_names": [], "import_names": [], "rhs_call_name": "match", "annotation": ""}, "snippet": "\t\tpat = re.match( \\\n\t\t\tr'^(\\S+)\\t([\\w /]+)\\t(0x[\\dA-F]{8})\\t(0x[\\dA-F]{8})\\t(0x[\\dA-F]{8})\\t(0x[\\dA-F]{8})\\t(0x[\\dA-F]{4})\\s*$', \\\n\t\t\tself._linestr)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99133:If_L36_C2", "label": "if", "type": "if", "loc": [36, 38], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99133:FunctionDef_L27_C1", "vector": [4, 2, 0.2256, 0.0183, 2, 0.03, 0.3, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tif not pat:\n\t\t\tlog.warning(r'<DicItem Line Format Error> : %s', self._linestr)\n\t\t\traise ItemParseError()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99133:Expr_L37_C3", "label": "warning()", "type": "expression", "loc": [37, 37], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99133:If_L36_C2", "vector": [8, 3, 0.2256, 0.0061, 3, 0.3, 0.0, 320, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "warning", "arg_names": [], "import_names": [], "rhs_call_name": "warning", "annotation": ""}, "snippet": "\t\t\tlog.warning(r'<DicItem Line Format Error> : %s', self._linestr)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99133:Assign_L39_C2", "label": "self._name = group()", "type": "assigned_variable", "loc": [39, 39], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99133:FunctionDef_L27_C1", "vector": [14, 2, 0.2378, 0.0061, 2, 0.03, 0.4, 257, 3, 1, 0, 0, 43, 10, 1], "semantic": {"name": "self._name", "arg_names": [], "import_names": [], "rhs_call_name": "group", "annotation": ""}, "snippet": "\t\tself._name = pat.group(1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99133:Assign_L40_C2", "label": "self._pinyin = group()", "type": "assigned_variable", "loc": [40, 40], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99133:FunctionDef_L27_C1", "vector": [14, 2, 0.2439, 0.0061, 2, 0.03, 0.5, 711, 3, 1, 0, 0, 43, 10, 1], "semantic": {"name": "self._pinyin", "arg_names": [], "import_names": [], "rhs_call_name": "group", "annotation": ""}, "snippet": "\t\tself._pinyin = pat.group(2)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99133:Assign_L41_C2", "label": "self._nextLevelId = group()", "type": "assigned_variable", "loc": [41, 41], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99133:FunctionDef_L27_C1", "vector": [14, 2, 0.25, 0.0061, 2, 0.03, 0.6, 657, 3, 1, 0, 0, 43, 10, 1], "semantic": {"name": "self._nextLevelId", "arg_names": [], "import_names": [], "rhs_call_name": "group", "annotation": ""}, "snippet": "\t\tself._nextLevelId = pat.group(3)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99133:Assign_L42_C2", "label": "self._nextLevelInfo = group()", "type": "assigned_variable", "loc": [42, 42], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99133:FunctionDef_L27_C1", "vector": [14, 2, 0.2561, 0.0061, 2, 0.03, 0.7, 222, 3, 1, 0, 0, 43, 10, 1], "semantic": {"name": "self._nextLevelInfo", "arg_names": [], "import_names": [], "rhs_call_name": "group", "annotation": ""}, "snippet": "\t\tself._nextLevelInfo = pat.group(4)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99133:Assign_L43_C2", "label": "self._offset = group()", "type": "assigned_variable", "loc": [43, 43], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99133:FunctionDef_L27_C1", "vector": [14, 2, 0.2622, 0.0061, 2, 0.03, 0.8, 914, 3, 1, 0, 0, 43, 10, 1], "semantic": {"name": "self._offset", "arg_names": [], "import_names": [], "rhs_call_name": "group", "annotation": ""}, "snippet": "\t\tself._offset = pat.group(5)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99133:Assign_L44_C2", "label": "self._voiceId = group()", "type": "assigned_variable", "loc": [44, 44], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99133:FunctionDef_L27_C1", "vector": [14, 2, 0.2683, 0.0061, 2, 0.03, 0.9, 728, 3, 1, 0, 0, 43, 10, 1], "semantic": {"name": "self._voiceId", "arg_names": [], "import_names": [], "rhs_call_name": "group", "annotation": ""}, "snippet": "\t\tself._voiceId = pat.group(6)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99133:Assign_L45_C2", "label": "self._nextLevelNum = group()", "type": "assigned_variable", "loc": [45, 45], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99133:FunctionDef_L27_C1", "vector": [14, 2, 0.2744, 0.0061, 2, 0.03, 1.0, 316, 3, 1, 0, 0, 43, 10, 1], "semantic": {"name": "self._nextLevelNum", "arg_names": [], "import_names": [], "rhs_call_name": "group", "annotation": ""}, "snippet": "\t\tself._nextLevelNum = pat.group(7)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99133:FunctionDef_L56_C1", "label": "get_str", "type": "function", "loc": [56, 57], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99133:ClassDef_L26_C0", "vector": [2, 1, 0.3445, 0.0122, 1, 0.83, 0.25, 383, 0, 1, 1, 0, 0, 0, 0], "semantic": {"name": "get_str", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tdef get_str(self):\n\t\treturn self._linestr"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99133:Return_L57_C2", "label": "return", "type": "return", "loc": [57, 57], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99133:FunctionDef_L56_C1", "vector": [13, 2, 0.3476, 0.0061, 2, 0.73, 0.0, 0, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\treturn self._linestr"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99133:FunctionDef_L60_C1", "label": "_get_from_file", "type": "function", "loc": [60, 63], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99133:ClassDef_L26_C0", "vector": [2, 1, 0.375, 0.0244, 1, 0.83, 0.5, 491, 0, 1, 1, 0, 0, 0, 5], "semantic": {"name": "_get_from_file", "arg_names": ["fn"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tdef _get_from_file(fn):\n\t\tlns = codecs.open(fn, 'r', 'gbk').readlines()\n\t\t#return tuple(DicItem(ln) for ln in lns)\n\t\treturn tuple(map(lambda line:DicItem(line), lns))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99133:Assign_L61_C2", "label": "lns = readlines()", "type": "assigned_variable", "loc": [61, 61], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99133:FunctionDef_L60_C1", "vector": [14, 2, 0.372, 0.0061, 2, 0.79, 0.0, 406, 3, 0, 0, 0, 841, 10, 2], "semantic": {"name": "lns", "arg_names": [], "import_names": [], "rhs_call_name": "readlines", "annotation": ""}, "snippet": "\t\tlns = codecs.open(fn, 'r', 'gbk').readlines()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99133:Return_L63_C2", "label": "return", "type": "return", "loc": [63, 63], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99133:FunctionDef_L60_C1", "vector": [13, 2, 0.3841, 0.0061, 2, 0.79, 1.0, 0, 3, 0, 0, 0, 0, 10, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\treturn tuple(map(lambda line:DicItem(line), lns))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99133:Assign_L64_C1", "label": "get_from_file = staticmethod()", "type": "assigned_variable", "loc": [64, 64], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99133:ClassDef_L26_C0", "vector": [14, 1, 0.3902, 0.0061, 1, 0.83, 0.75, 849, 3, 1, 0, 0, 884, 10, 1], "semantic": {"name": "get_from_file", "arg_names": [], "import_names": [], "rhs_call_name": "staticmethod", "annotation": ""}, "snippet": "\tget_from_file = staticmethod (_get_from_file)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99133:FunctionDef_L66_C1", "label": "__getitem__", "type": "function", "loc": [66, 69], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99133:ClassDef_L26_C0", "vector": [2, 1, 0.4116, 0.0244, 1, 0.83, 1.0, 698, 0, 2, 1, 0, 0, 0, 0], "semantic": {"name": "__getitem__", "arg_names": ["self", "attr"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tdef __getitem__(self, attr):\n\t\t' Return a string.\\n'\n\t\t#return self._attrs[attr]\n\t\treturn self.__dict__['_' + attr]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99133:Expr_L67_C2", "label": "expression", "type": "expression", "loc": [67, 67], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99133:FunctionDef_L66_C1", "vector": [8, 2, 0.4085, 0.0061, 2, 0.43, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t' Return a string.\\n'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99133:Return_L69_C2", "label": "return", "type": "return", "loc": [69, 69], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99133:FunctionDef_L66_C1", "vector": [13, 2, 0.4207, 0.0061, 2, 0.43, 1.0, 0, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\treturn self.__dict__['_' + attr]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99133:ClassDef_L71_C0", "label": "VrResultItem", "type": "class", "loc": [71, 106], "level": 0, "parent": null, "vector": [3, 0, 0.5396, 0.2195, 0, 0.66, 0.7333, 678, 0, 4, 0, 0, 0, 0, 16], "semantic": {"name": "VrResultItem", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class VrResultItem:\n\tdef __init__(self, linestr):\n\t\twhile linestr[-1].isspace():\n\t\t\tlinestr = linestr[:-1]\n\t\tself._linestr = linestr;\n\t\t#pat = re.match( \\\n\t\t\t#r'^(\\S+)\\t(\\S+)\\t(.+\\])\\s(0x[\\dA-F]{8})\\t(0x[\\dA-F]{8})\\t(0x[\\dA-F]{8})\\t(0x[\\dA-F]{8})\\t(0x[\\dA-F]{8})\\s*$', \\\n\t\t\t#self._linestr)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99133:FunctionDef_L72_C1", "label": "__init__", "type": "function", "loc": [72, 91], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99133:ClassDef_L71_C0", "vector": [2, 1, 0.497, 0.122, 1, 0.5, 0.0, 555, 0, 2, 0, 0, 0, 0, 10], "semantic": {"name": "__init__", "arg_names": ["self", "linestr"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tdef __init__(self, linestr):\n\t\twhile linestr[-1].isspace():\n\t\t\tlinestr = linestr[:-1]\n\t\tself._linestr = linestr;\n\t\t#pat = re.match( \\\n\t\t\t#r'^(\\S+)\\t(\\S+)\\t(.+\\])\\s(0x[\\dA-F]{8})\\t(0x[\\dA-F]{8})\\t(0x[\\dA-F]{8})\\t(0x[\\dA-F]{8})\\t(0x[\\dA-F]{8})\\s*$', \\\n\t\t\t#self._linestr)\n\t\tpat = re.search( \\"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99133:While_L73_C2", "label": "while", "type": "while", "loc": [73, 74], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99133:FunctionDef_L72_C1", "vector": [5, 2, 0.4482, 0.0122, 2, 0.34, 0.0, 0, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\twhile linestr[-1].isspace():\n\t\t\tlinestr = linestr[:-1]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99133:Assign_L74_C3", "label": "linestr =", "type": "assigned_variable", "loc": [74, 74], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99133:While_L73_C2", "vector": [14, 3, 0.4512, 0.0061, 3, 0.64, 0.0, 501, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "linestr", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\tlinestr = linestr[:-1]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99133:Assign_L75_C2", "label": "self._linestr =", "type": "assigned_variable", "loc": [75, 75], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99133:FunctionDef_L72_C1", "vector": [14, 2, 0.4573, 0.0061, 2, 0.34, 0.1111, 293, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self._linestr", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tself._linestr = linestr;"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99133:Assign_L79_C2", "label": "pat = search()", "type": "assigned_variable", "loc": [79, 81], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99133:FunctionDef_L72_C1", "vector": [14, 2, 0.4878, 0.0183, 2, 0.34, 0.2222, 545, 3, 2, 0, 0, 163, 10, 1], "semantic": {"name": "pat", "arg_names": [], "import_names": [], "rhs_call_name": "search", "annotation": ""}, "snippet": "\t\tpat = re.search( \\\n\t\t\tr'(\\S+)\\t(.+\\])\\s(0x[\\dA-F]{8})\\t(0x[\\dA-F]{8})\\t(0x[\\dA-F]{8})\\t(0x[\\dA-F]{8})\\t(0x[\\dA-F]{8})\\s*$', \\\n\t\t\tself._linestr)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99133:If_L82_C2", "label": "if", "type": "if", "loc": [82, 84], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99133:FunctionDef_L72_C1", "vector": [4, 2, 0.5061, 0.0183, 2, 0.34, 0.3333, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tif not pat:\n\t\t\tlog.warning(r'<VrResultItem Line Format Error> : %s', self._linestr)\n\t\t\traise ItemParseError()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99133:Expr_L83_C3", "label": "warning()", "type": "expression", "loc": [83, 83], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99133:If_L82_C2", "vector": [8, 3, 0.5061, 0.0061, 3, 0.25, 0.0, 320, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "warning", "arg_names": [], "import_names": [], "rhs_call_name": "warning", "annotation": ""}, "snippet": "\t\t\tlog.warning(r'<VrResultItem Line Format Error> : %s', self._linestr)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99133:Assign_L86_C2", "label": "self._vrName = group()", "type": "assigned_variable", "loc": [86, 86], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99133:FunctionDef_L72_C1", "vector": [14, 2, 0.5244, 0.0061, 2, 0.34, 0.4444, 334, 3, 1, 0, 0, 43, 10, 1], "semantic": {"name": "self._vrName", "arg_names": [], "import_names": [], "rhs_call_name": "group", "annotation": ""}, "snippet": "\t\tself._vrName = pat.group(1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99133:Assign_L87_C2", "label": "self._dicId = group()", "type": "assigned_variable", "loc": [87, 87], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99133:FunctionDef_L72_C1", "vector": [14, 2, 0.5305, 0.0061, 2, 0.34, 0.5556, 875, 3, 1, 0, 0, 43, 10, 1], "semantic": {"name": "self._dicId", "arg_names": [], "import_names": [], "rhs_call_name": "group", "annotation": ""}, "snippet": "\t\tself._dicId = pat.group(3)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99133:Assign_L88_C2", "label": "self._nextLevelId = group()", "type": "assigned_variable", "loc": [88, 88], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99133:FunctionDef_L72_C1", "vector": [14, 2, 0.5366, 0.0061, 2, 0.34, 0.6667, 657, 3, 1, 0, 0, 43, 10, 1], "semantic": {"name": "self._nextLevelId", "arg_names": [], "import_names": [], "rhs_call_name": "group", "annotation": ""}, "snippet": "\t\tself._nextLevelId = pat.group(4)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99133:Assign_L89_C2", "label": "self._nextLevelInfo = group()", "type": "assigned_variable", "loc": [89, 89], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99133:FunctionDef_L72_C1", "vector": [14, 2, 0.5427, 0.0061, 2, 0.34, 0.7778, 222, 3, 1, 0, 0, 43, 10, 1], "semantic": {"name": "self._nextLevelInfo", "arg_names": [], "import_names": [], "rhs_call_name": "group", "annotation": ""}, "snippet": "\t\tself._nextLevelInfo = pat.group(5)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99133:Assign_L90_C2", "label": "self._offset = group()", "type": "assigned_variable", "loc": [90, 90], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99133:FunctionDef_L72_C1", "vector": [14, 2, 0.5488, 0.0061, 2, 0.34, 0.8889, 914, 3, 1, 0, 0, 43, 10, 1], "semantic": {"name": "self._offset", "arg_names": [], "import_names": [], "rhs_call_name": "group", "annotation": ""}, "snippet": "\t\tself._offset = pat.group(6)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99133:Assign_L91_C2", "label": "self._voiceId = group()", "type": "assigned_variable", "loc": [91, 91], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99133:FunctionDef_L72_C1", "vector": [14, 2, 0.5549, 0.0061, 2, 0.34, 1.0, 728, 3, 1, 0, 0, 43, 10, 1], "semantic": {"name": "self._voiceId", "arg_names": [], "import_names": [], "rhs_call_name": "group", "annotation": ""}, "snippet": "\t\tself._voiceId = pat.group(7)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99133:FunctionDef_L93_C1", "label": "get_str", "type": "function", "loc": [93, 94], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99133:ClassDef_L71_C0", "vector": [2, 1, 0.5701, 0.0122, 1, 0.5, 0.25, 383, 0, 1, 1, 0, 0, 0, 0], "semantic": {"name": "get_str", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tdef get_str(self):\n\t\treturn self._linestr"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99133:Return_L94_C2", "label": "return", "type": "return", "loc": [94, 94], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99133:FunctionDef_L93_C1", "vector": [13, 2, 0.5732, 0.0061, 2, 0.6, 0.0, 0, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\treturn self._linestr"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99133:FunctionDef_L97_C1", "label": "_get_from_file", "type": "function", "loc": [97, 100], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99133:ClassDef_L71_C0", "vector": [2, 1, 0.6006, 0.0244, 1, 0.5, 0.5, 491, 0, 1, 1, 0, 0, 0, 5], "semantic": {"name": "_get_from_file", "arg_names": ["fn"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tdef _get_from_file(fn):\n\t\tlns = codecs.open(fn, 'r', 'gbk').readlines()\n\t\t#return tuple(DicItem(ln) for ln in lns[4:])\n\t\treturn tuple(map(lambda line:VrResultItem(line), lns[4:]))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99133:Assign_L98_C2", "label": "lns = readlines()", "type": "assigned_variable", "loc": [98, 98], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99133:FunctionDef_L97_C1", "vector": [14, 2, 0.5976, 0.0061, 2, 0.44, 0.0, 406, 3, 0, 0, 0, 841, 10, 2], "semantic": {"name": "lns", "arg_names": [], "import_names": [], "rhs_call_name": "readlines", "annotation": ""}, "snippet": "\t\tlns = codecs.open(fn, 'r', 'gbk').readlines()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99133:Return_L100_C2", "label": "return", "type": "return", "loc": [100, 100], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99133:FunctionDef_L97_C1", "vector": [13, 2, 0.6098, 0.0061, 2, 0.44, 1.0, 0, 3, 0, 0, 0, 0, 10, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\treturn tuple(map(lambda line:VrResultItem(line), lns[4:]))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99133:Assign_L101_C1", "label": "get_from_file = staticmethod()", "type": "assigned_variable", "loc": [101, 101], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99133:ClassDef_L71_C0", "vector": [14, 1, 0.6159, 0.0061, 1, 0.5, 0.75, 849, 3, 1, 0, 0, 884, 10, 1], "semantic": {"name": "get_from_file", "arg_names": [], "import_names": [], "rhs_call_name": "staticmethod", "annotation": ""}, "snippet": "\tget_from_file = staticmethod(_get_from_file)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99133:FunctionDef_L103_C1", "label": "__getitem__", "type": "function", "loc": [103, 106], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99133:ClassDef_L71_C0", "vector": [2, 1, 0.6372, 0.0244, 1, 0.5, 1.0, 698, 0, 2, 1, 0, 0, 0, 0], "semantic": {"name": "__getitem__", "arg_names": ["self", "attr"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tdef __getitem__(self, attr):\n\t\t' Return a string.\\n'\n\t\t#return self._attrs[attr]\n\t\treturn self.__dict__['_' + attr]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99133:Expr_L104_C2", "label": "expression", "type": "expression", "loc": [104, 104], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99133:FunctionDef_L103_C1", "vector": [8, 2, 0.6341, 0.0061, 2, 0.94, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t' Return a string.\\n'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99133:Return_L106_C2", "label": "return", "type": "return", "loc": [106, 106], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99133:FunctionDef_L103_C1", "vector": [13, 2, 0.6463, 0.0061, 2, 0.94, 1.0, 0, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\treturn self.__dict__['_' + attr]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99133:FunctionDef_L109_C0", "label": "compare_vr_result", "type": "function", "loc": [109, 113], "level": 0, "parent": null, "vector": [2, 0, 0.6768, 0.0305, 0, 0.66, 0.8, 865, 0, 2, 1, 0, 0, 0, 2], "semantic": {"name": "compare_vr_result", "arg_names": ["dicIds", "folder"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def compare_vr_result(dicIds, folder):\n\tret = []\n\tfor dicId in dicIds:\n\t\tret.append(compare_vr_dic(dicId, folder))\n\treturn ret"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99133:Assign_L110_C1", "label": "ret =", "type": "assigned_variable", "loc": [110, 110], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99133:FunctionDef_L109_C0", "vector": [14, 1, 0.6707, 0.0061, 1, 0.88, 0.0, 501, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "ret", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tret = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99133:For_L111_C1", "label": "for dicId", "type": "for", "loc": [111, 112], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99133:FunctionDef_L109_C0", "vector": [6, 1, 0.6799, 0.0122, 1, 0.88, 0.5, 40, 2, 0, 0, 0, 0, 0, 2], "semantic": {"name": "dicId", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tfor dicId in dicIds:\n\t\tret.append(compare_vr_dic(dicId, folder))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99133:Expr_L112_C2", "label": "append()", "type": "expression", "loc": [112, 112], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99133:For_L111_C1", "vector": [8, 2, 0.6829, 0.0061, 2, 0.06, 0.0, 243, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": "\t\tret.append(compare_vr_dic(dicId, folder))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99133:Return_L113_C1", "label": "return", "type": "return", "loc": [113, 113], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99133:FunctionDef_L109_C0", "vector": [13, 1, 0.689, 0.0061, 1, 0.88, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\treturn ret"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99133:FunctionDef_L115_C0", "label": "compare_vr_dic", "type": "function", "loc": [115, 143], "level": 0, "parent": null, "vector": [2, 0, 0.7866, 0.1768, 0, 0.66, 0.8667, 444, 0, 2, 1, 0, 0, 0, 16], "semantic": {"name": "compare_vr_dic", "arg_names": ["dicId", "folder"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def compare_vr_dic(dicId, folder):\n\tallRight = True\n\tallWrong = True\n\tdicItems = DicItem.get_from_file(os.path.join(folder, dicId+'.txt'))\n\tvrRIs = VrResultItem.get_from_file(os.path.join(folder, dicId+'.out.txt'))\n\tif len(dicItems) != len(vrRIs) or len(dicItems) == 0:\n\t\tlog.warning('<VR Length Error> : %s', dic)\n\t\traise Exception()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99133:Assign_L116_C1", "label": "allRight =", "type": "assigned_variable", "loc": [116, 116], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99133:FunctionDef_L115_C0", "vector": [14, 1, 0.7073, 0.0061, 1, 0.89, 0.0, 687, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "allRight", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tallRight = True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99133:Assign_L117_C1", "label": "allWrong =", "type": "assigned_variable", "loc": [117, 117], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99133:FunctionDef_L115_C0", "vector": [14, 1, 0.7134, 0.0061, 1, 0.89, 0.1667, 561, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "allWrong", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tallWrong = True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99133:Assign_L118_C1", "label": "dicItems = get_from_file()", "type": "assigned_variable", "loc": [118, 118], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99133:FunctionDef_L115_C0", "vector": [14, 1, 0.7195, 0.0061, 1, 0.89, 0.3333, 216, 3, 1, 0, 0, 849, 10, 2], "semantic": {"name": "dicItems", "arg_names": [], "import_names": [], "rhs_call_name": "get_from_file", "annotation": ""}, "snippet": "\tdicItems = DicItem.get_from_file(os.path.join(folder, dicId+'.txt'))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99133:Assign_L119_C1", "label": "vrRIs = get_from_file()", "type": "assigned_variable", "loc": [119, 119], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99133:FunctionDef_L115_C0", "vector": [14, 1, 0.7256, 0.0061, 1, 0.89, 0.5, 157, 3, 1, 0, 0, 849, 10, 2], "semantic": {"name": "vrRIs", "arg_names": [], "import_names": [], "rhs_call_name": "get_from_file", "annotation": ""}, "snippet": "\tvrRIs = VrResultItem.get_from_file(os.path.join(folder, dicId+'.out.txt'))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99133:If_L120_C1", "label": "if", "type": "if", "loc": [120, 122], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99133:FunctionDef_L115_C0", "vector": [4, 1, 0.7378, 0.0183, 1, 0.89, 0.6667, 0, 0, 0, 0, 0, 0, 0, 5], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tif len(dicItems) != len(vrRIs) or len(dicItems) == 0:\n\t\tlog.warning('<VR Length Error> : %s', dic)\n\t\traise Exception()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99133:Expr_L121_C2", "label": "warning()", "type": "expression", "loc": [121, 121], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99133:If_L120_C1", "vector": [8, 2, 0.7378, 0.0061, 2, 0.75, 0.0, 320, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "warning", "arg_names": [], "import_names": [], "rhs_call_name": "warning", "annotation": ""}, "snippet": "\t\tlog.warning('<VR Length Error> : %s', dic)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99133:For_L123_C1", "label": "for n", "type": "for", "loc": [123, 135], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99133:FunctionDef_L115_C0", "vector": [6, 1, 0.7866, 0.0793, 1, 0.89, 0.8333, 773, 3, 0, 0, 0, 0, 0, 6], "semantic": {"name": "n", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tfor n in range(len(dicItems)):\n\t\titm = dicItems[n]\n\t\tvrt = vrRIs[n]\n\t\tif vrt['vrName'] != itm['name'] or \\\n\t\t\t\tvrt['dicId'] != '0x' + dicId or \\\n\t\t\t\tvrt['nextLevelId'] != itm['nextLevelId'] or \\\n\t\t\t\tvrt['nextLevelInfo'] != itm['nextLevelInfo'] or \\\n\t\t\t\tvrt['offset'] != itm['offset'] or \\"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99133:Assign_L124_C2", "label": "itm =", "type": "assigned_variable", "loc": [124, 124], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99133:For_L123_C1", "vector": [14, 2, 0.7561, 0.0061, 2, 0.89, 0.0, 769, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "itm", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\titm = dicItems[n]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99133:Assign_L125_C2", "label": "vrt =", "type": "assigned_variable", "loc": [125, 125], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99133:For_L123_C1", "vector": [14, 2, 0.7622, 0.0061, 2, 0.89, 0.5, 578, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "vrt", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tvrt = vrRIs[n]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99133:If_L126_C2", "label": "if", "type": "if", "loc": [126, 135], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99133:For_L123_C1", "vector": [4, 2, 0.7957, 0.061, 2, 0.89, 1.0, 0, 0, 0, 0, 0, 0, 0, 4], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tif vrt['vrName'] != itm['name'] or \\\n\t\t\t\tvrt['dicId'] != '0x' + dicId or \\\n\t\t\t\tvrt['nextLevelId'] != itm['nextLevelId'] or \\\n\t\t\t\tvrt['nextLevelInfo'] != itm['nextLevelInfo'] or \\\n\t\t\t\tvrt['offset'] != itm['offset'] or \\\n\t\t\t\tvrt['voiceId'] != itm['voiceId'] :\n\t\t\tlog.warning('<VR Error> : 0x%s : %d : %s : %s', dicId, len(dicItems), itm.get_str(), vrt.get_str())\n\t\t\tallRight = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99133:Expr_L132_C3", "label": "warning()", "type": "expression", "loc": [132, 132], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99133:If_L126_C2", "vector": [8, 3, 0.8049, 0.0061, 3, 0.87, 0.0, 320, 3, 5, 0, 0, 0, 0, 4], "semantic": {"name": "warning", "arg_names": [], "import_names": [], "rhs_call_name": "warning", "annotation": ""}, "snippet": "\t\t\tlog.warning('<VR Error> : 0x%s : %d : %s : %s', dicId, len(dicItems), itm.get_str(), vrt.get_str())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99133:Assign_L133_C3", "label": "allRight =", "type": "assigned_variable", "loc": [133, 133], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99133:If_L126_C2", "vector": [14, 3, 0.811, 0.0061, 3, 0.87, 0.5, 687, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "allRight", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\tallRight = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99133:Assign_L135_C3", "label": "allWrong =", "type": "assigned_variable", "loc": [135, 135], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99133:If_L126_C2", "vector": [14, 3, 0.8232, 0.0061, 3, 0.87, 1.0, 561, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "allWrong", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\tallWrong = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99133:If_L136_C1", "label": "if", "type": "if", "loc": [136, 143], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99133:FunctionDef_L115_C0", "vector": [4, 1, 0.8506, 0.0488, 1, 0.89, 1.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tif allRight and not allWrong:\n\t\treturn 'OK'\n\telif not allRight and not allWrong:\n\t\treturn 'NotGood'\n\telif not allRight and allWrong:\n\t\treturn 'Failed'\n\telse:\n\t\traise Exception()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99133:Return_L137_C2", "label": "return", "type": "return", "loc": [137, 137], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99133:If_L136_C1", "vector": [13, 2, 0.8354, 0.0061, 2, 0.35, 0.0, 0, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\treturn 'OK'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99133:If_L138_C1", "label": "if", "type": "if", "loc": [138, 143], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99133:If_L136_C1", "vector": [4, 2, 0.8567, 0.0366, 2, 0.35, 1.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\telif not allRight and not allWrong:\n\t\treturn 'NotGood'\n\telif not allRight and allWrong:\n\t\treturn 'Failed'\n\telse:\n\t\traise Exception()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99133:Return_L139_C2", "label": "return", "type": "return", "loc": [139, 139], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99133:If_L138_C1", "vector": [13, 3, 0.8476, 0.0061, 3, 0.81, 0.0, 0, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\treturn 'NotGood'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99133:If_L140_C1", "label": "if", "type": "if", "loc": [140, 143], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99133:If_L138_C1", "vector": [4, 3, 0.8628, 0.0244, 3, 0.81, 1.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\telif not allRight and allWrong:\n\t\treturn 'Failed'\n\telse:\n\t\traise Exception()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99133:Return_L141_C2", "label": "return", "type": "return", "loc": [141, 141], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99133:If_L140_C1", "vector": [13, 4, 0.8598, 0.0061, 4, 0.26, 0.0, 0, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\treturn 'Failed'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99133:FunctionDef_L145_C0", "label": "main", "type": "function", "loc": [145, 158], "level": 0, "parent": null, "vector": [2, 0, 0.9238, 0.0854, 0, 0.66, 0.9333, 624, 0, 0, 0, 0, 0, 0, 15], "semantic": {"name": "main", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def main():\n\tif len(sys.argv) != 2:\n\t\tprint('Usage:')\n\t\tprint('python CheckLoopbackResult.py [ResultFolder]')\n\t\tsys.exit(0)\n\tfolder = sys.argv[1]\n\tfns = tuple(os.path.split(p)[1] for p in glob.glob(os.path.join(folder, '????????.txt')))\n\t#dicIds = tuple(fn[:8] for fn in fns)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99133:If_L146_C1", "label": "if", "type": "if", "loc": [146, 149], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99133:FunctionDef_L145_C0", "vector": [4, 1, 0.8994, 0.0244, 1, 0.93, 0.0, 0, 0, 0, 0, 0, 0, 0, 4], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tif len(sys.argv) != 2:\n\t\tprint('Usage:')\n\t\tprint('python CheckLoopbackResult.py [ResultFolder]')\n\t\tsys.exit(0)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99133:Expr_L147_C2", "label": "print()", "type": "expression", "loc": [147, 147], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99133:If_L146_C1", "vector": [8, 2, 0.8963, 0.0061, 2, 0.5, 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('Usage:')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99133:Expr_L148_C2", "label": "print()", "type": "expression", "loc": [148, 148], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99133:If_L146_C1", "vector": [8, 2, 0.9024, 0.0061, 2, 0.5, 0.5, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": "\t\tprint('python CheckLoopbackResult.py [ResultFolder]')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99133:Expr_L149_C2", "label": "exit()", "type": "expression", "loc": [149, 149], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99133:If_L146_C1", "vector": [8, 2, 0.9085, 0.0061, 2, 0.5, 1.0, 436, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "exit", "arg_names": [], "import_names": [], "rhs_call_name": "exit", "annotation": ""}, "snippet": "\t\tsys.exit(0)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99133:Assign_L150_C1", "label": "folder =", "type": "assigned_variable", "loc": [150, 150], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99133:FunctionDef_L145_C0", "vector": [14, 1, 0.9146, 0.0061, 1, 0.93, 0.1429, 841, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "folder", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tfolder = sys.argv[1]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99133:Assign_L151_C1", "label": "fns = tuple()", "type": "assigned_variable", "loc": [151, 151], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99133:FunctionDef_L145_C0", "vector": [14, 1, 0.9207, 0.0061, 1, 0.93, 0.2857, 344, 3, 1, 0, 0, 259, 10, 4], "semantic": {"name": "fns", "arg_names": [], "import_names": [], "rhs_call_name": "tuple", "annotation": ""}, "snippet": "\tfns = tuple(os.path.split(p)[1] for p in glob.glob(os.path.join(folder, '????????.txt')))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99133:Assign_L153_C1", "label": "dicIds = tuple()", "type": "assigned_variable", "loc": [153, 153], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99133:FunctionDef_L145_C0", "vector": [14, 1, 0.9329, 0.0061, 1, 0.93, 0.4286, 161, 3, 1, 0, 0, 259, 10, 2], "semantic": {"name": "dicIds", "arg_names": [], "import_names": [], "rhs_call_name": "tuple", "annotation": ""}, "snippet": "\tdicIds = tuple(map(lambda s:s[:8], fns))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99133:Assign_L154_C1", "label": "cr = compare_vr_result()", "type": "assigned_variable", "loc": [154, 154], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99133:FunctionDef_L145_C0", "vector": [14, 1, 0.939, 0.0061, 1, 0.93, 0.5714, 766, 3, 2, 0, 0, 865, 10, 1], "semantic": {"name": "cr", "arg_names": [], "import_names": [], "rhs_call_name": "compare_vr_result", "annotation": ""}, "snippet": "\tcr = compare_vr_result(dicIds, folder)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99133:Assign_L155_C1", "label": "fo = open()", "type": "assigned_variable", "loc": [155, 155], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99133:FunctionDef_L145_C0", "vector": [14, 1, 0.9451, 0.0061, 1, 0.93, 0.7143, 542, 3, 2, 0, 0, 693, 10, 1], "semantic": {"name": "fo", "arg_names": [], "import_names": [], "rhs_call_name": "open", "annotation": ""}, "snippet": "\tfo = open('Result.txt', 'w')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99133:For_L156_C1", "label": "for n", "type": "for", "loc": [156, 157], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99133:FunctionDef_L145_C0", "vector": [6, 1, 0.9543, 0.0122, 1, 0.93, 0.8571, 773, 3, 0, 0, 0, 0, 0, 2], "semantic": {"name": "n", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tfor n in range(len(dicIds)):\n\t\tprint >> fo, '%s\\t%s' % (dicIds[n], cr[n])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99133:Expr_L157_C2", "label": "expression", "type": "expression", "loc": [157, 157], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99133:For_L156_C1", "vector": [8, 2, 0.9573, 0.0061, 2, 0.18, 0.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tprint >> fo, '%s\\t%s' % (dicIds[n], cr[n])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99133:Expr_L158_C1", "label": "close()", "type": "expression", "loc": [158, 158], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99133:FunctionDef_L145_C0", "vector": [8, 1, 0.9634, 0.0061, 1, 0.93, 1.0, 77, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "close", "arg_names": [], "import_names": [], "rhs_call_name": "close", "annotation": ""}, "snippet": "\tfo.close()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99133:If_L161_C0", "label": "if", "type": "if", "loc": [161, 162], "level": 0, "parent": null, "vector": [4, 0, 0.9848, 0.0122, 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\tmain()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99133:Expr_L162_C1", "label": "main()", "type": "expression", "loc": [162, 162], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99133:If_L161_C0", "vector": [8, 1, 0.9878, 0.0061, 1, 0.37, 0.0, 624, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "main", "arg_names": [], "import_names": [], "rhs_call_name": "main", "annotation": ""}, "snippet": "\tmain()"}]
[{"f": "ajibawa-2023/Python-Code-Large/train/row_99133:FunctionDef_L13_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99133:Assign_L14_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99133:FunctionDef_L13_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99133:Assign_L15_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99133:FunctionDef_L13_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99133:Assign_L16_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99133:FunctionDef_L13_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99133:Expr_L17_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99133:FunctionDef_L13_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99133:Expr_L18_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99133:FunctionDef_L13_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99133:Expr_L19_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99133:FunctionDef_L13_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99133:Return_L20_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99133:ClassDef_L26_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99133:FunctionDef_L27_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99133:FunctionDef_L27_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99133:While_L28_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99133:While_L28_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99133:Assign_L29_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99133:FunctionDef_L27_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99133:Assign_L30_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99133:FunctionDef_L27_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99133:Assign_L33_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99133:FunctionDef_L27_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99133:If_L36_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99133:If_L36_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99133:Expr_L37_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99133:FunctionDef_L27_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99133:Assign_L39_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99133:FunctionDef_L27_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99133:Assign_L40_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99133:FunctionDef_L27_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99133:Assign_L41_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99133:FunctionDef_L27_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99133:Assign_L42_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99133:FunctionDef_L27_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99133:Assign_L43_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99133:FunctionDef_L27_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99133:Assign_L44_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99133:FunctionDef_L27_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99133:Assign_L45_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99133:ClassDef_L26_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99133:FunctionDef_L56_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99133:FunctionDef_L56_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99133:Return_L57_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99133:ClassDef_L26_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99133:FunctionDef_L60_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99133:FunctionDef_L60_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99133:Assign_L61_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99133:FunctionDef_L60_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99133:Return_L63_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99133:ClassDef_L26_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99133:Assign_L64_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99133:ClassDef_L26_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99133:FunctionDef_L66_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99133:FunctionDef_L66_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99133:Expr_L67_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99133:FunctionDef_L66_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99133:Return_L69_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99133:ClassDef_L71_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99133:FunctionDef_L72_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99133:FunctionDef_L72_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99133:While_L73_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99133:While_L73_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99133:Assign_L74_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99133:FunctionDef_L72_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99133:Assign_L75_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99133:FunctionDef_L72_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99133:Assign_L79_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99133:FunctionDef_L72_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99133:If_L82_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99133:If_L82_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99133:Expr_L83_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99133:FunctionDef_L72_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99133:Assign_L86_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99133:FunctionDef_L72_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99133:Assign_L87_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99133:FunctionDef_L72_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99133:Assign_L88_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99133:FunctionDef_L72_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99133:Assign_L89_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99133:FunctionDef_L72_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99133:Assign_L90_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99133:FunctionDef_L72_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99133:Assign_L91_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99133:ClassDef_L71_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99133:FunctionDef_L93_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99133:FunctionDef_L93_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99133:Return_L94_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99133:ClassDef_L71_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99133:FunctionDef_L97_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99133:FunctionDef_L97_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99133:Assign_L98_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99133:FunctionDef_L97_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99133:Return_L100_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99133:ClassDef_L71_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99133:Assign_L101_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99133:ClassDef_L71_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99133:FunctionDef_L103_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99133:FunctionDef_L103_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99133:Expr_L104_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99133:FunctionDef_L103_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99133:Return_L106_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99133:FunctionDef_L109_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99133:Assign_L110_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99133:FunctionDef_L109_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99133:For_L111_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99133:For_L111_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99133:Expr_L112_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99133:FunctionDef_L109_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99133:Return_L113_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99133:FunctionDef_L115_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99133:Assign_L116_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99133:FunctionDef_L115_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99133:Assign_L117_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99133:FunctionDef_L115_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99133:Assign_L118_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99133:FunctionDef_L115_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99133:Assign_L119_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99133:FunctionDef_L115_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99133:If_L120_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99133:If_L120_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99133:Expr_L121_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99133:FunctionDef_L115_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99133:For_L123_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99133:For_L123_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99133:Assign_L124_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99133:For_L123_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99133:Assign_L125_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99133:For_L123_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99133:If_L126_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99133:If_L126_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99133:Expr_L132_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99133:If_L126_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99133:Assign_L133_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99133:If_L126_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99133:Assign_L135_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99133:FunctionDef_L115_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99133:If_L136_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99133:If_L136_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99133:Return_L137_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99133:If_L136_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99133:If_L138_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99133:If_L138_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99133:Return_L139_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99133:If_L138_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99133:If_L140_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99133:If_L140_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99133:Return_L141_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99133:FunctionDef_L145_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99133:If_L146_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99133:If_L146_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99133:Expr_L147_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99133:If_L146_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99133:Expr_L148_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99133:If_L146_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99133:Expr_L149_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99133:FunctionDef_L145_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99133:Assign_L150_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99133:FunctionDef_L145_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99133:Assign_L151_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99133:FunctionDef_L145_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99133:Assign_L153_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99133:FunctionDef_L145_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99133:Assign_L154_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99133:FunctionDef_L145_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99133:Assign_L155_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99133:FunctionDef_L145_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99133:For_L156_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99133:For_L156_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99133:Expr_L157_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99133:FunctionDef_L145_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99133:Expr_L158_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99133:If_L161_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99133:Expr_L162_C1"}]
#!/usr/bin/env python # coding=utf-8 """ Join records of two files. For example: file1: A 1 2 B 4 3 file2: B b A a CrossJoin.py file1 file2 file3 then file3: A 1 2 | A a B 4 3 | B b """ import os import sys import codecs import string import logging # set log logFileName = 'CrossJoin.log' def init_log(): logger = logging.getLogger() hdlr = logging.FileHandler(logFileName) formatter = logging.Formatter('%(asctime)s %(levelname)s:: %(message)s') hdlr.setFormatter(formatter) logger.addHandler(hdlr) logger.setLevel(logging.INFO) return logger log = init_log() class RepeatedRecordError(Exception):pass def cross_join(list1, list2): 'list1 and list2 may be changed in the function.\n' for pos1 in range(len(list1)): cnt = len(filter(lambda x:x[0]==list1[pos1][0], list2)) if cnt > 1: raise RepeatedRecordError() for pos2 in range(len(list2)): if list1[pos1][0] == list2[pos2][0]: list1[pos1] += [u'\t|\t'] list1[pos1] += list2[pos2] list2.pop(pos2) break return list1, list2 def read_list(filename): f = codecs.open(filename, 'r', 'utf-8') ret = [] for line in f.readlines(): while line[-1].isspace(): line = line[:-1] ret.append(list(line.split('\t'))) return ret def main(): if len(sys.argv) != 4: print(r'Usage:') print(r'CrossJoin.py file1 file2 outfile') sys.exit(0) file1 = sys.argv[1] file2 = sys.argv[2] outfile = sys.argv[3] list1 = read_list(file1) list2 = read_list(file2) (list1, list2) = cross_join(list1, list2) outf = codecs.open(outfile, 'w', 'utf-8') for r in list1: outf.write(string.join(r, u'\t') + u'\n') outf.write('\n\n\nRest Records in %s : \n\n' % (file2,)) for r in list2: outf.write(string.join(r, u'\t') + u'\n') if __name__ == '__main__': main()
ajibawa-2023/Python-Code-Large/train/row_99134
53
88
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_99134:Expr_L4_C0", "label": "expression", "type": "expression", "loc": [4, 21], "level": 0, "parent": null, "vector": [8, 0, 0.142, 0.2045, 0, 0.66, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\"\"\"\nJoin records of two files.\nFor example:\nfile1:\nA\t1\t2\nB\t4\t3\n\nfile2:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99134:Import_L23_C0", "label": "os import os", "type": "import", "loc": [23, 23], "level": 0, "parent": null, "vector": [1, 0, 0.2614, 0.0114, 0, 0.66, 0.0769, 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_99134:Import_L24_C0", "label": "sys import sys", "type": "import", "loc": [24, 24], "level": 0, "parent": null, "vector": [1, 0, 0.2727, 0.0114, 0, 0.66, 0.1538, 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_99134:Import_L25_C0", "label": "codecs import codecs", "type": "import", "loc": [25, 25], "level": 0, "parent": null, "vector": [1, 0, 0.2841, 0.0114, 0, 0.66, 0.2308, 220, 0, 1, 0, 0, 220, 0, 0], "semantic": {"name": "codecs", "arg_names": [], "import_names": ["codecs"], "rhs_call_name": "", "annotation": ""}, "snippet": "import codecs"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99134:Import_L26_C0", "label": "string import string", "type": "import", "loc": [26, 26], "level": 0, "parent": null, "vector": [1, 0, 0.2955, 0.0114, 0, 0.66, 0.3077, 890, 0, 1, 0, 0, 890, 0, 0], "semantic": {"name": "string", "arg_names": [], "import_names": ["string"], "rhs_call_name": "", "annotation": ""}, "snippet": "import string"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99134:Import_L27_C0", "label": "logging import logging", "type": "import", "loc": [27, 27], "level": 0, "parent": null, "vector": [1, 0, 0.3068, 0.0114, 0, 0.66, 0.3846, 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_99134:Assign_L30_C0", "label": "logFileName =", "type": "assigned_variable", "loc": [30, 30], "level": 0, "parent": null, "vector": [14, 0, 0.3409, 0.0114, 0, 0.66, 0.4615, 181, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "logFileName", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "logFileName = 'CrossJoin.log'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99134:FunctionDef_L31_C0", "label": "init_log", "type": "function", "loc": [31, 38], "level": 0, "parent": null, "vector": [2, 0, 0.392, 0.0909, 0, 0.66, 0.5385, 377, 0, 0, 1, 0, 0, 0, 6], "semantic": {"name": "init_log", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def init_log():\n logger = logging.getLogger()\n hdlr = logging.FileHandler(logFileName)\n formatter = logging.Formatter('%(asctime)s %(levelname)s:: %(message)s')\n hdlr.setFormatter(formatter)\n logger.addHandler(hdlr)\n logger.setLevel(logging.INFO)\n return logger"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99134:Assign_L32_C4", "label": "logger = getLogger()", "type": "assigned_variable", "loc": [32, 32], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99134:FunctionDef_L31_C0", "vector": [14, 1, 0.3636, 0.0114, 1, 0.18, 0.0, 532, 3, 0, 0, 0, 71, 10, 1], "semantic": {"name": "logger", "arg_names": [], "import_names": [], "rhs_call_name": "getLogger", "annotation": ""}, "snippet": " logger = logging.getLogger()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99134:Assign_L33_C4", "label": "hdlr = FileHandler()", "type": "assigned_variable", "loc": [33, 33], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99134:FunctionDef_L31_C0", "vector": [14, 1, 0.375, 0.0114, 1, 0.18, 0.1667, 149, 3, 1, 0, 0, 306, 10, 1], "semantic": {"name": "hdlr", "arg_names": [], "import_names": [], "rhs_call_name": "FileHandler", "annotation": ""}, "snippet": " hdlr = logging.FileHandler(logFileName)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99134:Assign_L34_C4", "label": "formatter = Formatter()", "type": "assigned_variable", "loc": [34, 34], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99134:FunctionDef_L31_C0", "vector": [14, 1, 0.3864, 0.0114, 1, 0.18, 0.3333, 791, 3, 1, 0, 0, 766, 10, 1], "semantic": {"name": "formatter", "arg_names": [], "import_names": [], "rhs_call_name": "Formatter", "annotation": ""}, "snippet": " formatter = logging.Formatter('%(asctime)s %(levelname)s:: %(message)s')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99134:Expr_L35_C4", "label": "setFormatter()", "type": "expression", "loc": [35, 35], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99134:FunctionDef_L31_C0", "vector": [8, 1, 0.3977, 0.0114, 1, 0.18, 0.5, 948, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "setFormatter", "arg_names": [], "import_names": [], "rhs_call_name": "setFormatter", "annotation": ""}, "snippet": " hdlr.setFormatter(formatter)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99134:Expr_L36_C4", "label": "addHandler()", "type": "expression", "loc": [36, 36], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99134:FunctionDef_L31_C0", "vector": [8, 1, 0.4091, 0.0114, 1, 0.18, 0.6667, 255, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "addHandler", "arg_names": [], "import_names": [], "rhs_call_name": "addHandler", "annotation": ""}, "snippet": " logger.addHandler(hdlr)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99134:Expr_L37_C4", "label": "setLevel()", "type": "expression", "loc": [37, 37], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99134:FunctionDef_L31_C0", "vector": [8, 1, 0.4205, 0.0114, 1, 0.18, 0.8333, 810, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "setLevel", "arg_names": [], "import_names": [], "rhs_call_name": "setLevel", "annotation": ""}, "snippet": " logger.setLevel(logging.INFO)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99134:Return_L38_C4", "label": "return", "type": "return", "loc": [38, 38], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99134:FunctionDef_L31_C0", "vector": [13, 1, 0.4318, 0.0114, 1, 0.18, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return logger"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99134:Assign_L40_C0", "label": "log = init_log()", "type": "assigned_variable", "loc": [40, 40], "level": 0, "parent": null, "vector": [14, 0, 0.4545, 0.0114, 0, 0.66, 0.6154, 432, 3, 0, 0, 0, 377, 10, 1], "semantic": {"name": "log", "arg_names": [], "import_names": [], "rhs_call_name": "init_log", "annotation": ""}, "snippet": "log = init_log()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99134:ClassDef_L43_C0", "label": "RepeatedRecordError", "type": "class", "loc": [43, 43], "level": 0, "parent": null, "vector": [3, 0, 0.4886, 0.0114, 0, 0.66, 0.6923, 706, 0, 0, 0, 0, 645, 0, 0], "semantic": {"name": "RepeatedRecordError", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class RepeatedRecordError(Exception):pass"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99134:FunctionDef_L45_C0", "label": "cross_join", "type": "function", "loc": [45, 57], "level": 0, "parent": null, "vector": [2, 0, 0.5795, 0.1477, 0, 0.66, 0.7692, 165, 0, 2, 1, 0, 0, 0, 8], "semantic": {"name": "cross_join", "arg_names": ["list1", "list2"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def cross_join(list1, list2):\n\t'list1 and list2 may be changed in the function.\\n'\n\tfor pos1 in range(len(list1)):\n\t\tcnt = len(filter(lambda x:x[0]==list1[pos1][0], list2))\n\t\tif cnt > 1:\n\t\t\traise RepeatedRecordError()\n\t\tfor pos2 in range(len(list2)):\n\t\t\tif list1[pos1][0] == list2[pos2][0]:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99134:Expr_L46_C1", "label": "expression", "type": "expression", "loc": [46, 46], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99134:FunctionDef_L45_C0", "vector": [8, 1, 0.5227, 0.0114, 1, 0.71, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t'list1 and list2 may be changed in the function.\\n'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99134:For_L47_C1", "label": "for pos1", "type": "for", "loc": [47, 56], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99134:FunctionDef_L45_C0", "vector": [6, 1, 0.5852, 0.1136, 1, 0.71, 0.5, 653, 3, 0, 0, 0, 0, 0, 8], "semantic": {"name": "pos1", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tfor pos1 in range(len(list1)):\n\t\tcnt = len(filter(lambda x:x[0]==list1[pos1][0], list2))\n\t\tif cnt > 1:\n\t\t\traise RepeatedRecordError()\n\t\tfor pos2 in range(len(list2)):\n\t\t\tif list1[pos1][0] == list2[pos2][0]:\n\t\t\t\tlist1[pos1] += [u'\\t|\\t']\n\t\t\t\tlist1[pos1] += list2[pos2]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99134:Assign_L48_C2", "label": "cnt = len()", "type": "assigned_variable", "loc": [48, 48], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99134:For_L47_C1", "vector": [14, 2, 0.5455, 0.0114, 2, 0.81, 0.0, 307, 3, 1, 0, 0, 890, 10, 2], "semantic": {"name": "cnt", "arg_names": [], "import_names": [], "rhs_call_name": "len", "annotation": ""}, "snippet": "\t\tcnt = len(filter(lambda x:x[0]==list1[pos1][0], list2))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99134:If_L49_C2", "label": "if", "type": "if", "loc": [49, 50], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99134:For_L47_C1", "vector": [4, 2, 0.5625, 0.0227, 2, 0.81, 0.5, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tif cnt > 1:\n\t\t\traise RepeatedRecordError()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99134:For_L51_C2", "label": "for pos2", "type": "for", "loc": [51, 56], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99134:For_L47_C1", "vector": [6, 2, 0.608, 0.0682, 2, 0.81, 1.0, 970, 3, 0, 0, 0, 0, 0, 3], "semantic": {"name": "pos2", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tfor pos2 in range(len(list2)):\n\t\t\tif list1[pos1][0] == list2[pos2][0]:\n\t\t\t\tlist1[pos1] += [u'\\t|\\t']\n\t\t\t\tlist1[pos1] += list2[pos2]\n\t\t\t\tlist2.pop(pos2)\n\t\t\t\tbreak"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99134:If_L52_C3", "label": "if", "type": "if", "loc": [52, 56], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99134:For_L51_C2", "vector": [4, 3, 0.6136, 0.0568, 3, 0.32, 0.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\tif list1[pos1][0] == list2[pos2][0]:\n\t\t\t\tlist1[pos1] += [u'\\t|\\t']\n\t\t\t\tlist1[pos1] += list2[pos2]\n\t\t\t\tlist2.pop(pos2)\n\t\t\t\tbreak"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99134:Expr_L55_C4", "label": "pop()", "type": "expression", "loc": [55, 55], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99134:If_L52_C3", "vector": [8, 4, 0.625, 0.0114, 4, 0.72, 0.0, 969, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "pop", "arg_names": [], "import_names": [], "rhs_call_name": "pop", "annotation": ""}, "snippet": "\t\t\t\tlist2.pop(pos2)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99134:Return_L57_C1", "label": "return", "type": "return", "loc": [57, 57], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99134:FunctionDef_L45_C0", "vector": [13, 1, 0.6477, 0.0114, 1, 0.71, 1.0, 0, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\treturn list1, list2"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99134:FunctionDef_L59_C0", "label": "read_list", "type": "function", "loc": [59, 66], "level": 0, "parent": null, "vector": [2, 0, 0.7102, 0.0909, 0, 0.66, 0.8462, 658, 0, 1, 1, 0, 0, 0, 6], "semantic": {"name": "read_list", "arg_names": ["filename"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def read_list(filename):\n\tf = codecs.open(filename, 'r', 'utf-8')\n\tret = []\n\tfor line in f.readlines():\n\t\twhile line[-1].isspace():\n\t\t\tline = line[:-1]\n\t\tret.append(list(line.split('\\t')))\n\treturn ret"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99134:Assign_L60_C1", "label": "f = open()", "type": "assigned_variable", "loc": [60, 60], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99134:FunctionDef_L59_C0", "vector": [14, 1, 0.6818, 0.0114, 1, 0.93, 0.0, 899, 3, 3, 0, 0, 693, 10, 1], "semantic": {"name": "f", "arg_names": [], "import_names": [], "rhs_call_name": "open", "annotation": ""}, "snippet": "\tf = codecs.open(filename, 'r', 'utf-8')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99134:Assign_L61_C1", "label": "ret =", "type": "assigned_variable", "loc": [61, 61], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99134:FunctionDef_L59_C0", "vector": [14, 1, 0.6932, 0.0114, 1, 0.93, 0.3333, 501, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "ret", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tret = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99134:For_L62_C1", "label": "for line", "type": "for", "loc": [62, 65], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99134:FunctionDef_L59_C0", "vector": [6, 1, 0.7216, 0.0455, 1, 0.93, 0.6667, 373, 3, 0, 0, 0, 0, 0, 5], "semantic": {"name": "line", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tfor line in f.readlines():\n\t\twhile line[-1].isspace():\n\t\t\tline = line[:-1]\n\t\tret.append(list(line.split('\\t')))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99134:While_L63_C2", "label": "while", "type": "while", "loc": [63, 64], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99134:For_L62_C1", "vector": [5, 2, 0.7216, 0.0227, 2, 0.13, 0.0, 0, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\twhile line[-1].isspace():\n\t\t\tline = line[:-1]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99134:Assign_L64_C3", "label": "line =", "type": "assigned_variable", "loc": [64, 64], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99134:While_L63_C2", "vector": [14, 3, 0.7273, 0.0114, 3, 0.85, 0.0, 373, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "line", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\tline = line[:-1]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99134:Expr_L65_C2", "label": "append()", "type": "expression", "loc": [65, 65], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99134:For_L62_C1", "vector": [8, 2, 0.7386, 0.0114, 2, 0.13, 1.0, 243, 3, 1, 0, 0, 0, 0, 3], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": "\t\tret.append(list(line.split('\\t')))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99134:Return_L66_C1", "label": "return", "type": "return", "loc": [66, 66], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99134:FunctionDef_L59_C0", "vector": [13, 1, 0.75, 0.0114, 1, 0.93, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\treturn ret"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99134:FunctionDef_L68_C0", "label": "main", "type": "function", "loc": [68, 84], "level": 0, "parent": null, "vector": [2, 0, 0.8636, 0.1932, 0, 0.66, 0.9231, 624, 0, 0, 0, 0, 0, 0, 13], "semantic": {"name": "main", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def main():\n\tif len(sys.argv) != 4:\n\t\tprint(r'Usage:')\n\t\tprint(r'CrossJoin.py file1 file2 outfile')\n\t\tsys.exit(0)\n\tfile1 = sys.argv[1]\n\tfile2 = sys.argv[2]\n\toutfile = sys.argv[3]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99134:If_L69_C1", "label": "if", "type": "if", "loc": [69, 72], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99134:FunctionDef_L68_C0", "vector": [4, 1, 0.8011, 0.0455, 1, 0.96, 0.0, 0, 0, 0, 0, 0, 0, 0, 4], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tif len(sys.argv) != 4:\n\t\tprint(r'Usage:')\n\t\tprint(r'CrossJoin.py file1 file2 outfile')\n\t\tsys.exit(0)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99134:Expr_L70_C2", "label": "print()", "type": "expression", "loc": [70, 70], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99134:If_L69_C1", "vector": [8, 2, 0.7955, 0.0114, 2, 0.99, 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(r'Usage:')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99134:Expr_L71_C2", "label": "print()", "type": "expression", "loc": [71, 71], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99134:If_L69_C1", "vector": [8, 2, 0.8068, 0.0114, 2, 0.99, 0.5, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": "\t\tprint(r'CrossJoin.py file1 file2 outfile')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99134:Expr_L72_C2", "label": "exit()", "type": "expression", "loc": [72, 72], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99134:If_L69_C1", "vector": [8, 2, 0.8182, 0.0114, 2, 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": "\t\tsys.exit(0)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99134:Assign_L73_C1", "label": "file1 =", "type": "assigned_variable", "loc": [73, 73], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99134:FunctionDef_L68_C0", "vector": [14, 1, 0.8295, 0.0114, 1, 0.96, 0.1, 127, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "file1", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tfile1 = sys.argv[1]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99134:Assign_L74_C1", "label": "file2 =", "type": "assigned_variable", "loc": [74, 74], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99134:FunctionDef_L68_C0", "vector": [14, 1, 0.8409, 0.0114, 1, 0.96, 0.2, 147, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "file2", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tfile2 = sys.argv[2]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99134:Assign_L75_C1", "label": "outfile =", "type": "assigned_variable", "loc": [75, 75], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99134:FunctionDef_L68_C0", "vector": [14, 1, 0.8523, 0.0114, 1, 0.96, 0.3, 206, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "outfile", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\toutfile = sys.argv[3]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99134:Assign_L76_C1", "label": "list1 = read_list()", "type": "assigned_variable", "loc": [76, 76], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99134:FunctionDef_L68_C0", "vector": [14, 1, 0.8636, 0.0114, 1, 0.96, 0.4, 150, 3, 1, 0, 0, 658, 10, 1], "semantic": {"name": "list1", "arg_names": [], "import_names": [], "rhs_call_name": "read_list", "annotation": ""}, "snippet": "\tlist1 = read_list(file1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99134:Assign_L77_C1", "label": "list2 = read_list()", "type": "assigned_variable", "loc": [77, 77], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99134:FunctionDef_L68_C0", "vector": [14, 1, 0.875, 0.0114, 1, 0.96, 0.5, 526, 3, 1, 0, 0, 658, 10, 1], "semantic": {"name": "list2", "arg_names": [], "import_names": [], "rhs_call_name": "read_list", "annotation": ""}, "snippet": "\tlist2 = read_list(file2)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99134:Assign_L78_C1", "label": "list1, list2 = cross_join()", "type": "assigned_variable", "loc": [78, 78], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99134:FunctionDef_L68_C0", "vector": [14, 1, 0.8864, 0.0114, 1, 0.96, 0.6, 892, 3, 2, 0, 0, 165, 10, 1], "semantic": {"name": "list1, list2", "arg_names": [], "import_names": [], "rhs_call_name": "cross_join", "annotation": ""}, "snippet": "\t(list1, list2) = cross_join(list1, list2)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99134:Assign_L79_C1", "label": "outf = open()", "type": "assigned_variable", "loc": [79, 79], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99134:FunctionDef_L68_C0", "vector": [14, 1, 0.8977, 0.0114, 1, 0.96, 0.7, 808, 3, 3, 0, 0, 693, 10, 1], "semantic": {"name": "outf", "arg_names": [], "import_names": [], "rhs_call_name": "open", "annotation": ""}, "snippet": "\toutf = codecs.open(outfile, 'w', 'utf-8')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99134:For_L80_C1", "label": "for r", "type": "for", "loc": [80, 81], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99134:FunctionDef_L68_C0", "vector": [6, 1, 0.9148, 0.0227, 1, 0.96, 0.8, 436, 2, 0, 0, 0, 0, 0, 2], "semantic": {"name": "r", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tfor r in list1:\n\t\toutf.write(string.join(r, u'\\t') + u'\\n')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99134:Expr_L81_C2", "label": "write()", "type": "expression", "loc": [81, 81], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99134:For_L80_C1", "vector": [8, 2, 0.9205, 0.0114, 2, 0.96, 0.0, 837, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "write", "arg_names": [], "import_names": [], "rhs_call_name": "write", "annotation": ""}, "snippet": "\t\toutf.write(string.join(r, u'\\t') + u'\\n')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99134:Expr_L82_C1", "label": "write()", "type": "expression", "loc": [82, 82], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99134:FunctionDef_L68_C0", "vector": [8, 1, 0.9318, 0.0114, 1, 0.96, 0.9, 837, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "write", "arg_names": [], "import_names": [], "rhs_call_name": "write", "annotation": ""}, "snippet": "\toutf.write('\\n\\n\\nRest Records in %s : \\n\\n' % (file2,))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99134:For_L83_C1", "label": "for r", "type": "for", "loc": [83, 84], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99134:FunctionDef_L68_C0", "vector": [6, 1, 0.9489, 0.0227, 1, 0.96, 1.0, 436, 2, 0, 0, 0, 0, 0, 2], "semantic": {"name": "r", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tfor r in list2:\n\t\toutf.write(string.join(r, u'\\t') + u'\\n')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99134:Expr_L84_C2", "label": "write()", "type": "expression", "loc": [84, 84], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99134:For_L83_C1", "vector": [8, 2, 0.9545, 0.0114, 2, 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": "\t\toutf.write(string.join(r, u'\\t') + u'\\n')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99134:If_L87_C0", "label": "if", "type": "if", "loc": [87, 88], "level": 0, "parent": null, "vector": [4, 0, 0.9943, 0.0227, 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\tmain()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99134:Expr_L88_C1", "label": "main()", "type": "expression", "loc": [88, 88], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99134:If_L87_C0", "vector": [8, 1, 1.0, 0.0114, 1, 0.72, 0.0, 624, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "main", "arg_names": [], "import_names": [], "rhs_call_name": "main", "annotation": ""}, "snippet": "\tmain()"}]
[{"f": "ajibawa-2023/Python-Code-Large/train/row_99134:FunctionDef_L31_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99134:Assign_L32_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99134:FunctionDef_L31_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99134:Assign_L33_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99134:FunctionDef_L31_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99134:Assign_L34_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99134:FunctionDef_L31_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99134:Expr_L35_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99134:FunctionDef_L31_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99134:Expr_L36_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99134:FunctionDef_L31_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99134:Expr_L37_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99134:FunctionDef_L31_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99134:Return_L38_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99134:FunctionDef_L45_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99134:Expr_L46_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99134:FunctionDef_L45_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99134:For_L47_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99134:For_L47_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99134:Assign_L48_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99134:For_L47_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99134:If_L49_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99134:For_L47_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99134:For_L51_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99134:For_L51_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99134:If_L52_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99134:If_L52_C3", "t": "ajibawa-2023/Python-Code-Large/train/row_99134:Expr_L55_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99134:FunctionDef_L45_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99134:Return_L57_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99134:FunctionDef_L59_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99134:Assign_L60_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99134:FunctionDef_L59_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99134:Assign_L61_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99134:FunctionDef_L59_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99134:For_L62_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99134:For_L62_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99134:While_L63_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99134:While_L63_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99134:Assign_L64_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99134:For_L62_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99134:Expr_L65_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99134:FunctionDef_L59_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99134:Return_L66_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99134:FunctionDef_L68_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99134:If_L69_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99134:If_L69_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99134:Expr_L70_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99134:If_L69_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99134:Expr_L71_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99134:If_L69_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99134:Expr_L72_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99134:FunctionDef_L68_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99134:Assign_L73_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99134:FunctionDef_L68_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99134:Assign_L74_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99134:FunctionDef_L68_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99134:Assign_L75_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99134:FunctionDef_L68_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99134:Assign_L76_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99134:FunctionDef_L68_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99134:Assign_L77_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99134:FunctionDef_L68_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99134:Assign_L78_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99134:FunctionDef_L68_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99134:Assign_L79_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99134:FunctionDef_L68_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99134:For_L80_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99134:For_L80_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99134:Expr_L81_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99134:FunctionDef_L68_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99134:Expr_L82_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99134:FunctionDef_L68_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99134:For_L83_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99134:For_L83_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99134:Expr_L84_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99134:If_L87_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99134:Expr_L88_C1"}]
#!/usr/bin/env python # coding=utf-8 import pyExcelerator as pE import codecs excel_filename = r'09Light_UC_tts_PhraseList081210.xls' outfile = codecs.open('specials.log', 'w', 'utf-8') ss = u'~!@#$%^&*()_+`=[]\\;/{}|:"<>?`-=【】、;‘,。/~!@#¥%……&×()——+{}|“:?》《' ss = unicode(ss) specialSymbols = list(ss) specialSymbols.append(u'..') def main(): xlsdata = pE.parse_xls(excel_filename) sheetdata = xlsdata[0][1] for col in range(100): for row in range(1000): if sheetdata.has_key((row, col)): dat = unicode(sheetdata[(row, col)]) spTag = False for s in specialSymbols: if dat.find(s) >= 0: spTag = True if spTag: colName = chr(ord('A') + col) print >> outfile, '(', row+1, ',', colName, ')', dat if __name__ == '__main__': main()
ajibawa-2023/Python-Code-Large/train/row_99135
24
35
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_99135:Import_L4_C0", "label": "pyExcelerator import pE", "type": "import", "loc": [4, 4], "level": 0, "parent": null, "vector": [1, 0, 0.1143, 0.0286, 0, 0.66, 0.0, 173, 0, 1, 0, 0, 173, 0, 0], "semantic": {"name": "pyExcelerator", "arg_names": [], "import_names": ["pE"], "rhs_call_name": "", "annotation": ""}, "snippet": "import pyExcelerator as pE"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99135:Import_L5_C0", "label": "codecs import codecs", "type": "import", "loc": [5, 5], "level": 0, "parent": null, "vector": [1, 0, 0.1429, 0.0286, 0, 0.66, 0.1111, 220, 0, 1, 0, 0, 220, 0, 0], "semantic": {"name": "codecs", "arg_names": [], "import_names": ["codecs"], "rhs_call_name": "", "annotation": ""}, "snippet": "import codecs"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99135:Assign_L7_C0", "label": "excel_filename =", "type": "assigned_variable", "loc": [7, 7], "level": 0, "parent": null, "vector": [14, 0, 0.2, 0.0286, 0, 0.66, 0.2222, 379, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "excel_filename", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "excel_filename = r'09Light_UC_tts_PhraseList081210.xls'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99135:Assign_L8_C0", "label": "outfile = open()", "type": "assigned_variable", "loc": [8, 8], "level": 0, "parent": null, "vector": [14, 0, 0.2286, 0.0286, 0, 0.66, 0.3333, 206, 3, 3, 0, 0, 693, 10, 1], "semantic": {"name": "outfile", "arg_names": [], "import_names": [], "rhs_call_name": "open", "annotation": ""}, "snippet": "outfile = codecs.open('specials.log', 'w', 'utf-8')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99135:Assign_L10_C0", "label": "ss =", "type": "assigned_variable", "loc": [10, 10], "level": 0, "parent": null, "vector": [14, 0, 0.2857, 0.0286, 0, 0.66, 0.4444, 582, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "ss", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "ss = u'~!@#$%^&*()_+`=[]\\\\;/{}|:\"<>?\uff40\uff0d\uff1d\u3010\u3011\u3001\uff1b\u2018\uff0c\u3002\uff0f\uff5e\uff01\uff20\uff03\uffe5\uff05\u2026\u2026\uff06\u00d7\uff08\uff09\u2014\u2014\uff0b\uff5b\uff5d\uff5c\u201c\uff1a\uff1f\u300b\u300a'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99135:Assign_L11_C0", "label": "ss = unicode()", "type": "assigned_variable", "loc": [11, 11], "level": 0, "parent": null, "vector": [14, 0, 0.3143, 0.0286, 0, 0.66, 0.5556, 582, 3, 1, 0, 0, 733, 10, 1], "semantic": {"name": "ss", "arg_names": [], "import_names": [], "rhs_call_name": "unicode", "annotation": ""}, "snippet": "ss = unicode(ss)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99135:Assign_L12_C0", "label": "specialSymbols = list()", "type": "assigned_variable", "loc": [12, 12], "level": 0, "parent": null, "vector": [14, 0, 0.3429, 0.0286, 0, 0.66, 0.6667, 338, 3, 1, 0, 0, 430, 10, 1], "semantic": {"name": "specialSymbols", "arg_names": [], "import_names": [], "rhs_call_name": "list", "annotation": ""}, "snippet": "specialSymbols = list(ss)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99135:Expr_L13_C0", "label": "append()", "type": "expression", "loc": [13, 13], "level": 0, "parent": null, "vector": [8, 0, 0.3714, 0.0286, 0, 0.66, 0.7778, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": "specialSymbols.append(u'..')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99135:FunctionDef_L15_C0", "label": "main", "type": "function", "loc": [15, 28], "level": 0, "parent": null, "vector": [2, 0, 0.6143, 0.4, 0, 0.66, 0.8889, 624, 0, 0, 0, 0, 0, 0, 8], "semantic": {"name": "main", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def main():\n\txlsdata = pE.parse_xls(excel_filename)\n\tsheetdata = xlsdata[0][1]\n\tfor col in range(100):\n\t\tfor row in range(1000):\n\t\t\tif sheetdata.has_key((row, col)):\n\t\t\t\tdat = unicode(sheetdata[(row, col)])\n\t\t\t\tspTag = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99135:Assign_L16_C1", "label": "xlsdata = parse_xls()", "type": "assigned_variable", "loc": [16, 16], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99135:FunctionDef_L15_C0", "vector": [14, 1, 0.4571, 0.0286, 1, 0.04, 0.0, 795, 3, 1, 0, 0, 508, 10, 1], "semantic": {"name": "xlsdata", "arg_names": [], "import_names": [], "rhs_call_name": "parse_xls", "annotation": ""}, "snippet": "\txlsdata = pE.parse_xls(excel_filename)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99135:Assign_L17_C1", "label": "sheetdata =", "type": "assigned_variable", "loc": [17, 17], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99135:FunctionDef_L15_C0", "vector": [14, 1, 0.4857, 0.0286, 1, 0.04, 0.5, 12, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "sheetdata", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tsheetdata = xlsdata[0][1]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99135:For_L18_C1", "label": "for col", "type": "for", "loc": [18, 28], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99135:FunctionDef_L15_C0", "vector": [6, 1, 0.6571, 0.3143, 1, 0.04, 1.0, 157, 3, 0, 0, 0, 0, 0, 7], "semantic": {"name": "col", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tfor col in range(100):\n\t\tfor row in range(1000):\n\t\t\tif sheetdata.has_key((row, col)):\n\t\t\t\tdat = unicode(sheetdata[(row, col)])\n\t\t\t\tspTag = False\n\t\t\t\tfor s in specialSymbols:\n\t\t\t\t\tif dat.find(s) >= 0:\n\t\t\t\t\t\tspTag = True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99135:For_L19_C2", "label": "for row", "type": "for", "loc": [19, 28], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99135:For_L18_C1", "vector": [6, 2, 0.6714, 0.2857, 2, 0.4, 0.0, 767, 3, 0, 0, 0, 0, 0, 6], "semantic": {"name": "row", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tfor row in range(1000):\n\t\t\tif sheetdata.has_key((row, col)):\n\t\t\t\tdat = unicode(sheetdata[(row, col)])\n\t\t\t\tspTag = False\n\t\t\t\tfor s in specialSymbols:\n\t\t\t\t\tif dat.find(s) >= 0:\n\t\t\t\t\t\tspTag = True\n\t\t\t\tif spTag:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99135:If_L20_C3", "label": "if", "type": "if", "loc": [20, 28], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99135:For_L19_C2", "vector": [4, 3, 0.6857, 0.2571, 3, 0.35, 0.0, 0, 3, 0, 0, 0, 0, 0, 5], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\tif sheetdata.has_key((row, col)):\n\t\t\t\tdat = unicode(sheetdata[(row, col)])\n\t\t\t\tspTag = False\n\t\t\t\tfor s in specialSymbols:\n\t\t\t\t\tif dat.find(s) >= 0:\n\t\t\t\t\t\tspTag = True\n\t\t\t\tif spTag:\n\t\t\t\t\tcolName = chr(ord('A') + col)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99135:Assign_L21_C4", "label": "dat = unicode()", "type": "assigned_variable", "loc": [21, 21], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99135:If_L20_C3", "vector": [14, 4, 0.6, 0.0286, 4, 0.85, 0.0, 934, 3, 1, 0, 0, 733, 10, 1], "semantic": {"name": "dat", "arg_names": [], "import_names": [], "rhs_call_name": "unicode", "annotation": ""}, "snippet": "\t\t\t\tdat = unicode(sheetdata[(row, col)])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99135:Assign_L22_C4", "label": "spTag =", "type": "assigned_variable", "loc": [22, 22], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99135:If_L20_C3", "vector": [14, 4, 0.6286, 0.0286, 4, 0.85, 0.3333, 505, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "spTag", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\t\tspTag = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99135:For_L23_C4", "label": "for s", "type": "for", "loc": [23, 25], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99135:If_L20_C3", "vector": [6, 4, 0.6857, 0.0857, 4, 0.85, 0.6667, 553, 2, 0, 0, 0, 0, 0, 1], "semantic": {"name": "s", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\t\tfor s in specialSymbols:\n\t\t\t\t\tif dat.find(s) >= 0:\n\t\t\t\t\t\tspTag = True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99135:If_L24_C5", "label": "if", "type": "if", "loc": [24, 25], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99135:For_L23_C4", "vector": [4, 5, 0.7, 0.0571, 5, 0.68, 0.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\t\t\tif dat.find(s) >= 0:\n\t\t\t\t\t\tspTag = True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99135:Assign_L25_C6", "label": "spTag =", "type": "assigned_variable", "loc": [25, 25], "level": 6, "parent": "ajibawa-2023/Python-Code-Large/train/row_99135:If_L24_C5", "vector": [14, 6, 0.7143, 0.0286, 6, 0.13, 0.0, 505, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "spTag", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\t\t\t\tspTag = True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99135:If_L26_C4", "label": "if", "type": "if", "loc": [26, 28], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99135:If_L20_C3", "vector": [4, 4, 0.7714, 0.0857, 4, 0.85, 1.0, 0, 2, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\t\tif spTag:\n\t\t\t\t\tcolName = chr(ord('A') + col)\n\t\t\t\t\tprint >> outfile, '(', row+1, ',', colName, ')', dat"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99135:Assign_L27_C5", "label": "colName = chr()", "type": "assigned_variable", "loc": [27, 27], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99135:If_L26_C4", "vector": [14, 5, 0.7714, 0.0286, 5, 0.89, 0.0, 624, 3, 1, 0, 0, 915, 10, 2], "semantic": {"name": "colName", "arg_names": [], "import_names": [], "rhs_call_name": "chr", "annotation": ""}, "snippet": "\t\t\t\t\tcolName = chr(ord('A') + col)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99135:Expr_L28_C5", "label": "expression", "type": "expression", "loc": [28, 28], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99135:If_L26_C4", "vector": [8, 5, 0.8, 0.0286, 5, 0.89, 1.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\t\t\tprint >> outfile, '(', row+1, ',', colName, ')', dat"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99135:If_L30_C0", "label": "if", "type": "if", "loc": [30, 31], "level": 0, "parent": null, "vector": [4, 0, 0.8714, 0.0571, 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\tmain()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99135:Expr_L31_C1", "label": "main()", "type": "expression", "loc": [31, 31], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99135:If_L30_C0", "vector": [8, 1, 0.8857, 0.0286, 1, 0.58, 0.0, 624, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "main", "arg_names": [], "import_names": [], "rhs_call_name": "main", "annotation": ""}, "snippet": "\tmain()"}]
[{"f": "ajibawa-2023/Python-Code-Large/train/row_99135:FunctionDef_L15_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99135:Assign_L16_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99135:FunctionDef_L15_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99135:Assign_L17_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99135:FunctionDef_L15_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99135:For_L18_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99135:For_L18_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99135:For_L19_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99135:For_L19_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99135:If_L20_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99135:If_L20_C3", "t": "ajibawa-2023/Python-Code-Large/train/row_99135:Assign_L21_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99135:If_L20_C3", "t": "ajibawa-2023/Python-Code-Large/train/row_99135:Assign_L22_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99135:If_L20_C3", "t": "ajibawa-2023/Python-Code-Large/train/row_99135:For_L23_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99135:For_L23_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99135:If_L24_C5"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99135:If_L24_C5", "t": "ajibawa-2023/Python-Code-Large/train/row_99135:Assign_L25_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99135:If_L20_C3", "t": "ajibawa-2023/Python-Code-Large/train/row_99135:If_L26_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99135:If_L26_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99135:Assign_L27_C5"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99135:If_L26_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99135:Expr_L28_C5"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99135:If_L30_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99135:Expr_L31_C1"}]
#!/usr/bin/env python # coding=utf-8 import re import os import logging import sys import codecs def init_log(): logger = logging.getLogger() hdlr = logging.FileHandler('link_check.log') formatter = logging.Formatter('%(asctime)s %(levelname)s:: %(message)s') hdlr.setFormatter(formatter) logger.addHandler(hdlr) logger.setLevel(logging.INFO) return logger logger = init_log() def checklink(filename): urlBase = r"http://172.26.10.31/LightAplSrc/trunk/" url = urlBase + filename logger.info('svn file : %s', url) hasVoiceLib = False hasVoiceLibBase = False lines = os.popen(r'svn cat ' + url).readlines() for lnum in range(len(lines)): line = lines[lnum] if re.search(r'voicelib\.lib', line, re.I): # if line.find(r'VoiceLib.lib') >=0 or line.find(r'VoiceLib.Lib') >= 0: hasVoiceLib = True logger.info(r'Find VoiceLib.lib in %d %s', lnum, line) elif re.search(r'voicelibbase\.lib', line, re.I): # elif line.find(r'VoiceLibBase.lib')>=0 or line.find(r'VoiceLibBase.Lib')>=0: hasVoiceLibBase = True logger.info(r'Find VoiceLibBase.lib in %d %s', lnum, line) ret = not (hasVoiceLib and hasVoiceLibBase) if not ret: logger.warning('Find conflict !!!!') print 'Error', url return ret def main(): logger.info('hello') for fn in open('filepaths.txt').readlines(): checklink(fn) print 'Check complete.' if __name__ == '__main__': main()
ajibawa-2023/Python-Code-Large/train/row_99136
41
55
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_99136:Import_L4_C0", "label": "re import re", "type": "import", "loc": [4, 4], "level": 0, "parent": null, "vector": [1, 0, 0.0727, 0.0182, 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_99136:Import_L5_C0", "label": "os import os", "type": "import", "loc": [5, 5], "level": 0, "parent": null, "vector": [1, 0, 0.0909, 0.0182, 0, 0.66, 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_99136:Import_L6_C0", "label": "logging import logging", "type": "import", "loc": [6, 6], "level": 0, "parent": null, "vector": [1, 0, 0.1091, 0.0182, 0, 0.66, 0.2222, 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_99136:Import_L7_C0", "label": "sys import sys", "type": "import", "loc": [7, 7], "level": 0, "parent": null, "vector": [1, 0, 0.1273, 0.0182, 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_99136:Import_L8_C0", "label": "codecs import codecs", "type": "import", "loc": [8, 8], "level": 0, "parent": null, "vector": [1, 0, 0.1455, 0.0182, 0, 0.66, 0.4444, 220, 0, 1, 0, 0, 220, 0, 0], "semantic": {"name": "codecs", "arg_names": [], "import_names": ["codecs"], "rhs_call_name": "", "annotation": ""}, "snippet": "import codecs"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99136:FunctionDef_L10_C0", "label": "init_log", "type": "function", "loc": [10, 17], "level": 0, "parent": null, "vector": [2, 0, 0.2455, 0.1455, 0, 0.66, 0.5556, 377, 0, 0, 1, 0, 0, 0, 6], "semantic": {"name": "init_log", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def init_log():\n logger = logging.getLogger()\n hdlr = logging.FileHandler('link_check.log')\n formatter = logging.Formatter('%(asctime)s %(levelname)s:: %(message)s')\n hdlr.setFormatter(formatter)\n logger.addHandler(hdlr)\n logger.setLevel(logging.INFO)\n return logger"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99136:Assign_L11_C4", "label": "logger = getLogger()", "type": "assigned_variable", "loc": [11, 11], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99136:FunctionDef_L10_C0", "vector": [14, 1, 0.2, 0.0182, 1, 0.28, 0.0, 532, 3, 0, 0, 0, 71, 10, 1], "semantic": {"name": "logger", "arg_names": [], "import_names": [], "rhs_call_name": "getLogger", "annotation": ""}, "snippet": " logger = logging.getLogger()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99136:Assign_L12_C4", "label": "hdlr = FileHandler()", "type": "assigned_variable", "loc": [12, 12], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99136:FunctionDef_L10_C0", "vector": [14, 1, 0.2182, 0.0182, 1, 0.28, 0.1667, 149, 3, 1, 0, 0, 306, 10, 1], "semantic": {"name": "hdlr", "arg_names": [], "import_names": [], "rhs_call_name": "FileHandler", "annotation": ""}, "snippet": " hdlr = logging.FileHandler('link_check.log')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99136:Assign_L13_C4", "label": "formatter = Formatter()", "type": "assigned_variable", "loc": [13, 13], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99136:FunctionDef_L10_C0", "vector": [14, 1, 0.2364, 0.0182, 1, 0.28, 0.3333, 791, 3, 1, 0, 0, 766, 10, 1], "semantic": {"name": "formatter", "arg_names": [], "import_names": [], "rhs_call_name": "Formatter", "annotation": ""}, "snippet": " formatter = logging.Formatter('%(asctime)s %(levelname)s:: %(message)s')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99136:Expr_L14_C4", "label": "setFormatter()", "type": "expression", "loc": [14, 14], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99136:FunctionDef_L10_C0", "vector": [8, 1, 0.2545, 0.0182, 1, 0.28, 0.5, 948, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "setFormatter", "arg_names": [], "import_names": [], "rhs_call_name": "setFormatter", "annotation": ""}, "snippet": " hdlr.setFormatter(formatter)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99136:Expr_L15_C4", "label": "addHandler()", "type": "expression", "loc": [15, 15], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99136:FunctionDef_L10_C0", "vector": [8, 1, 0.2727, 0.0182, 1, 0.28, 0.6667, 255, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "addHandler", "arg_names": [], "import_names": [], "rhs_call_name": "addHandler", "annotation": ""}, "snippet": " logger.addHandler(hdlr)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99136:Expr_L16_C4", "label": "setLevel()", "type": "expression", "loc": [16, 16], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99136:FunctionDef_L10_C0", "vector": [8, 1, 0.2909, 0.0182, 1, 0.28, 0.8333, 810, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "setLevel", "arg_names": [], "import_names": [], "rhs_call_name": "setLevel", "annotation": ""}, "snippet": " logger.setLevel(logging.INFO)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99136:Return_L17_C4", "label": "return", "type": "return", "loc": [17, 17], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99136:FunctionDef_L10_C0", "vector": [13, 1, 0.3091, 0.0182, 1, 0.28, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return logger"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99136:Assign_L19_C0", "label": "logger = init_log()", "type": "assigned_variable", "loc": [19, 19], "level": 0, "parent": null, "vector": [14, 0, 0.3455, 0.0182, 0, 0.66, 0.6667, 532, 3, 0, 0, 0, 377, 10, 1], "semantic": {"name": "logger", "arg_names": [], "import_names": [], "rhs_call_name": "init_log", "annotation": ""}, "snippet": "logger = init_log()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99136:FunctionDef_L21_C0", "label": "checklink", "type": "function", "loc": [21, 42], "level": 0, "parent": null, "vector": [2, 0, 0.5727, 0.4, 0, 0.66, 0.7778, 264, 0, 1, 1, 0, 0, 0, 11], "semantic": {"name": "checklink", "arg_names": ["filename"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def checklink(filename):\n urlBase = r\"http://172.26.10.31/LightAplSrc/trunk/\"\n url = urlBase + filename\n logger.info('svn file : %s', url)\n hasVoiceLib = False\n hasVoiceLibBase = False\n lines = os.popen(r'svn cat ' + url).readlines()\n for lnum in range(len(lines)):"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99136:Assign_L22_C4", "label": "urlBase =", "type": "assigned_variable", "loc": [22, 22], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99136:FunctionDef_L21_C0", "vector": [14, 1, 0.4, 0.0182, 1, 0.83, 0.0, 857, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "urlBase", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " urlBase = r\"http://172.26.10.31/LightAplSrc/trunk/\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99136:Assign_L23_C4", "label": "url =", "type": "assigned_variable", "loc": [23, 23], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99136:FunctionDef_L21_C0", "vector": [14, 1, 0.4182, 0.0182, 1, 0.83, 0.1111, 789, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "url", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " url = urlBase + filename"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99136:Expr_L24_C4", "label": "info()", "type": "expression", "loc": [24, 24], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99136:FunctionDef_L21_C0", "vector": [8, 1, 0.4364, 0.0182, 1, 0.83, 0.2222, 730, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "info", "arg_names": [], "import_names": [], "rhs_call_name": "info", "annotation": ""}, "snippet": " logger.info('svn file : %s', url)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99136:Assign_L25_C4", "label": "hasVoiceLib =", "type": "assigned_variable", "loc": [25, 25], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99136:FunctionDef_L21_C0", "vector": [14, 1, 0.4545, 0.0182, 1, 0.83, 0.3333, 311, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "hasVoiceLib", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " hasVoiceLib = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99136:Assign_L26_C4", "label": "hasVoiceLibBase =", "type": "assigned_variable", "loc": [26, 26], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99136:FunctionDef_L21_C0", "vector": [14, 1, 0.4727, 0.0182, 1, 0.83, 0.4444, 9, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "hasVoiceLibBase", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " hasVoiceLibBase = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99136:Assign_L27_C4", "label": "lines = readlines()", "type": "assigned_variable", "loc": [27, 27], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99136:FunctionDef_L21_C0", "vector": [14, 1, 0.4909, 0.0182, 1, 0.83, 0.5556, 73, 3, 0, 0, 0, 841, 10, 2], "semantic": {"name": "lines", "arg_names": [], "import_names": [], "rhs_call_name": "readlines", "annotation": ""}, "snippet": " lines = os.popen(r'svn cat ' + url).readlines()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99136:For_L28_C4", "label": "for lnum", "type": "for", "loc": [28, 37], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99136:FunctionDef_L21_C0", "vector": [6, 1, 0.5909, 0.1818, 1, 0.83, 0.6667, 427, 3, 0, 0, 0, 0, 0, 6], "semantic": {"name": "lnum", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for lnum in range(len(lines)):\n line = lines[lnum]\n if re.search(r'voicelib\\.lib', line, re.I):\n# if line.find(r'VoiceLib.lib') >=0 or line.find(r'VoiceLib.Lib') >= 0:\n hasVoiceLib = True\n logger.info(r'Find VoiceLib.lib in %d %s', lnum, line)\n elif re.search(r'voicelibbase\\.lib', line, re.I):\n# elif line.find(r'VoiceLibBase.lib')>=0 or line.find(r'VoiceLibBase.Lib')>=0:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99136:Assign_L29_C8", "label": "line =", "type": "assigned_variable", "loc": [29, 29], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99136:For_L28_C4", "vector": [14, 2, 0.5273, 0.0182, 2, 0.11, 0.0, 373, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "line", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " line = lines[lnum]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99136:If_L30_C8", "label": "if", "type": "if", "loc": [30, 37], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99136:For_L28_C4", "vector": [4, 2, 0.6091, 0.1455, 2, 0.11, 1.0, 0, 3, 0, 0, 0, 0, 0, 4], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if re.search(r'voicelib\\.lib', line, re.I):\n# if line.find(r'VoiceLib.lib') >=0 or line.find(r'VoiceLib.Lib') >= 0:\n hasVoiceLib = True\n logger.info(r'Find VoiceLib.lib in %d %s', lnum, line)\n elif re.search(r'voicelibbase\\.lib', line, re.I):\n# elif line.find(r'VoiceLibBase.lib')>=0 or line.find(r'VoiceLibBase.Lib')>=0:\n hasVoiceLibBase = True\n logger.info(r'Find VoiceLibBase.lib in %d %s', lnum, line)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99136:Assign_L32_C12", "label": "hasVoiceLib =", "type": "assigned_variable", "loc": [32, 32], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99136:If_L30_C8", "vector": [14, 3, 0.5818, 0.0182, 3, 0.86, 0.0, 311, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "hasVoiceLib", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " hasVoiceLib = True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99136:Expr_L33_C12", "label": "info()", "type": "expression", "loc": [33, 33], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99136:If_L30_C8", "vector": [8, 3, 0.6, 0.0182, 3, 0.86, 0.5, 730, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "info", "arg_names": [], "import_names": [], "rhs_call_name": "info", "annotation": ""}, "snippet": " logger.info(r'Find VoiceLib.lib in %d %s', lnum, line)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99136:If_L34_C8", "label": "if", "type": "if", "loc": [34, 37], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99136:If_L30_C8", "vector": [4, 3, 0.6455, 0.0727, 3, 0.86, 1.0, 0, 3, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " elif re.search(r'voicelibbase\\.lib', line, re.I):\n# elif line.find(r'VoiceLibBase.lib')>=0 or line.find(r'VoiceLibBase.Lib')>=0:\n hasVoiceLibBase = True\n logger.info(r'Find VoiceLibBase.lib in %d %s', lnum, line)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99136:Assign_L36_C12", "label": "hasVoiceLibBase =", "type": "assigned_variable", "loc": [36, 36], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99136:If_L34_C8", "vector": [14, 4, 0.6545, 0.0182, 4, 0.14, 0.0, 9, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "hasVoiceLibBase", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " hasVoiceLibBase = True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99136:Expr_L37_C12", "label": "info()", "type": "expression", "loc": [37, 37], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99136:If_L34_C8", "vector": [8, 4, 0.6727, 0.0182, 4, 0.14, 1.0, 730, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "info", "arg_names": [], "import_names": [], "rhs_call_name": "info", "annotation": ""}, "snippet": " logger.info(r'Find VoiceLibBase.lib in %d %s', lnum, line)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99136:Assign_L38_C4", "label": "ret =", "type": "assigned_variable", "loc": [38, 38], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99136:FunctionDef_L21_C0", "vector": [14, 1, 0.6909, 0.0182, 1, 0.83, 0.7778, 501, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "ret", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ret = not (hasVoiceLib and hasVoiceLibBase)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99136:If_L39_C4", "label": "if", "type": "if", "loc": [39, 41], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99136:FunctionDef_L21_C0", "vector": [4, 1, 0.7273, 0.0545, 1, 0.83, 0.8889, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not ret:\n logger.warning('Find conflict !!!!')\n print('Error', url)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99136:Expr_L40_C8", "label": "warning()", "type": "expression", "loc": [40, 40], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99136:If_L39_C4", "vector": [8, 2, 0.7273, 0.0182, 2, 0.64, 0.0, 320, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "warning", "arg_names": [], "import_names": [], "rhs_call_name": "warning", "annotation": ""}, "snippet": " logger.warning('Find conflict !!!!')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99136:Expr_L41_C8", "label": "print()", "type": "expression", "loc": [41, 41], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99136:If_L39_C4", "vector": [8, 2, 0.7455, 0.0182, 2, 0.64, 1.0, 535, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('Error', url)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99136:Return_L42_C4", "label": "return", "type": "return", "loc": [42, 42], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99136:FunctionDef_L21_C0", "vector": [13, 1, 0.7636, 0.0182, 1, 0.83, 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_99136:FunctionDef_L45_C0", "label": "main", "type": "function", "loc": [45, 49], "level": 0, "parent": null, "vector": [2, 0, 0.8545, 0.0909, 0, 0.66, 0.8889, 624, 0, 0, 0, 0, 0, 0, 5], "semantic": {"name": "main", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def main():\n logger.info('hello')\n for fn in open('filepaths.txt').readlines():\n checklink(fn)\n print('Check complete.')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99136:Expr_L46_C4", "label": "info()", "type": "expression", "loc": [46, 46], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99136:FunctionDef_L45_C0", "vector": [8, 1, 0.8364, 0.0182, 1, 0.14, 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('hello')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99136:For_L47_C4", "label": "for fn", "type": "for", "loc": [47, 48], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99136:FunctionDef_L45_C0", "vector": [6, 1, 0.8636, 0.0364, 1, 0.14, 0.5, 59, 3, 0, 0, 0, 0, 0, 3], "semantic": {"name": "fn", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for fn in open('filepaths.txt').readlines():\n checklink(fn)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99136:Expr_L48_C8", "label": "checklink()", "type": "expression", "loc": [48, 48], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99136:For_L47_C4", "vector": [8, 2, 0.8727, 0.0182, 2, 0.41, 0.0, 264, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "checklink", "arg_names": [], "import_names": [], "rhs_call_name": "checklink", "annotation": ""}, "snippet": " checklink(fn)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99136:Expr_L49_C4", "label": "print()", "type": "expression", "loc": [49, 49], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99136:FunctionDef_L45_C0", "vector": [8, 1, 0.8909, 0.0182, 1, 0.14, 1.0, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('Check complete.')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99136:If_L53_C0", "label": "if", "type": "if", "loc": [53, 54], "level": 0, "parent": null, "vector": [4, 0, 0.9727, 0.0364, 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_99136:Expr_L54_C4", "label": "main()", "type": "expression", "loc": [54, 54], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99136:If_L53_C0", "vector": [8, 1, 0.9818, 0.0182, 1, 0.89, 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_99136:FunctionDef_L10_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99136:Assign_L11_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99136:FunctionDef_L10_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99136:Assign_L12_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99136:FunctionDef_L10_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99136:Assign_L13_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99136:FunctionDef_L10_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99136:Expr_L14_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99136:FunctionDef_L10_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99136:Expr_L15_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99136:FunctionDef_L10_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99136:Expr_L16_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99136:FunctionDef_L10_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99136:Return_L17_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99136:FunctionDef_L21_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99136:Assign_L22_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99136:FunctionDef_L21_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99136:Assign_L23_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99136:FunctionDef_L21_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99136:Expr_L24_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99136:FunctionDef_L21_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99136:Assign_L25_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99136:FunctionDef_L21_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99136:Assign_L26_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99136:FunctionDef_L21_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99136:Assign_L27_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99136:FunctionDef_L21_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99136:For_L28_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99136:For_L28_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99136:Assign_L29_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99136:For_L28_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99136:If_L30_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99136:If_L30_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99136:Assign_L32_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99136:If_L30_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99136:Expr_L33_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99136:If_L30_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99136:If_L34_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99136:If_L34_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99136:Assign_L36_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99136:If_L34_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99136:Expr_L37_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99136:FunctionDef_L21_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99136:Assign_L38_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99136:FunctionDef_L21_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99136:If_L39_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99136:If_L39_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99136:Expr_L40_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99136:If_L39_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99136:Expr_L41_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99136:FunctionDef_L21_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99136:Return_L42_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99136:FunctionDef_L45_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99136:Expr_L46_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99136:FunctionDef_L45_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99136:For_L47_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99136:For_L47_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99136:Expr_L48_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99136:FunctionDef_L45_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99136:Expr_L49_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99136:If_L53_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99136:Expr_L54_C4"}]
#!/usr/bin/env python # coding=utf-8 import os import codecs import re import time from glob import glob mp3FilePatterns = (u'*.mp3',) listFilename = u'mp3list.txt' def main(): mp3Filenames = [] for p in mp3FilePatterns: mp3Filenames += glob(p) mp3Renames = [] mp3Index = 1 for f in mp3Filenames: if re.match(r'\d+\.\S+', f): mp3Renames.append((f, f)) else: rf = str(mp3Index) + f[f.rfind('.'):] mp3Index += 1 while os.path.exists(rf): rf = str(mp3Index) + f[f.rfind('.'):] mp3Index += 1 mp3Renames.append((f, rf)) listFile = codecs.open(listFilename, 'a', 'utf-8') listFile.write('\n') listFile.write(time.asctime() + '\n') for f,rf in mp3Renames: os.rename(f, rf) listFile.write(u'%s --> %s\n' % (f.decode('gbk'), rf)) print(u'%s --> %s' % (f.decode('gbk'), rf)) if __name__ == '__main__': main()
ajibawa-2023/Python-Code-Large/train/row_99137
28
41
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_99137:Import_L4_C0", "label": "os import os", "type": "import", "loc": [4, 4], "level": 0, "parent": null, "vector": [1, 0, 0.0976, 0.0244, 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_99137:Import_L5_C0", "label": "codecs import codecs", "type": "import", "loc": [5, 5], "level": 0, "parent": null, "vector": [1, 0, 0.122, 0.0244, 0, 0.66, 0.125, 220, 0, 1, 0, 0, 220, 0, 0], "semantic": {"name": "codecs", "arg_names": [], "import_names": ["codecs"], "rhs_call_name": "", "annotation": ""}, "snippet": "import codecs"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99137:Import_L6_C0", "label": "re import re", "type": "import", "loc": [6, 6], "level": 0, "parent": null, "vector": [1, 0, 0.1463, 0.0244, 0, 0.66, 0.25, 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_99137:Import_L7_C0", "label": "time import time", "type": "import", "loc": [7, 7], "level": 0, "parent": null, "vector": [1, 0, 0.1707, 0.0244, 0, 0.66, 0.375, 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_99137:ImportFrom_L8_C0", "label": "from glob import glob", "type": "import", "loc": [8, 8], "level": 0, "parent": null, "vector": [1, 0, 0.1951, 0.0244, 0, 0.66, 0.5, 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_99137:Assign_L10_C0", "label": "mp3FilePatterns =", "type": "assigned_variable", "loc": [10, 10], "level": 0, "parent": null, "vector": [14, 0, 0.2439, 0.0244, 0, 0.66, 0.625, 518, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "mp3FilePatterns", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "mp3FilePatterns = (u'*.mp3',)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99137:Assign_L11_C0", "label": "listFilename =", "type": "assigned_variable", "loc": [11, 11], "level": 0, "parent": null, "vector": [14, 0, 0.2683, 0.0244, 0, 0.66, 0.75, 484, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "listFilename", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "listFilename = u'mp3list.txt'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99137:FunctionDef_L14_C0", "label": "main", "type": "function", "loc": [14, 36], "level": 0, "parent": null, "vector": [2, 0, 0.6098, 0.561, 0, 0.66, 0.875, 624, 0, 0, 0, 0, 0, 0, 18], "semantic": {"name": "main", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def main():\n\tmp3Filenames = []\n\tfor p in mp3FilePatterns:\n\t\tmp3Filenames += glob(p)\n\tmp3Renames = []\n\tmp3Index = 1\n\tfor f in mp3Filenames:\n\t\tif re.match(r'\\d+\\.\\S+', f):"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99137:Assign_L15_C1", "label": "mp3Filenames =", "type": "assigned_variable", "loc": [15, 15], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99137:FunctionDef_L14_C0", "vector": [14, 1, 0.3659, 0.0244, 1, 0.91, 0.0, 643, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "mp3Filenames", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tmp3Filenames = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99137:For_L16_C1", "label": "for p", "type": "for", "loc": [16, 17], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99137:FunctionDef_L14_C0", "vector": [6, 1, 0.4024, 0.0488, 1, 0.91, 0.125, 491, 2, 0, 0, 0, 0, 0, 1], "semantic": {"name": "p", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tfor p in mp3FilePatterns:\n\t\tmp3Filenames += glob(p)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99137:Assign_L18_C1", "label": "mp3Renames =", "type": "assigned_variable", "loc": [18, 18], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99137:FunctionDef_L14_C0", "vector": [14, 1, 0.439, 0.0244, 1, 0.91, 0.25, 472, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "mp3Renames", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tmp3Renames = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99137:Assign_L19_C1", "label": "mp3Index =", "type": "assigned_variable", "loc": [19, 19], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99137:FunctionDef_L14_C0", "vector": [14, 1, 0.4634, 0.0244, 1, 0.91, 0.375, 314, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "mp3Index", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tmp3Index = 1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99137:For_L20_C1", "label": "for f", "type": "for", "loc": [20, 29], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99137:FunctionDef_L14_C0", "vector": [6, 1, 0.5976, 0.2439, 1, 0.91, 0.5, 899, 2, 0, 0, 0, 0, 0, 8], "semantic": {"name": "f", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tfor f in mp3Filenames:\n\t\tif re.match(r'\\d+\\.\\S+', f):\n\t\t\tmp3Renames.append((f, f))\n\t\telse:\n\t\t\trf = str(mp3Index) + f[f.rfind('.'):]\n\t\t\tmp3Index += 1\n\t\t\twhile os.path.exists(rf):\n\t\t\t\trf = str(mp3Index) + f[f.rfind('.'):]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99137:If_L21_C2", "label": "if", "type": "if", "loc": [21, 29], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99137:For_L20_C1", "vector": [4, 2, 0.6098, 0.2195, 2, 0.79, 0.0, 0, 3, 0, 0, 0, 0, 0, 8], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tif re.match(r'\\d+\\.\\S+', f):\n\t\t\tmp3Renames.append((f, f))\n\t\telse:\n\t\t\trf = str(mp3Index) + f[f.rfind('.'):]\n\t\t\tmp3Index += 1\n\t\t\twhile os.path.exists(rf):\n\t\t\t\trf = str(mp3Index) + f[f.rfind('.'):]\n\t\t\t\tmp3Index += 1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99137:Expr_L22_C3", "label": "append()", "type": "expression", "loc": [22, 22], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99137:If_L21_C2", "vector": [8, 3, 0.5366, 0.0244, 3, 0.58, 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\tmp3Renames.append((f, f))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99137:Assign_L24_C3", "label": "rf =", "type": "assigned_variable", "loc": [24, 24], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99137:If_L21_C2", "vector": [14, 3, 0.5854, 0.0244, 3, 0.58, 0.3333, 657, 4, 0, 0, 0, 0, 0, 2], "semantic": {"name": "rf", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\trf = str(mp3Index) + f[f.rfind('.'):]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99137:While_L26_C3", "label": "while", "type": "while", "loc": [26, 28], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99137:If_L21_C2", "vector": [5, 3, 0.6585, 0.0732, 3, 0.58, 0.6667, 0, 3, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\twhile os.path.exists(rf):\n\t\t\t\trf = str(mp3Index) + f[f.rfind('.'):]\n\t\t\t\tmp3Index += 1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99137:Assign_L27_C4", "label": "rf =", "type": "assigned_variable", "loc": [27, 27], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99137:While_L26_C3", "vector": [14, 4, 0.6585, 0.0244, 4, 0.78, 0.0, 657, 4, 0, 0, 0, 0, 0, 2], "semantic": {"name": "rf", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\t\trf = str(mp3Index) + f[f.rfind('.'):]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99137:Expr_L29_C3", "label": "append()", "type": "expression", "loc": [29, 29], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99137:If_L21_C2", "vector": [8, 3, 0.7073, 0.0244, 3, 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": "\t\t\tmp3Renames.append((f, rf))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99137:Assign_L30_C1", "label": "listFile = open()", "type": "assigned_variable", "loc": [30, 30], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99137:FunctionDef_L14_C0", "vector": [14, 1, 0.7317, 0.0244, 1, 0.91, 0.625, 425, 3, 3, 0, 0, 693, 10, 1], "semantic": {"name": "listFile", "arg_names": [], "import_names": [], "rhs_call_name": "open", "annotation": ""}, "snippet": "\tlistFile = codecs.open(listFilename, 'a', 'utf-8')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99137:Expr_L31_C1", "label": "write()", "type": "expression", "loc": [31, 31], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99137:FunctionDef_L14_C0", "vector": [8, 1, 0.7561, 0.0244, 1, 0.91, 0.75, 837, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "write", "arg_names": [], "import_names": [], "rhs_call_name": "write", "annotation": ""}, "snippet": "\tlistFile.write('\\n')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99137:Expr_L32_C1", "label": "write()", "type": "expression", "loc": [32, 32], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99137:FunctionDef_L14_C0", "vector": [8, 1, 0.7805, 0.0244, 1, 0.91, 0.875, 837, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "write", "arg_names": [], "import_names": [], "rhs_call_name": "write", "annotation": ""}, "snippet": "\tlistFile.write(time.asctime() + '\\n')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99137:For_L33_C1", "label": "for f, rf", "type": "for", "loc": [33, 36], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99137:FunctionDef_L14_C0", "vector": [6, 1, 0.8415, 0.0976, 1, 0.91, 1.0, 950, 2, 0, 0, 0, 0, 0, 5], "semantic": {"name": "f, rf", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tfor f,rf in mp3Renames:\n\t\tos.rename(f, rf)\n\t\tlistFile.write(u'%s\t-->\t%s\\n' % (f.decode('gbk'), rf))\n\t\tprint(u'%s\t-->\t%s' % (f.decode('gbk'), rf))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99137:Expr_L34_C2", "label": "rename()", "type": "expression", "loc": [34, 34], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99137:For_L33_C1", "vector": [8, 2, 0.8293, 0.0244, 2, 0.47, 0.0, 508, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "rename", "arg_names": [], "import_names": [], "rhs_call_name": "rename", "annotation": ""}, "snippet": "\t\tos.rename(f, rf)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99137:Expr_L35_C2", "label": "write()", "type": "expression", "loc": [35, 35], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99137:For_L33_C1", "vector": [8, 2, 0.8537, 0.0244, 2, 0.47, 0.5, 837, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "write", "arg_names": [], "import_names": [], "rhs_call_name": "write", "annotation": ""}, "snippet": "\t\tlistFile.write(u'%s\t-->\t%s\\n' % (f.decode('gbk'), rf))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99137:Expr_L36_C2", "label": "print()", "type": "expression", "loc": [36, 36], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99137:For_L33_C1", "vector": [8, 2, 0.878, 0.0244, 2, 0.47, 1.0, 535, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": "\t\tprint(u'%s\t-->\t%s' % (f.decode('gbk'), rf))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99137:If_L38_C0", "label": "if", "type": "if", "loc": [38, 39], "level": 0, "parent": null, "vector": [4, 0, 0.939, 0.0488, 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\tmain()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99137:Expr_L39_C1", "label": "main()", "type": "expression", "loc": [39, 39], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99137:If_L38_C0", "vector": [8, 1, 0.9512, 0.0244, 1, 0.99, 0.0, 624, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "main", "arg_names": [], "import_names": [], "rhs_call_name": "main", "annotation": ""}, "snippet": "\tmain()"}]
[{"f": "ajibawa-2023/Python-Code-Large/train/row_99137:FunctionDef_L14_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99137:Assign_L15_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99137:FunctionDef_L14_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99137:For_L16_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99137:FunctionDef_L14_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99137:Assign_L18_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99137:FunctionDef_L14_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99137:Assign_L19_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99137:FunctionDef_L14_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99137:For_L20_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99137:For_L20_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99137:If_L21_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99137:If_L21_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99137:Expr_L22_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99137:If_L21_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99137:Assign_L24_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99137:If_L21_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99137:While_L26_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99137:While_L26_C3", "t": "ajibawa-2023/Python-Code-Large/train/row_99137:Assign_L27_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99137:If_L21_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99137:Expr_L29_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99137:FunctionDef_L14_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99137:Assign_L30_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99137:FunctionDef_L14_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99137:Expr_L31_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99137:FunctionDef_L14_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99137:Expr_L32_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99137:FunctionDef_L14_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99137:For_L33_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99137:For_L33_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99137:Expr_L34_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99137:For_L33_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99137:Expr_L35_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99137:For_L33_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99137:Expr_L36_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99137:If_L38_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99137:Expr_L39_C1"}]
#!/usr/bin/env python # coding=utf-8 import os import sys import re import time import struct def read_from_text(filename, version): timeNow = time.localtime()[:6] + (int(time.time()%1 * 1000),) # file struct fileStruct = {'Version': version, # Date (year, month, day, hour, minute, second, ms) 'Date': timeNow, 'Declaration': 'VRMP', 'OffsetToData': 24, 'Records': {} } f = open(filename) for line in f: if line.strip() == '': print('Empty Line!!') continue textFields = line.strip().split('\t') ids = textFields[0] rds = tuple(textFields[1:]) if re.match(r'0[xX][\dA-Fa-f]+', ids): id = int(ids, 16) else: id = int(ids) assert(not fileStruct['Records'].has_key(id)) fileStruct['Records'][id] = rds return fileStruct def write_to_data_file(filename, fileStruct): def Num2BCD(num): # 2 digit number to one byte compressed BCD assert(isinstance(num, int) or isinstance(num, long)) assert(num < 100 and num >= 0) return chr(int(str(num), 16)) # version version = (fileStruct['Version'] + '\0'*4)[:4] t = fileStruct['Date'] # time timeNow = Num2BCD(int(t[0]/100)) + Num2BCD(t[0]%100) + Num2BCD(t[1]) + Num2BCD(t[2]) \ + Num2BCD(t[3]) + Num2BCD(t[4]) + Num2BCD(t[5]) + Num2BCD(int(t[6]/10)) # declaration declaration = fileStruct['Declaration'] # record number recordNum = len(fileStruct['Records']) # offset to data dataOffset = fileStruct['OffsetToData'] assert(dataOffset == 24) allRecordId = list(fileStruct['Records'].keys()) allRecordId.sort() allRecordId = tuple(allRecordId) # record size, sum of all strings' length and 1 (string number) and "\0" # string number of each record allRecordStrNum = tuple(len(fileStruct['Records'][id]) for id in allRecordId) # string of each record allRecordStr = tuple(str.join(' / ', fileStruct['Records'][id]) for id in allRecordId) # size of each record, string, '\0', length, string number allRecordSize = tuple(len(s)+3 for s in allRecordStr) # check assert(len(version) == 4) assert(len(timeNow) == 8) assert(declaration == 'VRMP') assert(all(size<256 for size in allRecordSize)) def OffsetOfRecord(n): return 24 + 8 * recordNum + sum(allRecordSize[:n]) def DW2BIN(dw): return struct.pack('>I', dw) def N2BYTE(n): return struct.pack('>B', n) f = open(filename, 'wb') f.write(version) f.write(timeNow) f.write(declaration) f.write(DW2BIN(recordNum)) f.write(DW2BIN(dataOffset)) assert(f.tell() == 24) # write offset table for n in range(len(allRecordId)): f.write(DW2BIN(allRecordId[n])) f.write(DW2BIN(OffsetOfRecord(n))) # write data for n in range(len(allRecordId)): assert(f.tell() == OffsetOfRecord(n)) f.write(N2BYTE(allRecordSize[n]-1)) f.write(N2BYTE(allRecordStrNum[n])) f.write(allRecordStr[n]) f.write('\0') f.close() def main(): if len(sys.argv) < 3 or len(sys.argv) > 4: print('Usage:') print('mk_MltPhoneme.py inputfile ver (outputfilename)') return inputfilename = sys.argv[1] ver = sys.argv[2] if len(sys.argv) == 4: outputfilename = sys.argv[3] else: outputfilename = inputfilename + 'mltphn' fs = read_from_text(inputfilename, ver) write_to_data_file(outputfilename, fs) print('OK') if __name__ == '__main__': main()
ajibawa-2023/Python-Code-Large/train/row_99138
71
122
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_99138:Import_L5_C0", "label": "os import os", "type": "import", "loc": [5, 5], "level": 0, "parent": null, "vector": [1, 0, 0.041, 0.0082, 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_99138:Import_L6_C0", "label": "sys import sys", "type": "import", "loc": [6, 6], "level": 0, "parent": null, "vector": [1, 0, 0.0492, 0.0082, 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_99138:Import_L7_C0", "label": "re import re", "type": "import", "loc": [7, 7], "level": 0, "parent": null, "vector": [1, 0, 0.0574, 0.0082, 0, 0.66, 0.25, 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_99138:Import_L8_C0", "label": "time import time", "type": "import", "loc": [8, 8], "level": 0, "parent": null, "vector": [1, 0, 0.0656, 0.0082, 0, 0.66, 0.375, 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_99138:Import_L9_C0", "label": "struct import struct", "type": "import", "loc": [9, 9], "level": 0, "parent": null, "vector": [1, 0, 0.0738, 0.0082, 0, 0.66, 0.5, 399, 0, 1, 0, 0, 399, 0, 0], "semantic": {"name": "struct", "arg_names": [], "import_names": ["struct"], "rhs_call_name": "", "annotation": ""}, "snippet": "import struct"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99138:FunctionDef_L12_C0", "label": "read_from_text", "type": "function", "loc": [12, 36], "level": 0, "parent": null, "vector": [2, 0, 0.1967, 0.2049, 0, 0.66, 0.625, 308, 0, 2, 1, 0, 0, 0, 13], "semantic": {"name": "read_from_text", "arg_names": ["filename", "version"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def read_from_text(filename, version):\n\ttimeNow = time.localtime()[:6] + (int(time.time()%1 * 1000),)\n\t# file struct\n\tfileStruct = {'Version': version,\n\t\t\t# Date (year, month, day, hour, minute, second, ms)\n\t\t\t'Date': timeNow,\n\t\t\t'Declaration': 'VRMP',\n\t\t\t'OffsetToData': 24,"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99138:Assign_L13_C1", "label": "timeNow =", "type": "assigned_variable", "loc": [13, 13], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99138:FunctionDef_L12_C0", "vector": [14, 1, 0.1066, 0.0082, 1, 0.54, 0.0, 63, 4, 0, 0, 0, 0, 0, 3], "semantic": {"name": "timeNow", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\ttimeNow = time.localtime()[:6] + (int(time.time()%1 * 1000),)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99138:Assign_L15_C1", "label": "fileStruct =", "type": "assigned_variable", "loc": [15, 21], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99138:FunctionDef_L12_C0", "vector": [14, 1, 0.1475, 0.0574, 1, 0.54, 0.25, 758, 0, 0, 0, 0, 0, 6, 0], "semantic": {"name": "fileStruct", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tfileStruct = {'Version': version,\n\t\t\t# Date (year, month, day, hour, minute, second, ms)\n\t\t\t'Date': timeNow,\n\t\t\t'Declaration': 'VRMP',\n\t\t\t'OffsetToData': 24,\n\t\t\t'Records': {}\n\t\t\t}"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99138:Assign_L22_C1", "label": "f = open()", "type": "assigned_variable", "loc": [22, 22], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99138:FunctionDef_L12_C0", "vector": [14, 1, 0.1803, 0.0082, 1, 0.54, 0.5, 899, 3, 1, 0, 0, 693, 10, 1], "semantic": {"name": "f", "arg_names": [], "import_names": [], "rhs_call_name": "open", "annotation": ""}, "snippet": "\tf = open(filename)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99138:For_L23_C1", "label": "for line", "type": "for", "loc": [23, 35], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99138:FunctionDef_L12_C0", "vector": [6, 1, 0.2377, 0.1066, 1, 0.54, 0.75, 373, 2, 0, 0, 0, 0, 0, 9], "semantic": {"name": "line", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tfor line in f:\n\t\tif line.strip() == '':\n\t\t\tprint('Empty Line!!')\n\t\t\tcontinue\n\t\ttextFields = line.strip().split('\\t')\n\t\tids = textFields[0]\n\t\trds = tuple(textFields[1:])\n\t\tif re.match(r'0[xX][\\dA-Fa-f]+', ids):"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99138:If_L24_C2", "label": "if", "type": "if", "loc": [24, 26], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99138:For_L23_C1", "vector": [4, 2, 0.2049, 0.0246, 2, 0.51, 0.0, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tif line.strip() == '':\n\t\t\tprint('Empty Line!!')\n\t\t\tcontinue"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99138:Expr_L25_C3", "label": "print()", "type": "expression", "loc": [25, 25], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99138:If_L24_C2", "vector": [8, 3, 0.2049, 0.0082, 3, 0.31, 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('Empty Line!!')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99138:Assign_L27_C2", "label": "textFields = split()", "type": "assigned_variable", "loc": [27, 27], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99138:For_L23_C1", "vector": [14, 2, 0.2213, 0.0082, 2, 0.51, 0.2, 333, 3, 1, 0, 0, 908, 10, 2], "semantic": {"name": "textFields", "arg_names": [], "import_names": [], "rhs_call_name": "split", "annotation": ""}, "snippet": "\t\ttextFields = line.strip().split('\\t')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99138:Assign_L28_C2", "label": "ids =", "type": "assigned_variable", "loc": [28, 28], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99138:For_L23_C1", "vector": [14, 2, 0.2295, 0.0082, 2, 0.51, 0.4, 202, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "ids", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tids = textFields[0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99138:Assign_L29_C2", "label": "rds = tuple()", "type": "assigned_variable", "loc": [29, 29], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99138:For_L23_C1", "vector": [14, 2, 0.2377, 0.0082, 2, 0.51, 0.6, 985, 3, 1, 0, 0, 259, 10, 1], "semantic": {"name": "rds", "arg_names": [], "import_names": [], "rhs_call_name": "tuple", "annotation": ""}, "snippet": "\t\trds = tuple(textFields[1:])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99138:If_L30_C2", "label": "if", "type": "if", "loc": [30, 33], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99138:For_L23_C1", "vector": [4, 2, 0.2582, 0.0328, 2, 0.51, 0.8, 0, 3, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tif re.match(r'0[xX][\\dA-Fa-f]+', ids):\n\t\t\tid = int(ids, 16)\n\t\telse:\n\t\t\tid = int(ids)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99138:Assign_L31_C3", "label": "id = int()", "type": "assigned_variable", "loc": [31, 31], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99138:If_L30_C2", "vector": [14, 3, 0.2541, 0.0082, 3, 0.86, 0.0, 941, 3, 2, 0, 0, 901, 10, 1], "semantic": {"name": "id", "arg_names": [], "import_names": [], "rhs_call_name": "int", "annotation": ""}, "snippet": "\t\t\tid = int(ids, 16)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99138:Assign_L33_C3", "label": "id = int()", "type": "assigned_variable", "loc": [33, 33], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99138:If_L30_C2", "vector": [14, 3, 0.2705, 0.0082, 3, 0.86, 1.0, 941, 3, 1, 0, 0, 901, 10, 1], "semantic": {"name": "id", "arg_names": [], "import_names": [], "rhs_call_name": "int", "annotation": ""}, "snippet": "\t\t\tid = int(ids)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99138:Assign_L35_C2", "label": "assign", "type": "assigned_variable", "loc": [35, 35], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99138:For_L23_C1", "vector": [14, 2, 0.2869, 0.0082, 2, 0.51, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tfileStruct['Records'][id] = rds"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99138:Return_L36_C1", "label": "return", "type": "return", "loc": [36, 36], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99138:FunctionDef_L12_C0", "vector": [13, 1, 0.2951, 0.0082, 1, 0.54, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\treturn fileStruct"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99138:FunctionDef_L38_C0", "label": "write_to_data_file", "type": "function", "loc": [38, 102], "level": 0, "parent": null, "vector": [2, 0, 0.5738, 0.5328, 0, 0.66, 0.75, 937, 0, 2, 1, 0, 0, 0, 59], "semantic": {"name": "write_to_data_file", "arg_names": ["filename", "fileStruct"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def write_to_data_file(filename, fileStruct):\n\tdef Num2BCD(num):\n\t\t# 2 digit number to one byte compressed BCD\n\t\tassert(isinstance(num, int) or isinstance(num, long))\n\t\tassert(num < 100 and num >= 0)\n\t\treturn chr(int(str(num), 16))\n\n\t# version"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99138:FunctionDef_L39_C1", "label": "Num2BCD", "type": "function", "loc": [39, 43], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99138:FunctionDef_L38_C0", "vector": [2, 1, 0.3361, 0.041, 1, 0.61, 0.0, 917, 0, 1, 1, 0, 0, 0, 5], "semantic": {"name": "Num2BCD", "arg_names": ["num"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tdef Num2BCD(num):\n\t\t# 2 digit number to one byte compressed BCD\n\t\tassert(isinstance(num, int) or isinstance(num, long))\n\t\tassert(num < 100 and num >= 0)\n\t\treturn chr(int(str(num), 16))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99138:Return_L43_C2", "label": "return", "type": "return", "loc": [43, 43], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99138:FunctionDef_L39_C1", "vector": [13, 2, 0.3525, 0.0082, 2, 0.13, 0.0, 0, 3, 0, 0, 0, 0, 10, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\treturn chr(int(str(num), 16))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99138:Assign_L46_C1", "label": "version =", "type": "assigned_variable", "loc": [46, 46], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99138:FunctionDef_L38_C0", "vector": [14, 1, 0.377, 0.0082, 1, 0.61, 0.0417, 623, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "version", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tversion = (fileStruct['Version'] + '\\0'*4)[:4]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99138:Assign_L47_C1", "label": "t =", "type": "assigned_variable", "loc": [47, 47], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99138:FunctionDef_L38_C0", "vector": [14, 1, 0.3852, 0.0082, 1, 0.61, 0.0833, 15, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "t", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tt = fileStruct['Date']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99138:Assign_L49_C1", "label": "timeNow =", "type": "assigned_variable", "loc": [49, 50], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99138:FunctionDef_L38_C0", "vector": [14, 1, 0.4057, 0.0164, 1, 0.61, 0.125, 63, 4, 0, 0, 0, 0, 0, 10], "semantic": {"name": "timeNow", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\ttimeNow = Num2BCD(int(t[0]/100)) + Num2BCD(t[0]%100) + Num2BCD(t[1]) + Num2BCD(t[2]) \\\n\t\t\t+ Num2BCD(t[3]) + Num2BCD(t[4]) + Num2BCD(t[5]) + Num2BCD(int(t[6]/10))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99138:Assign_L52_C1", "label": "declaration =", "type": "assigned_variable", "loc": [52, 52], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99138:FunctionDef_L38_C0", "vector": [14, 1, 0.4262, 0.0082, 1, 0.61, 0.1667, 6, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "declaration", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tdeclaration = fileStruct['Declaration']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99138:Assign_L54_C1", "label": "recordNum = len()", "type": "assigned_variable", "loc": [54, 54], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99138:FunctionDef_L38_C0", "vector": [14, 1, 0.4426, 0.0082, 1, 0.61, 0.2083, 423, 3, 1, 0, 0, 890, 10, 1], "semantic": {"name": "recordNum", "arg_names": [], "import_names": [], "rhs_call_name": "len", "annotation": ""}, "snippet": "\trecordNum = len(fileStruct['Records'])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99138:Assign_L56_C1", "label": "dataOffset =", "type": "assigned_variable", "loc": [56, 56], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99138:FunctionDef_L38_C0", "vector": [14, 1, 0.459, 0.0082, 1, 0.61, 0.25, 526, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "dataOffset", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tdataOffset = fileStruct['OffsetToData']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99138:Assign_L59_C1", "label": "allRecordId = list()", "type": "assigned_variable", "loc": [59, 59], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99138:FunctionDef_L38_C0", "vector": [14, 1, 0.4836, 0.0082, 1, 0.61, 0.2917, 449, 3, 1, 0, 0, 430, 10, 2], "semantic": {"name": "allRecordId", "arg_names": [], "import_names": [], "rhs_call_name": "list", "annotation": ""}, "snippet": "\tallRecordId = list(fileStruct['Records'].keys())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99138:Expr_L60_C1", "label": "sort()", "type": "expression", "loc": [60, 60], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99138:FunctionDef_L38_C0", "vector": [8, 1, 0.4918, 0.0082, 1, 0.61, 0.3333, 489, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "sort", "arg_names": [], "import_names": [], "rhs_call_name": "sort", "annotation": ""}, "snippet": "\tallRecordId.sort()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99138:Assign_L61_C1", "label": "allRecordId = tuple()", "type": "assigned_variable", "loc": [61, 61], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99138:FunctionDef_L38_C0", "vector": [14, 1, 0.5, 0.0082, 1, 0.61, 0.375, 449, 3, 1, 0, 0, 259, 10, 1], "semantic": {"name": "allRecordId", "arg_names": [], "import_names": [], "rhs_call_name": "tuple", "annotation": ""}, "snippet": "\tallRecordId = tuple(allRecordId)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99138:Assign_L65_C1", "label": "allRecordStrNum = tuple()", "type": "assigned_variable", "loc": [65, 65], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99138:FunctionDef_L38_C0", "vector": [14, 1, 0.5328, 0.0082, 1, 0.61, 0.4167, 117, 3, 1, 0, 0, 259, 10, 2], "semantic": {"name": "allRecordStrNum", "arg_names": [], "import_names": [], "rhs_call_name": "tuple", "annotation": ""}, "snippet": "\tallRecordStrNum = tuple(len(fileStruct['Records'][id]) for id in allRecordId)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99138:Assign_L67_C1", "label": "allRecordStr = tuple()", "type": "assigned_variable", "loc": [67, 67], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99138:FunctionDef_L38_C0", "vector": [14, 1, 0.5492, 0.0082, 1, 0.61, 0.4583, 31, 3, 1, 0, 0, 259, 10, 2], "semantic": {"name": "allRecordStr", "arg_names": [], "import_names": [], "rhs_call_name": "tuple", "annotation": ""}, "snippet": "\tallRecordStr = tuple(str.join(' / ', fileStruct['Records'][id]) for id in allRecordId)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99138:Assign_L69_C1", "label": "allRecordSize = tuple()", "type": "assigned_variable", "loc": [69, 69], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99138:FunctionDef_L38_C0", "vector": [14, 1, 0.5656, 0.0082, 1, 0.61, 0.5, 110, 3, 1, 0, 0, 259, 10, 2], "semantic": {"name": "allRecordSize", "arg_names": [], "import_names": [], "rhs_call_name": "tuple", "annotation": ""}, "snippet": "\tallRecordSize = tuple(len(s)+3 for s in allRecordStr)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99138:FunctionDef_L77_C1", "label": "OffsetOfRecord", "type": "function", "loc": [77, 78], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99138:FunctionDef_L38_C0", "vector": [2, 1, 0.6352, 0.0164, 1, 0.61, 0.5417, 721, 0, 1, 1, 0, 0, 0, 1], "semantic": {"name": "OffsetOfRecord", "arg_names": ["n"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tdef OffsetOfRecord(n):\n\t\treturn 24 + 8 * recordNum + sum(allRecordSize[:n]) "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99138:Return_L78_C2", "label": "return", "type": "return", "loc": [78, 78], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99138:FunctionDef_L77_C1", "vector": [13, 2, 0.6393, 0.0082, 2, 0.68, 0.0, 0, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\treturn 24 + 8 * recordNum + sum(allRecordSize[:n]) "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99138:FunctionDef_L79_C1", "label": "DW2BIN", "type": "function", "loc": [79, 80], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99138:FunctionDef_L38_C0", "vector": [2, 1, 0.6516, 0.0164, 1, 0.61, 0.5833, 612, 0, 1, 1, 0, 0, 0, 1], "semantic": {"name": "DW2BIN", "arg_names": ["dw"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tdef DW2BIN(dw):\n\t\treturn struct.pack('>I', dw)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99138:Return_L80_C2", "label": "return", "type": "return", "loc": [80, 80], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99138:FunctionDef_L79_C1", "vector": [13, 2, 0.6557, 0.0082, 2, 0.2, 0.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\treturn struct.pack('>I', dw)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99138:FunctionDef_L81_C1", "label": "N2BYTE", "type": "function", "loc": [81, 82], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99138:FunctionDef_L38_C0", "vector": [2, 1, 0.668, 0.0164, 1, 0.61, 0.625, 315, 0, 1, 1, 0, 0, 0, 1], "semantic": {"name": "N2BYTE", "arg_names": ["n"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tdef N2BYTE(n):\n\t\treturn struct.pack('>B', n)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99138:Return_L82_C2", "label": "return", "type": "return", "loc": [82, 82], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99138:FunctionDef_L81_C1", "vector": [13, 2, 0.6721, 0.0082, 2, 0.09, 0.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\treturn struct.pack('>B', n)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99138:Assign_L84_C1", "label": "f = open()", "type": "assigned_variable", "loc": [84, 84], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99138:FunctionDef_L38_C0", "vector": [14, 1, 0.6885, 0.0082, 1, 0.61, 0.6667, 899, 3, 2, 0, 0, 693, 10, 1], "semantic": {"name": "f", "arg_names": [], "import_names": [], "rhs_call_name": "open", "annotation": ""}, "snippet": "\tf = open(filename, 'wb')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99138:Expr_L85_C1", "label": "write()", "type": "expression", "loc": [85, 85], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99138:FunctionDef_L38_C0", "vector": [8, 1, 0.6967, 0.0082, 1, 0.61, 0.7083, 837, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "write", "arg_names": [], "import_names": [], "rhs_call_name": "write", "annotation": ""}, "snippet": "\tf.write(version)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99138:Expr_L86_C1", "label": "write()", "type": "expression", "loc": [86, 86], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99138:FunctionDef_L38_C0", "vector": [8, 1, 0.7049, 0.0082, 1, 0.61, 0.75, 837, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "write", "arg_names": [], "import_names": [], "rhs_call_name": "write", "annotation": ""}, "snippet": "\tf.write(timeNow)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99138:Expr_L87_C1", "label": "write()", "type": "expression", "loc": [87, 87], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99138:FunctionDef_L38_C0", "vector": [8, 1, 0.7131, 0.0082, 1, 0.61, 0.7917, 837, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "write", "arg_names": [], "import_names": [], "rhs_call_name": "write", "annotation": ""}, "snippet": "\tf.write(declaration)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99138:Expr_L88_C1", "label": "write()", "type": "expression", "loc": [88, 88], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99138:FunctionDef_L38_C0", "vector": [8, 1, 0.7213, 0.0082, 1, 0.61, 0.8333, 837, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "write", "arg_names": [], "import_names": [], "rhs_call_name": "write", "annotation": ""}, "snippet": "\tf.write(DW2BIN(recordNum))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99138:Expr_L89_C1", "label": "write()", "type": "expression", "loc": [89, 89], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99138:FunctionDef_L38_C0", "vector": [8, 1, 0.7295, 0.0082, 1, 0.61, 0.875, 837, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "write", "arg_names": [], "import_names": [], "rhs_call_name": "write", "annotation": ""}, "snippet": "\tf.write(DW2BIN(dataOffset))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99138:For_L92_C1", "label": "for n", "type": "for", "loc": [92, 94], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99138:FunctionDef_L38_C0", "vector": [6, 1, 0.7623, 0.0246, 1, 0.61, 0.9167, 773, 3, 0, 0, 0, 0, 0, 7], "semantic": {"name": "n", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tfor n in range(len(allRecordId)):\n\t\tf.write(DW2BIN(allRecordId[n]))\n\t\tf.write(DW2BIN(OffsetOfRecord(n)))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99138:Expr_L93_C2", "label": "write()", "type": "expression", "loc": [93, 93], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99138:For_L92_C1", "vector": [8, 2, 0.7623, 0.0082, 2, 0.05, 0.0, 837, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "write", "arg_names": [], "import_names": [], "rhs_call_name": "write", "annotation": ""}, "snippet": "\t\tf.write(DW2BIN(allRecordId[n]))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99138:Expr_L94_C2", "label": "write()", "type": "expression", "loc": [94, 94], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99138:For_L92_C1", "vector": [8, 2, 0.7705, 0.0082, 2, 0.05, 1.0, 837, 3, 1, 0, 0, 0, 0, 3], "semantic": {"name": "write", "arg_names": [], "import_names": [], "rhs_call_name": "write", "annotation": ""}, "snippet": "\t\tf.write(DW2BIN(OffsetOfRecord(n)))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99138:For_L96_C1", "label": "for n", "type": "for", "loc": [96, 101], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99138:FunctionDef_L38_C0", "vector": [6, 1, 0.8074, 0.0492, 1, 0.61, 0.9583, 773, 3, 0, 0, 0, 0, 0, 10], "semantic": {"name": "n", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tfor n in range(len(allRecordId)):\n\t\tassert(f.tell() == OffsetOfRecord(n))\n\t\tf.write(N2BYTE(allRecordSize[n]-1))\n\t\tf.write(N2BYTE(allRecordStrNum[n]))\n\t\tf.write(allRecordStr[n])\n\t\tf.write('\\0')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99138:Expr_L98_C2", "label": "write()", "type": "expression", "loc": [98, 98], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99138:For_L96_C1", "vector": [8, 2, 0.8033, 0.0082, 2, 0.13, 0.0, 837, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "write", "arg_names": [], "import_names": [], "rhs_call_name": "write", "annotation": ""}, "snippet": "\t\tf.write(N2BYTE(allRecordSize[n]-1))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99138:Expr_L99_C2", "label": "write()", "type": "expression", "loc": [99, 99], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99138:For_L96_C1", "vector": [8, 2, 0.8115, 0.0082, 2, 0.13, 0.3333, 837, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "write", "arg_names": [], "import_names": [], "rhs_call_name": "write", "annotation": ""}, "snippet": "\t\tf.write(N2BYTE(allRecordStrNum[n]))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99138:Expr_L100_C2", "label": "write()", "type": "expression", "loc": [100, 100], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99138:For_L96_C1", "vector": [8, 2, 0.8197, 0.0082, 2, 0.13, 0.6667, 837, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "write", "arg_names": [], "import_names": [], "rhs_call_name": "write", "annotation": ""}, "snippet": "\t\tf.write(allRecordStr[n])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99138:Expr_L101_C2", "label": "write()", "type": "expression", "loc": [101, 101], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99138:For_L96_C1", "vector": [8, 2, 0.8279, 0.0082, 2, 0.13, 1.0, 837, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "write", "arg_names": [], "import_names": [], "rhs_call_name": "write", "annotation": ""}, "snippet": "\t\tf.write('\\0')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99138:Expr_L102_C1", "label": "close()", "type": "expression", "loc": [102, 102], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99138:FunctionDef_L38_C0", "vector": [8, 1, 0.8361, 0.0082, 1, 0.61, 1.0, 77, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "close", "arg_names": [], "import_names": [], "rhs_call_name": "close", "annotation": ""}, "snippet": "\tf.close()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99138:FunctionDef_L105_C0", "label": "main", "type": "function", "loc": [105, 118], "level": 0, "parent": null, "vector": [2, 0, 0.9139, 0.1148, 0, 0.66, 0.875, 624, 0, 0, 0, 0, 0, 0, 8], "semantic": {"name": "main", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def main():\n\tif len(sys.argv) < 3 or len(sys.argv) > 4:\n\t\tprint('Usage:')\n\t\tprint('mk_MltPhoneme.py inputfile ver (outputfilename)')\n\t\treturn\n\tinputfilename = sys.argv[1]\n\tver = sys.argv[2]\n\tif len(sys.argv) == 4:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99138:If_L106_C1", "label": "if", "type": "if", "loc": [106, 109], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99138:FunctionDef_L105_C0", "vector": [4, 1, 0.8811, 0.0328, 1, 0.94, 0.0, 0, 0, 0, 0, 0, 0, 0, 4], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tif len(sys.argv) < 3 or len(sys.argv) > 4:\n\t\tprint('Usage:')\n\t\tprint('mk_MltPhoneme.py inputfile ver (outputfilename)')\n\t\treturn"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99138:Expr_L107_C2", "label": "print()", "type": "expression", "loc": [107, 107], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99138:If_L106_C1", "vector": [8, 2, 0.877, 0.0082, 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": "\t\tprint('Usage:')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99138:Expr_L108_C2", "label": "print()", "type": "expression", "loc": [108, 108], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99138:If_L106_C1", "vector": [8, 2, 0.8852, 0.0082, 2, 0.68, 0.5, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": "\t\tprint('mk_MltPhoneme.py inputfile ver (outputfilename)')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99138:Return_L109_C2", "label": "return", "type": "return", "loc": [109, 109], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99138:If_L106_C1", "vector": [13, 2, 0.8934, 0.0082, 2, 0.68, 1.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\treturn"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99138:Assign_L110_C1", "label": "inputfilename =", "type": "assigned_variable", "loc": [110, 110], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99138:FunctionDef_L105_C0", "vector": [14, 1, 0.9016, 0.0082, 1, 0.94, 0.1667, 913, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "inputfilename", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tinputfilename = sys.argv[1]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99138:Assign_L111_C1", "label": "ver =", "type": "assigned_variable", "loc": [111, 111], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99138:FunctionDef_L105_C0", "vector": [14, 1, 0.9098, 0.0082, 1, 0.94, 0.3333, 648, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "ver", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tver = sys.argv[2]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99138:If_L112_C1", "label": "if", "type": "if", "loc": [112, 115], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99138:FunctionDef_L105_C0", "vector": [4, 1, 0.9303, 0.0328, 1, 0.94, 0.5, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tif len(sys.argv) == 4:\n\t\toutputfilename = sys.argv[3]\n\telse:\n\t\toutputfilename = inputfilename + 'mltphn'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99138:Assign_L113_C2", "label": "outputfilename =", "type": "assigned_variable", "loc": [113, 113], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99138:If_L112_C1", "vector": [14, 2, 0.9262, 0.0082, 2, 0.2, 0.0, 350, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "outputfilename", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\toutputfilename = sys.argv[3]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99138:Assign_L115_C2", "label": "outputfilename =", "type": "assigned_variable", "loc": [115, 115], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99138:If_L112_C1", "vector": [14, 2, 0.9426, 0.0082, 2, 0.2, 1.0, 350, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "outputfilename", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\toutputfilename = inputfilename + 'mltphn'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99138:Assign_L116_C1", "label": "fs = read_from_text()", "type": "assigned_variable", "loc": [116, 116], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99138:FunctionDef_L105_C0", "vector": [14, 1, 0.9508, 0.0082, 1, 0.94, 0.6667, 245, 3, 2, 0, 0, 308, 10, 1], "semantic": {"name": "fs", "arg_names": [], "import_names": [], "rhs_call_name": "read_from_text", "annotation": ""}, "snippet": "\tfs = read_from_text(inputfilename, ver)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99138:Expr_L117_C1", "label": "write_to_data_file()", "type": "expression", "loc": [117, 117], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99138:FunctionDef_L105_C0", "vector": [8, 1, 0.959, 0.0082, 1, 0.94, 0.8333, 937, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "write_to_data_file", "arg_names": [], "import_names": [], "rhs_call_name": "write_to_data_file", "annotation": ""}, "snippet": "\twrite_to_data_file(outputfilename, fs)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99138:Expr_L118_C1", "label": "print()", "type": "expression", "loc": [118, 118], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99138:FunctionDef_L105_C0", "vector": [8, 1, 0.9672, 0.0082, 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": "\tprint('OK')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99138:If_L120_C0", "label": "if", "type": "if", "loc": [120, 121], "level": 0, "parent": null, "vector": [4, 0, 0.9877, 0.0164, 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\tmain()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99138:Expr_L121_C1", "label": "main()", "type": "expression", "loc": [121, 121], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99138:If_L120_C0", "vector": [8, 1, 0.9918, 0.0082, 1, 0.7, 0.0, 624, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "main", "arg_names": [], "import_names": [], "rhs_call_name": "main", "annotation": ""}, "snippet": "\tmain()"}]
[{"f": "ajibawa-2023/Python-Code-Large/train/row_99138:FunctionDef_L12_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99138:Assign_L13_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99138:FunctionDef_L12_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99138:Assign_L15_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99138:FunctionDef_L12_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99138:Assign_L22_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99138:FunctionDef_L12_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99138:For_L23_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99138:For_L23_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99138:If_L24_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99138:If_L24_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99138:Expr_L25_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99138:For_L23_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99138:Assign_L27_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99138:For_L23_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99138:Assign_L28_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99138:For_L23_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99138:Assign_L29_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99138:For_L23_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99138:If_L30_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99138:If_L30_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99138:Assign_L31_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99138:If_L30_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99138:Assign_L33_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99138:For_L23_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99138:Assign_L35_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99138:FunctionDef_L12_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99138:Return_L36_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99138:FunctionDef_L38_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99138:FunctionDef_L39_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99138:FunctionDef_L39_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99138:Return_L43_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99138:FunctionDef_L38_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99138:Assign_L46_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99138:FunctionDef_L38_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99138:Assign_L47_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99138:FunctionDef_L38_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99138:Assign_L49_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99138:FunctionDef_L38_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99138:Assign_L52_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99138:FunctionDef_L38_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99138:Assign_L54_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99138:FunctionDef_L38_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99138:Assign_L56_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99138:FunctionDef_L38_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99138:Assign_L59_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99138:FunctionDef_L38_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99138:Expr_L60_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99138:FunctionDef_L38_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99138:Assign_L61_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99138:FunctionDef_L38_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99138:Assign_L65_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99138:FunctionDef_L38_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99138:Assign_L67_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99138:FunctionDef_L38_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99138:Assign_L69_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99138:FunctionDef_L38_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99138:FunctionDef_L77_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99138:FunctionDef_L77_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99138:Return_L78_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99138:FunctionDef_L38_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99138:FunctionDef_L79_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99138:FunctionDef_L79_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99138:Return_L80_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99138:FunctionDef_L38_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99138:FunctionDef_L81_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99138:FunctionDef_L81_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99138:Return_L82_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99138:FunctionDef_L38_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99138:Assign_L84_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99138:FunctionDef_L38_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99138:Expr_L85_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99138:FunctionDef_L38_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99138:Expr_L86_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99138:FunctionDef_L38_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99138:Expr_L87_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99138:FunctionDef_L38_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99138:Expr_L88_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99138:FunctionDef_L38_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99138:Expr_L89_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99138:FunctionDef_L38_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99138:For_L92_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99138:For_L92_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99138:Expr_L93_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99138:For_L92_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99138:Expr_L94_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99138:FunctionDef_L38_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99138:For_L96_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99138:For_L96_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99138:Expr_L98_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99138:For_L96_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99138:Expr_L99_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99138:For_L96_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99138:Expr_L100_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99138:For_L96_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99138:Expr_L101_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99138:FunctionDef_L38_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99138:Expr_L102_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99138:FunctionDef_L105_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99138:If_L106_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99138:If_L106_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99138:Expr_L107_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99138:If_L106_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99138:Expr_L108_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99138:If_L106_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99138:Return_L109_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99138:FunctionDef_L105_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99138:Assign_L110_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99138:FunctionDef_L105_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99138:Assign_L111_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99138:FunctionDef_L105_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99138:If_L112_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99138:If_L112_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99138:Assign_L113_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99138:If_L112_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99138:Assign_L115_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99138:FunctionDef_L105_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99138:Assign_L116_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99138:FunctionDef_L105_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99138:Expr_L117_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99138:FunctionDef_L105_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99138:Expr_L118_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99138:If_L120_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99138:Expr_L121_C1"}]
#!/usr/bin/env python # coding=utf-8 import os,sys import shutil projs = ('je609', 'nx005', 'nx007', 'jg500') update_cmd = r'batch\DEV_AutoUpdate.bat' getsln = lambda s:s+'.sln' getfolder = lambda s:s getbat = lambda s:s+'.bat' targets = ('Rebuild', 'Build') cfgs = ('Debug', 'Release') platforms = (r'09Light Platform (ARMV4I)', r'Windows Mobile 5.0 Pocket PC SDK (ARMV4I)', r'WS_NX005 (ARMV4I)') for n in range(4): os.system(bats[n]) os.chdir(projfolders[n]) os.system('batch\\DEV_AutoUpdate.bat') os.system('batch\\DEV_AutoUpdate.bat') os.chdir('..')
ajibawa-2023/Python-Code-Large/train/row_99139
16
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_99139:Import_L4_C0", "label": "os import os, sys", "type": "import", "loc": [4, 4], "level": 0, "parent": null, "vector": [1, 0, 0.1429, 0.0357, 0, 0.66, 0.0, 688, 0, 2, 0, 0, 688, 0, 0], "semantic": {"name": "os", "arg_names": [], "import_names": ["os", "sys"], "rhs_call_name": "", "annotation": ""}, "snippet": "import os,sys"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99139:Import_L5_C0", "label": "shutil import shutil", "type": "import", "loc": [5, 5], "level": 0, "parent": null, "vector": [1, 0, 0.1786, 0.0357, 0, 0.66, 0.1, 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_99139:Assign_L8_C0", "label": "projs =", "type": "assigned_variable", "loc": [8, 8], "level": 0, "parent": null, "vector": [14, 0, 0.2857, 0.0357, 0, 0.66, 0.2, 889, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "projs", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "projs = ('je609', 'nx005', 'nx007', 'jg500')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99139:Assign_L9_C0", "label": "update_cmd =", "type": "assigned_variable", "loc": [9, 9], "level": 0, "parent": null, "vector": [14, 0, 0.3214, 0.0357, 0, 0.66, 0.3, 683, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "update_cmd", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "update_cmd = r'batch\\DEV_AutoUpdate.bat'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99139:Assign_L11_C0", "label": "getsln =", "type": "assigned_variable", "loc": [11, 11], "level": 0, "parent": null, "vector": [14, 0, 0.3929, 0.0357, 0, 0.66, 0.4, 323, 9, 0, 0, 0, 0, 0, 0], "semantic": {"name": "getsln", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "getsln = lambda s:s+'.sln'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99139:Assign_L12_C0", "label": "getfolder =", "type": "assigned_variable", "loc": [12, 12], "level": 0, "parent": null, "vector": [14, 0, 0.4286, 0.0357, 0, 0.66, 0.5, 932, 9, 0, 0, 0, 0, 0, 0], "semantic": {"name": "getfolder", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "getfolder = lambda s:s"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99139:Assign_L13_C0", "label": "getbat =", "type": "assigned_variable", "loc": [13, 13], "level": 0, "parent": null, "vector": [14, 0, 0.4643, 0.0357, 0, 0.66, 0.6, 767, 9, 0, 0, 0, 0, 0, 0], "semantic": {"name": "getbat", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "getbat = lambda s:s+'.bat'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99139:Assign_L15_C0", "label": "targets =", "type": "assigned_variable", "loc": [15, 15], "level": 0, "parent": null, "vector": [14, 0, 0.5357, 0.0357, 0, 0.66, 0.7, 409, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "targets", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "targets = ('Rebuild', 'Build')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99139:Assign_L16_C0", "label": "cfgs =", "type": "assigned_variable", "loc": [16, 16], "level": 0, "parent": null, "vector": [14, 0, 0.5714, 0.0357, 0, 0.66, 0.8, 813, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "cfgs", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "cfgs = ('Debug', 'Release')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99139:Assign_L17_C0", "label": "platforms =", "type": "assigned_variable", "loc": [17, 19], "level": 0, "parent": null, "vector": [14, 0, 0.6429, 0.1071, 0, 0.66, 0.9, 332, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "platforms", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "platforms = (r'09Light Platform (ARMV4I)', \n\t\t\t\tr'Windows Mobile 5.0 Pocket PC SDK (ARMV4I)', \n\t\t\t\tr'WS_NX005 (ARMV4I)')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99139:For_L21_C0", "label": "for n", "type": "for", "loc": [21, 26], "level": 0, "parent": null, "vector": [6, 0, 0.8393, 0.2143, 0, 0.66, 1.0, 773, 3, 0, 0, 0, 0, 0, 6], "semantic": {"name": "n", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "for n in range(4):\n\tos.system(bats[n])\n\tos.chdir(projfolders[n])\n\tos.system('batch\\\\DEV_AutoUpdate.bat')\n\tos.system('batch\\\\DEV_AutoUpdate.bat')\n\tos.chdir('..')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99139:Expr_L22_C1", "label": "system()", "type": "expression", "loc": [22, 22], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99139:For_L21_C0", "vector": [8, 1, 0.7857, 0.0357, 1, 0.47, 0.0, 856, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "system", "arg_names": [], "import_names": [], "rhs_call_name": "system", "annotation": ""}, "snippet": "\tos.system(bats[n])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99139:Expr_L23_C1", "label": "chdir()", "type": "expression", "loc": [23, 23], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99139:For_L21_C0", "vector": [8, 1, 0.8214, 0.0357, 1, 0.47, 0.25, 122, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "chdir", "arg_names": [], "import_names": [], "rhs_call_name": "chdir", "annotation": ""}, "snippet": "\tos.chdir(projfolders[n])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99139:Expr_L24_C1", "label": "system()", "type": "expression", "loc": [24, 24], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99139:For_L21_C0", "vector": [8, 1, 0.8571, 0.0357, 1, 0.47, 0.5, 856, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "system", "arg_names": [], "import_names": [], "rhs_call_name": "system", "annotation": ""}, "snippet": "\tos.system('batch\\\\DEV_AutoUpdate.bat')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99139:Expr_L25_C1", "label": "system()", "type": "expression", "loc": [25, 25], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99139:For_L21_C0", "vector": [8, 1, 0.8929, 0.0357, 1, 0.47, 0.75, 856, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "system", "arg_names": [], "import_names": [], "rhs_call_name": "system", "annotation": ""}, "snippet": "\tos.system('batch\\\\DEV_AutoUpdate.bat')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99139:Expr_L26_C1", "label": "chdir()", "type": "expression", "loc": [26, 26], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99139:For_L21_C0", "vector": [8, 1, 0.9286, 0.0357, 1, 0.47, 1.0, 122, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "chdir", "arg_names": [], "import_names": [], "rhs_call_name": "chdir", "annotation": ""}, "snippet": "\tos.chdir('..')"}]
[{"f": "ajibawa-2023/Python-Code-Large/train/row_99139:For_L21_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99139:Expr_L22_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99139:For_L21_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99139:Expr_L23_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99139:For_L21_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99139:Expr_L24_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99139:For_L21_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99139:Expr_L25_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99139:For_L21_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99139:Expr_L26_C1"}]
#!/usr/bin/env python # coding=utf-8 import os import sys import re import codecs import pickle # set log import CheckLog log = CheckLog.get_file_log('OffsetDump.log') # the offset dump program VR_DIC_OFFSET_DUMP_TOOL = r'VrDicOffsetDump.exe' class FetchPlaceError(Exception):pass class KiwiPlace: def __init__(self, name, offset, voiceId, hasNextLevel): self._name = unicode(name) self._offset = int(offset) self._voiceId = int(voiceId) if 'Y' == hasNextLevel: hasNextLevel = True elif 'N' == hasNextLevel: hasNextLevel = False self._hasNextLevel = bool(hasNextLevel) def __getitem__(self, n): if 0 == n or 'name' == n: return self._name elif 1 == n or 'offset' == n: return self._offset elif 2 == n or 'voiceId' == n: return self._voiceId elif 3 == n or 'hasNextLevel' == n: return self._hasNextLevel else: return None def get_name(self): return self._name def get_offset(self): return self._offset def get_voiceId(self): return self._voiceId def has_next_level(self): return self._hasNextLevel class KiwiDataManager(): def __init__(self, sKiwiFilepath): self._kiwiFilepath = sKiwiFilepath self._kiwiDataTree = None self._kiwiDataTree = self._fetch_places_tree() def fetch_frame(self, *sPlaces): all_places_tree = self._kiwiDataTree if 0 == len(sPlaces): d = all_places_tree elif 1 == len(sPlaces): d = all_places_tree[sPlaces[0]][1] elif 2 == len(sPlaces): d = all_places_tree[sPlaces[0]][1][sPlaces[1]][1] elif 3 == len(sPlaces): d = all_places_tree[sPlaces[0]][1][sPlaces[1]][1][sPlaces[2]][1] else: raise KeyError() ret = () for r in d.values(): ret += r[0:1] ret += r[2:] return ret def fetch_record(self, *sPlaces): all_places_tree = self._kiwiDataTree if 1 == len(sPlaces): r = all_places_tree[sPlaces[0]] return r[0:1]+r[2:] elif 2 == len(sPlaces): r = all_places_tree[sPlaces[0]][1][sPlaces[1]] return r[0:1]+r[2:] elif 3 == len(sPlaces): r = all_places_tree[sPlaces[0]][1][sPlaces[1]][1][sPlaces[2]] return r[0:1]+r[2:] elif 4 == len(sPlaces): r = all_places_tree[sPlaces[0]][1][sPlaces[1]][1][sPlaces[2]][1][sPlaces[3]] return r[0:1]+r[2:] else: raise KeyError() def get_same_place_number(self): all_places_tree = self._kiwiDataTree if 1 == len(sPlaces): return len(all_places_tree[sPlaces[0]]) - 2 elif 2 == len(sPlaces): return len(all_places_tree[sPlaces[0]][1][sPlaces[1]]) - 2 elif 3 == len(sPlaces): return len(all_places_tree[sPlaces[0]][1][sPlaces[1]][1][sPlaces[2]]) - 2 elif 4 == len(sPlaces): return len(all_places_tree[sPlaces[0]][1][sPlaces[1]][1][sPlaces[2]][1][sPlaces[3]]) - 2 else: raise KeyError() def _fetch_frame_from_kiwi(self, sPlace1 = '', sPlace2 = '', sPlace3 = ''): ret = [] sFolder, sFn = os.path.split(self._kiwiFilepath) cmdline = '%s %s %s %s %s %s' \ % (VR_DIC_OFFSET_DUMP_TOOL, sFolder, sFn, sPlace1, sPlace2, sPlace3) (pin, pout) = os.popen4(cmdline.encode('gbk')) lines = pout.readlines() if 0 == len(lines): log.error(r'<Read Pipe Error> : %s', cmdline) raise FetchPlaceError() lines = list(line.decode('gbk') for line in lines) if lines[0].find(r'ERROR') >= 0: log.error(r'<Get Place Error> : %s %s %s : %s', \ sPlace1, sPlace2, sPlace3, lines[0]) raise FetchPlaceError() for line in lines[1:]: r = re.match(r'(.+)\t\t(\d+)\t\t(\d+)\t\t([YN])', line) if not r: log.error(r'<Get Place Error> : %s %s %s : %s', sPlace1, sPlace2, sPlace3, line) raise FetchPlaceError() ret.append(KiwiPlace(r.group(1), r.group(2), r.group(3), r.group(4))) return ret def _fetch_places_tree(self): if None != self._kiwiDataTree: return self._kiwiDataTree all_places = {} # fetch provinces for p in self._fetch_frame_from_kiwi(): if all_places.has_key(p.get_name()): log.critical(r'%s has the same province !!!', p.get_name()) raise KeyError() all_places[p.get_name()] = (p, {}) #fetch cities for provName in all_places.keys(): prov = all_places[provName][0] prov_next_frame = all_places[provName][1] for city in self._fetch_frame_from_kiwi(provName): if prov_next_frame.has_key(city.get_name()): log.critical(r'%s has the same city !!!', city.get_name()) raise KeyError() prov_next_frame[city.get_name()] = (city, {}) log.debug(r'Get cities OK') # fetch towns for provName in all_places.keys(): prov = all_places[provName][0] prov_next_frame = all_places[provName][1] for cityName in prov_next_frame.keys(): city = prov_next_frame[cityName][0] city_next_frame = prov_next_frame[cityName][1] if city.has_next_level(): log.debug(r'Get towns of city - %s, city - %s', provName, cityName) for town in self._fetch_frame_from_kiwi(provName, cityName): if city_next_frame.has_key(town.get_name()): log.debug(r'%s has the same town/road !!', town.get_name()) city_next_frame[town.get_name()] += (town,) continue city_next_frame[town.get_name()] = (town, {}) # fetch roads for provName in all_places.keys(): prov = all_places[provName][0] prov_next_frame = all_places[provName][1] for cityName in prov_next_frame.keys(): city = prov_next_frame[cityName][0] city_next_level_frame = prov_next_frame[cityName][1] for townName in city_next_level_frame.keys(): town = city_next_level_frame[townName][0] town_next_frame = city_next_level_frame[townName][1] if town.has_next_level(): log.debug(r'Get roads of town - %s, city - %s, town - %s', provName, cityName, townName) for road in self._fetch_frame_from_kiwi(provName, cityName, townName): if town_next_frame.has_key(road.get_name()): log.debug(r'%s has the same name road !', road.get_name()) town_next_frame[road.get_name()] += (road,) continue town_next_frame[road.get_name()] = (road, {}) self._kiwiDataTree = all_places return self._kiwiDataTree def write_all_to_file(self, sFilename): all_places = self._fetch_places_tree() f = codecs.open(sFilename, 'w', encoding='utf-8') for provName in all_places.keys(): prov = all_places[provName][0] f.write( '%s\t\t%d\t\t%d\t\t%s \n' % (prov.get_name(), prov.get_offset(), prov.get_voiceId(), prov.has_next_level())) prov_next_frame = all_places[provName][1] for cityName in prov_next_frame.keys(): city = prov_next_frame[cityName][0] f.write( '\t%s\t\t%d\t\t%d\t\t%s \n' % (city.get_name(), city.get_offset(), city.get_voiceId(), city.has_next_level())) city_next_level_frame = prov_next_frame[cityName][1] for townName in city_next_level_frame.keys(): town = city_next_level_frame[townName][0] f.write( '\t\t%s\t\t%d\t\t%d\t\t%s \n' % (town.get_name(), town.get_offset(), town.get_voiceId(), town.has_next_level())) town_next_frame = city_next_level_frame[townName][1] for roadName in town_next_frame.keys(): road = town_next_frame[roadName][0] f.write( '\t\t\t%s\t\t%d\t\t%d\t\t%s \n' % (road.get_name(), road.get_offset(), road.get_voiceId(), road.has_next_level())) def main(): # parse parameters if len(sys.argv) != 3: print('Usage:') print('OffsetDump.py [Kiwi Index File Path] [output file]') sys.exit(0) kiwiFilePath = sys.argv[1] sOutFilename = sys.argv[2] # get places from KIWI kdm = KiwiDataManager(kiwiFilePath) # write to file kdm.write_all_to_file(sOutFilename) print("Dump all OK") if __name__ == '__main__': main()
ajibawa-2023/Python-Code-Large/train/row_99140
171
232
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_99140:Import_L4_C0", "label": "os import os", "type": "import", "loc": [4, 4], "level": 0, "parent": null, "vector": [1, 0, 0.0172, 0.0043, 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_99140:Import_L5_C0", "label": "sys import sys", "type": "import", "loc": [5, 5], "level": 0, "parent": null, "vector": [1, 0, 0.0216, 0.0043, 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_99140:Import_L6_C0", "label": "re import re", "type": "import", "loc": [6, 6], "level": 0, "parent": null, "vector": [1, 0, 0.0259, 0.0043, 0, 0.66, 0.1667, 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_99140:Import_L7_C0", "label": "codecs import codecs", "type": "import", "loc": [7, 7], "level": 0, "parent": null, "vector": [1, 0, 0.0302, 0.0043, 0, 0.66, 0.25, 220, 0, 1, 0, 0, 220, 0, 0], "semantic": {"name": "codecs", "arg_names": [], "import_names": ["codecs"], "rhs_call_name": "", "annotation": ""}, "snippet": "import codecs"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99140:Import_L8_C0", "label": "pickle import pickle", "type": "import", "loc": [8, 8], "level": 0, "parent": null, "vector": [1, 0, 0.0345, 0.0043, 0, 0.66, 0.3333, 848, 0, 1, 0, 0, 848, 0, 0], "semantic": {"name": "pickle", "arg_names": [], "import_names": ["pickle"], "rhs_call_name": "", "annotation": ""}, "snippet": "import pickle"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99140:Import_L11_C0", "label": "CheckLog import CheckLog", "type": "import", "loc": [11, 11], "level": 0, "parent": null, "vector": [1, 0, 0.0474, 0.0043, 0, 0.66, 0.4167, 11, 0, 1, 0, 0, 11, 0, 0], "semantic": {"name": "CheckLog", "arg_names": [], "import_names": ["CheckLog"], "rhs_call_name": "", "annotation": ""}, "snippet": "import CheckLog"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99140:Assign_L12_C0", "label": "log = get_file_log()", "type": "assigned_variable", "loc": [12, 12], "level": 0, "parent": null, "vector": [14, 0, 0.0517, 0.0043, 0, 0.66, 0.5, 432, 3, 1, 0, 0, 730, 10, 1], "semantic": {"name": "log", "arg_names": [], "import_names": [], "rhs_call_name": "get_file_log", "annotation": ""}, "snippet": "log = CheckLog.get_file_log('OffsetDump.log')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99140:Assign_L15_C0", "label": "VR_DIC_OFFSET_DUMP_TOOL =", "type": "assigned_variable", "loc": [15, 15], "level": 0, "parent": null, "vector": [14, 0, 0.0647, 0.0043, 0, 0.66, 0.5833, 27, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "VR_DIC_OFFSET_DUMP_TOOL", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "VR_DIC_OFFSET_DUMP_TOOL = r'VrDicOffsetDump.exe'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99140:ClassDef_L18_C0", "label": "FetchPlaceError", "type": "class", "loc": [18, 18], "level": 0, "parent": null, "vector": [3, 0, 0.0776, 0.0043, 0, 0.66, 0.6667, 816, 0, 0, 0, 0, 645, 0, 0], "semantic": {"name": "FetchPlaceError", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class FetchPlaceError(Exception):pass"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99140:ClassDef_L21_C0", "label": "KiwiPlace", "type": "class", "loc": [21, 54], "level": 0, "parent": null, "vector": [3, 0, 0.1616, 0.1466, 0, 0.66, 0.75, 603, 0, 6, 0, 0, 0, 0, 4], "semantic": {"name": "KiwiPlace", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class KiwiPlace:\n\tdef __init__(self, name, offset, voiceId, hasNextLevel):\n\t\tself._name = unicode(name)\n\t\tself._offset = int(offset)\n\t\tself._voiceId = int(voiceId)\n\t\tif 'Y' == hasNextLevel:\n\t\t\thasNextLevel = True\n\t\telif 'N' == hasNextLevel:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99140:FunctionDef_L22_C1", "label": "__init__", "type": "function", "loc": [22, 30], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99140:ClassDef_L21_C0", "vector": [2, 1, 0.1121, 0.0388, 1, 0.99, 0.0, 555, 0, 5, 0, 0, 0, 0, 4], "semantic": {"name": "__init__", "arg_names": ["self", "name", "offset", "voiceId", "hasNextLevel"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tdef __init__(self, name, offset, voiceId, hasNextLevel):\n\t\tself._name = unicode(name)\n\t\tself._offset = int(offset)\n\t\tself._voiceId = int(voiceId)\n\t\tif 'Y' == hasNextLevel:\n\t\t\thasNextLevel = True\n\t\telif 'N' == hasNextLevel:\n\t\t\thasNextLevel = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99140:Assign_L23_C2", "label": "self._name = unicode()", "type": "assigned_variable", "loc": [23, 23], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99140:FunctionDef_L22_C1", "vector": [14, 2, 0.0991, 0.0043, 2, 0.06, 0.0, 257, 3, 1, 0, 0, 733, 10, 1], "semantic": {"name": "self._name", "arg_names": [], "import_names": [], "rhs_call_name": "unicode", "annotation": ""}, "snippet": "\t\tself._name = unicode(name)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99140:Assign_L24_C2", "label": "self._offset = int()", "type": "assigned_variable", "loc": [24, 24], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99140:FunctionDef_L22_C1", "vector": [14, 2, 0.1034, 0.0043, 2, 0.06, 0.25, 914, 3, 1, 0, 0, 901, 10, 1], "semantic": {"name": "self._offset", "arg_names": [], "import_names": [], "rhs_call_name": "int", "annotation": ""}, "snippet": "\t\tself._offset = int(offset)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99140:Assign_L25_C2", "label": "self._voiceId = int()", "type": "assigned_variable", "loc": [25, 25], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99140:FunctionDef_L22_C1", "vector": [14, 2, 0.1078, 0.0043, 2, 0.06, 0.5, 728, 3, 1, 0, 0, 901, 10, 1], "semantic": {"name": "self._voiceId", "arg_names": [], "import_names": [], "rhs_call_name": "int", "annotation": ""}, "snippet": "\t\tself._voiceId = int(voiceId)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99140:If_L26_C2", "label": "if", "type": "if", "loc": [26, 29], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99140:FunctionDef_L22_C1", "vector": [4, 2, 0.1185, 0.0172, 2, 0.06, 0.75, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tif 'Y' == hasNextLevel:\n\t\t\thasNextLevel = True\n\t\telif 'N' == hasNextLevel:\n\t\t\thasNextLevel = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99140:Assign_L27_C3", "label": "hasNextLevel =", "type": "assigned_variable", "loc": [27, 27], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99140:If_L26_C2", "vector": [14, 3, 0.1164, 0.0043, 3, 0.89, 0.0, 447, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "hasNextLevel", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\thasNextLevel = True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99140:If_L28_C2", "label": "if", "type": "if", "loc": [28, 29], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99140:If_L26_C2", "vector": [4, 3, 0.1228, 0.0086, 3, 0.89, 1.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\telif 'N' == hasNextLevel:\n\t\t\thasNextLevel = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99140:Assign_L29_C3", "label": "hasNextLevel =", "type": "assigned_variable", "loc": [29, 29], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99140:If_L28_C2", "vector": [14, 4, 0.125, 0.0043, 4, 0.1, 0.0, 447, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "hasNextLevel", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\thasNextLevel = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99140:Assign_L30_C2", "label": "self._hasNextLevel = bool()", "type": "assigned_variable", "loc": [30, 30], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99140:FunctionDef_L22_C1", "vector": [14, 2, 0.1293, 0.0043, 2, 0.06, 1.0, 7, 3, 1, 0, 0, 337, 10, 1], "semantic": {"name": "self._hasNextLevel", "arg_names": [], "import_names": [], "rhs_call_name": "bool", "annotation": ""}, "snippet": "\t\tself._hasNextLevel = bool(hasNextLevel)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99140:FunctionDef_L32_C1", "label": "__getitem__", "type": "function", "loc": [32, 42], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99140:ClassDef_L21_C0", "vector": [2, 1, 0.1595, 0.0474, 1, 0.99, 0.2, 698, 0, 2, 1, 0, 0, 0, 0], "semantic": {"name": "__getitem__", "arg_names": ["self", "n"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tdef __getitem__(self, n):\n\t\tif 0 == n or 'name' == n:\n\t\t\treturn self._name\n\t\telif 1 == n or 'offset' == n:\n\t\t\treturn self._offset\n\t\telif 2 == n or 'voiceId' == n:\n\t\t\treturn self._voiceId\n\t\telif 3 == n or 'hasNextLevel' == n:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99140:If_L33_C2", "label": "if", "type": "if", "loc": [33, 42], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99140:FunctionDef_L32_C1", "vector": [4, 2, 0.1616, 0.0431, 2, 0.67, 0.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tif 0 == n or 'name' == n:\n\t\t\treturn self._name\n\t\telif 1 == n or 'offset' == n:\n\t\t\treturn self._offset\n\t\telif 2 == n or 'voiceId' == n:\n\t\t\treturn self._voiceId\n\t\telif 3 == n or 'hasNextLevel' == n:\n\t\t\treturn self._hasNextLevel"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99140:Return_L34_C3", "label": "return", "type": "return", "loc": [34, 34], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99140:If_L33_C2", "vector": [13, 3, 0.1466, 0.0043, 3, 0.0, 0.0, 0, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\treturn self._name"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99140:If_L35_C2", "label": "if", "type": "if", "loc": [35, 42], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99140:If_L33_C2", "vector": [4, 3, 0.1659, 0.0345, 3, 0.0, 1.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\telif 1 == n or 'offset' == n:\n\t\t\treturn self._offset\n\t\telif 2 == n or 'voiceId' == n:\n\t\t\treturn self._voiceId\n\t\telif 3 == n or 'hasNextLevel' == n:\n\t\t\treturn self._hasNextLevel\n\t\telse:\n\t\t\treturn None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99140:Return_L36_C3", "label": "return", "type": "return", "loc": [36, 36], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99140:If_L35_C2", "vector": [13, 4, 0.1552, 0.0043, 4, 0.84, 0.0, 0, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\treturn self._offset"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99140:If_L37_C2", "label": "if", "type": "if", "loc": [37, 42], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99140:If_L35_C2", "vector": [4, 4, 0.1703, 0.0259, 4, 0.84, 1.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\telif 2 == n or 'voiceId' == n:\n\t\t\treturn self._voiceId\n\t\telif 3 == n or 'hasNextLevel' == n:\n\t\t\treturn self._hasNextLevel\n\t\telse:\n\t\t\treturn None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99140:Return_L38_C3", "label": "return", "type": "return", "loc": [38, 38], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99140:If_L37_C2", "vector": [13, 5, 0.1638, 0.0043, 5, 0.46, 0.0, 0, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\treturn self._voiceId"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99140:If_L39_C2", "label": "if", "type": "if", "loc": [39, 42], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99140:If_L37_C2", "vector": [4, 5, 0.1746, 0.0172, 5, 0.46, 1.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\telif 3 == n or 'hasNextLevel' == n:\n\t\t\treturn self._hasNextLevel\n\t\telse:\n\t\t\treturn None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99140:Return_L40_C3", "label": "return", "type": "return", "loc": [40, 40], "level": 6, "parent": "ajibawa-2023/Python-Code-Large/train/row_99140:If_L39_C2", "vector": [13, 6, 0.1724, 0.0043, 6, 0.03, 0.0, 0, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\treturn self._hasNextLevel"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99140:Return_L42_C3", "label": "return", "type": "return", "loc": [42, 42], "level": 6, "parent": "ajibawa-2023/Python-Code-Large/train/row_99140:If_L39_C2", "vector": [13, 6, 0.181, 0.0043, 6, 0.03, 1.0, 0, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\treturn None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99140:FunctionDef_L44_C1", "label": "get_name", "type": "function", "loc": [44, 45], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99140:ClassDef_L21_C0", "vector": [2, 1, 0.1918, 0.0086, 1, 0.99, 0.4, 770, 0, 1, 1, 0, 0, 0, 0], "semantic": {"name": "get_name", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tdef get_name(self):\n\t\treturn self._name"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99140:Return_L45_C2", "label": "return", "type": "return", "loc": [45, 45], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99140:FunctionDef_L44_C1", "vector": [13, 2, 0.194, 0.0043, 2, 0.21, 0.0, 0, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\treturn self._name"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99140:FunctionDef_L47_C1", "label": "get_offset", "type": "function", "loc": [47, 48], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99140:ClassDef_L21_C0", "vector": [2, 1, 0.2047, 0.0086, 1, 0.99, 0.6, 428, 0, 1, 1, 0, 0, 0, 0], "semantic": {"name": "get_offset", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tdef get_offset(self):\n\t\treturn self._offset"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99140:Return_L48_C2", "label": "return", "type": "return", "loc": [48, 48], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99140:FunctionDef_L47_C1", "vector": [13, 2, 0.2069, 0.0043, 2, 0.94, 0.0, 0, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\treturn self._offset"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99140:FunctionDef_L50_C1", "label": "get_voiceId", "type": "function", "loc": [50, 51], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99140:ClassDef_L21_C0", "vector": [2, 1, 0.2177, 0.0086, 1, 0.99, 0.8, 433, 0, 1, 1, 0, 0, 0, 0], "semantic": {"name": "get_voiceId", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tdef get_voiceId(self):\n\t\treturn self._voiceId"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99140:Return_L51_C2", "label": "return", "type": "return", "loc": [51, 51], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99140:FunctionDef_L50_C1", "vector": [13, 2, 0.2198, 0.0043, 2, 0.65, 0.0, 0, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\treturn self._voiceId"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99140:FunctionDef_L53_C1", "label": "has_next_level", "type": "function", "loc": [53, 54], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99140:ClassDef_L21_C0", "vector": [2, 1, 0.2306, 0.0086, 1, 0.99, 1.0, 194, 0, 1, 1, 0, 0, 0, 0], "semantic": {"name": "has_next_level", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tdef has_next_level(self):\n\t\treturn self._hasNextLevel\t"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99140:Return_L54_C2", "label": "return", "type": "return", "loc": [54, 54], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99140:FunctionDef_L53_C1", "vector": [13, 2, 0.2328, 0.0043, 2, 0.65, 0.0, 0, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\treturn self._hasNextLevel\t"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99140:ClassDef_L57_C0", "label": "KiwiDataManager", "type": "class", "loc": [57, 212], "level": 0, "parent": null, "vector": [3, 0, 0.5797, 0.6724, 0, 0.66, 0.8333, 240, 0, 7, 0, 0, 0, 0, 99], "semantic": {"name": "KiwiDataManager", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class KiwiDataManager():\n\tdef __init__(self, sKiwiFilepath):\n\t\tself._kiwiFilepath = sKiwiFilepath\n\t\tself._kiwiDataTree = None\n\t\tself._kiwiDataTree = self._fetch_places_tree()\n\t\n\tdef fetch_frame(self, *sPlaces):\n\t\tall_places_tree = self._kiwiDataTree"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99140:FunctionDef_L58_C1", "label": "__init__", "type": "function", "loc": [58, 61], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99140:ClassDef_L57_C0", "vector": [2, 1, 0.2565, 0.0172, 1, 0.61, 0.0, 555, 0, 2, 0, 0, 0, 0, 1], "semantic": {"name": "__init__", "arg_names": ["self", "sKiwiFilepath"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tdef __init__(self, sKiwiFilepath):\n\t\tself._kiwiFilepath = sKiwiFilepath\n\t\tself._kiwiDataTree = None\n\t\tself._kiwiDataTree = self._fetch_places_tree()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99140:Assign_L59_C2", "label": "self._kiwiFilepath =", "type": "assigned_variable", "loc": [59, 59], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99140:FunctionDef_L58_C1", "vector": [14, 2, 0.2543, 0.0043, 2, 0.43, 0.0, 830, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self._kiwiFilepath", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tself._kiwiFilepath = sKiwiFilepath"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99140:Assign_L60_C2", "label": "self._kiwiDataTree =", "type": "assigned_variable", "loc": [60, 60], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99140:FunctionDef_L58_C1", "vector": [14, 2, 0.2586, 0.0043, 2, 0.43, 0.5, 577, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "self._kiwiDataTree", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tself._kiwiDataTree = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99140:Assign_L61_C2", "label": "self._kiwiDataTree = _fetch_places_tree()", "type": "assigned_variable", "loc": [61, 61], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99140:FunctionDef_L58_C1", "vector": [14, 2, 0.2629, 0.0043, 2, 0.43, 1.0, 577, 3, 0, 0, 0, 818, 10, 1], "semantic": {"name": "self._kiwiDataTree", "arg_names": [], "import_names": [], "rhs_call_name": "_fetch_places_tree", "annotation": ""}, "snippet": "\t\tself._kiwiDataTree = self._fetch_places_tree()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99140:FunctionDef_L63_C1", "label": "fetch_frame", "type": "function", "loc": [63, 79], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99140:ClassDef_L57_C0", "vector": [2, 1, 0.306, 0.0733, 1, 0.61, 0.1667, 254, 0, 2, 1, 0, 0, 0, 6], "semantic": {"name": "fetch_frame", "arg_names": ["self", "sPlaces"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tdef fetch_frame(self, *sPlaces):\n\t\tall_places_tree = self._kiwiDataTree\n\t\tif 0 == len(sPlaces):\n\t\t\td = all_places_tree\n\t\telif 1 == len(sPlaces):\n\t\t\td = all_places_tree[sPlaces[0]][1]\n\t\telif 2 == len(sPlaces):\n\t\t\td = all_places_tree[sPlaces[0]][1][sPlaces[1]][1]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99140:Assign_L64_C2", "label": "all_places_tree =", "type": "assigned_variable", "loc": [64, 64], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99140:FunctionDef_L63_C1", "vector": [14, 2, 0.2759, 0.0043, 2, 0.25, 0.0, 634, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "all_places_tree", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tall_places_tree = self._kiwiDataTree"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99140:If_L65_C2", "label": "if", "type": "if", "loc": [65, 74], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99140:FunctionDef_L63_C1", "vector": [4, 2, 0.2996, 0.0431, 2, 0.25, 0.25, 0, 0, 0, 0, 0, 0, 0, 5], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tif 0 == len(sPlaces):\n\t\t\td = all_places_tree\n\t\telif 1 == len(sPlaces):\n\t\t\td = all_places_tree[sPlaces[0]][1]\n\t\telif 2 == len(sPlaces):\n\t\t\td = all_places_tree[sPlaces[0]][1][sPlaces[1]][1]\n\t\telif 3 == len(sPlaces):\n\t\t\td = all_places_tree[sPlaces[0]][1][sPlaces[1]][1][sPlaces[2]][1]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99140:Assign_L66_C3", "label": "d =", "type": "assigned_variable", "loc": [66, 66], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99140:If_L65_C2", "vector": [14, 3, 0.2845, 0.0043, 3, 0.45, 0.0, 355, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "d", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\td = all_places_tree"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99140:If_L67_C2", "label": "if", "type": "if", "loc": [67, 74], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99140:If_L65_C2", "vector": [4, 3, 0.3039, 0.0345, 3, 0.45, 1.0, 0, 0, 0, 0, 0, 0, 0, 4], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\telif 1 == len(sPlaces):\n\t\t\td = all_places_tree[sPlaces[0]][1]\n\t\telif 2 == len(sPlaces):\n\t\t\td = all_places_tree[sPlaces[0]][1][sPlaces[1]][1]\n\t\telif 3 == len(sPlaces):\n\t\t\td = all_places_tree[sPlaces[0]][1][sPlaces[1]][1][sPlaces[2]][1]\n\t\telse: \n\t\t\traise KeyError()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99140:Assign_L68_C3", "label": "d =", "type": "assigned_variable", "loc": [68, 68], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99140:If_L67_C2", "vector": [14, 4, 0.2931, 0.0043, 4, 0.98, 0.0, 355, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "d", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\td = all_places_tree[sPlaces[0]][1]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99140:If_L69_C2", "label": "if", "type": "if", "loc": [69, 74], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99140:If_L67_C2", "vector": [4, 4, 0.3082, 0.0259, 4, 0.98, 1.0, 0, 0, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\telif 2 == len(sPlaces):\n\t\t\td = all_places_tree[sPlaces[0]][1][sPlaces[1]][1]\n\t\telif 3 == len(sPlaces):\n\t\t\td = all_places_tree[sPlaces[0]][1][sPlaces[1]][1][sPlaces[2]][1]\n\t\telse: \n\t\t\traise KeyError()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99140:Assign_L70_C3", "label": "d =", "type": "assigned_variable", "loc": [70, 70], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99140:If_L69_C2", "vector": [14, 5, 0.3017, 0.0043, 5, 0.13, 0.0, 355, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "d", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\td = all_places_tree[sPlaces[0]][1][sPlaces[1]][1]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99140:If_L71_C2", "label": "if", "type": "if", "loc": [71, 74], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99140:If_L69_C2", "vector": [4, 5, 0.3125, 0.0172, 5, 0.13, 1.0, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\telif 3 == len(sPlaces):\n\t\t\td = all_places_tree[sPlaces[0]][1][sPlaces[1]][1][sPlaces[2]][1]\n\t\telse: \n\t\t\traise KeyError()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99140:Assign_L72_C3", "label": "d =", "type": "assigned_variable", "loc": [72, 72], "level": 6, "parent": "ajibawa-2023/Python-Code-Large/train/row_99140:If_L71_C2", "vector": [14, 6, 0.3103, 0.0043, 6, 0.39, 0.0, 355, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "d", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\td = all_places_tree[sPlaces[0]][1][sPlaces[1]][1][sPlaces[2]][1]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99140:Assign_L75_C2", "label": "ret =", "type": "assigned_variable", "loc": [75, 75], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99140:FunctionDef_L63_C1", "vector": [14, 2, 0.3233, 0.0043, 2, 0.25, 0.5, 501, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "ret", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tret = ()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99140:For_L76_C2", "label": "for r", "type": "for", "loc": [76, 78], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99140:FunctionDef_L63_C1", "vector": [6, 2, 0.3319, 0.0129, 2, 0.25, 0.75, 436, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "r", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tfor r in d.values():\n\t\t\tret += r[0:1]\n\t\t\tret += r[2:]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99140:Return_L79_C2", "label": "return", "type": "return", "loc": [79, 79], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99140:FunctionDef_L63_C1", "vector": [13, 2, 0.3405, 0.0043, 2, 0.25, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\treturn ret"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99140:FunctionDef_L81_C1", "label": "fetch_record", "type": "function", "loc": [81, 96], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99140:ClassDef_L57_C0", "vector": [2, 1, 0.3815, 0.069, 1, 0.61, 0.3333, 660, 0, 2, 1, 0, 0, 0, 5], "semantic": {"name": "fetch_record", "arg_names": ["self", "sPlaces"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tdef fetch_record(self, *sPlaces):\n\t\tall_places_tree = self._kiwiDataTree\n\t\tif 1 == len(sPlaces):\n\t\t\tr = all_places_tree[sPlaces[0]]\n\t\t\treturn r[0:1]+r[2:]\n\t\telif 2 == len(sPlaces):\n\t\t\tr = all_places_tree[sPlaces[0]][1][sPlaces[1]]\n\t\t\treturn r[0:1]+r[2:]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99140:Assign_L82_C2", "label": "all_places_tree =", "type": "assigned_variable", "loc": [82, 82], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99140:FunctionDef_L81_C1", "vector": [14, 2, 0.3534, 0.0043, 2, 0.64, 0.0, 634, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "all_places_tree", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tall_places_tree = self._kiwiDataTree"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99140:If_L83_C2", "label": "if", "type": "if", "loc": [83, 96], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99140:FunctionDef_L81_C1", "vector": [4, 2, 0.3858, 0.0603, 2, 0.64, 1.0, 0, 0, 0, 0, 0, 0, 0, 5], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tif 1 == len(sPlaces):\n\t\t\tr = all_places_tree[sPlaces[0]]\n\t\t\treturn r[0:1]+r[2:]\n\t\telif 2 == len(sPlaces):\n\t\t\tr = all_places_tree[sPlaces[0]][1][sPlaces[1]]\n\t\t\treturn r[0:1]+r[2:]\n\t\telif 3 == len(sPlaces):\n\t\t\tr = all_places_tree[sPlaces[0]][1][sPlaces[1]][1][sPlaces[2]]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99140:Assign_L84_C3", "label": "r =", "type": "assigned_variable", "loc": [84, 84], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99140:If_L83_C2", "vector": [14, 3, 0.3621, 0.0043, 3, 0.04, 0.0, 436, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "r", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\tr = all_places_tree[sPlaces[0]]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99140:Return_L85_C3", "label": "return", "type": "return", "loc": [85, 85], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99140:If_L83_C2", "vector": [13, 3, 0.3664, 0.0043, 3, 0.04, 0.5, 0, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\treturn r[0:1]+r[2:]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99140:If_L86_C2", "label": "if", "type": "if", "loc": [86, 96], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99140:If_L83_C2", "vector": [4, 3, 0.3922, 0.0474, 3, 0.04, 1.0, 0, 0, 0, 0, 0, 0, 0, 4], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\telif 2 == len(sPlaces):\n\t\t\tr = all_places_tree[sPlaces[0]][1][sPlaces[1]]\n\t\t\treturn r[0:1]+r[2:]\n\t\telif 3 == len(sPlaces):\n\t\t\tr = all_places_tree[sPlaces[0]][1][sPlaces[1]][1][sPlaces[2]]\n\t\t\treturn r[0:1]+r[2:]\n\t\telif 4 == len(sPlaces):\n\t\t\tr = all_places_tree[sPlaces[0]][1][sPlaces[1]][1][sPlaces[2]][1][sPlaces[3]]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99140:Assign_L87_C3", "label": "r =", "type": "assigned_variable", "loc": [87, 87], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99140:If_L86_C2", "vector": [14, 4, 0.375, 0.0043, 4, 0.15, 0.0, 436, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "r", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\tr = all_places_tree[sPlaces[0]][1][sPlaces[1]]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99140:Return_L88_C3", "label": "return", "type": "return", "loc": [88, 88], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99140:If_L86_C2", "vector": [13, 4, 0.3793, 0.0043, 4, 0.15, 0.5, 0, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\treturn r[0:1]+r[2:]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99140:If_L89_C2", "label": "if", "type": "if", "loc": [89, 96], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99140:If_L86_C2", "vector": [4, 4, 0.3987, 0.0345, 4, 0.15, 1.0, 0, 0, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\telif 3 == len(sPlaces):\n\t\t\tr = all_places_tree[sPlaces[0]][1][sPlaces[1]][1][sPlaces[2]]\n\t\t\treturn r[0:1]+r[2:]\n\t\telif 4 == len(sPlaces):\n\t\t\tr = all_places_tree[sPlaces[0]][1][sPlaces[1]][1][sPlaces[2]][1][sPlaces[3]]\n\t\t\treturn r[0:1]+r[2:]\n\t\telse: \n\t\t\traise KeyError()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99140:Assign_L90_C3", "label": "r =", "type": "assigned_variable", "loc": [90, 90], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99140:If_L89_C2", "vector": [14, 5, 0.3879, 0.0043, 5, 0.23, 0.0, 436, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "r", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\tr = all_places_tree[sPlaces[0]][1][sPlaces[1]][1][sPlaces[2]]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99140:Return_L91_C3", "label": "return", "type": "return", "loc": [91, 91], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99140:If_L89_C2", "vector": [13, 5, 0.3922, 0.0043, 5, 0.23, 0.5, 0, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\treturn r[0:1]+r[2:]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99140:If_L92_C2", "label": "if", "type": "if", "loc": [92, 96], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99140:If_L89_C2", "vector": [4, 5, 0.4052, 0.0216, 5, 0.23, 1.0, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\telif 4 == len(sPlaces):\n\t\t\tr = all_places_tree[sPlaces[0]][1][sPlaces[1]][1][sPlaces[2]][1][sPlaces[3]]\n\t\t\treturn r[0:1]+r[2:]\n\t\telse: \n\t\t\traise KeyError()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99140:Assign_L93_C3", "label": "r =", "type": "assigned_variable", "loc": [93, 93], "level": 6, "parent": "ajibawa-2023/Python-Code-Large/train/row_99140:If_L92_C2", "vector": [14, 6, 0.4009, 0.0043, 6, 0.17, 0.0, 436, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "r", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\tr = all_places_tree[sPlaces[0]][1][sPlaces[1]][1][sPlaces[2]][1][sPlaces[3]]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99140:Return_L94_C3", "label": "return", "type": "return", "loc": [94, 94], "level": 6, "parent": "ajibawa-2023/Python-Code-Large/train/row_99140:If_L92_C2", "vector": [13, 6, 0.4052, 0.0043, 6, 0.17, 1.0, 0, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\treturn r[0:1]+r[2:]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99140:FunctionDef_L98_C1", "label": "get_same_place_number", "type": "function", "loc": [98, 109], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99140:ClassDef_L57_C0", "vector": [2, 1, 0.4461, 0.0517, 1, 0.61, 0.5, 729, 0, 1, 1, 0, 0, 0, 9], "semantic": {"name": "get_same_place_number", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tdef get_same_place_number(self):\n\t\tall_places_tree = self._kiwiDataTree\n\t\tif 1 == len(sPlaces):\n\t\t\treturn len(all_places_tree[sPlaces[0]]) - 2\n\t\telif 2 == len(sPlaces):\n\t\t\treturn len(all_places_tree[sPlaces[0]][1][sPlaces[1]]) - 2\n\t\telif 3 == len(sPlaces):\n\t\t\treturn len(all_places_tree[sPlaces[0]][1][sPlaces[1]][1][sPlaces[2]]) - 2"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99140:Assign_L99_C2", "label": "all_places_tree =", "type": "assigned_variable", "loc": [99, 99], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99140:FunctionDef_L98_C1", "vector": [14, 2, 0.4267, 0.0043, 2, 0.24, 0.0, 634, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "all_places_tree", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tall_places_tree = self._kiwiDataTree"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99140:If_L100_C2", "label": "if", "type": "if", "loc": [100, 109], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99140:FunctionDef_L98_C1", "vector": [4, 2, 0.4504, 0.0431, 2, 0.24, 1.0, 0, 0, 0, 0, 0, 0, 0, 9], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tif 1 == len(sPlaces):\n\t\t\treturn len(all_places_tree[sPlaces[0]]) - 2\n\t\telif 2 == len(sPlaces):\n\t\t\treturn len(all_places_tree[sPlaces[0]][1][sPlaces[1]]) - 2\n\t\telif 3 == len(sPlaces):\n\t\t\treturn len(all_places_tree[sPlaces[0]][1][sPlaces[1]][1][sPlaces[2]]) - 2\n\t\telif 4 == len(sPlaces):\n\t\t\treturn len(all_places_tree[sPlaces[0]][1][sPlaces[1]][1][sPlaces[2]][1][sPlaces[3]]) - 2"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99140:Return_L101_C3", "label": "return", "type": "return", "loc": [101, 101], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99140:If_L100_C2", "vector": [13, 3, 0.4353, 0.0043, 3, 0.24, 0.0, 0, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\treturn len(all_places_tree[sPlaces[0]]) - 2"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99140:If_L102_C2", "label": "if", "type": "if", "loc": [102, 109], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99140:If_L100_C2", "vector": [4, 3, 0.4547, 0.0345, 3, 0.24, 1.0, 0, 0, 0, 0, 0, 0, 0, 7], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\telif 2 == len(sPlaces):\n\t\t\treturn len(all_places_tree[sPlaces[0]][1][sPlaces[1]]) - 2\n\t\telif 3 == len(sPlaces):\n\t\t\treturn len(all_places_tree[sPlaces[0]][1][sPlaces[1]][1][sPlaces[2]]) - 2\n\t\telif 4 == len(sPlaces):\n\t\t\treturn len(all_places_tree[sPlaces[0]][1][sPlaces[1]][1][sPlaces[2]][1][sPlaces[3]]) - 2\n\t\telse: \n\t\t\traise KeyError()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99140:Return_L103_C3", "label": "return", "type": "return", "loc": [103, 103], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99140:If_L102_C2", "vector": [13, 4, 0.444, 0.0043, 4, 0.6, 0.0, 0, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\treturn len(all_places_tree[sPlaces[0]][1][sPlaces[1]]) - 2"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99140:If_L104_C2", "label": "if", "type": "if", "loc": [104, 109], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99140:If_L102_C2", "vector": [4, 4, 0.4591, 0.0259, 4, 0.6, 1.0, 0, 0, 0, 0, 0, 0, 0, 5], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\telif 3 == len(sPlaces):\n\t\t\treturn len(all_places_tree[sPlaces[0]][1][sPlaces[1]][1][sPlaces[2]]) - 2\n\t\telif 4 == len(sPlaces):\n\t\t\treturn len(all_places_tree[sPlaces[0]][1][sPlaces[1]][1][sPlaces[2]][1][sPlaces[3]]) - 2\n\t\telse: \n\t\t\traise KeyError()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99140:Return_L105_C3", "label": "return", "type": "return", "loc": [105, 105], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99140:If_L104_C2", "vector": [13, 5, 0.4526, 0.0043, 5, 0.14, 0.0, 0, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\treturn len(all_places_tree[sPlaces[0]][1][sPlaces[1]][1][sPlaces[2]]) - 2"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99140:If_L106_C2", "label": "if", "type": "if", "loc": [106, 109], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99140:If_L104_C2", "vector": [4, 5, 0.4634, 0.0172, 5, 0.14, 1.0, 0, 0, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\telif 4 == len(sPlaces):\n\t\t\treturn len(all_places_tree[sPlaces[0]][1][sPlaces[1]][1][sPlaces[2]][1][sPlaces[3]]) - 2\n\t\telse: \n\t\t\traise KeyError()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99140:Return_L107_C3", "label": "return", "type": "return", "loc": [107, 107], "level": 6, "parent": "ajibawa-2023/Python-Code-Large/train/row_99140:If_L106_C2", "vector": [13, 6, 0.4612, 0.0043, 6, 0.81, 0.0, 0, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\treturn len(all_places_tree[sPlaces[0]][1][sPlaces[1]][1][sPlaces[2]][1][sPlaces[3]]) - 2"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99140:FunctionDef_L111_C1", "label": "_fetch_frame_from_kiwi", "type": "function", "loc": [111, 133], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99140:ClassDef_L57_C0", "vector": [2, 1, 0.5259, 0.0991, 1, 0.61, 0.6667, 331, 0, 4, 1, 0, 0, 0, 21], "semantic": {"name": "_fetch_frame_from_kiwi", "arg_names": ["self", "sPlace1", "sPlace2", "sPlace3"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tdef _fetch_frame_from_kiwi(self, sPlace1 = '', sPlace2 = '', sPlace3 = ''):\n\t\tret = []\n\t\tsFolder, sFn = os.path.split(self._kiwiFilepath)\n\t\tcmdline = '%s %s %s %s %s %s' \\\n\t\t\t% (VR_DIC_OFFSET_DUMP_TOOL, sFolder, sFn, sPlace1, sPlace2, sPlace3)\n\t\t(pin, pout) = os.popen4(cmdline.encode('gbk'))\n\t\tlines = pout.readlines()\n\t\tif 0 == len(lines):"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99140:Assign_L112_C2", "label": "ret =", "type": "assigned_variable", "loc": [112, 112], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99140:FunctionDef_L111_C1", "vector": [14, 2, 0.4828, 0.0043, 2, 0.63, 0.0, 501, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "ret", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tret = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99140:Assign_L113_C2", "label": "sFolder, sFn = split()", "type": "assigned_variable", "loc": [113, 113], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99140:FunctionDef_L111_C1", "vector": [14, 2, 0.4871, 0.0043, 2, 0.63, 0.1111, 2, 3, 1, 0, 0, 908, 10, 1], "semantic": {"name": "sFolder, sFn", "arg_names": [], "import_names": [], "rhs_call_name": "split", "annotation": ""}, "snippet": "\t\tsFolder, sFn = os.path.split(self._kiwiFilepath)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99140:Assign_L114_C2", "label": "cmdline =", "type": "assigned_variable", "loc": [114, 115], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99140:FunctionDef_L111_C1", "vector": [14, 2, 0.4935, 0.0086, 2, 0.63, 0.2222, 83, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "cmdline", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tcmdline = '%s %s %s %s %s %s' \\\n\t\t\t% (VR_DIC_OFFSET_DUMP_TOOL, sFolder, sFn, sPlace1, sPlace2, sPlace3)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99140:Assign_L116_C2", "label": "pin, pout = popen4()", "type": "assigned_variable", "loc": [116, 116], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99140:FunctionDef_L111_C1", "vector": [14, 2, 0.5, 0.0043, 2, 0.63, 0.3333, 787, 3, 1, 0, 0, 954, 10, 2], "semantic": {"name": "pin, pout", "arg_names": [], "import_names": [], "rhs_call_name": "popen4", "annotation": ""}, "snippet": "\t\t(pin, pout) = os.popen4(cmdline.encode('gbk'))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99140:Assign_L117_C2", "label": "lines = readlines()", "type": "assigned_variable", "loc": [117, 117], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99140:FunctionDef_L111_C1", "vector": [14, 2, 0.5043, 0.0043, 2, 0.63, 0.4444, 73, 3, 0, 0, 0, 841, 10, 1], "semantic": {"name": "lines", "arg_names": [], "import_names": [], "rhs_call_name": "readlines", "annotation": ""}, "snippet": "\t\tlines = pout.readlines()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99140:If_L118_C2", "label": "if", "type": "if", "loc": [118, 120], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99140:FunctionDef_L111_C1", "vector": [4, 2, 0.5129, 0.0129, 2, 0.63, 0.5556, 0, 0, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tif 0 == len(lines):\n\t\t\tlog.error(r'<Read Pipe Error> : %s', cmdline)\n\t\t\traise FetchPlaceError()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99140:Expr_L119_C3", "label": "error()", "type": "expression", "loc": [119, 119], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99140:If_L118_C2", "vector": [8, 3, 0.5129, 0.0043, 3, 0.09, 0.0, 771, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "error", "arg_names": [], "import_names": [], "rhs_call_name": "error", "annotation": ""}, "snippet": "\t\t\tlog.error(r'<Read Pipe Error> : %s', cmdline)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99140:Assign_L121_C2", "label": "lines = list()", "type": "assigned_variable", "loc": [121, 121], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99140:FunctionDef_L111_C1", "vector": [14, 2, 0.5216, 0.0043, 2, 0.63, 0.6667, 73, 3, 1, 0, 0, 430, 10, 2], "semantic": {"name": "lines", "arg_names": [], "import_names": [], "rhs_call_name": "list", "annotation": ""}, "snippet": "\t\tlines = list(line.decode('gbk') for line in lines)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99140:If_L122_C2", "label": "if", "type": "if", "loc": [122, 125], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99140:FunctionDef_L111_C1", "vector": [4, 2, 0.5323, 0.0172, 2, 0.63, 0.7778, 0, 0, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tif lines[0].find(r'ERROR') >= 0:\n\t\t\tlog.error(r'<Get Place Error> : %s %s %s : %s', \\\n\t\t\t\t\tsPlace1, sPlace2, sPlace3, lines[0])\n\t\t\traise FetchPlaceError()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99140:Expr_L123_C3", "label": "error()", "type": "expression", "loc": [123, 124], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99140:If_L122_C2", "vector": [8, 3, 0.5323, 0.0086, 3, 0.73, 0.0, 771, 3, 5, 0, 0, 0, 0, 1], "semantic": {"name": "error", "arg_names": [], "import_names": [], "rhs_call_name": "error", "annotation": ""}, "snippet": "\t\t\tlog.error(r'<Get Place Error> : %s %s %s : %s', \\\n\t\t\t\t\tsPlace1, sPlace2, sPlace3, lines[0])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99140:For_L126_C2", "label": "for line", "type": "for", "loc": [126, 132], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99140:FunctionDef_L111_C1", "vector": [6, 2, 0.556, 0.0302, 2, 0.63, 0.8889, 373, 6, 0, 0, 0, 0, 0, 9], "semantic": {"name": "line", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tfor line in lines[1:]:\n\t\t\tr = re.match(r'(.+)\\t\\t(\\d+)\\t\\t(\\d+)\\t\\t([YN])', line)\n\t\t\tif not r:\n\t\t\t\tlog.error(r'<Get Place Error> : %s %s %s : %s', \n\t\t\t\t\t\tsPlace1, sPlace2, sPlace3, line)\n\t\t\t\traise FetchPlaceError()\n\t\t\tret.append(KiwiPlace(r.group(1), r.group(2), r.group(3), r.group(4)))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99140:Assign_L127_C3", "label": "r = match()", "type": "assigned_variable", "loc": [127, 127], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99140:For_L126_C2", "vector": [14, 3, 0.5474, 0.0043, 3, 0.4, 0.0, 436, 3, 2, 0, 0, 36, 10, 1], "semantic": {"name": "r", "arg_names": [], "import_names": [], "rhs_call_name": "match", "annotation": ""}, "snippet": "\t\t\tr = re.match(r'(.+)\\t\\t(\\d+)\\t\\t(\\d+)\\t\\t([YN])', line)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99140:If_L128_C3", "label": "if", "type": "if", "loc": [128, 131], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99140:For_L126_C2", "vector": [4, 3, 0.5582, 0.0172, 3, 0.4, 0.5, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\tif not r:\n\t\t\t\tlog.error(r'<Get Place Error> : %s %s %s : %s', \n\t\t\t\t\t\tsPlace1, sPlace2, sPlace3, line)\n\t\t\t\traise FetchPlaceError()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99140:Expr_L129_C4", "label": "error()", "type": "expression", "loc": [129, 130], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99140:If_L128_C3", "vector": [8, 4, 0.5582, 0.0086, 4, 0.34, 0.0, 771, 3, 5, 0, 0, 0, 0, 1], "semantic": {"name": "error", "arg_names": [], "import_names": [], "rhs_call_name": "error", "annotation": ""}, "snippet": "\t\t\t\tlog.error(r'<Get Place Error> : %s %s %s : %s', \n\t\t\t\t\t\tsPlace1, sPlace2, sPlace3, line)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99140:Expr_L132_C3", "label": "append()", "type": "expression", "loc": [132, 132], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99140:For_L126_C2", "vector": [8, 3, 0.569, 0.0043, 3, 0.4, 1.0, 243, 3, 1, 0, 0, 0, 0, 6], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": "\t\t\tret.append(KiwiPlace(r.group(1), r.group(2), r.group(3), r.group(4)))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99140:Return_L133_C2", "label": "return", "type": "return", "loc": [133, 133], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99140:FunctionDef_L111_C1", "vector": [13, 2, 0.5733, 0.0043, 2, 0.63, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\treturn ret"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99140:FunctionDef_L135_C1", "label": "_fetch_places_tree", "type": "function", "loc": [135, 193], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99140:ClassDef_L57_C0", "vector": [2, 1, 0.7069, 0.2543, 1, 0.61, 0.8333, 818, 0, 1, 1, 0, 0, 0, 39], "semantic": {"name": "_fetch_places_tree", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tdef _fetch_places_tree(self):\n\t\tif None != self._kiwiDataTree:\n\t\t\treturn self._kiwiDataTree\n\t\tall_places = {}\n\t\t\n\t\t# fetch provinces\n\t\tfor p in self._fetch_frame_from_kiwi():\n\t\t\tif all_places.has_key(p.get_name()):"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99140:If_L136_C2", "label": "if", "type": "if", "loc": [136, 137], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99140:FunctionDef_L135_C1", "vector": [4, 2, 0.5884, 0.0086, 2, 0.66, 0.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tif None != self._kiwiDataTree:\n\t\t\treturn self._kiwiDataTree"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99140:Return_L137_C3", "label": "return", "type": "return", "loc": [137, 137], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99140:If_L136_C2", "vector": [13, 3, 0.5905, 0.0043, 3, 0.98, 0.0, 0, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\treturn self._kiwiDataTree"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99140:Assign_L138_C2", "label": "all_places =", "type": "assigned_variable", "loc": [138, 138], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99140:FunctionDef_L135_C1", "vector": [14, 2, 0.5948, 0.0043, 2, 0.66, 0.125, 326, 0, 0, 0, 0, 0, 6, 0], "semantic": {"name": "all_places", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tall_places = {}"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99140:For_L141_C2", "label": "for p", "type": "for", "loc": [141, 145], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99140:FunctionDef_L135_C1", "vector": [6, 2, 0.6164, 0.0216, 2, 0.66, 0.25, 491, 3, 0, 0, 0, 0, 0, 7], "semantic": {"name": "p", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tfor p in self._fetch_frame_from_kiwi():\n\t\t\tif all_places.has_key(p.get_name()):\n\t\t\t\tlog.critical(r'%s has the same province !!!', p.get_name())\n\t\t\t\traise KeyError()\n\t\t\tall_places[p.get_name()] = (p, {})"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99140:If_L142_C3", "label": "if", "type": "if", "loc": [142, 144], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99140:For_L141_C2", "vector": [4, 3, 0.6164, 0.0129, 3, 0.3, 0.0, 0, 3, 0, 0, 0, 0, 0, 5], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\tif all_places.has_key(p.get_name()):\n\t\t\t\tlog.critical(r'%s has the same province !!!', p.get_name())\n\t\t\t\traise KeyError()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99140:Expr_L143_C4", "label": "critical()", "type": "expression", "loc": [143, 143], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99140:If_L142_C3", "vector": [8, 4, 0.6164, 0.0043, 4, 0.99, 0.0, 432, 3, 2, 0, 0, 0, 0, 2], "semantic": {"name": "critical", "arg_names": [], "import_names": [], "rhs_call_name": "critical", "annotation": ""}, "snippet": "\t\t\t\tlog.critical(r'%s has the same province !!!', p.get_name())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99140:Assign_L145_C3", "label": "assign", "type": "assigned_variable", "loc": [145, 145], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99140:For_L141_C2", "vector": [14, 3, 0.625, 0.0043, 3, 0.3, 1.0, 0, 0, 0, 0, 0, 0, 8, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\tall_places[p.get_name()] = (p, {})"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99140:For_L148_C2", "label": "for provName", "type": "for", "loc": [148, 155], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99140:FunctionDef_L135_C1", "vector": [6, 2, 0.653, 0.0345, 2, 0.66, 0.375, 689, 3, 0, 0, 0, 0, 0, 8], "semantic": {"name": "provName", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tfor provName in all_places.keys():\n\t\t\tprov = all_places[provName][0]\n\t\t\tprov_next_frame = all_places[provName][1]\n\t\t\tfor city in self._fetch_frame_from_kiwi(provName):\n\t\t\t\tif prov_next_frame.has_key(city.get_name()):\n\t\t\t\t\tlog.critical(r'%s has the same city !!!', city.get_name())\n\t\t\t\t\traise KeyError()\n\t\t\t\tprov_next_frame[city.get_name()] = (city, {})"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99140:Assign_L149_C3", "label": "prov =", "type": "assigned_variable", "loc": [149, 149], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99140:For_L148_C2", "vector": [14, 3, 0.6422, 0.0043, 3, 0.13, 0.0, 479, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "prov", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\tprov = all_places[provName][0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99140:Assign_L150_C3", "label": "prov_next_frame =", "type": "assigned_variable", "loc": [150, 150], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99140:For_L148_C2", "vector": [14, 3, 0.6466, 0.0043, 3, 0.13, 0.5, 709, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "prov_next_frame", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\tprov_next_frame = all_places[provName][1]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99140:For_L151_C3", "label": "for city", "type": "for", "loc": [151, 155], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99140:For_L148_C2", "vector": [6, 3, 0.6595, 0.0216, 3, 0.13, 1.0, 825, 3, 0, 0, 0, 0, 0, 7], "semantic": {"name": "city", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\tfor city in self._fetch_frame_from_kiwi(provName):\n\t\t\t\tif prov_next_frame.has_key(city.get_name()):\n\t\t\t\t\tlog.critical(r'%s has the same city !!!', city.get_name())\n\t\t\t\t\traise KeyError()\n\t\t\t\tprov_next_frame[city.get_name()] = (city, {})"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99140:If_L152_C4", "label": "if", "type": "if", "loc": [152, 154], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99140:For_L151_C3", "vector": [4, 4, 0.6595, 0.0129, 4, 0.42, 0.0, 0, 3, 0, 0, 0, 0, 0, 5], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\t\tif prov_next_frame.has_key(city.get_name()):\n\t\t\t\t\tlog.critical(r'%s has the same city !!!', city.get_name())\n\t\t\t\t\traise KeyError()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99140:Expr_L153_C5", "label": "critical()", "type": "expression", "loc": [153, 153], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99140:If_L152_C4", "vector": [8, 5, 0.6595, 0.0043, 5, 0.72, 0.0, 432, 3, 2, 0, 0, 0, 0, 2], "semantic": {"name": "critical", "arg_names": [], "import_names": [], "rhs_call_name": "critical", "annotation": ""}, "snippet": "\t\t\t\t\tlog.critical(r'%s has the same city !!!', city.get_name())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99140:Assign_L155_C4", "label": "assign", "type": "assigned_variable", "loc": [155, 155], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99140:For_L151_C3", "vector": [14, 4, 0.6681, 0.0043, 4, 0.42, 1.0, 0, 0, 0, 0, 0, 0, 8, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\t\tprov_next_frame[city.get_name()] = (city, {})"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99140:Expr_L156_C2", "label": "debug()", "type": "expression", "loc": [156, 156], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99140:FunctionDef_L135_C1", "vector": [8, 2, 0.6724, 0.0043, 2, 0.66, 0.5, 924, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "debug", "arg_names": [], "import_names": [], "rhs_call_name": "debug", "annotation": ""}, "snippet": "\t\tlog.debug(r'Get cities OK')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99140:For_L159_C2", "label": "for provName", "type": "for", "loc": [159, 172], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99140:FunctionDef_L135_C1", "vector": [6, 2, 0.7134, 0.0603, 2, 0.66, 0.625, 689, 3, 0, 0, 0, 0, 0, 11], "semantic": {"name": "provName", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tfor provName in all_places.keys():\n\t\t\tprov = all_places[provName][0]\n\t\t\tprov_next_frame = all_places[provName][1]\n\t\t\tfor cityName in prov_next_frame.keys():\n\t\t\t\tcity = prov_next_frame[cityName][0]\n\t\t\t\tcity_next_frame = prov_next_frame[cityName][1]\n\t\t\t\tif city.has_next_level():\n\t\t\t\t\tlog.debug(r'Get towns of city - %s, city - %s', provName, cityName)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99140:Assign_L160_C3", "label": "prov =", "type": "assigned_variable", "loc": [160, 160], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99140:For_L159_C2", "vector": [14, 3, 0.6897, 0.0043, 3, 0.1, 0.0, 479, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "prov", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\tprov = all_places[provName][0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99140:Assign_L161_C3", "label": "prov_next_frame =", "type": "assigned_variable", "loc": [161, 161], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99140:For_L159_C2", "vector": [14, 3, 0.694, 0.0043, 3, 0.1, 0.5, 709, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "prov_next_frame", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\tprov_next_frame = all_places[provName][1]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99140:For_L162_C3", "label": "for cityName", "type": "for", "loc": [162, 172], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99140:For_L159_C2", "vector": [6, 3, 0.7198, 0.0474, 3, 0.1, 1.0, 971, 3, 0, 0, 0, 0, 0, 10], "semantic": {"name": "cityName", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\tfor cityName in prov_next_frame.keys():\n\t\t\t\tcity = prov_next_frame[cityName][0]\n\t\t\t\tcity_next_frame = prov_next_frame[cityName][1]\n\t\t\t\tif city.has_next_level():\n\t\t\t\t\tlog.debug(r'Get towns of city - %s, city - %s', provName, cityName)\n\t\t\t\t\tfor town in self._fetch_frame_from_kiwi(provName, cityName):\n\t\t\t\t\t\tif city_next_frame.has_key(town.get_name()):\n\t\t\t\t\t\t\tlog.debug(r'%s has the same town/road !!', town.get_name())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99140:Assign_L163_C4", "label": "city =", "type": "assigned_variable", "loc": [163, 163], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99140:For_L162_C3", "vector": [14, 4, 0.7026, 0.0043, 4, 0.92, 0.0, 825, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "city", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\t\tcity = prov_next_frame[cityName][0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99140:Assign_L164_C4", "label": "city_next_frame =", "type": "assigned_variable", "loc": [164, 164], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99140:For_L162_C3", "vector": [14, 4, 0.7069, 0.0043, 4, 0.92, 0.5, 115, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "city_next_frame", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\t\tcity_next_frame = prov_next_frame[cityName][1]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99140:If_L165_C4", "label": "if", "type": "if", "loc": [165, 172], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99140:For_L162_C3", "vector": [4, 4, 0.7263, 0.0345, 4, 0.92, 1.0, 0, 3, 0, 0, 0, 0, 0, 9], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\t\tif city.has_next_level():\n\t\t\t\t\tlog.debug(r'Get towns of city - %s, city - %s', provName, cityName)\n\t\t\t\t\tfor town in self._fetch_frame_from_kiwi(provName, cityName):\n\t\t\t\t\t\tif city_next_frame.has_key(town.get_name()):\n\t\t\t\t\t\t\tlog.debug(r'%s has the same town/road !!', town.get_name())\n\t\t\t\t\t\t\tcity_next_frame[town.get_name()] += (town,)\n\t\t\t\t\t\t\tcontinue\n\t\t\t\t\t\tcity_next_frame[town.get_name()] = (town, {})"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99140:Expr_L166_C5", "label": "debug()", "type": "expression", "loc": [166, 166], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99140:If_L165_C4", "vector": [8, 5, 0.7155, 0.0043, 5, 0.76, 0.0, 924, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "debug", "arg_names": [], "import_names": [], "rhs_call_name": "debug", "annotation": ""}, "snippet": "\t\t\t\t\tlog.debug(r'Get towns of city - %s, city - %s', provName, cityName)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99140:For_L167_C5", "label": "for town", "type": "for", "loc": [167, 172], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99140:If_L165_C4", "vector": [6, 5, 0.7306, 0.0259, 5, 0.76, 1.0, 527, 3, 0, 0, 0, 0, 0, 7], "semantic": {"name": "town", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\t\t\tfor town in self._fetch_frame_from_kiwi(provName, cityName):\n\t\t\t\t\t\tif city_next_frame.has_key(town.get_name()):\n\t\t\t\t\t\t\tlog.debug(r'%s has the same town/road !!', town.get_name())\n\t\t\t\t\t\t\tcity_next_frame[town.get_name()] += (town,)\n\t\t\t\t\t\t\tcontinue\n\t\t\t\t\t\tcity_next_frame[town.get_name()] = (town, {})"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99140:If_L168_C6", "label": "if", "type": "if", "loc": [168, 171], "level": 6, "parent": "ajibawa-2023/Python-Code-Large/train/row_99140:For_L167_C5", "vector": [4, 6, 0.7306, 0.0172, 6, 0.38, 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\t\tif city_next_frame.has_key(town.get_name()):\n\t\t\t\t\t\t\tlog.debug(r'%s has the same town/road !!', town.get_name())\n\t\t\t\t\t\t\tcity_next_frame[town.get_name()] += (town,)\n\t\t\t\t\t\t\tcontinue"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99140:Expr_L169_C7", "label": "debug()", "type": "expression", "loc": [169, 169], "level": 7, "parent": "ajibawa-2023/Python-Code-Large/train/row_99140:If_L168_C6", "vector": [8, 7, 0.7284, 0.0043, 7, 0.91, 0.0, 924, 3, 2, 0, 0, 0, 0, 2], "semantic": {"name": "debug", "arg_names": [], "import_names": [], "rhs_call_name": "debug", "annotation": ""}, "snippet": "\t\t\t\t\t\t\tlog.debug(r'%s has the same town/road !!', town.get_name())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99140:Assign_L172_C6", "label": "assign", "type": "assigned_variable", "loc": [172, 172], "level": 6, "parent": "ajibawa-2023/Python-Code-Large/train/row_99140:For_L167_C5", "vector": [14, 6, 0.7414, 0.0043, 6, 0.38, 1.0, 0, 0, 0, 0, 0, 0, 8, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\t\t\t\tcity_next_frame[town.get_name()] = (town, {})"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99140:For_L175_C2", "label": "for provName", "type": "for", "loc": [175, 191], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99140:FunctionDef_L135_C1", "vector": [6, 2, 0.7888, 0.0733, 2, 0.66, 0.75, 689, 3, 0, 0, 0, 0, 0, 12], "semantic": {"name": "provName", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tfor provName in all_places.keys():\n\t\t\tprov = all_places[provName][0]\n\t\t\tprov_next_frame = all_places[provName][1]\n\t\t\tfor cityName in prov_next_frame.keys():\n\t\t\t\tcity = prov_next_frame[cityName][0]\n\t\t\t\tcity_next_level_frame = prov_next_frame[cityName][1]\n\t\t\t\tfor townName in city_next_level_frame.keys():\n\t\t\t\t\ttown = city_next_level_frame[townName][0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99140:Assign_L176_C3", "label": "prov =", "type": "assigned_variable", "loc": [176, 176], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99140:For_L175_C2", "vector": [14, 3, 0.7586, 0.0043, 3, 0.14, 0.0, 479, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "prov", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\tprov = all_places[provName][0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99140:Assign_L177_C3", "label": "prov_next_frame =", "type": "assigned_variable", "loc": [177, 177], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99140:For_L175_C2", "vector": [14, 3, 0.7629, 0.0043, 3, 0.14, 0.5, 709, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "prov_next_frame", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\tprov_next_frame = all_places[provName][1]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99140:For_L178_C3", "label": "for cityName", "type": "for", "loc": [178, 191], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99140:For_L175_C2", "vector": [6, 3, 0.7953, 0.0603, 3, 0.14, 1.0, 971, 3, 0, 0, 0, 0, 0, 11], "semantic": {"name": "cityName", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\tfor cityName in prov_next_frame.keys():\n\t\t\t\tcity = prov_next_frame[cityName][0]\n\t\t\t\tcity_next_level_frame = prov_next_frame[cityName][1]\n\t\t\t\tfor townName in city_next_level_frame.keys():\n\t\t\t\t\ttown = city_next_level_frame[townName][0]\n\t\t\t\t\ttown_next_frame = city_next_level_frame[townName][1]\n\t\t\t\t\tif town.has_next_level():\n\t\t\t\t\t\tlog.debug(r'Get roads of town - %s, city - %s, town - %s', provName, cityName, townName)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99140:Assign_L179_C4", "label": "city =", "type": "assigned_variable", "loc": [179, 179], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99140:For_L178_C3", "vector": [14, 4, 0.7716, 0.0043, 4, 0.24, 0.0, 825, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "city", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\t\tcity = prov_next_frame[cityName][0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99140:Assign_L180_C4", "label": "city_next_level_frame =", "type": "assigned_variable", "loc": [180, 180], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99140:For_L178_C3", "vector": [14, 4, 0.7759, 0.0043, 4, 0.24, 0.5, 705, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "city_next_level_frame", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\t\tcity_next_level_frame = prov_next_frame[cityName][1]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99140:For_L181_C4", "label": "for townName", "type": "for", "loc": [181, 191], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99140:For_L178_C3", "vector": [6, 4, 0.8017, 0.0474, 4, 0.24, 1.0, 241, 3, 0, 0, 0, 0, 0, 10], "semantic": {"name": "townName", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\t\tfor townName in city_next_level_frame.keys():\n\t\t\t\t\ttown = city_next_level_frame[townName][0]\n\t\t\t\t\ttown_next_frame = city_next_level_frame[townName][1]\n\t\t\t\t\tif town.has_next_level():\n\t\t\t\t\t\tlog.debug(r'Get roads of town - %s, city - %s, town - %s', provName, cityName, townName)\n\t\t\t\t\t\tfor road in self._fetch_frame_from_kiwi(provName, cityName, townName):\n\t\t\t\t\t\t\tif town_next_frame.has_key(road.get_name()):\n\t\t\t\t\t\t\t\tlog.debug(r'%s has the same name road !', road.get_name())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99140:Assign_L182_C5", "label": "town =", "type": "assigned_variable", "loc": [182, 182], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99140:For_L181_C4", "vector": [14, 5, 0.7845, 0.0043, 5, 0.9, 0.0, 527, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "town", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\t\t\ttown = city_next_level_frame[townName][0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99140:Assign_L183_C5", "label": "town_next_frame =", "type": "assigned_variable", "loc": [183, 183], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99140:For_L181_C4", "vector": [14, 5, 0.7888, 0.0043, 5, 0.9, 0.5, 375, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "town_next_frame", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\t\t\ttown_next_frame = city_next_level_frame[townName][1]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99140:If_L184_C5", "label": "if", "type": "if", "loc": [184, 191], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99140:For_L181_C4", "vector": [4, 5, 0.8082, 0.0345, 5, 0.9, 1.0, 0, 3, 0, 0, 0, 0, 0, 9], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\t\t\tif town.has_next_level():\n\t\t\t\t\t\tlog.debug(r'Get roads of town - %s, city - %s, town - %s', provName, cityName, townName)\n\t\t\t\t\t\tfor road in self._fetch_frame_from_kiwi(provName, cityName, townName):\n\t\t\t\t\t\t\tif town_next_frame.has_key(road.get_name()):\n\t\t\t\t\t\t\t\tlog.debug(r'%s has the same name road !', road.get_name())\n\t\t\t\t\t\t\t\ttown_next_frame[road.get_name()] += (road,)\n\t\t\t\t\t\t\t\tcontinue\n\t\t\t\t\t\t\ttown_next_frame[road.get_name()] = (road, {})"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99140:Expr_L185_C6", "label": "debug()", "type": "expression", "loc": [185, 185], "level": 6, "parent": "ajibawa-2023/Python-Code-Large/train/row_99140:If_L184_C5", "vector": [8, 6, 0.7974, 0.0043, 6, 0.19, 0.0, 924, 3, 4, 0, 0, 0, 0, 1], "semantic": {"name": "debug", "arg_names": [], "import_names": [], "rhs_call_name": "debug", "annotation": ""}, "snippet": "\t\t\t\t\t\tlog.debug(r'Get roads of town - %s, city - %s, town - %s', provName, cityName, townName)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99140:For_L186_C6", "label": "for road", "type": "for", "loc": [186, 191], "level": 6, "parent": "ajibawa-2023/Python-Code-Large/train/row_99140:If_L184_C5", "vector": [6, 6, 0.8125, 0.0259, 6, 0.19, 1.0, 448, 3, 0, 0, 0, 0, 0, 7], "semantic": {"name": "road", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\t\t\t\tfor road in self._fetch_frame_from_kiwi(provName, cityName, townName):\n\t\t\t\t\t\t\tif town_next_frame.has_key(road.get_name()):\n\t\t\t\t\t\t\t\tlog.debug(r'%s has the same name road !', road.get_name())\n\t\t\t\t\t\t\t\ttown_next_frame[road.get_name()] += (road,)\n\t\t\t\t\t\t\t\tcontinue\n\t\t\t\t\t\t\ttown_next_frame[road.get_name()] = (road, {})"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99140:If_L187_C7", "label": "if", "type": "if", "loc": [187, 190], "level": 7, "parent": "ajibawa-2023/Python-Code-Large/train/row_99140:For_L186_C6", "vector": [4, 7, 0.8125, 0.0172, 7, 0.15, 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\t\t\tif town_next_frame.has_key(road.get_name()):\n\t\t\t\t\t\t\t\tlog.debug(r'%s has the same name road !', road.get_name())\n\t\t\t\t\t\t\t\ttown_next_frame[road.get_name()] += (road,)\n\t\t\t\t\t\t\t\tcontinue"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99140:Expr_L188_C8", "label": "debug()", "type": "expression", "loc": [188, 188], "level": 8, "parent": "ajibawa-2023/Python-Code-Large/train/row_99140:If_L187_C7", "vector": [8, 8, 0.8103, 0.0043, 8, 0.18, 0.0, 924, 3, 2, 0, 0, 0, 0, 2], "semantic": {"name": "debug", "arg_names": [], "import_names": [], "rhs_call_name": "debug", "annotation": ""}, "snippet": "\t\t\t\t\t\t\t\tlog.debug(r'%s has the same name road !', road.get_name())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99140:Assign_L191_C7", "label": "assign", "type": "assigned_variable", "loc": [191, 191], "level": 7, "parent": "ajibawa-2023/Python-Code-Large/train/row_99140:For_L186_C6", "vector": [14, 7, 0.8233, 0.0043, 7, 0.15, 1.0, 0, 0, 0, 0, 0, 0, 8, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\t\t\t\t\ttown_next_frame[road.get_name()] = (road, {})"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99140:Assign_L192_C2", "label": "self._kiwiDataTree =", "type": "assigned_variable", "loc": [192, 192], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99140:FunctionDef_L135_C1", "vector": [14, 2, 0.8276, 0.0043, 2, 0.66, 0.875, 577, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self._kiwiDataTree", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tself._kiwiDataTree = all_places"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99140:Return_L193_C2", "label": "return", "type": "return", "loc": [193, 193], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99140:FunctionDef_L135_C1", "vector": [13, 2, 0.8319, 0.0043, 2, 0.66, 1.0, 0, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\treturn self._kiwiDataTree"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99140:FunctionDef_L195_C1", "label": "write_all_to_file", "type": "function", "loc": [195, 212], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99140:ClassDef_L57_C0", "vector": [2, 1, 0.8772, 0.0776, 1, 0.61, 1.0, 13, 0, 2, 0, 0, 0, 0, 26], "semantic": {"name": "write_all_to_file", "arg_names": ["self", "sFilename"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tdef write_all_to_file(self, sFilename):\n\t\tall_places = self._fetch_places_tree()\n\t\tf = codecs.open(sFilename, 'w', encoding='utf-8')\n\t\tfor provName in all_places.keys():\n\t\t\tprov = all_places[provName][0]\n\t\t\tf.write( '%s\\t\\t%d\\t\\t%d\\t\\t%s \\n' % (prov.get_name(), prov.get_offset(), prov.get_voiceId(), prov.has_next_level())) \n\t\t\tprov_next_frame = all_places[provName][1]\n\t\t\tfor cityName in prov_next_frame.keys():"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99140:Assign_L196_C2", "label": "all_places = _fetch_places_tree()", "type": "assigned_variable", "loc": [196, 196], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99140:FunctionDef_L195_C1", "vector": [14, 2, 0.8448, 0.0043, 2, 0.94, 0.0, 326, 3, 0, 0, 0, 818, 10, 1], "semantic": {"name": "all_places", "arg_names": [], "import_names": [], "rhs_call_name": "_fetch_places_tree", "annotation": ""}, "snippet": "\t\tall_places = self._fetch_places_tree()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99140:Assign_L197_C2", "label": "f = open()", "type": "assigned_variable", "loc": [197, 197], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99140:FunctionDef_L195_C1", "vector": [14, 2, 0.8491, 0.0043, 2, 0.94, 0.5, 899, 3, 3, 0, 0, 693, 10, 1], "semantic": {"name": "f", "arg_names": [], "import_names": [], "rhs_call_name": "open", "annotation": ""}, "snippet": "\t\tf = codecs.open(sFilename, 'w', encoding='utf-8')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99140:For_L198_C2", "label": "for provName", "type": "for", "loc": [198, 212], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99140:FunctionDef_L195_C1", "vector": [6, 2, 0.8836, 0.0647, 2, 0.94, 1.0, 689, 3, 0, 0, 0, 0, 0, 24], "semantic": {"name": "provName", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tfor provName in all_places.keys():\n\t\t\tprov = all_places[provName][0]\n\t\t\tf.write( '%s\\t\\t%d\\t\\t%d\\t\\t%s \\n' % (prov.get_name(), prov.get_offset(), prov.get_voiceId(), prov.has_next_level())) \n\t\t\tprov_next_frame = all_places[provName][1]\n\t\t\tfor cityName in prov_next_frame.keys():\n\t\t\t\tcity = prov_next_frame[cityName][0]\n\t\t\t\tf.write( '\\t%s\\t\\t%d\\t\\t%d\\t\\t%s \\n' % (city.get_name(), city.get_offset(), city.get_voiceId(), city.has_next_level())) \n\t\t\t\tcity_next_level_frame = prov_next_frame[cityName][1]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99140:Assign_L199_C3", "label": "prov =", "type": "assigned_variable", "loc": [199, 199], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99140:For_L198_C2", "vector": [14, 3, 0.8578, 0.0043, 3, 0.03, 0.0, 479, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "prov", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\tprov = all_places[provName][0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99140:Expr_L200_C3", "label": "write()", "type": "expression", "loc": [200, 200], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99140:For_L198_C2", "vector": [8, 3, 0.8621, 0.0043, 3, 0.03, 0.3333, 837, 3, 1, 0, 0, 0, 0, 5], "semantic": {"name": "write", "arg_names": [], "import_names": [], "rhs_call_name": "write", "annotation": ""}, "snippet": "\t\t\tf.write( '%s\\t\\t%d\\t\\t%d\\t\\t%s \\n' % (prov.get_name(), prov.get_offset(), prov.get_voiceId(), prov.has_next_level())) "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99140:Assign_L201_C3", "label": "prov_next_frame =", "type": "assigned_variable", "loc": [201, 201], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99140:For_L198_C2", "vector": [14, 3, 0.8664, 0.0043, 3, 0.03, 0.6667, 709, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "prov_next_frame", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\tprov_next_frame = all_places[provName][1]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99140:For_L202_C3", "label": "for cityName", "type": "for", "loc": [202, 212], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99140:For_L198_C2", "vector": [6, 3, 0.8922, 0.0474, 3, 0.03, 1.0, 971, 3, 0, 0, 0, 0, 0, 18], "semantic": {"name": "cityName", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\tfor cityName in prov_next_frame.keys():\n\t\t\t\tcity = prov_next_frame[cityName][0]\n\t\t\t\tf.write( '\\t%s\\t\\t%d\\t\\t%d\\t\\t%s \\n' % (city.get_name(), city.get_offset(), city.get_voiceId(), city.has_next_level())) \n\t\t\t\tcity_next_level_frame = prov_next_frame[cityName][1]\n\t\t\t\tfor townName in city_next_level_frame.keys():\n\t\t\t\t\ttown = city_next_level_frame[townName][0]\n\t\t\t\t\tf.write( '\\t\\t%s\\t\\t%d\\t\\t%d\\t\\t%s \\n' % (town.get_name(), town.get_offset(), town.get_voiceId(), town.has_next_level())) \n\t\t\t\t\ttown_next_frame = city_next_level_frame[townName][1]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99140:Assign_L203_C4", "label": "city =", "type": "assigned_variable", "loc": [203, 203], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99140:For_L202_C3", "vector": [14, 4, 0.875, 0.0043, 4, 0.81, 0.0, 825, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "city", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\t\tcity = prov_next_frame[cityName][0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99140:Expr_L204_C4", "label": "write()", "type": "expression", "loc": [204, 204], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99140:For_L202_C3", "vector": [8, 4, 0.8793, 0.0043, 4, 0.81, 0.3333, 837, 3, 1, 0, 0, 0, 0, 5], "semantic": {"name": "write", "arg_names": [], "import_names": [], "rhs_call_name": "write", "annotation": ""}, "snippet": "\t\t\t\tf.write( '\\t%s\\t\\t%d\\t\\t%d\\t\\t%s \\n' % (city.get_name(), city.get_offset(), city.get_voiceId(), city.has_next_level())) "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99140:Assign_L205_C4", "label": "city_next_level_frame =", "type": "assigned_variable", "loc": [205, 205], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99140:For_L202_C3", "vector": [14, 4, 0.8836, 0.0043, 4, 0.81, 0.6667, 705, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "city_next_level_frame", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\t\tcity_next_level_frame = prov_next_frame[cityName][1]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99140:For_L206_C4", "label": "for townName", "type": "for", "loc": [206, 212], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99140:For_L202_C3", "vector": [6, 4, 0.9009, 0.0302, 4, 0.81, 1.0, 241, 3, 0, 0, 0, 0, 0, 12], "semantic": {"name": "townName", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\t\tfor townName in city_next_level_frame.keys():\n\t\t\t\t\ttown = city_next_level_frame[townName][0]\n\t\t\t\t\tf.write( '\\t\\t%s\\t\\t%d\\t\\t%d\\t\\t%s \\n' % (town.get_name(), town.get_offset(), town.get_voiceId(), town.has_next_level())) \n\t\t\t\t\ttown_next_frame = city_next_level_frame[townName][1]\n\t\t\t\t\tfor roadName in town_next_frame.keys():\n\t\t\t\t\t\troad = town_next_frame[roadName][0]\n\t\t\t\t\t\tf.write( '\\t\\t\\t%s\\t\\t%d\\t\\t%d\\t\\t%s \\n' % (road.get_name(), road.get_offset(), road.get_voiceId(), road.has_next_level())) "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99140:Assign_L207_C5", "label": "town =", "type": "assigned_variable", "loc": [207, 207], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99140:For_L206_C4", "vector": [14, 5, 0.8922, 0.0043, 5, 0.37, 0.0, 527, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "town", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\t\t\ttown = city_next_level_frame[townName][0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99140:Expr_L208_C5", "label": "write()", "type": "expression", "loc": [208, 208], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99140:For_L206_C4", "vector": [8, 5, 0.8966, 0.0043, 5, 0.37, 0.3333, 837, 3, 1, 0, 0, 0, 0, 5], "semantic": {"name": "write", "arg_names": [], "import_names": [], "rhs_call_name": "write", "annotation": ""}, "snippet": "\t\t\t\t\tf.write( '\\t\\t%s\\t\\t%d\\t\\t%d\\t\\t%s \\n' % (town.get_name(), town.get_offset(), town.get_voiceId(), town.has_next_level())) "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99140:Assign_L209_C5", "label": "town_next_frame =", "type": "assigned_variable", "loc": [209, 209], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99140:For_L206_C4", "vector": [14, 5, 0.9009, 0.0043, 5, 0.37, 0.6667, 375, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "town_next_frame", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\t\t\ttown_next_frame = city_next_level_frame[townName][1]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99140:For_L210_C5", "label": "for roadName", "type": "for", "loc": [210, 212], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99140:For_L206_C4", "vector": [6, 5, 0.9095, 0.0129, 5, 0.37, 1.0, 921, 3, 0, 0, 0, 0, 0, 6], "semantic": {"name": "roadName", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\t\t\tfor roadName in town_next_frame.keys():\n\t\t\t\t\t\troad = town_next_frame[roadName][0]\n\t\t\t\t\t\tf.write( '\\t\\t\\t%s\\t\\t%d\\t\\t%d\\t\\t%s \\n' % (road.get_name(), road.get_offset(), road.get_voiceId(), road.has_next_level())) "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99140:Assign_L211_C6", "label": "road =", "type": "assigned_variable", "loc": [211, 211], "level": 6, "parent": "ajibawa-2023/Python-Code-Large/train/row_99140:For_L210_C5", "vector": [14, 6, 0.9095, 0.0043, 6, 0.0, 0.0, 448, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "road", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\t\t\t\troad = town_next_frame[roadName][0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99140:Expr_L212_C6", "label": "write()", "type": "expression", "loc": [212, 212], "level": 6, "parent": "ajibawa-2023/Python-Code-Large/train/row_99140:For_L210_C5", "vector": [8, 6, 0.9138, 0.0043, 6, 0.0, 1.0, 837, 3, 1, 0, 0, 0, 0, 5], "semantic": {"name": "write", "arg_names": [], "import_names": [], "rhs_call_name": "write", "annotation": ""}, "snippet": "\t\t\t\t\t\tf.write( '\\t\\t\\t%s\\t\\t%d\\t\\t%d\\t\\t%s \\n' % (road.get_name(), road.get_offset(), road.get_voiceId(), road.has_next_level())) "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99140:FunctionDef_L215_C0", "label": "main", "type": "function", "loc": [215, 228], "level": 0, "parent": null, "vector": [2, 0, 0.9547, 0.0603, 0, 0.66, 0.9167, 624, 0, 0, 0, 0, 0, 0, 7], "semantic": {"name": "main", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def main():\n\t# parse parameters\n\tif len(sys.argv) != 3:\n\t\tprint('Usage:')\n\t\tprint('OffsetDump.py [Kiwi Index File Path] [output file]')\n\t\tsys.exit(0)\n\tkiwiFilePath = sys.argv[1]\n\tsOutFilename = sys.argv[2]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99140:If_L217_C1", "label": "if", "type": "if", "loc": [217, 220], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99140:FunctionDef_L215_C0", "vector": [4, 1, 0.9418, 0.0172, 1, 0.77, 0.0, 0, 0, 0, 0, 0, 0, 0, 4], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tif len(sys.argv) != 3:\n\t\tprint('Usage:')\n\t\tprint('OffsetDump.py [Kiwi Index File Path] [output file]')\n\t\tsys.exit(0)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99140:Expr_L218_C2", "label": "print()", "type": "expression", "loc": [218, 218], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99140:If_L217_C1", "vector": [8, 2, 0.9397, 0.0043, 2, 0.64, 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('Usage:')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99140:Expr_L219_C2", "label": "print()", "type": "expression", "loc": [219, 219], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99140:If_L217_C1", "vector": [8, 2, 0.944, 0.0043, 2, 0.64, 0.5, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": "\t\tprint('OffsetDump.py [Kiwi Index File Path] [output file]')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99140:Expr_L220_C2", "label": "exit()", "type": "expression", "loc": [220, 220], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99140:If_L217_C1", "vector": [8, 2, 0.9483, 0.0043, 2, 0.64, 1.0, 436, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "exit", "arg_names": [], "import_names": [], "rhs_call_name": "exit", "annotation": ""}, "snippet": "\t\tsys.exit(0)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99140:Assign_L221_C1", "label": "kiwiFilePath =", "type": "assigned_variable", "loc": [221, 221], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99140:FunctionDef_L215_C0", "vector": [14, 1, 0.9526, 0.0043, 1, 0.77, 0.2, 600, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "kiwiFilePath", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tkiwiFilePath = sys.argv[1]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99140:Assign_L222_C1", "label": "sOutFilename =", "type": "assigned_variable", "loc": [222, 222], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99140:FunctionDef_L215_C0", "vector": [14, 1, 0.9569, 0.0043, 1, 0.77, 0.4, 300, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "sOutFilename", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tsOutFilename = sys.argv[2]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99140:Assign_L225_C1", "label": "kdm = KiwiDataManager()", "type": "assigned_variable", "loc": [225, 225], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99140:FunctionDef_L215_C0", "vector": [14, 1, 0.9698, 0.0043, 1, 0.77, 0.6, 444, 3, 1, 0, 0, 240, 10, 1], "semantic": {"name": "kdm", "arg_names": [], "import_names": [], "rhs_call_name": "KiwiDataManager", "annotation": ""}, "snippet": "\tkdm = KiwiDataManager(kiwiFilePath)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99140:Expr_L227_C1", "label": "write_all_to_file()", "type": "expression", "loc": [227, 227], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99140:FunctionDef_L215_C0", "vector": [8, 1, 0.9784, 0.0043, 1, 0.77, 0.8, 13, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "write_all_to_file", "arg_names": [], "import_names": [], "rhs_call_name": "write_all_to_file", "annotation": ""}, "snippet": "\tkdm.write_all_to_file(sOutFilename)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99140:Expr_L228_C1", "label": "print()", "type": "expression", "loc": [228, 228], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99140:FunctionDef_L215_C0", "vector": [8, 1, 0.9828, 0.0043, 1, 0.77, 1.0, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": "\tprint(\"Dump all OK\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99140:If_L230_C0", "label": "if", "type": "if", "loc": [230, 231], "level": 0, "parent": null, "vector": [4, 0, 0.9935, 0.0086, 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\tmain()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99140:Expr_L231_C1", "label": "main()", "type": "expression", "loc": [231, 231], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99140:If_L230_C0", "vector": [8, 1, 0.9957, 0.0043, 1, 0.77, 0.0, 624, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "main", "arg_names": [], "import_names": [], "rhs_call_name": "main", "annotation": ""}, "snippet": "\tmain()"}]
[{"f": "ajibawa-2023/Python-Code-Large/train/row_99140:ClassDef_L21_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99140:FunctionDef_L22_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99140:FunctionDef_L22_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99140:Assign_L23_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99140:FunctionDef_L22_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99140:Assign_L24_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99140:FunctionDef_L22_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99140:Assign_L25_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99140:FunctionDef_L22_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99140:If_L26_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99140:If_L26_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99140:Assign_L27_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99140:If_L26_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99140:If_L28_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99140:If_L28_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99140:Assign_L29_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99140:FunctionDef_L22_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99140:Assign_L30_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99140:ClassDef_L21_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99140:FunctionDef_L32_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99140:FunctionDef_L32_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99140:If_L33_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99140:If_L33_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99140:Return_L34_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99140:If_L33_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99140:If_L35_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99140:If_L35_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99140:Return_L36_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99140:If_L35_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99140:If_L37_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99140:If_L37_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99140:Return_L38_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99140:If_L37_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99140:If_L39_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99140:If_L39_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99140:Return_L40_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99140:If_L39_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99140:Return_L42_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99140:ClassDef_L21_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99140:FunctionDef_L44_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99140:FunctionDef_L44_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99140:Return_L45_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99140:ClassDef_L21_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99140:FunctionDef_L47_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99140:FunctionDef_L47_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99140:Return_L48_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99140:ClassDef_L21_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99140:FunctionDef_L50_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99140:FunctionDef_L50_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99140:Return_L51_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99140:ClassDef_L21_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99140:FunctionDef_L53_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99140:FunctionDef_L53_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99140:Return_L54_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99140:ClassDef_L57_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99140:FunctionDef_L58_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99140:FunctionDef_L58_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99140:Assign_L59_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99140:FunctionDef_L58_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99140:Assign_L60_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99140:FunctionDef_L58_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99140:Assign_L61_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99140:ClassDef_L57_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99140:FunctionDef_L63_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99140:FunctionDef_L63_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99140:Assign_L64_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99140:FunctionDef_L63_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99140:If_L65_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99140:If_L65_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99140:Assign_L66_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99140:If_L65_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99140:If_L67_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99140:If_L67_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99140:Assign_L68_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99140:If_L67_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99140:If_L69_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99140:If_L69_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99140:Assign_L70_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99140:If_L69_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99140:If_L71_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99140:If_L71_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99140:Assign_L72_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99140:FunctionDef_L63_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99140:Assign_L75_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99140:FunctionDef_L63_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99140:For_L76_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99140:FunctionDef_L63_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99140:Return_L79_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99140:ClassDef_L57_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99140:FunctionDef_L81_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99140:FunctionDef_L81_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99140:Assign_L82_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99140:FunctionDef_L81_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99140:If_L83_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99140:If_L83_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99140:Assign_L84_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99140:If_L83_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99140:Return_L85_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99140:If_L83_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99140:If_L86_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99140:If_L86_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99140:Assign_L87_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99140:If_L86_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99140:Return_L88_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99140:If_L86_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99140:If_L89_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99140:If_L89_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99140:Assign_L90_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99140:If_L89_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99140:Return_L91_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99140:If_L89_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99140:If_L92_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99140:If_L92_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99140:Assign_L93_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99140:If_L92_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99140:Return_L94_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99140:ClassDef_L57_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99140:FunctionDef_L98_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99140:FunctionDef_L98_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99140:Assign_L99_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99140:FunctionDef_L98_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99140:If_L100_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99140:If_L100_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99140:Return_L101_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99140:If_L100_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99140:If_L102_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99140:If_L102_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99140:Return_L103_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99140:If_L102_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99140:If_L104_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99140:If_L104_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99140:Return_L105_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99140:If_L104_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99140:If_L106_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99140:If_L106_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99140:Return_L107_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99140:ClassDef_L57_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99140:FunctionDef_L111_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99140:FunctionDef_L111_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99140:Assign_L112_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99140:FunctionDef_L111_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99140:Assign_L113_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99140:FunctionDef_L111_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99140:Assign_L114_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99140:FunctionDef_L111_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99140:Assign_L116_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99140:FunctionDef_L111_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99140:Assign_L117_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99140:FunctionDef_L111_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99140:If_L118_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99140:If_L118_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99140:Expr_L119_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99140:FunctionDef_L111_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99140:Assign_L121_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99140:FunctionDef_L111_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99140:If_L122_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99140:If_L122_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99140:Expr_L123_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99140:FunctionDef_L111_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99140:For_L126_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99140:For_L126_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99140:Assign_L127_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99140:For_L126_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99140:If_L128_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99140:If_L128_C3", "t": "ajibawa-2023/Python-Code-Large/train/row_99140:Expr_L129_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99140:For_L126_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99140:Expr_L132_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99140:FunctionDef_L111_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99140:Return_L133_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99140:ClassDef_L57_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99140:FunctionDef_L135_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99140:FunctionDef_L135_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99140:If_L136_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99140:If_L136_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99140:Return_L137_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99140:FunctionDef_L135_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99140:Assign_L138_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99140:FunctionDef_L135_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99140:For_L141_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99140:For_L141_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99140:If_L142_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99140:If_L142_C3", "t": "ajibawa-2023/Python-Code-Large/train/row_99140:Expr_L143_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99140:For_L141_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99140:Assign_L145_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99140:FunctionDef_L135_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99140:For_L148_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99140:For_L148_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99140:Assign_L149_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99140:For_L148_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99140:Assign_L150_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99140:For_L148_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99140:For_L151_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99140:For_L151_C3", "t": "ajibawa-2023/Python-Code-Large/train/row_99140:If_L152_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99140:If_L152_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99140:Expr_L153_C5"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99140:For_L151_C3", "t": "ajibawa-2023/Python-Code-Large/train/row_99140:Assign_L155_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99140:FunctionDef_L135_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99140:Expr_L156_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99140:FunctionDef_L135_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99140:For_L159_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99140:For_L159_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99140:Assign_L160_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99140:For_L159_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99140:Assign_L161_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99140:For_L159_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99140:For_L162_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99140:For_L162_C3", "t": "ajibawa-2023/Python-Code-Large/train/row_99140:Assign_L163_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99140:For_L162_C3", "t": "ajibawa-2023/Python-Code-Large/train/row_99140:Assign_L164_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99140:For_L162_C3", "t": "ajibawa-2023/Python-Code-Large/train/row_99140:If_L165_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99140:If_L165_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99140:Expr_L166_C5"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99140:If_L165_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99140:For_L167_C5"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99140:For_L167_C5", "t": "ajibawa-2023/Python-Code-Large/train/row_99140:If_L168_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99140:If_L168_C6", "t": "ajibawa-2023/Python-Code-Large/train/row_99140:Expr_L169_C7"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99140:For_L167_C5", "t": "ajibawa-2023/Python-Code-Large/train/row_99140:Assign_L172_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99140:FunctionDef_L135_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99140:For_L175_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99140:For_L175_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99140:Assign_L176_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99140:For_L175_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99140:Assign_L177_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99140:For_L175_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99140:For_L178_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99140:For_L178_C3", "t": "ajibawa-2023/Python-Code-Large/train/row_99140:Assign_L179_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99140:For_L178_C3", "t": "ajibawa-2023/Python-Code-Large/train/row_99140:Assign_L180_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99140:For_L178_C3", "t": "ajibawa-2023/Python-Code-Large/train/row_99140:For_L181_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99140:For_L181_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99140:Assign_L182_C5"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99140:For_L181_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99140:Assign_L183_C5"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99140:For_L181_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99140:If_L184_C5"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99140:If_L184_C5", "t": "ajibawa-2023/Python-Code-Large/train/row_99140:Expr_L185_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99140:If_L184_C5", "t": "ajibawa-2023/Python-Code-Large/train/row_99140:For_L186_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99140:For_L186_C6", "t": "ajibawa-2023/Python-Code-Large/train/row_99140:If_L187_C7"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99140:If_L187_C7", "t": "ajibawa-2023/Python-Code-Large/train/row_99140:Expr_L188_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99140:For_L186_C6", "t": "ajibawa-2023/Python-Code-Large/train/row_99140:Assign_L191_C7"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99140:FunctionDef_L135_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99140:Assign_L192_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99140:FunctionDef_L135_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99140:Return_L193_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99140:ClassDef_L57_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99140:FunctionDef_L195_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99140:FunctionDef_L195_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99140:Assign_L196_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99140:FunctionDef_L195_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99140:Assign_L197_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99140:FunctionDef_L195_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99140:For_L198_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99140:For_L198_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99140:Assign_L199_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99140:For_L198_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99140:Expr_L200_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99140:For_L198_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99140:Assign_L201_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99140:For_L198_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99140:For_L202_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99140:For_L202_C3", "t": "ajibawa-2023/Python-Code-Large/train/row_99140:Assign_L203_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99140:For_L202_C3", "t": "ajibawa-2023/Python-Code-Large/train/row_99140:Expr_L204_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99140:For_L202_C3", "t": "ajibawa-2023/Python-Code-Large/train/row_99140:Assign_L205_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99140:For_L202_C3", "t": "ajibawa-2023/Python-Code-Large/train/row_99140:For_L206_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99140:For_L206_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99140:Assign_L207_C5"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99140:For_L206_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99140:Expr_L208_C5"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99140:For_L206_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99140:Assign_L209_C5"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99140:For_L206_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99140:For_L210_C5"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99140:For_L210_C5", "t": "ajibawa-2023/Python-Code-Large/train/row_99140:Assign_L211_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99140:For_L210_C5", "t": "ajibawa-2023/Python-Code-Large/train/row_99140:Expr_L212_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99140:FunctionDef_L215_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99140:If_L217_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99140:If_L217_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99140:Expr_L218_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99140:If_L217_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99140:Expr_L219_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99140:If_L217_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99140:Expr_L220_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99140:FunctionDef_L215_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99140:Assign_L221_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99140:FunctionDef_L215_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99140:Assign_L222_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99140:FunctionDef_L215_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99140:Assign_L225_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99140:FunctionDef_L215_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99140:Expr_L227_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99140:FunctionDef_L215_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99140:Expr_L228_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99140:If_L230_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99140:Expr_L231_C1"}]
#!/usr/bin/env python # coding: utf-8 """ make 09light beep file from .wav files native endian edit the following config variable: BEEP_FILE_CONTENT WAVE_DATA_PATH OUTPUT_FILE_NAME """ ################################################# # edit the config variable BEEP_FILE_CONTENT BEEP_FILE_CONTENT = { 'Volume Label': 'OPERATION SOUND', # 16*char 'Date': '200812151003', # 12*char 'Version': '0.02', # 4*char 'WaveData': [ # ID: DWORD, Offset: DWORD, DataSize: DWORD # (ID, FileName), #(0, 'PSG2Hi.wav'), #(1, 'PSG2LOW.wav'), (12, '00.wav'), (13, '01.wav'), (14, '02.wav'), (15, '03.wav'), (16, '04.wav'), (17, '05.wav'), (18, '06.wav'), (19, '07.wav'), ] } def n2s(n): s = str(n) if len(s) == 1: s = '0' + s return s for n in range(39, 67): BEEP_FILE_CONTENT['WaveData'].append((n, n2s(n-31)+'.wav')) print BEEP_FILE_CONTENT['WaveData'] # path where stores the .wav file, default is '.' WAVE_DATA_PATH = r'.' # output file name OUTPUT_FILE_NAME = r"BEEPS.09LIGHT" ################################################## import os,sys import array import ConfigParser def CreateBeepFile(ofn): BEEP_FILE_CONTENT['WaveData'].sort(key = lambda x:x[0]) of = open(ofn, 'wb') bfc = BEEP_FILE_CONTENT vl = (bfc['Volume Label'] + '\0'*16)[:16] d = (bfc['Date'] + '\0'*12)[:12] ver = (bfc['Version']+ '\0'*4)[:4] log(of.tell(), 'Volume Label', vl) of.write(vl) log(of.tell(), 'Date', d) of.write(d) log(of.tell(), 'Version', ver) of.write(ver) num = len(bfc['WaveData']) print 'Count: %d' % (num) of.write(array.array('I', (num,)).tostring()) fheadLen = 16+12+4+4+len(bfc['WaveData'])*(4+4+4) wd = bfc['WaveData'] for n in range(len(wd)): w = wd[n] id = w[0] ofs = fheadLen + sum((os.path.getsize(f) for f in \ (WAVE_DATA_PATH + '\\'+wfn[1] for wfn in wd[:n]))) dsize = os.path.getsize(WAVE_DATA_PATH + '\\' + wd[n][1]) log(of.tell(), 'id, offset, dsize', str(id)+' '+str(ofs)+' '+str(dsize)) of.write(array.array('I', [id, ofs, dsize]).tostring()) for w in wd: log(of.tell(), 'wav data', str(w[0]) + ' ' + w[1]) of.write(open(WAVE_DATA_PATH+'\\'+w[1], 'rb').read()) of.close() def log(ofs, vname, val=''): print 'write %s at offset %d \n %s = %s'%(vname, ofs, vname, val) def __main__(): CreateBeepFile(OUTPUT_FILE_NAME) if __name__=='__main__': __main__()
ajibawa-2023/Python-Code-Large/train/row_99141
50
104
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_99141:Expr_L4_C0", "label": "expression", "type": "expression", "loc": [4, 11], "level": 0, "parent": null, "vector": [8, 0, 0.0721, 0.0769, 0, 0.66, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\"\"\"\nmake 09light beep file from .wav files\nnative endian\nedit the following config variable:\n\tBEEP_FILE_CONTENT\n\tWAVE_DATA_PATH\n\tOUTPUT_FILE_NAME\n\"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99141:Assign_L15_C0", "label": "BEEP_FILE_CONTENT =", "type": "assigned_variable", "loc": [15, 32], "level": 0, "parent": null, "vector": [14, 0, 0.226, 0.1731, 0, 0.66, 0.0769, 577, 0, 0, 0, 0, 0, 6, 0], "semantic": {"name": "BEEP_FILE_CONTENT", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "BEEP_FILE_CONTENT = {\n\t'Volume Label': 'OPERATION SOUND',\t\t# 16*char\n\t'Date': '200812151003',\t\t\t\t\t\t\t# 12*char\n\t'Version': '0.02',\t\t\t\t\t\t# 4*char\n\t'WaveData': [\t\t\t\t\t\t# ID: DWORD, Offset: DWORD, DataSize: DWORD\n\t\t# (ID, FileName),\n\t\t#(0, 'PSG2Hi.wav'),\n\t\t#(1, 'PSG2LOW.wav'),"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99141:FunctionDef_L34_C0", "label": "n2s", "type": "function", "loc": [34, 38], "level": 0, "parent": null, "vector": [2, 0, 0.3462, 0.0481, 0, 0.66, 0.1538, 612, 0, 1, 1, 0, 0, 0, 2], "semantic": {"name": "n2s", "arg_names": ["n"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def n2s(n):\n\ts = str(n)\n\tif len(s) == 1:\n\t\ts = '0' + s\n\treturn s"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99141:Assign_L35_C1", "label": "s = str()", "type": "assigned_variable", "loc": [35, 35], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99141:FunctionDef_L34_C0", "vector": [14, 1, 0.3365, 0.0096, 1, 0.82, 0.0, 553, 3, 1, 0, 0, 52, 10, 1], "semantic": {"name": "s", "arg_names": [], "import_names": [], "rhs_call_name": "str", "annotation": ""}, "snippet": "\ts = str(n)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99141:If_L36_C1", "label": "if", "type": "if", "loc": [36, 37], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99141:FunctionDef_L34_C0", "vector": [4, 1, 0.351, 0.0192, 1, 0.82, 0.5, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tif len(s) == 1:\n\t\ts = '0' + s"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99141:Assign_L37_C2", "label": "s =", "type": "assigned_variable", "loc": [37, 37], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99141:If_L36_C1", "vector": [14, 2, 0.3558, 0.0096, 2, 0.81, 0.0, 553, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "s", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\ts = '0' + s"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99141:Return_L38_C1", "label": "return", "type": "return", "loc": [38, 38], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99141:FunctionDef_L34_C0", "vector": [13, 1, 0.3654, 0.0096, 1, 0.82, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\treturn s"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99141:For_L40_C0", "label": "for n", "type": "for", "loc": [40, 41], "level": 0, "parent": null, "vector": [6, 0, 0.3894, 0.0192, 0, 0.66, 0.2308, 773, 3, 0, 0, 0, 0, 0, 3], "semantic": {"name": "n", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "for n in range(39, 67):\n\tBEEP_FILE_CONTENT['WaveData'].append((n, n2s(n-31)+'.wav'))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99141:Expr_L41_C1", "label": "append()", "type": "expression", "loc": [41, 41], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99141:For_L40_C0", "vector": [8, 1, 0.3942, 0.0096, 1, 0.83, 0.0, 243, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": "\tBEEP_FILE_CONTENT['WaveData'].append((n, n2s(n-31)+'.wav'))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99141:Expr_L43_C0", "label": "print()", "type": "expression", "loc": [43, 43], "level": 0, "parent": null, "vector": [8, 0, 0.4135, 0.0096, 0, 0.66, 0.3077, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": "print(BEEP_FILE_CONTENT['WaveData'])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99141:Assign_L46_C0", "label": "WAVE_DATA_PATH =", "type": "assigned_variable", "loc": [46, 46], "level": 0, "parent": null, "vector": [14, 0, 0.4423, 0.0096, 0, 0.66, 0.3846, 178, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "WAVE_DATA_PATH", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "WAVE_DATA_PATH = r'.'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99141:Assign_L49_C0", "label": "OUTPUT_FILE_NAME =", "type": "assigned_variable", "loc": [49, 49], "level": 0, "parent": null, "vector": [14, 0, 0.4712, 0.0096, 0, 0.66, 0.4615, 230, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "OUTPUT_FILE_NAME", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "OUTPUT_FILE_NAME = r\"BEEPS.09LIGHT\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99141:Import_L54_C0", "label": "os import os, sys", "type": "import", "loc": [54, 54], "level": 0, "parent": null, "vector": [1, 0, 0.5192, 0.0096, 0, 0.66, 0.5385, 688, 0, 2, 0, 0, 688, 0, 0], "semantic": {"name": "os", "arg_names": [], "import_names": ["os", "sys"], "rhs_call_name": "", "annotation": ""}, "snippet": "import os,sys"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99141:Import_L55_C0", "label": "array import array", "type": "import", "loc": [55, 55], "level": 0, "parent": null, "vector": [1, 0, 0.5288, 0.0096, 0, 0.66, 0.6154, 80, 0, 1, 0, 0, 80, 0, 0], "semantic": {"name": "array", "arg_names": [], "import_names": ["array"], "rhs_call_name": "", "annotation": ""}, "snippet": "import array"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99141:Import_L56_C0", "label": "ConfigParser import ConfigParser", "type": "import", "loc": [56, 56], "level": 0, "parent": null, "vector": [1, 0, 0.5385, 0.0096, 0, 0.66, 0.6923, 272, 0, 1, 0, 0, 272, 0, 0], "semantic": {"name": "ConfigParser", "arg_names": [], "import_names": ["ConfigParser"], "rhs_call_name": "", "annotation": ""}, "snippet": "import ConfigParser"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99141:FunctionDef_L60_C0", "label": "CreateBeepFile", "type": "function", "loc": [60, 90], "level": 0, "parent": null, "vector": [2, 0, 0.7212, 0.2981, 0, 0.66, 0.7692, 833, 0, 1, 0, 0, 0, 0, 37], "semantic": {"name": "CreateBeepFile", "arg_names": ["ofn"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def CreateBeepFile(ofn):\n\tBEEP_FILE_CONTENT['WaveData'].sort(key = lambda x:x[0])\n\tof = open(ofn, 'wb')\n\tbfc = BEEP_FILE_CONTENT\n\tvl = (bfc['Volume Label'] + '\\0'*16)[:16]\n\td = (bfc['Date'] + '\\0'*12)[:12]\n\tver = (bfc['Version']+ '\\0'*4)[:4]\n\tlog(of.tell(), 'Volume Label', vl)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99141:Expr_L61_C1", "label": "sort()", "type": "expression", "loc": [61, 61], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99141:FunctionDef_L60_C0", "vector": [8, 1, 0.5865, 0.0096, 1, 0.03, 0.0, 489, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "sort", "arg_names": [], "import_names": [], "rhs_call_name": "sort", "annotation": ""}, "snippet": "\tBEEP_FILE_CONTENT['WaveData'].sort(key = lambda x:x[0])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99141:Assign_L62_C1", "label": "of = open()", "type": "assigned_variable", "loc": [62, 62], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99141:FunctionDef_L60_C0", "vector": [14, 1, 0.5962, 0.0096, 1, 0.03, 0.0526, 835, 3, 2, 0, 0, 693, 10, 1], "semantic": {"name": "of", "arg_names": [], "import_names": [], "rhs_call_name": "open", "annotation": ""}, "snippet": "\tof = open(ofn, 'wb')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99141:Assign_L63_C1", "label": "bfc =", "type": "assigned_variable", "loc": [63, 63], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99141:FunctionDef_L60_C0", "vector": [14, 1, 0.6058, 0.0096, 1, 0.03, 0.1053, 390, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "bfc", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tbfc = BEEP_FILE_CONTENT"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99141:Assign_L64_C1", "label": "vl =", "type": "assigned_variable", "loc": [64, 64], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99141:FunctionDef_L60_C0", "vector": [14, 1, 0.6154, 0.0096, 1, 0.03, 0.1579, 441, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "vl", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tvl = (bfc['Volume Label'] + '\\0'*16)[:16]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99141:Assign_L65_C1", "label": "d =", "type": "assigned_variable", "loc": [65, 65], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99141:FunctionDef_L60_C0", "vector": [14, 1, 0.625, 0.0096, 1, 0.03, 0.2105, 355, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "d", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\td = (bfc['Date'] + '\\0'*12)[:12]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99141:Assign_L66_C1", "label": "ver =", "type": "assigned_variable", "loc": [66, 66], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99141:FunctionDef_L60_C0", "vector": [14, 1, 0.6346, 0.0096, 1, 0.03, 0.2632, 648, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "ver", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tver = (bfc['Version']+ '\\0'*4)[:4]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99141:Expr_L67_C1", "label": "log()", "type": "expression", "loc": [67, 67], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99141:FunctionDef_L60_C0", "vector": [8, 1, 0.6442, 0.0096, 1, 0.03, 0.3158, 432, 3, 3, 0, 0, 0, 0, 2], "semantic": {"name": "log", "arg_names": [], "import_names": [], "rhs_call_name": "log", "annotation": ""}, "snippet": "\tlog(of.tell(), 'Volume Label', vl)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99141:Expr_L68_C1", "label": "write()", "type": "expression", "loc": [68, 68], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99141:FunctionDef_L60_C0", "vector": [8, 1, 0.6538, 0.0096, 1, 0.03, 0.3684, 837, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "write", "arg_names": [], "import_names": [], "rhs_call_name": "write", "annotation": ""}, "snippet": "\tof.write(vl)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99141:Expr_L69_C1", "label": "log()", "type": "expression", "loc": [69, 69], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99141:FunctionDef_L60_C0", "vector": [8, 1, 0.6635, 0.0096, 1, 0.03, 0.4211, 432, 3, 3, 0, 0, 0, 0, 2], "semantic": {"name": "log", "arg_names": [], "import_names": [], "rhs_call_name": "log", "annotation": ""}, "snippet": "\tlog(of.tell(), 'Date', d)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99141:Expr_L70_C1", "label": "write()", "type": "expression", "loc": [70, 70], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99141:FunctionDef_L60_C0", "vector": [8, 1, 0.6731, 0.0096, 1, 0.03, 0.4737, 837, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "write", "arg_names": [], "import_names": [], "rhs_call_name": "write", "annotation": ""}, "snippet": "\tof.write(d)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99141:Expr_L71_C1", "label": "log()", "type": "expression", "loc": [71, 71], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99141:FunctionDef_L60_C0", "vector": [8, 1, 0.6827, 0.0096, 1, 0.03, 0.5263, 432, 3, 3, 0, 0, 0, 0, 2], "semantic": {"name": "log", "arg_names": [], "import_names": [], "rhs_call_name": "log", "annotation": ""}, "snippet": "\tlog(of.tell(), 'Version', ver)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99141:Expr_L72_C1", "label": "write()", "type": "expression", "loc": [72, 72], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99141:FunctionDef_L60_C0", "vector": [8, 1, 0.6923, 0.0096, 1, 0.03, 0.5789, 837, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "write", "arg_names": [], "import_names": [], "rhs_call_name": "write", "annotation": ""}, "snippet": "\tof.write(ver)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99141:Assign_L73_C1", "label": "num = len()", "type": "assigned_variable", "loc": [73, 73], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99141:FunctionDef_L60_C0", "vector": [14, 1, 0.7019, 0.0096, 1, 0.03, 0.6316, 328, 3, 1, 0, 0, 890, 10, 1], "semantic": {"name": "num", "arg_names": [], "import_names": [], "rhs_call_name": "len", "annotation": ""}, "snippet": "\tnum = len(bfc['WaveData'])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99141:Expr_L74_C1", "label": "print()", "type": "expression", "loc": [74, 74], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99141:FunctionDef_L60_C0", "vector": [8, 1, 0.7115, 0.0096, 1, 0.03, 0.6842, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": "\tprint('Count: %d' % (num))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99141:Expr_L75_C1", "label": "write()", "type": "expression", "loc": [75, 75], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99141:FunctionDef_L60_C0", "vector": [8, 1, 0.7212, 0.0096, 1, 0.03, 0.7368, 837, 3, 1, 0, 0, 0, 0, 3], "semantic": {"name": "write", "arg_names": [], "import_names": [], "rhs_call_name": "write", "annotation": ""}, "snippet": "\tof.write(array.array('I', (num,)).tostring())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99141:Assign_L77_C1", "label": "fheadLen =", "type": "assigned_variable", "loc": [77, 77], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99141:FunctionDef_L60_C0", "vector": [14, 1, 0.7404, 0.0096, 1, 0.03, 0.7895, 800, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "fheadLen", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tfheadLen = 16+12+4+4+len(bfc['WaveData'])*(4+4+4)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99141:Assign_L78_C1", "label": "wd =", "type": "assigned_variable", "loc": [78, 78], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99141:FunctionDef_L60_C0", "vector": [14, 1, 0.75, 0.0096, 1, 0.03, 0.8421, 339, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "wd", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\twd = bfc['WaveData']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99141:For_L79_C1", "label": "for n", "type": "for", "loc": [79, 86], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99141:FunctionDef_L60_C0", "vector": [6, 1, 0.7933, 0.0769, 1, 0.03, 0.8947, 773, 3, 0, 0, 0, 0, 0, 13], "semantic": {"name": "n", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tfor n in range(len(wd)):\n\t\tw = wd[n]\n\t\tid = w[0]\n\t\tofs = fheadLen + sum((os.path.getsize(f) for f in \\\n\t\t\t\t\t(WAVE_DATA_PATH + '\\\\'+wfn[1] for wfn in wd[:n])))\n\t\tdsize = os.path.getsize(WAVE_DATA_PATH + '\\\\' + wd[n][1])\n\t\tlog(of.tell(), 'id, offset, dsize', str(id)+' '+str(ofs)+' '+str(dsize))\n\t\tof.write(array.array('I', [id, ofs, dsize]).tostring())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99141:Assign_L80_C2", "label": "w =", "type": "assigned_variable", "loc": [80, 80], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99141:For_L79_C1", "vector": [14, 2, 0.7692, 0.0096, 2, 0.01, 0.0, 549, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "w", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tw = wd[n]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99141:Assign_L81_C2", "label": "id =", "type": "assigned_variable", "loc": [81, 81], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99141:For_L79_C1", "vector": [14, 2, 0.7788, 0.0096, 2, 0.01, 0.2, 941, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "id", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tid = w[0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99141:Assign_L82_C2", "label": "ofs =", "type": "assigned_variable", "loc": [82, 83], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99141:For_L79_C1", "vector": [14, 2, 0.7933, 0.0192, 2, 0.01, 0.4, 510, 4, 0, 0, 0, 0, 0, 2], "semantic": {"name": "ofs", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tofs = fheadLen + sum((os.path.getsize(f) for f in \\\n\t\t\t\t\t(WAVE_DATA_PATH + '\\\\'+wfn[1] for wfn in wd[:n])))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99141:Assign_L84_C2", "label": "dsize = getsize()", "type": "assigned_variable", "loc": [84, 84], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99141:For_L79_C1", "vector": [14, 2, 0.8077, 0.0096, 2, 0.01, 0.6, 769, 3, 1, 0, 0, 554, 10, 1], "semantic": {"name": "dsize", "arg_names": [], "import_names": [], "rhs_call_name": "getsize", "annotation": ""}, "snippet": "\t\tdsize = os.path.getsize(WAVE_DATA_PATH + '\\\\' + wd[n][1])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99141:Expr_L85_C2", "label": "log()", "type": "expression", "loc": [85, 85], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99141:For_L79_C1", "vector": [8, 2, 0.8173, 0.0096, 2, 0.01, 0.8, 432, 3, 3, 0, 0, 0, 0, 5], "semantic": {"name": "log", "arg_names": [], "import_names": [], "rhs_call_name": "log", "annotation": ""}, "snippet": "\t\tlog(of.tell(), 'id, offset, dsize', str(id)+' '+str(ofs)+' '+str(dsize))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99141:Expr_L86_C2", "label": "write()", "type": "expression", "loc": [86, 86], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99141:For_L79_C1", "vector": [8, 2, 0.8269, 0.0096, 2, 0.01, 1.0, 837, 3, 1, 0, 0, 0, 0, 3], "semantic": {"name": "write", "arg_names": [], "import_names": [], "rhs_call_name": "write", "annotation": ""}, "snippet": "\t\tof.write(array.array('I', [id, ofs, dsize]).tostring())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99141:For_L87_C1", "label": "for w", "type": "for", "loc": [87, 89], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99141:FunctionDef_L60_C0", "vector": [6, 1, 0.8462, 0.0288, 1, 0.03, 0.9474, 549, 2, 0, 0, 0, 0, 0, 6], "semantic": {"name": "w", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tfor w in wd:\n\t\tlog(of.tell(), 'wav data', str(w[0]) + ' ' + w[1])\n\t\tof.write(open(WAVE_DATA_PATH+'\\\\'+w[1], 'rb').read())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99141:Expr_L88_C2", "label": "log()", "type": "expression", "loc": [88, 88], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99141:For_L87_C1", "vector": [8, 2, 0.8462, 0.0096, 2, 0.37, 0.0, 432, 3, 3, 0, 0, 0, 0, 3], "semantic": {"name": "log", "arg_names": [], "import_names": [], "rhs_call_name": "log", "annotation": ""}, "snippet": "\t\tlog(of.tell(), 'wav data', str(w[0]) + ' ' + w[1])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99141:Expr_L89_C2", "label": "write()", "type": "expression", "loc": [89, 89], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99141:For_L87_C1", "vector": [8, 2, 0.8558, 0.0096, 2, 0.37, 1.0, 837, 3, 1, 0, 0, 0, 0, 3], "semantic": {"name": "write", "arg_names": [], "import_names": [], "rhs_call_name": "write", "annotation": ""}, "snippet": "\t\tof.write(open(WAVE_DATA_PATH+'\\\\'+w[1], 'rb').read())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99141:Expr_L90_C1", "label": "close()", "type": "expression", "loc": [90, 90], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99141:FunctionDef_L60_C0", "vector": [8, 1, 0.8654, 0.0096, 1, 0.03, 1.0, 77, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "close", "arg_names": [], "import_names": [], "rhs_call_name": "close", "annotation": ""}, "snippet": "\tof.close()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99141:FunctionDef_L93_C0", "label": "log", "type": "function", "loc": [93, 94], "level": 0, "parent": null, "vector": [2, 0, 0.899, 0.0192, 0, 0.66, 0.8462, 432, 0, 3, 0, 0, 0, 0, 1], "semantic": {"name": "log", "arg_names": ["ofs", "vname", "val"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def log(ofs, vname, val=''):\n\tprint('write %s at offset %d \\n %s = %s'%(vname, ofs, vname, val))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99141:Expr_L94_C1", "label": "print()", "type": "expression", "loc": [94, 94], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99141:FunctionDef_L93_C0", "vector": [8, 1, 0.9038, 0.0096, 1, 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": "\tprint('write %s at offset %d \\n %s = %s'%(vname, ofs, vname, val))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99141:FunctionDef_L96_C0", "label": "__main__", "type": "function", "loc": [96, 97], "level": 0, "parent": null, "vector": [2, 0, 0.9279, 0.0192, 0, 0.66, 0.9231, 593, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "__main__", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def __main__():\n\tCreateBeepFile(OUTPUT_FILE_NAME)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99141:Expr_L97_C1", "label": "CreateBeepFile()", "type": "expression", "loc": [97, 97], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99141:FunctionDef_L96_C0", "vector": [8, 1, 0.9327, 0.0096, 1, 0.95, 0.0, 833, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "CreateBeepFile", "arg_names": [], "import_names": [], "rhs_call_name": "CreateBeepFile", "annotation": ""}, "snippet": "\tCreateBeepFile(OUTPUT_FILE_NAME)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99141:If_L100_C0", "label": "if", "type": "if", "loc": [100, 101], "level": 0, "parent": null, "vector": [4, 0, 0.9663, 0.0192, 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\t__main__()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99141:Expr_L101_C1", "label": "__main__()", "type": "expression", "loc": [101, 101], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99141:If_L100_C0", "vector": [8, 1, 0.9712, 0.0096, 1, 0.94, 0.0, 593, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "__main__", "arg_names": [], "import_names": [], "rhs_call_name": "__main__", "annotation": ""}, "snippet": "\t__main__()"}]
[{"f": "ajibawa-2023/Python-Code-Large/train/row_99141:FunctionDef_L34_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99141:Assign_L35_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99141:FunctionDef_L34_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99141:If_L36_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99141:If_L36_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99141:Assign_L37_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99141:FunctionDef_L34_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99141:Return_L38_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99141:For_L40_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99141:Expr_L41_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99141:FunctionDef_L60_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99141:Expr_L61_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99141:FunctionDef_L60_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99141:Assign_L62_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99141:FunctionDef_L60_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99141:Assign_L63_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99141:FunctionDef_L60_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99141:Assign_L64_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99141:FunctionDef_L60_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99141:Assign_L65_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99141:FunctionDef_L60_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99141:Assign_L66_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99141:FunctionDef_L60_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99141:Expr_L67_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99141:FunctionDef_L60_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99141:Expr_L68_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99141:FunctionDef_L60_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99141:Expr_L69_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99141:FunctionDef_L60_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99141:Expr_L70_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99141:FunctionDef_L60_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99141:Expr_L71_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99141:FunctionDef_L60_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99141:Expr_L72_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99141:FunctionDef_L60_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99141:Assign_L73_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99141:FunctionDef_L60_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99141:Expr_L74_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99141:FunctionDef_L60_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99141:Expr_L75_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99141:FunctionDef_L60_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99141:Assign_L77_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99141:FunctionDef_L60_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99141:Assign_L78_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99141:FunctionDef_L60_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99141:For_L79_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99141:For_L79_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99141:Assign_L80_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99141:For_L79_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99141:Assign_L81_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99141:For_L79_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99141:Assign_L82_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99141:For_L79_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99141:Assign_L84_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99141:For_L79_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99141:Expr_L85_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99141:For_L79_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99141:Expr_L86_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99141:FunctionDef_L60_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99141:For_L87_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99141:For_L87_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99141:Expr_L88_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99141:For_L87_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99141:Expr_L89_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99141:FunctionDef_L60_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99141:Expr_L90_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99141:FunctionDef_L93_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99141:Expr_L94_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99141:FunctionDef_L96_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99141:Expr_L97_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99141:If_L100_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99141:Expr_L101_C1"}]
#!/usr/bin/env python # coding=utf-8 import os import sys import re import codecs import logging import pyExcelerator as pE xlsFileName = r'D:\ylb_work\data\Voice_ID_list_V15.xls' headerFileName = r'D:\ylb_work\data\waveID_Oversea.h' logFileName = r'makeconst_Oversea.log' def init_log(): logger = logging.getLogger() hdlr = logging.FileHandler(logFileName) formatter = logging.Formatter('%(asctime)s %(levelname)s:: %(message)s') hdlr.setFormatter(formatter) logger.addHandler(hdlr) logger.setLevel(logging.INFO) logger.info('\n\n\n\n\n') return logger logf = init_log() def sheet_size(sheet): keys = sheet[1].keys() rows = tuple(u[0] for u in keys) cols = tuple(u[1] for u in keys) return max(rows), max(cols) def get_all_constants(xlsfn): xls = pE.parse_xls(xlsfn) constants = {} # only in some sheets for sheet in xls[1:8]: maxRow, maxCol = sheet_size(sheet) sc = sheet[1] countSheetConst = 0 # from row 9 for row in range(0, maxRow+1): # number from row 1 for col in range(3, maxCol+1, 2): if sc.has_key((row, col)): v = unicode(str(sc[(row,col)])) rem = '' if re.match(r'\s*[\dA-Fa-f]+\s*$', v): # comment place from column 2 for remCol in range(2, maxCol+1, 2): if sc.has_key((row, remCol)): rem = sc[(row,remCol)] break if rem == '': # warning logf.warning( "Value %s has no comment, sheet: %s, row: %d, column: %d", v, sheet[0], row, col) if not constants.has_key(v[-6:]): constants[v[-6:]] = rem countSheetConst = countSheetConst + 1 else: # warning logf.debug("Value %s has already exists, sheet: %s, row: %d, column: %d", v, sheet[0], row, col) logf.info('Sheet(%s) has %d constants', sheet[0], countSheetConst) return constants # for test def compare(): all = get_all_constants(xlsFileName) part = get_regular_constants(xlsFileName) print len(all) print len(part) print len(all.keys()) print len(part.keys()) k1 = all.keys() k2 = part.keys() k1.sort() k2.sort() print k1 print k2 for k in all.keys(): if not part.has_key(k): print "different key: %s " % (k,) def convert_const_to_varname(v): if len(v) != 6: raise ValueError() typeId = v[0:2] if typeId=='10': return 'VL_PL_DIRGUIDE_' + v[-4:] elif typeId == '20': return 'VL_PL_REPLYMSG_' + v[-4:] elif typeId == '30': return 'VL_PL_CATEGORY_' + v[-4:] raise ValueError() def make_define_line(v, rem): vn = convert_const_to_varname(v) return 'const DWORD %s =\t%s;\t\t// %s \n' % (vn, '0x'+v, rem) def write_const_to_header(constants, outfn): outf = codecs.open(outfn, 'w', 'utf-8') ks = constants.keys() ks.sort() for k in ks: outf.write(make_define_line(k, constants[k])) outf.close() def main(): cts = get_all_constants(xlsFileName) write_const_to_header(cts, headerFileName) if __name__ == '__main__': main()
ajibawa-2023/Python-Code-Large/train/row_99142
88
125
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_99142:Import_L5_C0", "label": "os import os", "type": "import", "loc": [5, 5], "level": 0, "parent": null, "vector": [1, 0, 0.04, 0.008, 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_99142:Import_L6_C0", "label": "sys import sys", "type": "import", "loc": [6, 6], "level": 0, "parent": null, "vector": [1, 0, 0.048, 0.008, 0, 0.66, 0.0556, 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_99142:Import_L7_C0", "label": "re import re", "type": "import", "loc": [7, 7], "level": 0, "parent": null, "vector": [1, 0, 0.056, 0.008, 0, 0.66, 0.1111, 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_99142:Import_L8_C0", "label": "codecs import codecs", "type": "import", "loc": [8, 8], "level": 0, "parent": null, "vector": [1, 0, 0.064, 0.008, 0, 0.66, 0.1667, 220, 0, 1, 0, 0, 220, 0, 0], "semantic": {"name": "codecs", "arg_names": [], "import_names": ["codecs"], "rhs_call_name": "", "annotation": ""}, "snippet": "import codecs"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99142:Import_L9_C0", "label": "logging import logging", "type": "import", "loc": [9, 9], "level": 0, "parent": null, "vector": [1, 0, 0.072, 0.008, 0, 0.66, 0.2222, 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_99142:Import_L10_C0", "label": "pyExcelerator import pE", "type": "import", "loc": [10, 10], "level": 0, "parent": null, "vector": [1, 0, 0.08, 0.008, 0, 0.66, 0.2778, 173, 0, 1, 0, 0, 173, 0, 0], "semantic": {"name": "pyExcelerator", "arg_names": [], "import_names": ["pE"], "rhs_call_name": "", "annotation": ""}, "snippet": "import pyExcelerator as pE"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99142:Assign_L13_C0", "label": "xlsFileName =", "type": "assigned_variable", "loc": [13, 13], "level": 0, "parent": null, "vector": [14, 0, 0.104, 0.008, 0, 0.66, 0.3333, 5, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "xlsFileName", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "xlsFileName = r'D:\\ylb_work\\data\\Voice_ID_list_V15.xls'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99142:Assign_L14_C0", "label": "headerFileName =", "type": "assigned_variable", "loc": [14, 14], "level": 0, "parent": null, "vector": [14, 0, 0.112, 0.008, 0, 0.66, 0.3889, 872, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "headerFileName", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "headerFileName = r'D:\\ylb_work\\data\\waveID_Oversea.h'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99142:Assign_L15_C0", "label": "logFileName =", "type": "assigned_variable", "loc": [15, 15], "level": 0, "parent": null, "vector": [14, 0, 0.12, 0.008, 0, 0.66, 0.4444, 181, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "logFileName", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "logFileName = r'makeconst_Oversea.log'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99142:FunctionDef_L18_C0", "label": "init_log", "type": "function", "loc": [18, 26], "level": 0, "parent": null, "vector": [2, 0, 0.176, 0.072, 0, 0.66, 0.5, 377, 0, 0, 1, 0, 0, 0, 7], "semantic": {"name": "init_log", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def init_log():\n logger = logging.getLogger()\n hdlr = logging.FileHandler(logFileName)\n formatter = logging.Formatter('%(asctime)s %(levelname)s:: %(message)s')\n hdlr.setFormatter(formatter)\n logger.addHandler(hdlr)\n logger.setLevel(logging.INFO)\n logger.info('\\n\\n\\n\\n\\n')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99142:Assign_L19_C4", "label": "logger = getLogger()", "type": "assigned_variable", "loc": [19, 19], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99142:FunctionDef_L18_C0", "vector": [14, 1, 0.152, 0.008, 1, 0.13, 0.0, 532, 3, 0, 0, 0, 71, 10, 1], "semantic": {"name": "logger", "arg_names": [], "import_names": [], "rhs_call_name": "getLogger", "annotation": ""}, "snippet": " logger = logging.getLogger()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99142:Assign_L20_C4", "label": "hdlr = FileHandler()", "type": "assigned_variable", "loc": [20, 20], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99142:FunctionDef_L18_C0", "vector": [14, 1, 0.16, 0.008, 1, 0.13, 0.1429, 149, 3, 1, 0, 0, 306, 10, 1], "semantic": {"name": "hdlr", "arg_names": [], "import_names": [], "rhs_call_name": "FileHandler", "annotation": ""}, "snippet": " hdlr = logging.FileHandler(logFileName)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99142:Assign_L21_C4", "label": "formatter = Formatter()", "type": "assigned_variable", "loc": [21, 21], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99142:FunctionDef_L18_C0", "vector": [14, 1, 0.168, 0.008, 1, 0.13, 0.2857, 791, 3, 1, 0, 0, 766, 10, 1], "semantic": {"name": "formatter", "arg_names": [], "import_names": [], "rhs_call_name": "Formatter", "annotation": ""}, "snippet": " formatter = logging.Formatter('%(asctime)s %(levelname)s:: %(message)s')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99142:Expr_L22_C4", "label": "setFormatter()", "type": "expression", "loc": [22, 22], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99142:FunctionDef_L18_C0", "vector": [8, 1, 0.176, 0.008, 1, 0.13, 0.4286, 948, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "setFormatter", "arg_names": [], "import_names": [], "rhs_call_name": "setFormatter", "annotation": ""}, "snippet": " hdlr.setFormatter(formatter)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99142:Expr_L23_C4", "label": "addHandler()", "type": "expression", "loc": [23, 23], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99142:FunctionDef_L18_C0", "vector": [8, 1, 0.184, 0.008, 1, 0.13, 0.5714, 255, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "addHandler", "arg_names": [], "import_names": [], "rhs_call_name": "addHandler", "annotation": ""}, "snippet": " logger.addHandler(hdlr)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99142:Expr_L24_C4", "label": "setLevel()", "type": "expression", "loc": [24, 24], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99142:FunctionDef_L18_C0", "vector": [8, 1, 0.192, 0.008, 1, 0.13, 0.7143, 810, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "setLevel", "arg_names": [], "import_names": [], "rhs_call_name": "setLevel", "annotation": ""}, "snippet": " logger.setLevel(logging.INFO)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99142:Expr_L25_C4", "label": "info()", "type": "expression", "loc": [25, 25], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99142:FunctionDef_L18_C0", "vector": [8, 1, 0.2, 0.008, 1, 0.13, 0.8571, 730, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "info", "arg_names": [], "import_names": [], "rhs_call_name": "info", "annotation": ""}, "snippet": " logger.info('\\n\\n\\n\\n\\n')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99142:Return_L26_C4", "label": "return", "type": "return", "loc": [26, 26], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99142:FunctionDef_L18_C0", "vector": [13, 1, 0.208, 0.008, 1, 0.13, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return logger"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99142:Assign_L27_C0", "label": "logf = init_log()", "type": "assigned_variable", "loc": [27, 27], "level": 0, "parent": null, "vector": [14, 0, 0.216, 0.008, 0, 0.66, 0.5556, 204, 3, 0, 0, 0, 377, 10, 1], "semantic": {"name": "logf", "arg_names": [], "import_names": [], "rhs_call_name": "init_log", "annotation": ""}, "snippet": "logf = init_log()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99142:FunctionDef_L29_C0", "label": "sheet_size", "type": "function", "loc": [29, 33], "level": 0, "parent": null, "vector": [2, 0, 0.248, 0.04, 0, 0.66, 0.6111, 493, 0, 1, 1, 0, 0, 0, 5], "semantic": {"name": "sheet_size", "arg_names": ["sheet"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def sheet_size(sheet):\n keys = sheet[1].keys()\n rows = tuple(u[0] for u in keys)\n cols = tuple(u[1] for u in keys)\n return max(rows), max(cols)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99142:Assign_L30_C4", "label": "keys = keys()", "type": "assigned_variable", "loc": [30, 30], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99142:FunctionDef_L29_C0", "vector": [14, 1, 0.24, 0.008, 1, 0.59, 0.0, 204, 3, 0, 0, 0, 204, 10, 1], "semantic": {"name": "keys", "arg_names": [], "import_names": [], "rhs_call_name": "keys", "annotation": ""}, "snippet": " keys = sheet[1].keys()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99142:Assign_L31_C4", "label": "rows = tuple()", "type": "assigned_variable", "loc": [31, 31], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99142:FunctionDef_L29_C0", "vector": [14, 1, 0.248, 0.008, 1, 0.59, 0.3333, 275, 3, 1, 0, 0, 259, 10, 1], "semantic": {"name": "rows", "arg_names": [], "import_names": [], "rhs_call_name": "tuple", "annotation": ""}, "snippet": " rows = tuple(u[0] for u in keys)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99142:Assign_L32_C4", "label": "cols = tuple()", "type": "assigned_variable", "loc": [32, 32], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99142:FunctionDef_L29_C0", "vector": [14, 1, 0.256, 0.008, 1, 0.59, 0.6667, 876, 3, 1, 0, 0, 259, 10, 1], "semantic": {"name": "cols", "arg_names": [], "import_names": [], "rhs_call_name": "tuple", "annotation": ""}, "snippet": " cols = tuple(u[1] for u in keys)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99142:Return_L33_C4", "label": "return", "type": "return", "loc": [33, 33], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99142:FunctionDef_L29_C0", "vector": [13, 1, 0.264, 0.008, 1, 0.59, 1.0, 0, 0, 0, 0, 0, 0, 8, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return max(rows), max(cols)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99142:FunctionDef_L36_C0", "label": "get_all_constants", "type": "function", "loc": [36, 69], "level": 0, "parent": null, "vector": [2, 0, 0.42, 0.272, 0, 0.66, 0.6667, 97, 0, 1, 1, 0, 0, 0, 14], "semantic": {"name": "get_all_constants", "arg_names": ["xlsfn"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def get_all_constants(xlsfn):\n xls = pE.parse_xls(xlsfn)\n constants = {}\n # only in some sheets\n for sheet in xls[1:8]:\n maxRow, maxCol = sheet_size(sheet)\n sc = sheet[1]\n countSheetConst = 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99142:Assign_L37_C4", "label": "xls = parse_xls()", "type": "assigned_variable", "loc": [37, 37], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99142:FunctionDef_L36_C0", "vector": [14, 1, 0.296, 0.008, 1, 0.94, 0.0, 421, 3, 1, 0, 0, 508, 10, 1], "semantic": {"name": "xls", "arg_names": [], "import_names": [], "rhs_call_name": "parse_xls", "annotation": ""}, "snippet": " xls = pE.parse_xls(xlsfn)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99142:Assign_L38_C4", "label": "constants =", "type": "assigned_variable", "loc": [38, 38], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99142:FunctionDef_L36_C0", "vector": [14, 1, 0.304, 0.008, 1, 0.94, 0.3333, 208, 0, 0, 0, 0, 0, 6, 0], "semantic": {"name": "constants", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " constants = {}"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99142:For_L40_C4", "label": "for sheet", "type": "for", "loc": [40, 68], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99142:FunctionDef_L36_C0", "vector": [6, 1, 0.432, 0.232, 1, 0.94, 0.6667, 737, 6, 0, 0, 0, 0, 0, 13], "semantic": {"name": "sheet", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for sheet in xls[1:8]:\n maxRow, maxCol = sheet_size(sheet)\n sc = sheet[1]\n countSheetConst = 0\n # from row 9\n for row in range(0, maxRow+1):\n # number from row 1\n for col in range(3, maxCol+1, 2):"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99142:Assign_L41_C8", "label": "maxRow, maxCol = sheet_size()", "type": "assigned_variable", "loc": [41, 41], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99142:For_L40_C4", "vector": [14, 2, 0.328, 0.008, 2, 0.16, 0.0, 369, 3, 1, 0, 0, 493, 10, 1], "semantic": {"name": "maxRow, maxCol", "arg_names": [], "import_names": [], "rhs_call_name": "sheet_size", "annotation": ""}, "snippet": " maxRow, maxCol = sheet_size(sheet)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99142:Assign_L42_C8", "label": "sc =", "type": "assigned_variable", "loc": [42, 42], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99142:For_L40_C4", "vector": [14, 2, 0.336, 0.008, 2, 0.16, 0.25, 356, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "sc", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " sc = sheet[1]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99142:Assign_L43_C8", "label": "countSheetConst =", "type": "assigned_variable", "loc": [43, 43], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99142:For_L40_C4", "vector": [14, 2, 0.344, 0.008, 2, 0.16, 0.5, 111, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "countSheetConst", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " countSheetConst = 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99142:For_L45_C8", "label": "for row", "type": "for", "loc": [45, 67], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99142:For_L40_C4", "vector": [6, 2, 0.448, 0.184, 2, 0.16, 0.75, 767, 3, 0, 0, 0, 0, 0, 11], "semantic": {"name": "row", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for row in range(0, maxRow+1):\n # number from row 1\n for col in range(3, maxCol+1, 2):\n if sc.has_key((row, col)):\n v = unicode(str(sc[(row,col)]))\n rem = ''\n if re.match(r'\\s*[\\dA-Fa-f]+\\s*$', v):\n # comment place from column 2"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99142:For_L47_C12", "label": "for col", "type": "for", "loc": [47, 67], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99142:For_L45_C8", "vector": [6, 3, 0.456, 0.168, 3, 0.31, 0.0, 157, 3, 0, 0, 0, 0, 0, 10], "semantic": {"name": "col", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for col in range(3, maxCol+1, 2):\n if sc.has_key((row, col)):\n v = unicode(str(sc[(row,col)]))\n rem = ''\n if re.match(r'\\s*[\\dA-Fa-f]+\\s*$', v):\n # comment place from column 2\n for remCol in range(2, maxCol+1, 2):\n if sc.has_key((row, remCol)):"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99142:If_L48_C16", "label": "if", "type": "if", "loc": [48, 67], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99142:For_L47_C12", "vector": [4, 4, 0.46, 0.16, 4, 0.7, 0.0, 0, 3, 0, 0, 0, 0, 0, 9], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if sc.has_key((row, col)):\n v = unicode(str(sc[(row,col)]))\n rem = ''\n if re.match(r'\\s*[\\dA-Fa-f]+\\s*$', v):\n # comment place from column 2\n for remCol in range(2, maxCol+1, 2):\n if sc.has_key((row, remCol)):\n rem = sc[(row,remCol)]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99142:Assign_L49_C20", "label": "v = unicode()", "type": "assigned_variable", "loc": [49, 49], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99142:If_L48_C16", "vector": [14, 5, 0.392, 0.008, 5, 0.52, 0.0, 553, 3, 1, 0, 0, 733, 10, 2], "semantic": {"name": "v", "arg_names": [], "import_names": [], "rhs_call_name": "unicode", "annotation": ""}, "snippet": " v = unicode(str(sc[(row,col)]))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99142:Assign_L50_C20", "label": "rem =", "type": "assigned_variable", "loc": [50, 50], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99142:If_L48_C16", "vector": [14, 5, 0.4, 0.008, 5, 0.52, 0.5, 41, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "rem", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " rem = ''"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99142:If_L51_C20", "label": "if", "type": "if", "loc": [51, 67], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99142:If_L48_C16", "vector": [4, 5, 0.472, 0.136, 5, 0.52, 1.0, 0, 3, 0, 0, 0, 0, 0, 6], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if re.match(r'\\s*[\\dA-Fa-f]+\\s*$', v):\n # comment place from column 2\n for remCol in range(2, maxCol+1, 2):\n if sc.has_key((row, remCol)):\n rem = sc[(row,remCol)]\n break\n if rem == '':\n # warning"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99142:For_L53_C24", "label": "for remCol", "type": "for", "loc": [53, 56], "level": 6, "parent": "ajibawa-2023/Python-Code-Large/train/row_99142:If_L51_C20", "vector": [6, 6, 0.436, 0.032, 6, 0.49, 0.0, 899, 3, 0, 0, 0, 0, 0, 2], "semantic": {"name": "remCol", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for remCol in range(2, maxCol+1, 2):\n if sc.has_key((row, remCol)):\n rem = sc[(row,remCol)]\n break"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99142:If_L54_C28", "label": "if", "type": "if", "loc": [54, 56], "level": 7, "parent": "ajibawa-2023/Python-Code-Large/train/row_99142:For_L53_C24", "vector": [4, 7, 0.44, 0.024, 7, 0.82, 0.0, 0, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if sc.has_key((row, remCol)):\n rem = sc[(row,remCol)]\n break"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99142:Assign_L55_C32", "label": "rem =", "type": "assigned_variable", "loc": [55, 55], "level": 8, "parent": "ajibawa-2023/Python-Code-Large/train/row_99142:If_L54_C28", "vector": [14, 8, 0.44, 0.008, 8, 0.7, 0.0, 41, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "rem", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " rem = sc[(row,remCol)]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99142:If_L57_C24", "label": "if", "type": "if", "loc": [57, 60], "level": 6, "parent": "ajibawa-2023/Python-Code-Large/train/row_99142:If_L51_C20", "vector": [4, 6, 0.468, 0.032, 6, 0.49, 0.5, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if rem == '':\n # warning\n logf.warning( \"Value %s has no comment, sheet: %s, row: %d, column: %d\",\n v, sheet[0], row, col)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99142:Expr_L59_C28", "label": "warning()", "type": "expression", "loc": [59, 60], "level": 7, "parent": "ajibawa-2023/Python-Code-Large/train/row_99142:If_L57_C24", "vector": [8, 7, 0.476, 0.016, 7, 0.76, 0.0, 320, 3, 5, 0, 0, 0, 0, 1], "semantic": {"name": "warning", "arg_names": [], "import_names": [], "rhs_call_name": "warning", "annotation": ""}, "snippet": " logf.warning( \"Value %s has no comment, sheet: %s, row: %d, column: %d\",\n v, sheet[0], row, col)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99142:If_L61_C24", "label": "if", "type": "if", "loc": [61, 67], "level": 6, "parent": "ajibawa-2023/Python-Code-Large/train/row_99142:If_L51_C20", "vector": [4, 6, 0.512, 0.056, 6, 0.49, 1.0, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not constants.has_key(v[-6:]):\n constants[v[-6:]] = rem\n countSheetConst = countSheetConst + 1\n else:\n # warning\n logf.debug(\"Value %s has already exists, sheet: %s, row: %d, column: %d\",\n v, sheet[0], row, col)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99142:Assign_L62_C28", "label": "assign", "type": "assigned_variable", "loc": [62, 62], "level": 7, "parent": "ajibawa-2023/Python-Code-Large/train/row_99142:If_L61_C24", "vector": [14, 7, 0.496, 0.008, 7, 0.88, 0.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " constants[v[-6:]] = rem"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99142:Assign_L63_C28", "label": "countSheetConst =", "type": "assigned_variable", "loc": [63, 63], "level": 7, "parent": "ajibawa-2023/Python-Code-Large/train/row_99142:If_L61_C24", "vector": [14, 7, 0.504, 0.008, 7, 0.88, 0.5, 111, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "countSheetConst", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " countSheetConst = countSheetConst + 1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99142:Expr_L66_C28", "label": "debug()", "type": "expression", "loc": [66, 67], "level": 7, "parent": "ajibawa-2023/Python-Code-Large/train/row_99142:If_L61_C24", "vector": [8, 7, 0.532, 0.016, 7, 0.88, 1.0, 924, 3, 5, 0, 0, 0, 0, 1], "semantic": {"name": "debug", "arg_names": [], "import_names": [], "rhs_call_name": "debug", "annotation": ""}, "snippet": " logf.debug(\"Value %s has already exists, sheet: %s, row: %d, column: %d\",\n v, sheet[0], row, col)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99142:Expr_L68_C8", "label": "info()", "type": "expression", "loc": [68, 68], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99142:For_L40_C4", "vector": [8, 2, 0.544, 0.008, 2, 0.16, 1.0, 730, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "info", "arg_names": [], "import_names": [], "rhs_call_name": "info", "annotation": ""}, "snippet": " logf.info('Sheet(%s) has %d constants', sheet[0], countSheetConst)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99142:Return_L69_C4", "label": "return", "type": "return", "loc": [69, 69], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99142:FunctionDef_L36_C0", "vector": [13, 1, 0.552, 0.008, 1, 0.94, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return constants"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99142:FunctionDef_L73_C0", "label": "compare", "type": "function", "loc": [73, 88], "level": 0, "parent": null, "vector": [2, 0, 0.644, 0.128, 0, 0.66, 0.7222, 383, 0, 0, 0, 0, 0, 0, 21], "semantic": {"name": "compare", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def compare():\n all = get_all_constants(xlsFileName)\n part = get_regular_constants(xlsFileName)\n print(len(all))\n print(len(part))\n print(len(all.keys()))\n print(len(part.keys()))\n k1 = all.keys()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99142:Assign_L74_C4", "label": "all = get_all_constants()", "type": "assigned_variable", "loc": [74, 74], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99142:FunctionDef_L73_C0", "vector": [14, 1, 0.592, 0.008, 1, 0.68, 0.0, 895, 3, 1, 0, 0, 97, 10, 1], "semantic": {"name": "all", "arg_names": [], "import_names": [], "rhs_call_name": "get_all_constants", "annotation": ""}, "snippet": " all = get_all_constants(xlsFileName)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99142:Assign_L75_C4", "label": "part = get_regular_constants()", "type": "assigned_variable", "loc": [75, 75], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99142:FunctionDef_L73_C0", "vector": [14, 1, 0.6, 0.008, 1, 0.68, 0.0833, 374, 3, 1, 0, 0, 530, 10, 1], "semantic": {"name": "part", "arg_names": [], "import_names": [], "rhs_call_name": "get_regular_constants", "annotation": ""}, "snippet": " part = get_regular_constants(xlsFileName)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99142:Expr_L76_C4", "label": "print()", "type": "expression", "loc": [76, 76], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99142:FunctionDef_L73_C0", "vector": [8, 1, 0.608, 0.008, 1, 0.68, 0.1667, 535, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print(len(all))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99142:Expr_L77_C4", "label": "print()", "type": "expression", "loc": [77, 77], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99142:FunctionDef_L73_C0", "vector": [8, 1, 0.616, 0.008, 1, 0.68, 0.25, 535, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print(len(part))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99142:Expr_L78_C4", "label": "print()", "type": "expression", "loc": [78, 78], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99142:FunctionDef_L73_C0", "vector": [8, 1, 0.624, 0.008, 1, 0.68, 0.3333, 535, 3, 1, 0, 0, 0, 0, 3], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print(len(all.keys()))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99142:Expr_L79_C4", "label": "print()", "type": "expression", "loc": [79, 79], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99142:FunctionDef_L73_C0", "vector": [8, 1, 0.632, 0.008, 1, 0.68, 0.4167, 535, 3, 1, 0, 0, 0, 0, 3], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print(len(part.keys()))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99142:Assign_L80_C4", "label": "k1 = keys()", "type": "assigned_variable", "loc": [80, 80], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99142:FunctionDef_L73_C0", "vector": [14, 1, 0.64, 0.008, 1, 0.68, 0.5, 263, 3, 0, 0, 0, 204, 10, 1], "semantic": {"name": "k1", "arg_names": [], "import_names": [], "rhs_call_name": "keys", "annotation": ""}, "snippet": " k1 = all.keys()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99142:Assign_L81_C4", "label": "k2 = keys()", "type": "assigned_variable", "loc": [81, 81], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99142:FunctionDef_L73_C0", "vector": [14, 1, 0.648, 0.008, 1, 0.68, 0.5833, 482, 3, 0, 0, 0, 204, 10, 1], "semantic": {"name": "k2", "arg_names": [], "import_names": [], "rhs_call_name": "keys", "annotation": ""}, "snippet": " k2 = part.keys()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99142:Expr_L82_C4", "label": "sort()", "type": "expression", "loc": [82, 82], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99142:FunctionDef_L73_C0", "vector": [8, 1, 0.656, 0.008, 1, 0.68, 0.6667, 489, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "sort", "arg_names": [], "import_names": [], "rhs_call_name": "sort", "annotation": ""}, "snippet": " k1.sort()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99142:Expr_L83_C4", "label": "sort()", "type": "expression", "loc": [83, 83], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99142:FunctionDef_L73_C0", "vector": [8, 1, 0.664, 0.008, 1, 0.68, 0.75, 489, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "sort", "arg_names": [], "import_names": [], "rhs_call_name": "sort", "annotation": ""}, "snippet": " k2.sort()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99142:Expr_L84_C4", "label": "print()", "type": "expression", "loc": [84, 84], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99142:FunctionDef_L73_C0", "vector": [8, 1, 0.672, 0.008, 1, 0.68, 0.8333, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print(k1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99142:Expr_L85_C4", "label": "print()", "type": "expression", "loc": [85, 85], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99142:FunctionDef_L73_C0", "vector": [8, 1, 0.68, 0.008, 1, 0.68, 0.9167, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print(k2)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99142:For_L86_C4", "label": "for k", "type": "for", "loc": [86, 88], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99142:FunctionDef_L73_C0", "vector": [6, 1, 0.696, 0.024, 1, 0.68, 1.0, 954, 3, 0, 0, 0, 0, 0, 3], "semantic": {"name": "k", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for k in all.keys():\n if not part.has_key(k):\n print(\"different key: %s \" % (k,))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99142:If_L87_C8", "label": "if", "type": "if", "loc": [87, 88], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99142:For_L86_C4", "vector": [4, 2, 0.7, 0.016, 2, 0.53, 0.0, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not part.has_key(k):\n print(\"different key: %s \" % (k,))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99142:Expr_L88_C12", "label": "print()", "type": "expression", "loc": [88, 88], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99142:If_L87_C8", "vector": [8, 3, 0.704, 0.008, 3, 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(\"different key: %s \" % (k,))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99142:FunctionDef_L91_C0", "label": "convert_const_to_varname", "type": "function", "loc": [91, 101], "level": 0, "parent": null, "vector": [2, 0, 0.768, 0.088, 0, 0.66, 0.7778, 624, 0, 1, 1, 0, 0, 0, 3], "semantic": {"name": "convert_const_to_varname", "arg_names": ["v"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def convert_const_to_varname(v):\n if len(v) != 6:\n raise ValueError()\n typeId = v[0:2]\n if typeId=='10':\n return 'VL_PL_DIRGUIDE_' + v[-4:]\n elif typeId == '20':\n return 'VL_PL_REPLYMSG_' + v[-4:]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99142:If_L92_C4", "label": "if", "type": "if", "loc": [92, 93], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99142:FunctionDef_L91_C0", "vector": [4, 1, 0.74, 0.016, 1, 0.8, 0.0, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if len(v) != 6:\n raise ValueError()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99142:Assign_L94_C4", "label": "typeId =", "type": "assigned_variable", "loc": [94, 94], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99142:FunctionDef_L91_C0", "vector": [14, 1, 0.752, 0.008, 1, 0.8, 0.5, 667, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "typeId", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " typeId = v[0:2]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99142:If_L95_C4", "label": "if", "type": "if", "loc": [95, 100], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99142:FunctionDef_L91_C0", "vector": [4, 1, 0.78, 0.048, 1, 0.8, 1.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if typeId=='10':\n return 'VL_PL_DIRGUIDE_' + v[-4:]\n elif typeId == '20':\n return 'VL_PL_REPLYMSG_' + v[-4:]\n elif typeId == '30':\n return 'VL_PL_CATEGORY_' + v[-4:]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99142:Return_L96_C8", "label": "return", "type": "return", "loc": [96, 96], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99142:If_L95_C4", "vector": [13, 2, 0.768, 0.008, 2, 0.4, 0.0, 0, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return 'VL_PL_DIRGUIDE_' + v[-4:]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99142:If_L97_C4", "label": "if", "type": "if", "loc": [97, 100], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99142:If_L95_C4", "vector": [4, 2, 0.788, 0.032, 2, 0.4, 1.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " elif typeId == '20':\n return 'VL_PL_REPLYMSG_' + v[-4:]\n elif typeId == '30':\n return 'VL_PL_CATEGORY_' + v[-4:]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99142:Return_L98_C8", "label": "return", "type": "return", "loc": [98, 98], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99142:If_L97_C4", "vector": [13, 3, 0.784, 0.008, 3, 0.43, 0.0, 0, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return 'VL_PL_REPLYMSG_' + v[-4:]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99142:If_L99_C4", "label": "if", "type": "if", "loc": [99, 100], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99142:If_L97_C4", "vector": [4, 3, 0.796, 0.016, 3, 0.43, 1.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " elif typeId == '30':\n return 'VL_PL_CATEGORY_' + v[-4:]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99142:Return_L100_C8", "label": "return", "type": "return", "loc": [100, 100], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99142:If_L99_C4", "vector": [13, 4, 0.8, 0.008, 4, 0.51, 0.0, 0, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return 'VL_PL_CATEGORY_' + v[-4:]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99142:FunctionDef_L103_C0", "label": "make_define_line", "type": "function", "loc": [103, 105], "level": 0, "parent": null, "vector": [2, 0, 0.832, 0.024, 0, 0.66, 0.8333, 129, 0, 2, 1, 0, 0, 0, 1], "semantic": {"name": "make_define_line", "arg_names": ["v", "rem"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def make_define_line(v, rem):\n vn = convert_const_to_varname(v)\n return 'const DWORD %s =\\t%s;\\t\\t// %s \\n' % (vn, '0x'+v, rem)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99142:Assign_L104_C4", "label": "vn = convert_const_to_varname()", "type": "assigned_variable", "loc": [104, 104], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99142:FunctionDef_L103_C0", "vector": [14, 1, 0.832, 0.008, 1, 0.56, 0.0, 368, 3, 1, 0, 0, 624, 10, 1], "semantic": {"name": "vn", "arg_names": [], "import_names": [], "rhs_call_name": "convert_const_to_varname", "annotation": ""}, "snippet": " vn = convert_const_to_varname(v)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99142:Return_L105_C4", "label": "return", "type": "return", "loc": [105, 105], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99142:FunctionDef_L103_C0", "vector": [13, 1, 0.84, 0.008, 1, 0.56, 1.0, 0, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return 'const DWORD %s =\\t%s;\\t\\t// %s \\n' % (vn, '0x'+v, rem)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99142:FunctionDef_L107_C0", "label": "write_const_to_header", "type": "function", "loc": [107, 113], "level": 0, "parent": null, "vector": [2, 0, 0.88, 0.056, 0, 0.66, 0.8889, 188, 0, 2, 0, 0, 0, 0, 6], "semantic": {"name": "write_const_to_header", "arg_names": ["constants", "outfn"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def write_const_to_header(constants, outfn):\n outf = codecs.open(outfn, 'w', 'utf-8')\n ks = constants.keys()\n ks.sort()\n for k in ks:\n outf.write(make_define_line(k, constants[k]))\n outf.close()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99142:Assign_L108_C4", "label": "outf = open()", "type": "assigned_variable", "loc": [108, 108], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99142:FunctionDef_L107_C0", "vector": [14, 1, 0.864, 0.008, 1, 0.92, 0.0, 808, 3, 3, 0, 0, 693, 10, 1], "semantic": {"name": "outf", "arg_names": [], "import_names": [], "rhs_call_name": "open", "annotation": ""}, "snippet": " outf = codecs.open(outfn, 'w', 'utf-8')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99142:Assign_L109_C4", "label": "ks = keys()", "type": "assigned_variable", "loc": [109, 109], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99142:FunctionDef_L107_C0", "vector": [14, 1, 0.872, 0.008, 1, 0.92, 0.25, 316, 3, 0, 0, 0, 204, 10, 1], "semantic": {"name": "ks", "arg_names": [], "import_names": [], "rhs_call_name": "keys", "annotation": ""}, "snippet": " ks = constants.keys()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99142:Expr_L110_C4", "label": "sort()", "type": "expression", "loc": [110, 110], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99142:FunctionDef_L107_C0", "vector": [8, 1, 0.88, 0.008, 1, 0.92, 0.5, 489, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "sort", "arg_names": [], "import_names": [], "rhs_call_name": "sort", "annotation": ""}, "snippet": " ks.sort()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99142:For_L111_C4", "label": "for k", "type": "for", "loc": [111, 112], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99142:FunctionDef_L107_C0", "vector": [6, 1, 0.892, 0.016, 1, 0.92, 0.75, 954, 2, 0, 0, 0, 0, 0, 2], "semantic": {"name": "k", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for k in ks:\n outf.write(make_define_line(k, constants[k]))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99142:Expr_L112_C8", "label": "write()", "type": "expression", "loc": [112, 112], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99142:For_L111_C4", "vector": [8, 2, 0.896, 0.008, 2, 0.84, 0.0, 837, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "write", "arg_names": [], "import_names": [], "rhs_call_name": "write", "annotation": ""}, "snippet": " outf.write(make_define_line(k, constants[k]))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99142:Expr_L113_C4", "label": "close()", "type": "expression", "loc": [113, 113], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99142:FunctionDef_L107_C0", "vector": [8, 1, 0.904, 0.008, 1, 0.92, 1.0, 77, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "close", "arg_names": [], "import_names": [], "rhs_call_name": "close", "annotation": ""}, "snippet": " outf.close()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99142:FunctionDef_L117_C0", "label": "main", "type": "function", "loc": [117, 119], "level": 0, "parent": null, "vector": [2, 0, 0.944, 0.024, 0, 0.66, 0.9444, 624, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "main", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def main():\n cts = get_all_constants(xlsFileName)\n write_const_to_header(cts, headerFileName)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99142:Assign_L118_C4", "label": "cts = get_all_constants()", "type": "assigned_variable", "loc": [118, 118], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99142:FunctionDef_L117_C0", "vector": [14, 1, 0.944, 0.008, 1, 0.96, 0.0, 454, 3, 1, 0, 0, 97, 10, 1], "semantic": {"name": "cts", "arg_names": [], "import_names": [], "rhs_call_name": "get_all_constants", "annotation": ""}, "snippet": " cts = get_all_constants(xlsFileName)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99142:Expr_L119_C4", "label": "write_const_to_header()", "type": "expression", "loc": [119, 119], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99142:FunctionDef_L117_C0", "vector": [8, 1, 0.952, 0.008, 1, 0.96, 1.0, 188, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "write_const_to_header", "arg_names": [], "import_names": [], "rhs_call_name": "write_const_to_header", "annotation": ""}, "snippet": " write_const_to_header(cts, headerFileName)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99142:If_L122_C0", "label": "if", "type": "if", "loc": [122, 123], "level": 0, "parent": null, "vector": [4, 0, 0.98, 0.016, 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_99142:Expr_L123_C4", "label": "main()", "type": "expression", "loc": [123, 123], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99142:If_L122_C0", "vector": [8, 1, 0.984, 0.008, 1, 0.79, 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_99142:FunctionDef_L18_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99142:Assign_L19_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99142:FunctionDef_L18_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99142:Assign_L20_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99142:FunctionDef_L18_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99142:Assign_L21_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99142:FunctionDef_L18_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99142:Expr_L22_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99142:FunctionDef_L18_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99142:Expr_L23_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99142:FunctionDef_L18_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99142:Expr_L24_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99142:FunctionDef_L18_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99142:Expr_L25_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99142:FunctionDef_L18_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99142:Return_L26_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99142:FunctionDef_L29_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99142:Assign_L30_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99142:FunctionDef_L29_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99142:Assign_L31_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99142:FunctionDef_L29_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99142:Assign_L32_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99142:FunctionDef_L29_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99142:Return_L33_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99142:FunctionDef_L36_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99142:Assign_L37_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99142:FunctionDef_L36_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99142:Assign_L38_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99142:FunctionDef_L36_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99142:For_L40_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99142:For_L40_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99142:Assign_L41_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99142:For_L40_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99142:Assign_L42_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99142:For_L40_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99142:Assign_L43_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99142:For_L40_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99142:For_L45_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99142:For_L45_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99142:For_L47_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99142:For_L47_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99142:If_L48_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99142:If_L48_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99142:Assign_L49_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99142:If_L48_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99142:Assign_L50_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99142:If_L48_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99142:If_L51_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99142:If_L51_C20", "t": "ajibawa-2023/Python-Code-Large/train/row_99142:For_L53_C24"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99142:For_L53_C24", "t": "ajibawa-2023/Python-Code-Large/train/row_99142:If_L54_C28"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99142:If_L54_C28", "t": "ajibawa-2023/Python-Code-Large/train/row_99142:Assign_L55_C32"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99142:If_L51_C20", "t": "ajibawa-2023/Python-Code-Large/train/row_99142:If_L57_C24"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99142:If_L57_C24", "t": "ajibawa-2023/Python-Code-Large/train/row_99142:Expr_L59_C28"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99142:If_L51_C20", "t": "ajibawa-2023/Python-Code-Large/train/row_99142:If_L61_C24"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99142:If_L61_C24", "t": "ajibawa-2023/Python-Code-Large/train/row_99142:Assign_L62_C28"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99142:If_L61_C24", "t": "ajibawa-2023/Python-Code-Large/train/row_99142:Assign_L63_C28"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99142:If_L61_C24", "t": "ajibawa-2023/Python-Code-Large/train/row_99142:Expr_L66_C28"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99142:For_L40_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99142:Expr_L68_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99142:FunctionDef_L36_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99142:Return_L69_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99142:FunctionDef_L73_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99142:Assign_L74_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99142:FunctionDef_L73_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99142:Assign_L75_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99142:FunctionDef_L73_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99142:Expr_L76_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99142:FunctionDef_L73_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99142:Expr_L77_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99142:FunctionDef_L73_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99142:Expr_L78_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99142:FunctionDef_L73_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99142:Expr_L79_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99142:FunctionDef_L73_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99142:Assign_L80_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99142:FunctionDef_L73_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99142:Assign_L81_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99142:FunctionDef_L73_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99142:Expr_L82_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99142:FunctionDef_L73_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99142:Expr_L83_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99142:FunctionDef_L73_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99142:Expr_L84_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99142:FunctionDef_L73_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99142:Expr_L85_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99142:FunctionDef_L73_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99142:For_L86_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99142:For_L86_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99142:If_L87_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99142:If_L87_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99142:Expr_L88_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99142:FunctionDef_L91_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99142:If_L92_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99142:FunctionDef_L91_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99142:Assign_L94_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99142:FunctionDef_L91_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99142:If_L95_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99142:If_L95_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99142:Return_L96_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99142:If_L95_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99142:If_L97_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99142:If_L97_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99142:Return_L98_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99142:If_L97_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99142:If_L99_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99142:If_L99_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99142:Return_L100_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99142:FunctionDef_L103_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99142:Assign_L104_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99142:FunctionDef_L103_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99142:Return_L105_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99142:FunctionDef_L107_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99142:Assign_L108_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99142:FunctionDef_L107_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99142:Assign_L109_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99142:FunctionDef_L107_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99142:Expr_L110_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99142:FunctionDef_L107_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99142:For_L111_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99142:For_L111_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99142:Expr_L112_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99142:FunctionDef_L107_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99142:Expr_L113_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99142:FunctionDef_L117_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99142:Assign_L118_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99142:FunctionDef_L117_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99142:Expr_L119_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99142:If_L122_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99142:Expr_L123_C4"}]
#!/usr/bin/env python # coding=utf-8 import os,sys import re import codecs import glob import shutil import pyExcelerator as pE SECTIONS = { 'habitation': ( r'#street name dictionary start', r'#district name dictionary end' ), 'num1':( r'#1 digit number dictionary start', r'#1 digit number dictionary end' ), 'num3':( r'#3 digit number dictionary start', r'#3 digit number dictionary end' ), 'num4':( r'#4 digit number dictionary start', r'#4 digit number dictionary end' ), 'num5':( r'#5 digit number dictionary start', r'#5 digit number dictionary end' ), 'landline':( r'#landline dictionary start', r'#landline dictionary end' ), 'mobile_phone_number':( r'#mobile phone number(13digit) dictionary start', r'#mobile phone number(13digit) dictionary end' ), 'landline1':( r'#landline1 dictionary start', r'#landline1 dictionary end' ), 'num34':( r'#3 or 4 digit number dictionary start', r'#3 or 4 digit number dictionary end' ), 'num345':( r'#3,4,5 Digit dictionary start', r'#3,4,5 Digit dictionary end' ), 'num789':( r'#7,8,9 Digit dictionary start', r'#7,8,9 Digit dictionary end' ), 'num101112':( r'#10,11,12 Digit dictionary start', r'#10,11,12 Digit dictionary end' ) } LOG_FILE = open('ParseRes.log', 'w') def LogPrint(s): print s print >> LOG_FILE, s class CannotFindError(Exception): pass def FindLino(lines, s): for n in range(len(lines)): if lines[n].find(s)>=0: return n for n in range(len(lines)): if re.search(s,lines[n]): return n raise CannotFindError() def GetPercent(fnres): lines = codecs.open(fnres, encoding='utf-16').readlines() stLine = FindLino(lines, r'Cumulative percent of phrases matched by a phrase result number') m1 = re.match(r'^\s*1\s*\|\s*([\d\.]+)\s*$', lines[stLine+2]) p1 = float(m1.groups()[0]) return p1 # m2 = re.match(r'^\s*2\s*\|\s*([\d\.]+)\s*$', lines[stLine+3]) # p2 = float(m2.groups()[0]) # m3 = re.match(r'^\s*3\s*\|\s*([\d\.]+)\s*$', lines[stLine+4]) # p3 = float(m3.groups()[0]) # return (p1,p2,p3) def FillSheet(sheet,sn): dialects = ('Beijing', 'Gan', 'Kejia', 'Min','Wu', 'Xiang', 'Yue') for speaker in range(1,11): sheet.write(speaker+1, 0, 'speaker'+str(speaker)) for col in range(1, 22): sheet.write(1, col, 'C'+str((col-1)%3+1)) for n in range(len(dialects)): sheet.write(0, n*3+1, dialects[n]) for speaker in range(1,11): fn1 = os.path.join('ResArchive',sn,dialects[n],'speaker'+str(speaker)+''+'.res') p1 = GetPercent(fn1) sheet.write(speaker+1, n*3+1, p1) fn2 = os.path.join('ResArchive',sn,dialects[n],'speaker'+str(speaker)+'_C2'+'.res') p2 = GetPercent(fn2) sheet.write(speaker+1, n*3+2, p2) fn3 = os.path.join('ResArchive',sn,dialects[n],'speaker'+str(speaker)+'_C3'+'.res') p3 = GetPercent(fn3) sheet.write(speaker+1, n*3+3, p3) def CreateXls(xlsn): w = pE.Workbook() for sn in SECTIONS.keys(): ws = w.add_sheet(sn) FillSheet(ws,sn) w.save(xlsn) def __main__(): CreateXls('ResArchive\\AllPercents.xls') print 'see ResArchive\\AllPercents.xls' if __name__ == '__main__': __main__()
ajibawa-2023/Python-Code-Large/train/row_99143
53
126
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_99143:Import_L5_C0", "label": "os import os, sys", "type": "import", "loc": [5, 5], "level": 0, "parent": null, "vector": [1, 0, 0.0397, 0.0079, 0, 0.66, 0.0, 688, 0, 2, 0, 0, 688, 0, 0], "semantic": {"name": "os", "arg_names": [], "import_names": ["os", "sys"], "rhs_call_name": "", "annotation": ""}, "snippet": "import os,sys"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99143:Import_L6_C0", "label": "re import re", "type": "import", "loc": [6, 6], "level": 0, "parent": null, "vector": [1, 0, 0.0476, 0.0079, 0, 0.66, 0.0667, 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_99143:Import_L7_C0", "label": "codecs import codecs", "type": "import", "loc": [7, 7], "level": 0, "parent": null, "vector": [1, 0, 0.0556, 0.0079, 0, 0.66, 0.1333, 220, 0, 1, 0, 0, 220, 0, 0], "semantic": {"name": "codecs", "arg_names": [], "import_names": ["codecs"], "rhs_call_name": "", "annotation": ""}, "snippet": "import codecs"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99143:Import_L8_C0", "label": "glob import glob", "type": "import", "loc": [8, 8], "level": 0, "parent": null, "vector": [1, 0, 0.0635, 0.0079, 0, 0.66, 0.2, 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_99143:Import_L9_C0", "label": "shutil import shutil", "type": "import", "loc": [9, 9], "level": 0, "parent": null, "vector": [1, 0, 0.0714, 0.0079, 0, 0.66, 0.2667, 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_99143:Import_L10_C0", "label": "pyExcelerator import pE", "type": "import", "loc": [10, 10], "level": 0, "parent": null, "vector": [1, 0, 0.0794, 0.0079, 0, 0.66, 0.3333, 173, 0, 1, 0, 0, 173, 0, 0], "semantic": {"name": "pyExcelerator", "arg_names": [], "import_names": ["pE"], "rhs_call_name": "", "annotation": ""}, "snippet": "import pyExcelerator as pE"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99143:Assign_L12_C0", "label": "SECTIONS =", "type": "assigned_variable", "loc": [12, 61], "level": 0, "parent": null, "vector": [14, 0, 0.2897, 0.3968, 0, 0.66, 0.4, 544, 0, 0, 0, 0, 0, 6, 0], "semantic": {"name": "SECTIONS", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "SECTIONS = {\n\t\t'habitation': (\n\t\t\tr'#street name dictionary start',\n\t\t\tr'#district name dictionary end'\n\t\t\t),\n\t\t'num1':(\n\t\t\tr'#1 digit number dictionary start',\n\t\t\tr'#1 digit number dictionary end'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99143:Assign_L65_C0", "label": "LOG_FILE = open()", "type": "assigned_variable", "loc": [65, 65], "level": 0, "parent": null, "vector": [14, 0, 0.5159, 0.0079, 0, 0.66, 0.4667, 260, 3, 2, 0, 0, 693, 10, 1], "semantic": {"name": "LOG_FILE", "arg_names": [], "import_names": [], "rhs_call_name": "open", "annotation": ""}, "snippet": "LOG_FILE = open('ParseRes.log', 'w')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99143:FunctionDef_L66_C0", "label": "LogPrint", "type": "function", "loc": [66, 67], "level": 0, "parent": null, "vector": [2, 0, 0.5278, 0.0159, 0, 0.66, 0.5333, 576, 0, 1, 0, 0, 0, 0, 1], "semantic": {"name": "LogPrint", "arg_names": ["s"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def LogPrint(s):\n\tprint(s)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99143:Expr_L67_C1", "label": "print()", "type": "expression", "loc": [67, 67], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99143:FunctionDef_L66_C0", "vector": [8, 1, 0.5317, 0.0079, 1, 0.03, 0.0, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": "\tprint(s)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99143:ClassDef_L70_C0", "label": "CannotFindError", "type": "class", "loc": [70, 70], "level": 0, "parent": null, "vector": [3, 0, 0.5556, 0.0079, 0, 0.66, 0.6, 337, 0, 0, 0, 0, 645, 0, 0], "semantic": {"name": "CannotFindError", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class CannotFindError(Exception): pass"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99143:FunctionDef_L71_C0", "label": "FindLino", "type": "function", "loc": [71, 78], "level": 0, "parent": null, "vector": [2, 0, 0.5913, 0.0635, 0, 0.66, 0.6667, 729, 0, 2, 1, 0, 0, 0, 7], "semantic": {"name": "FindLino", "arg_names": ["lines", "s"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def FindLino(lines, s):\n\tfor n in range(len(lines)):\n\t\tif lines[n].find(s)>=0:\n\t\t\treturn n\n\tfor n in range(len(lines)):\n\t\tif re.search(s,lines[n]):\n\t\t\treturn n\n\traise CannotFindError()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99143:For_L72_C1", "label": "for n", "type": "for", "loc": [72, 74], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99143:FunctionDef_L71_C0", "vector": [6, 1, 0.5794, 0.0238, 1, 0.38, 0.0, 773, 3, 0, 0, 0, 0, 0, 3], "semantic": {"name": "n", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tfor n in range(len(lines)):\n\t\tif lines[n].find(s)>=0:\n\t\t\treturn n"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99143:If_L73_C2", "label": "if", "type": "if", "loc": [73, 74], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99143:For_L72_C1", "vector": [4, 2, 0.5833, 0.0159, 2, 0.5, 0.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tif lines[n].find(s)>=0:\n\t\t\treturn n"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99143:Return_L74_C3", "label": "return", "type": "return", "loc": [74, 74], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99143:If_L73_C2", "vector": [13, 3, 0.5873, 0.0079, 3, 0.42, 0.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\treturn n"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99143:For_L75_C1", "label": "for n", "type": "for", "loc": [75, 77], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99143:FunctionDef_L71_C0", "vector": [6, 1, 0.6032, 0.0238, 1, 0.38, 1.0, 773, 3, 0, 0, 0, 0, 0, 3], "semantic": {"name": "n", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tfor n in range(len(lines)):\n\t\tif re.search(s,lines[n]):\n\t\t\treturn n"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99143:If_L76_C2", "label": "if", "type": "if", "loc": [76, 77], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99143:For_L75_C1", "vector": [4, 2, 0.6071, 0.0159, 2, 0.12, 0.0, 0, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tif re.search(s,lines[n]):\n\t\t\treturn n"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99143:Return_L77_C3", "label": "return", "type": "return", "loc": [77, 77], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99143:If_L76_C2", "vector": [13, 3, 0.6111, 0.0079, 3, 0.23, 0.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\treturn n"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99143:FunctionDef_L80_C0", "label": "GetPercent", "type": "function", "loc": [80, 85], "level": 0, "parent": null, "vector": [2, 0, 0.6548, 0.0476, 0, 0.66, 0.7333, 283, 0, 1, 1, 0, 0, 0, 6], "semantic": {"name": "GetPercent", "arg_names": ["fnres"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def GetPercent(fnres):\n\tlines = codecs.open(fnres, encoding='utf-16').readlines()\n\tstLine = FindLino(lines, r'Cumulative percent of phrases matched by a phrase result number')\n\tm1 = re.match(r'^\\s*1\\s*\\|\\s*([\\d\\.]+)\\s*$', lines[stLine+2])\n\tp1 = float(m1.groups()[0])\n\treturn p1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99143:Assign_L81_C1", "label": "lines = readlines()", "type": "assigned_variable", "loc": [81, 81], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99143:FunctionDef_L80_C0", "vector": [14, 1, 0.6429, 0.0079, 1, 0.99, 0.0, 73, 3, 0, 0, 0, 841, 10, 2], "semantic": {"name": "lines", "arg_names": [], "import_names": [], "rhs_call_name": "readlines", "annotation": ""}, "snippet": "\tlines = codecs.open(fnres, encoding='utf-16').readlines()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99143:Assign_L82_C1", "label": "stLine = FindLino()", "type": "assigned_variable", "loc": [82, 82], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99143:FunctionDef_L80_C0", "vector": [14, 1, 0.6508, 0.0079, 1, 0.99, 0.25, 811, 3, 2, 0, 0, 729, 10, 1], "semantic": {"name": "stLine", "arg_names": [], "import_names": [], "rhs_call_name": "FindLino", "annotation": ""}, "snippet": "\tstLine = FindLino(lines, r'Cumulative percent of phrases matched by a phrase result number')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99143:Assign_L83_C1", "label": "m1 = match()", "type": "assigned_variable", "loc": [83, 83], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99143:FunctionDef_L80_C0", "vector": [14, 1, 0.6587, 0.0079, 1, 0.99, 0.5, 814, 3, 2, 0, 0, 36, 10, 1], "semantic": {"name": "m1", "arg_names": [], "import_names": [], "rhs_call_name": "match", "annotation": ""}, "snippet": "\tm1 = re.match(r'^\\s*1\\s*\\|\\s*([\\d\\.]+)\\s*$', lines[stLine+2])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99143:Assign_L84_C1", "label": "p1 = float()", "type": "assigned_variable", "loc": [84, 84], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99143:FunctionDef_L80_C0", "vector": [14, 1, 0.6667, 0.0079, 1, 0.99, 0.75, 87, 3, 1, 0, 0, 639, 10, 2], "semantic": {"name": "p1", "arg_names": [], "import_names": [], "rhs_call_name": "float", "annotation": ""}, "snippet": "\tp1 = float(m1.groups()[0])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99143:Return_L85_C1", "label": "return", "type": "return", "loc": [85, 85], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99143:FunctionDef_L80_C0", "vector": [13, 1, 0.6746, 0.0079, 1, 0.99, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\treturn p1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99143:FunctionDef_L92_C0", "label": "FillSheet", "type": "function", "loc": [92, 109], "level": 0, "parent": null, "vector": [2, 0, 0.7976, 0.1429, 0, 0.66, 0.8, 841, 0, 2, 0, 0, 0, 0, 22], "semantic": {"name": "FillSheet", "arg_names": ["sheet", "sn"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def FillSheet(sheet,sn):\n\tdialects = ('Beijing', 'Gan', 'Kejia', 'Min','Wu', 'Xiang', 'Yue')\n\tfor speaker in range(1,11):\n\t\tsheet.write(speaker+1, 0, 'speaker'+str(speaker))\n\tfor col in range(1, 22):\n\t\tsheet.write(1, col, 'C'+str((col-1)%3+1))\n\tfor n in range(len(dialects)):\n\t\tsheet.write(0, n*3+1, dialects[n])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99143:Assign_L93_C1", "label": "dialects =", "type": "assigned_variable", "loc": [93, 93], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99143:FunctionDef_L92_C0", "vector": [14, 1, 0.7381, 0.0079, 1, 0.76, 0.0, 783, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "dialects", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tdialects = ('Beijing', 'Gan', 'Kejia', 'Min','Wu', 'Xiang', 'Yue')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99143:For_L94_C1", "label": "for speaker", "type": "for", "loc": [94, 95], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99143:FunctionDef_L92_C0", "vector": [6, 1, 0.75, 0.0159, 1, 0.76, 0.3333, 600, 3, 0, 0, 0, 0, 0, 3], "semantic": {"name": "speaker", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tfor speaker in range(1,11):\n\t\tsheet.write(speaker+1, 0, 'speaker'+str(speaker))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99143:Expr_L95_C2", "label": "write()", "type": "expression", "loc": [95, 95], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99143:For_L94_C1", "vector": [8, 2, 0.754, 0.0079, 2, 0.39, 0.0, 837, 3, 3, 0, 0, 0, 0, 2], "semantic": {"name": "write", "arg_names": [], "import_names": [], "rhs_call_name": "write", "annotation": ""}, "snippet": "\t\tsheet.write(speaker+1, 0, 'speaker'+str(speaker))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99143:For_L96_C1", "label": "for col", "type": "for", "loc": [96, 97], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99143:FunctionDef_L92_C0", "vector": [6, 1, 0.7659, 0.0159, 1, 0.76, 0.6667, 157, 3, 0, 0, 0, 0, 0, 3], "semantic": {"name": "col", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tfor col in range(1, 22):\n\t\tsheet.write(1, col, 'C'+str((col-1)%3+1))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99143:Expr_L97_C2", "label": "write()", "type": "expression", "loc": [97, 97], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99143:For_L96_C1", "vector": [8, 2, 0.7698, 0.0079, 2, 0.24, 0.0, 837, 3, 3, 0, 0, 0, 0, 2], "semantic": {"name": "write", "arg_names": [], "import_names": [], "rhs_call_name": "write", "annotation": ""}, "snippet": "\t\tsheet.write(1, col, 'C'+str((col-1)%3+1))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99143:For_L98_C1", "label": "for n", "type": "for", "loc": [98, 109], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99143:FunctionDef_L92_C0", "vector": [6, 1, 0.8214, 0.0952, 1, 0.76, 1.0, 773, 3, 0, 0, 0, 0, 0, 16], "semantic": {"name": "n", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tfor n in range(len(dialects)):\n\t\tsheet.write(0, n*3+1, dialects[n])\n\t\tfor speaker in range(1,11):\n\t\t\tfn1 = os.path.join('ResArchive',sn,dialects[n],'speaker'+str(speaker)+''+'.res')\n\t\t\tp1 = GetPercent(fn1)\n\t\t\tsheet.write(speaker+1, n*3+1, p1)\n\t\t\tfn2 = os.path.join('ResArchive',sn,dialects[n],'speaker'+str(speaker)+'_C2'+'.res')\n\t\t\tp2 = GetPercent(fn2)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99143:Expr_L99_C2", "label": "write()", "type": "expression", "loc": [99, 99], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99143:For_L98_C1", "vector": [8, 2, 0.7857, 0.0079, 2, 0.73, 0.0, 837, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "write", "arg_names": [], "import_names": [], "rhs_call_name": "write", "annotation": ""}, "snippet": "\t\tsheet.write(0, n*3+1, dialects[n])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99143:For_L100_C2", "label": "for speaker", "type": "for", "loc": [100, 109], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99143:For_L98_C1", "vector": [6, 2, 0.8294, 0.0794, 2, 0.73, 1.0, 600, 3, 0, 0, 0, 0, 0, 13], "semantic": {"name": "speaker", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tfor speaker in range(1,11):\n\t\t\tfn1 = os.path.join('ResArchive',sn,dialects[n],'speaker'+str(speaker)+''+'.res')\n\t\t\tp1 = GetPercent(fn1)\n\t\t\tsheet.write(speaker+1, n*3+1, p1)\n\t\t\tfn2 = os.path.join('ResArchive',sn,dialects[n],'speaker'+str(speaker)+'_C2'+'.res')\n\t\t\tp2 = GetPercent(fn2)\n\t\t\tsheet.write(speaker+1, n*3+2, p2)\n\t\t\tfn3 = os.path.join('ResArchive',sn,dialects[n],'speaker'+str(speaker)+'_C3'+'.res')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99143:Assign_L101_C3", "label": "fn1 = join()", "type": "assigned_variable", "loc": [101, 101], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99143:For_L100_C2", "vector": [14, 3, 0.8016, 0.0079, 3, 0.59, 0.0, 21, 3, 4, 0, 0, 933, 10, 2], "semantic": {"name": "fn1", "arg_names": [], "import_names": [], "rhs_call_name": "join", "annotation": ""}, "snippet": "\t\t\tfn1 = os.path.join('ResArchive',sn,dialects[n],'speaker'+str(speaker)+''+'.res')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99143:Assign_L102_C3", "label": "p1 = GetPercent()", "type": "assigned_variable", "loc": [102, 102], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99143:For_L100_C2", "vector": [14, 3, 0.8095, 0.0079, 3, 0.59, 0.125, 87, 3, 1, 0, 0, 283, 10, 1], "semantic": {"name": "p1", "arg_names": [], "import_names": [], "rhs_call_name": "GetPercent", "annotation": ""}, "snippet": "\t\t\tp1 = GetPercent(fn1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99143:Expr_L103_C3", "label": "write()", "type": "expression", "loc": [103, 103], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99143:For_L100_C2", "vector": [8, 3, 0.8175, 0.0079, 3, 0.59, 0.25, 837, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "write", "arg_names": [], "import_names": [], "rhs_call_name": "write", "annotation": ""}, "snippet": "\t\t\tsheet.write(speaker+1, n*3+1, p1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99143:Assign_L104_C3", "label": "fn2 = join()", "type": "assigned_variable", "loc": [104, 104], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99143:For_L100_C2", "vector": [14, 3, 0.8254, 0.0079, 3, 0.59, 0.375, 307, 3, 4, 0, 0, 933, 10, 2], "semantic": {"name": "fn2", "arg_names": [], "import_names": [], "rhs_call_name": "join", "annotation": ""}, "snippet": "\t\t\tfn2 = os.path.join('ResArchive',sn,dialects[n],'speaker'+str(speaker)+'_C2'+'.res')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99143:Assign_L105_C3", "label": "p2 = GetPercent()", "type": "assigned_variable", "loc": [105, 105], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99143:For_L100_C2", "vector": [14, 3, 0.8333, 0.0079, 3, 0.59, 0.5, 843, 3, 1, 0, 0, 283, 10, 1], "semantic": {"name": "p2", "arg_names": [], "import_names": [], "rhs_call_name": "GetPercent", "annotation": ""}, "snippet": "\t\t\tp2 = GetPercent(fn2)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99143:Expr_L106_C3", "label": "write()", "type": "expression", "loc": [106, 106], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99143:For_L100_C2", "vector": [8, 3, 0.8413, 0.0079, 3, 0.59, 0.625, 837, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "write", "arg_names": [], "import_names": [], "rhs_call_name": "write", "annotation": ""}, "snippet": "\t\t\tsheet.write(speaker+1, n*3+2, p2)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99143:Assign_L107_C3", "label": "fn3 = join()", "type": "assigned_variable", "loc": [107, 107], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99143:For_L100_C2", "vector": [14, 3, 0.8492, 0.0079, 3, 0.59, 0.75, 719, 3, 4, 0, 0, 933, 10, 2], "semantic": {"name": "fn3", "arg_names": [], "import_names": [], "rhs_call_name": "join", "annotation": ""}, "snippet": "\t\t\tfn3 = os.path.join('ResArchive',sn,dialects[n],'speaker'+str(speaker)+'_C3'+'.res')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99143:Assign_L108_C3", "label": "p3 = GetPercent()", "type": "assigned_variable", "loc": [108, 108], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99143:For_L100_C2", "vector": [14, 3, 0.8571, 0.0079, 3, 0.59, 0.875, 80, 3, 1, 0, 0, 283, 10, 1], "semantic": {"name": "p3", "arg_names": [], "import_names": [], "rhs_call_name": "GetPercent", "annotation": ""}, "snippet": "\t\t\tp3 = GetPercent(fn3)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99143:Expr_L109_C3", "label": "write()", "type": "expression", "loc": [109, 109], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99143:For_L100_C2", "vector": [8, 3, 0.8651, 0.0079, 3, 0.59, 1.0, 837, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "write", "arg_names": [], "import_names": [], "rhs_call_name": "write", "annotation": ""}, "snippet": "\t\t\tsheet.write(speaker+1, n*3+3, p3)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99143:FunctionDef_L112_C0", "label": "CreateXls", "type": "function", "loc": [112, 117], "level": 0, "parent": null, "vector": [2, 0, 0.9087, 0.0476, 0, 0.66, 0.8667, 233, 0, 1, 0, 0, 0, 0, 5], "semantic": {"name": "CreateXls", "arg_names": ["xlsn"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def CreateXls(xlsn):\n\tw = pE.Workbook()\n\tfor sn in SECTIONS.keys():\n\t\tws = w.add_sheet(sn)\n\t\tFillSheet(ws,sn)\n\tw.save(xlsn)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99143:Assign_L113_C1", "label": "w = Workbook()", "type": "assigned_variable", "loc": [113, 113], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99143:FunctionDef_L112_C0", "vector": [14, 1, 0.8968, 0.0079, 1, 0.29, 0.0, 549, 3, 0, 0, 0, 590, 10, 1], "semantic": {"name": "w", "arg_names": [], "import_names": [], "rhs_call_name": "Workbook", "annotation": ""}, "snippet": "\tw = pE.Workbook()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99143:For_L114_C1", "label": "for sn", "type": "for", "loc": [114, 116], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99143:FunctionDef_L112_C0", "vector": [6, 1, 0.9127, 0.0238, 1, 0.29, 0.5, 981, 3, 0, 0, 0, 0, 0, 3], "semantic": {"name": "sn", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tfor sn in SECTIONS.keys():\n\t\tws = w.add_sheet(sn)\n\t\tFillSheet(ws,sn)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99143:Assign_L115_C2", "label": "ws = add_sheet()", "type": "assigned_variable", "loc": [115, 115], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99143:For_L114_C1", "vector": [14, 2, 0.9127, 0.0079, 2, 0.55, 0.0, 707, 3, 1, 0, 0, 478, 10, 1], "semantic": {"name": "ws", "arg_names": [], "import_names": [], "rhs_call_name": "add_sheet", "annotation": ""}, "snippet": "\t\tws = w.add_sheet(sn)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99143:Expr_L116_C2", "label": "FillSheet()", "type": "expression", "loc": [116, 116], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99143:For_L114_C1", "vector": [8, 2, 0.9206, 0.0079, 2, 0.55, 1.0, 841, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "FillSheet", "arg_names": [], "import_names": [], "rhs_call_name": "FillSheet", "annotation": ""}, "snippet": "\t\tFillSheet(ws,sn)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99143:Expr_L117_C1", "label": "save()", "type": "expression", "loc": [117, 117], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99143:FunctionDef_L112_C0", "vector": [8, 1, 0.9286, 0.0079, 1, 0.29, 1.0, 928, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "save", "arg_names": [], "import_names": [], "rhs_call_name": "save", "annotation": ""}, "snippet": "\tw.save(xlsn)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99143:FunctionDef_L119_C0", "label": "__main__", "type": "function", "loc": [119, 121], "level": 0, "parent": null, "vector": [2, 0, 0.9524, 0.0238, 0, 0.66, 0.9333, 593, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "__main__", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def __main__():\n\tCreateXls('ResArchive\\\\AllPercents.xls')\n\tprint('see ResArchive\\\\AllPercents.xls')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99143:Expr_L120_C1", "label": "CreateXls()", "type": "expression", "loc": [120, 120], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99143:FunctionDef_L119_C0", "vector": [8, 1, 0.9524, 0.0079, 1, 0.73, 0.0, 233, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "CreateXls", "arg_names": [], "import_names": [], "rhs_call_name": "CreateXls", "annotation": ""}, "snippet": "\tCreateXls('ResArchive\\\\AllPercents.xls')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99143:Expr_L121_C1", "label": "print()", "type": "expression", "loc": [121, 121], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99143:FunctionDef_L119_C0", "vector": [8, 1, 0.9603, 0.0079, 1, 0.73, 1.0, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": "\tprint('see ResArchive\\\\AllPercents.xls')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99143:If_L124_C0", "label": "if", "type": "if", "loc": [124, 125], "level": 0, "parent": null, "vector": [4, 0, 0.9881, 0.0159, 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\t__main__()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99143:Expr_L125_C1", "label": "__main__()", "type": "expression", "loc": [125, 125], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99143:If_L124_C0", "vector": [8, 1, 0.9921, 0.0079, 1, 0.38, 0.0, 593, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "__main__", "arg_names": [], "import_names": [], "rhs_call_name": "__main__", "annotation": ""}, "snippet": "\t__main__()"}]
[{"f": "ajibawa-2023/Python-Code-Large/train/row_99143:FunctionDef_L66_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99143:Expr_L67_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99143:FunctionDef_L71_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99143:For_L72_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99143:For_L72_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99143:If_L73_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99143:If_L73_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99143:Return_L74_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99143:FunctionDef_L71_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99143:For_L75_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99143:For_L75_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99143:If_L76_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99143:If_L76_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99143:Return_L77_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99143:FunctionDef_L80_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99143:Assign_L81_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99143:FunctionDef_L80_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99143:Assign_L82_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99143:FunctionDef_L80_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99143:Assign_L83_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99143:FunctionDef_L80_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99143:Assign_L84_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99143:FunctionDef_L80_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99143:Return_L85_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99143:FunctionDef_L92_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99143:Assign_L93_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99143:FunctionDef_L92_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99143:For_L94_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99143:For_L94_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99143:Expr_L95_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99143:FunctionDef_L92_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99143:For_L96_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99143:For_L96_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99143:Expr_L97_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99143:FunctionDef_L92_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99143:For_L98_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99143:For_L98_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99143:Expr_L99_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99143:For_L98_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99143:For_L100_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99143:For_L100_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99143:Assign_L101_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99143:For_L100_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99143:Assign_L102_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99143:For_L100_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99143:Expr_L103_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99143:For_L100_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99143:Assign_L104_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99143:For_L100_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99143:Assign_L105_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99143:For_L100_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99143:Expr_L106_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99143:For_L100_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99143:Assign_L107_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99143:For_L100_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99143:Assign_L108_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99143:For_L100_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99143:Expr_L109_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99143:FunctionDef_L112_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99143:Assign_L113_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99143:FunctionDef_L112_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99143:For_L114_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99143:For_L114_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99143:Assign_L115_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99143:For_L114_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99143:Expr_L116_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99143:FunctionDef_L112_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99143:Expr_L117_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99143:FunctionDef_L119_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99143:Expr_L120_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99143:FunctionDef_L119_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99143:Expr_L121_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99143:If_L124_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99143:Expr_L125_C1"}]
#! /usr/bin/env python # coding=utf-8 ############################################################################# # # # File: common.py # # # # Copyright (C) 2008-2009 Du XiaoGang <dugang@188.com> # # # # Home: http://gappproxy.googlecode.com # # # # This file is part of GAppProxy. # # # # GAppProxy is free software: you can redistribute it and/or modify # # it under the terms of the GNU General Public License as # # published by the Free Software Foundation, either version 3 of the # # License, or (at your option) any later version. # # # # GAppProxy 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 GAppProxy. If not, see <http://www.gnu.org/licenses/>. # # # ############################################################################# import os, sys def module_path(): """ This will get us the program's directory""" return os.path.dirname(__file__) dir = module_path() LOAD_BALANCE = 'http://gappproxy-center.appspot.com/available_fetchserver.py' GOOGLE_PROXY = 'www.google.cn:80' DEF_LOCAL_PROXY = '' DEF_FETCH_SERVER = '' DEF_LISTEN_PORT = 8000 DEF_KEY_FILE = os.path.join(dir, 'ssl/LocalProxyServer.key') DEF_CERT_FILE = os.path.join(dir, 'ssl/LocalProxyServer.cert') DEF_CONF_FILE = os.path.join(dir, 'proxy.conf') DEF_COMM_FILE = os.path.join(dir, '.proxy.conf.tmp') class GAppProxyError(Exception): def __init__(self, reason): self.reason = reason def __str__(self): return '<GAppProxy Error: %s>' % self.reason
ajibawa-2023/Python-Code-Large/train/row_99145
19
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_99145:Import_L28_C0", "label": "os import os, sys", "type": "import", "loc": [28, 28], "level": 0, "parent": null, "vector": [1, 0, 0.549, 0.0196, 0, 0.66, 0.0, 688, 0, 2, 0, 0, 688, 0, 0], "semantic": {"name": "os", "arg_names": [], "import_names": ["os", "sys"], "rhs_call_name": "", "annotation": ""}, "snippet": "import os, sys"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99145:FunctionDef_L30_C0", "label": "module_path", "type": "function", "loc": [30, 32], "level": 0, "parent": null, "vector": [2, 0, 0.6078, 0.0588, 0, 0.66, 0.0833, 663, 0, 0, 1, 0, 0, 0, 1], "semantic": {"name": "module_path", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def module_path():\n \"\"\" This will get us the program's directory\"\"\"\n return os.path.dirname(__file__)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99145:Expr_L31_C4", "label": "expression", "type": "expression", "loc": [31, 31], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99145:FunctionDef_L30_C0", "vector": [8, 1, 0.6078, 0.0196, 1, 0.8, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\" This will get us the program's directory\"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99145:Return_L32_C4", "label": "return", "type": "return", "loc": [32, 32], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99145:FunctionDef_L30_C0", "vector": [13, 1, 0.6275, 0.0196, 1, 0.8, 1.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return os.path.dirname(__file__)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99145:Assign_L34_C0", "label": "dir = module_path()", "type": "assigned_variable", "loc": [34, 34], "level": 0, "parent": null, "vector": [14, 0, 0.6667, 0.0196, 0, 0.66, 0.1667, 152, 3, 0, 0, 0, 663, 10, 1], "semantic": {"name": "dir", "arg_names": [], "import_names": [], "rhs_call_name": "module_path", "annotation": ""}, "snippet": "dir = module_path()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99145:Assign_L36_C0", "label": "LOAD_BALANCE =", "type": "assigned_variable", "loc": [36, 36], "level": 0, "parent": null, "vector": [14, 0, 0.7059, 0.0196, 0, 0.66, 0.25, 163, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "LOAD_BALANCE", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "LOAD_BALANCE = 'http://gappproxy-center.appspot.com/available_fetchserver.py'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99145:Assign_L37_C0", "label": "GOOGLE_PROXY =", "type": "assigned_variable", "loc": [37, 37], "level": 0, "parent": null, "vector": [14, 0, 0.7255, 0.0196, 0, 0.66, 0.3333, 466, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "GOOGLE_PROXY", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "GOOGLE_PROXY = 'www.google.cn:80'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99145:Assign_L38_C0", "label": "DEF_LOCAL_PROXY =", "type": "assigned_variable", "loc": [38, 38], "level": 0, "parent": null, "vector": [14, 0, 0.7451, 0.0196, 0, 0.66, 0.4167, 464, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "DEF_LOCAL_PROXY", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "DEF_LOCAL_PROXY = ''"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99145:Assign_L39_C0", "label": "DEF_FETCH_SERVER =", "type": "assigned_variable", "loc": [39, 39], "level": 0, "parent": null, "vector": [14, 0, 0.7647, 0.0196, 0, 0.66, 0.5, 406, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "DEF_FETCH_SERVER", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "DEF_FETCH_SERVER = ''"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99145:Assign_L40_C0", "label": "DEF_LISTEN_PORT =", "type": "assigned_variable", "loc": [40, 40], "level": 0, "parent": null, "vector": [14, 0, 0.7843, 0.0196, 0, 0.66, 0.5833, 840, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "DEF_LISTEN_PORT", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "DEF_LISTEN_PORT = 8000"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99145:Assign_L41_C0", "label": "DEF_KEY_FILE = join()", "type": "assigned_variable", "loc": [41, 41], "level": 0, "parent": null, "vector": [14, 0, 0.8039, 0.0196, 0, 0.66, 0.6667, 552, 3, 2, 0, 0, 933, 10, 1], "semantic": {"name": "DEF_KEY_FILE", "arg_names": [], "import_names": [], "rhs_call_name": "join", "annotation": ""}, "snippet": "DEF_KEY_FILE = os.path.join(dir, 'ssl/LocalProxyServer.key')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99145:Assign_L42_C0", "label": "DEF_CERT_FILE = join()", "type": "assigned_variable", "loc": [42, 42], "level": 0, "parent": null, "vector": [14, 0, 0.8235, 0.0196, 0, 0.66, 0.75, 437, 3, 2, 0, 0, 933, 10, 1], "semantic": {"name": "DEF_CERT_FILE", "arg_names": [], "import_names": [], "rhs_call_name": "join", "annotation": ""}, "snippet": "DEF_CERT_FILE = os.path.join(dir, 'ssl/LocalProxyServer.cert')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99145:Assign_L43_C0", "label": "DEF_CONF_FILE = join()", "type": "assigned_variable", "loc": [43, 43], "level": 0, "parent": null, "vector": [14, 0, 0.8431, 0.0196, 0, 0.66, 0.8333, 948, 3, 2, 0, 0, 933, 10, 1], "semantic": {"name": "DEF_CONF_FILE", "arg_names": [], "import_names": [], "rhs_call_name": "join", "annotation": ""}, "snippet": "DEF_CONF_FILE = os.path.join(dir, 'proxy.conf')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99145:Assign_L44_C0", "label": "DEF_COMM_FILE = join()", "type": "assigned_variable", "loc": [44, 44], "level": 0, "parent": null, "vector": [14, 0, 0.8627, 0.0196, 0, 0.66, 0.9167, 312, 3, 2, 0, 0, 933, 10, 1], "semantic": {"name": "DEF_COMM_FILE", "arg_names": [], "import_names": [], "rhs_call_name": "join", "annotation": ""}, "snippet": "DEF_COMM_FILE = os.path.join(dir, '.proxy.conf.tmp')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99145:ClassDef_L46_C0", "label": "GAppProxyError", "type": "class", "loc": [46, 51], "level": 0, "parent": null, "vector": [3, 0, 0.951, 0.1176, 0, 0.66, 1.0, 190, 0, 2, 0, 0, 645, 0, 0], "semantic": {"name": "GAppProxyError", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class GAppProxyError(Exception):\n def __init__(self, reason):\n self.reason = reason\n\n def __str__(self):\n return '<GAppProxy Error: %s>' % self.reason"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99145:FunctionDef_L47_C4", "label": "__init__", "type": "function", "loc": [47, 48], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99145:ClassDef_L46_C0", "vector": [2, 1, 0.9314, 0.0392, 1, 0.09, 0.0, 555, 0, 2, 0, 0, 0, 0, 0], "semantic": {"name": "__init__", "arg_names": ["self", "reason"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, reason):\n self.reason = reason"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99145:Assign_L48_C8", "label": "self.reason =", "type": "assigned_variable", "loc": [48, 48], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99145:FunctionDef_L47_C4", "vector": [14, 2, 0.9412, 0.0196, 2, 0.7, 0.0, 831, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.reason", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.reason = reason"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99145:FunctionDef_L50_C4", "label": "__str__", "type": "function", "loc": [50, 51], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99145:ClassDef_L46_C0", "vector": [2, 1, 0.9902, 0.0392, 1, 0.09, 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 '<GAppProxy Error: %s>' % self.reason"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99145:Return_L51_C8", "label": "return", "type": "return", "loc": [51, 51], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99145:FunctionDef_L50_C4", "vector": [13, 2, 1.0, 0.0196, 2, 0.33, 0.0, 0, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return '<GAppProxy Error: %s>' % self.reason"}]
[{"f": "ajibawa-2023/Python-Code-Large/train/row_99145:FunctionDef_L30_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99145:Expr_L31_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99145:FunctionDef_L30_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99145:Return_L32_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99145:ClassDef_L46_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99145:FunctionDef_L47_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99145:FunctionDef_L47_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99145:Assign_L48_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99145:ClassDef_L46_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99145:FunctionDef_L50_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99145:FunctionDef_L50_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99145:Return_L51_C8"}]
#! /usr/bin/env python # coding=utf-8 GAE_PROXY_APPLICATION = r'ylbproxy' DEF_FETCH_SERVER = ''
ajibawa-2023/Python-Code-Large/train/row_99146
2
5
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_99146:Assign_L4_C0", "label": "GAE_PROXY_APPLICATION =", "type": "assigned_variable", "loc": [4, 4], "level": 0, "parent": null, "vector": [14, 0, 0.8, 0.2, 0, 0.66, 0.0, 415, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "GAE_PROXY_APPLICATION", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "GAE_PROXY_APPLICATION = r'ylbproxy'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99146:Assign_L5_C0", "label": "DEF_FETCH_SERVER =", "type": "assigned_variable", "loc": [5, 5], "level": 0, "parent": null, "vector": [14, 0, 1.0, 0.2, 0, 0.66, 1.0, 406, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "DEF_FETCH_SERVER", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "DEF_FETCH_SERVER = ''"}]
[]
#!/usr/bin/env python # coding=utf-8 import os import logging # set log def get_file_log(logFileName): logger = logging.getLogger(os.path.abspath(logFileName)) hdlr = logging.FileHandler(logFileName) formatter = logging.Formatter('%(asctime)s %(levelname)s:: %(message)s') hdlr.setFormatter(formatter) logger.addHandler(hdlr) logger.setLevel(logging.INFO) logger.d = logger.debug logger.i = logger.info logger.w = logger.warning logger.e = logger.error logger.c = logger.critical return logger
ajibawa-2023/Python-Code-Large/train/row_99148
15
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_99148:Import_L4_C0", "label": "os import os", "type": "import", "loc": [4, 4], "level": 0, "parent": null, "vector": [1, 0, 0.1739, 0.0435, 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_99148:Import_L5_C0", "label": "logging import logging", "type": "import", "loc": [5, 5], "level": 0, "parent": null, "vector": [1, 0, 0.2174, 0.0435, 0, 0.66, 0.5, 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_99148:FunctionDef_L8_C0", "label": "get_file_log", "type": "function", "loc": [8, 22], "level": 0, "parent": null, "vector": [2, 0, 0.6522, 0.6522, 0, 0.66, 1.0, 730, 0, 1, 1, 0, 0, 0, 7], "semantic": {"name": "get_file_log", "arg_names": ["logFileName"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def get_file_log(logFileName):\n logger = logging.getLogger(os.path.abspath(logFileName))\n hdlr = logging.FileHandler(logFileName)\n formatter = logging.Formatter('%(asctime)s %(levelname)s:: %(message)s')\n hdlr.setFormatter(formatter)\n logger.addHandler(hdlr)\n logger.setLevel(logging.INFO)\n "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99148:Assign_L9_C4", "label": "logger = getLogger()", "type": "assigned_variable", "loc": [9, 9], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99148:FunctionDef_L8_C0", "vector": [14, 1, 0.3913, 0.0435, 1, 0.77, 0.0, 532, 3, 1, 0, 0, 71, 10, 2], "semantic": {"name": "logger", "arg_names": [], "import_names": [], "rhs_call_name": "getLogger", "annotation": ""}, "snippet": " logger = logging.getLogger(os.path.abspath(logFileName))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99148:Assign_L10_C4", "label": "hdlr = FileHandler()", "type": "assigned_variable", "loc": [10, 10], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99148:FunctionDef_L8_C0", "vector": [14, 1, 0.4348, 0.0435, 1, 0.77, 0.0909, 149, 3, 1, 0, 0, 306, 10, 1], "semantic": {"name": "hdlr", "arg_names": [], "import_names": [], "rhs_call_name": "FileHandler", "annotation": ""}, "snippet": " hdlr = logging.FileHandler(logFileName)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99148:Assign_L11_C4", "label": "formatter = Formatter()", "type": "assigned_variable", "loc": [11, 11], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99148:FunctionDef_L8_C0", "vector": [14, 1, 0.4783, 0.0435, 1, 0.77, 0.1818, 791, 3, 1, 0, 0, 766, 10, 1], "semantic": {"name": "formatter", "arg_names": [], "import_names": [], "rhs_call_name": "Formatter", "annotation": ""}, "snippet": " formatter = logging.Formatter('%(asctime)s %(levelname)s:: %(message)s')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99148:Expr_L12_C4", "label": "setFormatter()", "type": "expression", "loc": [12, 12], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99148:FunctionDef_L8_C0", "vector": [8, 1, 0.5217, 0.0435, 1, 0.77, 0.2727, 948, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "setFormatter", "arg_names": [], "import_names": [], "rhs_call_name": "setFormatter", "annotation": ""}, "snippet": " hdlr.setFormatter(formatter)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99148:Expr_L13_C4", "label": "addHandler()", "type": "expression", "loc": [13, 13], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99148:FunctionDef_L8_C0", "vector": [8, 1, 0.5652, 0.0435, 1, 0.77, 0.3636, 255, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "addHandler", "arg_names": [], "import_names": [], "rhs_call_name": "addHandler", "annotation": ""}, "snippet": " logger.addHandler(hdlr)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99148:Expr_L14_C4", "label": "setLevel()", "type": "expression", "loc": [14, 14], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99148:FunctionDef_L8_C0", "vector": [8, 1, 0.6087, 0.0435, 1, 0.77, 0.4545, 810, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "setLevel", "arg_names": [], "import_names": [], "rhs_call_name": "setLevel", "annotation": ""}, "snippet": " logger.setLevel(logging.INFO)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99148:Assign_L16_C4", "label": "logger.d =", "type": "assigned_variable", "loc": [16, 16], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99148:FunctionDef_L8_C0", "vector": [14, 1, 0.6957, 0.0435, 1, 0.77, 0.5455, 473, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "logger.d", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " logger.d = logger.debug"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99148:Assign_L17_C4", "label": "logger.i =", "type": "assigned_variable", "loc": [17, 17], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99148:FunctionDef_L8_C0", "vector": [14, 1, 0.7391, 0.0435, 1, 0.77, 0.6364, 803, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "logger.i", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " logger.i = logger.info"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99148:Assign_L18_C4", "label": "logger.w =", "type": "assigned_variable", "loc": [18, 18], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99148:FunctionDef_L8_C0", "vector": [14, 1, 0.7826, 0.0435, 1, 0.77, 0.7273, 467, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "logger.w", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " logger.w = logger.warning"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99148:Assign_L19_C4", "label": "logger.e =", "type": "assigned_variable", "loc": [19, 19], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99148:FunctionDef_L8_C0", "vector": [14, 1, 0.8261, 0.0435, 1, 0.77, 0.8182, 543, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "logger.e", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " logger.e = logger.error"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99148:Assign_L20_C4", "label": "logger.c =", "type": "assigned_variable", "loc": [20, 20], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99148:FunctionDef_L8_C0", "vector": [14, 1, 0.8696, 0.0435, 1, 0.77, 0.9091, 242, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "logger.c", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " logger.c = logger.critical"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99148:Return_L22_C4", "label": "return", "type": "return", "loc": [22, 22], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99148:FunctionDef_L8_C0", "vector": [13, 1, 0.9565, 0.0435, 1, 0.77, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return logger"}]
[{"f": "ajibawa-2023/Python-Code-Large/train/row_99148:FunctionDef_L8_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99148:Assign_L9_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99148:FunctionDef_L8_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99148:Assign_L10_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99148:FunctionDef_L8_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99148:Assign_L11_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99148:FunctionDef_L8_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99148:Expr_L12_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99148:FunctionDef_L8_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99148:Expr_L13_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99148:FunctionDef_L8_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99148:Expr_L14_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99148:FunctionDef_L8_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99148:Assign_L16_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99148:FunctionDef_L8_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99148:Assign_L17_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99148:FunctionDef_L8_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99148:Assign_L18_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99148:FunctionDef_L8_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99148:Assign_L19_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99148:FunctionDef_L8_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99148:Assign_L20_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99148:FunctionDef_L8_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99148:Return_L22_C4"}]
#! /usr/bin/env python # coding=utf-8 import wsgiref.handlers from google.appengine.ext import webapp from google.appengine.api import users import accesslog class MainHandler(webapp.RequestHandler): def listPopDesti(self, count): # format self.response.headers['Content-Type'] = 'text/html' self.response.out.write( \ '''<html> <head> <meta http-equiv="content-type" content="text/html; charset=utf-8"/> <title>GAppProxy 热门站点统计</title> </head> <body> <table width="800" border="1" align="center"> <tr><th colspan="2">GAppProxy 热门站点统计(TOP %d)</th></tr> <tr><th>站点</th><th>访问量</th></tr> ''' % count) ds = accesslog.listPopDesti(count) for d in ds: self.response.out.write( \ ''' <tr><td>%s</td><td>%d</td></tr> ''' % (str(d[0]), d[1])) self.response.out.write( \ ''' </table> </body> </html> ''') def listFreqFro(self, count): # format self.response.headers['Content-Type'] = 'text/html' self.response.out.write( \ '''<html> <head> <meta http-equiv="content-type" content="text/html; charset=utf-8"/> <title>GAppProxy 用户使用统计</title> </head> <body> <table width="800" border="1" align="center"> <tr><th colspan="2">GAppProxy 用户使用统计(TOP %d)</th></tr> <tr><th>用户 IP</th><th>访问量</th></tr> ''' % count) ds = accesslog.listFreqFro(count) for d in ds: self.response.out.write( \ ''' <tr><td>%s</td><td>%d</td></tr> ''' % (str(d[0]), d[1])) self.response.out.write( \ ''' </table> </body> </html> ''') def get(self): user = users.get_current_user() obj = self.request.get('obj') cmd = self.request.get('cmd') # check if user: if user.email() == 'dugang@188.com': # OK, dispatch if obj.lower() == 'accesslog': # for AccessLog if cmd.lower() == 'clear': # clear log accesslog.clearAll() self.response.headers['Content-Type'] = 'text/plain' self.response.out.write('Clear OK!') elif cmd.lower() == 'list_pop_desti': # list the most popular destinations self.listPopDesti(50) elif cmd.lower() == 'list_freq_fro': # list the most frequent user self.listFreqFro(50) else: self.response.headers['Content-Type'] = 'text/plain' self.response.out.write('Wrong cmd!') else: self.response.headers['Content-Type'] = 'text/plain' self.response.out.write('Wrong obj!') else: # FAILED, send response self.response.headers['Content-Type'] = 'text/plain' self.response.out.write('Forbidden!') else: # 'clear accesslog' is an exception, for batch operation if obj.lower() == 'accesslog' and cmd.lower() == 'clear': # need magic number magic = self.request.get('magic') if False: #if magic == '': # clear log accesslog.clearAll() self.response.headers['Content-Type'] = 'text/plain' self.response.out.write('Clear OK!') else: self.response.headers['Content-Type'] = 'text/plain' self.response.out.write('Forbidden!') else: self.redirect(users.create_login_url(self.request.uri)) def main(): application = webapp.WSGIApplication([('/admin.py', MainHandler)], debug=True) wsgiref.handlers.CGIHandler().run(application) if __name__ == '__main__': main()
ajibawa-2023/Python-Code-Large/train/row_99151
54
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_99151:Import_L5_C0", "label": "wsgiref.handlers import wsgiref.handlers", "type": "import", "loc": [5, 5], "level": 0, "parent": null, "vector": [1, 0, 0.0439, 0.0088, 0, 0.66, 0.0, 709, 0, 1, 0, 0, 709, 0, 0], "semantic": {"name": "wsgiref.handlers", "arg_names": [], "import_names": ["wsgiref.handlers"], "rhs_call_name": "", "annotation": ""}, "snippet": "import wsgiref.handlers"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99151:ImportFrom_L6_C0", "label": "from google.appengine.ext import webapp", "type": "import", "loc": [6, 6], "level": 0, "parent": null, "vector": [1, 0, 0.0526, 0.0088, 0, 0.66, 0.1667, 167, 0, 1, 0, 0, 167, 0, 0], "semantic": {"name": "google.appengine.ext", "arg_names": [], "import_names": ["webapp"], "rhs_call_name": "", "annotation": ""}, "snippet": "from google.appengine.ext import webapp"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99151:ImportFrom_L7_C0", "label": "from google.appengine.api import users", "type": "import", "loc": [7, 7], "level": 0, "parent": null, "vector": [1, 0, 0.0614, 0.0088, 0, 0.66, 0.3333, 279, 0, 1, 0, 0, 279, 0, 0], "semantic": {"name": "google.appengine.api", "arg_names": [], "import_names": ["users"], "rhs_call_name": "", "annotation": ""}, "snippet": "from google.appengine.api import users"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99151:Import_L8_C0", "label": "accesslog import accesslog", "type": "import", "loc": [8, 8], "level": 0, "parent": null, "vector": [1, 0, 0.0702, 0.0088, 0, 0.66, 0.5, 407, 0, 1, 0, 0, 407, 0, 0], "semantic": {"name": "accesslog", "arg_names": [], "import_names": ["accesslog"], "rhs_call_name": "", "annotation": ""}, "snippet": "import accesslog"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99151:ClassDef_L10_C0", "label": "MainHandler", "type": "class", "loc": [10, 107], "level": 0, "parent": null, "vector": [3, 0, 0.5132, 0.8596, 0, 0.66, 0.6667, 83, 0, 3, 0, 0, 256, 0, 33], "semantic": {"name": "MainHandler", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class MainHandler(webapp.RequestHandler):\n def listPopDesti(self, count):\n # format\n self.response.headers['Content-Type'] = 'text/html'\n self.response.out.write( \\\n'''<html>\n <head>\n <meta http-equiv=\"content-type\" content=\"text/html; charset=utf-8\"/>"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99151:FunctionDef_L11_C4", "label": "listPopDesti", "type": "function", "loc": [11, 34], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99151:ClassDef_L10_C0", "vector": [2, 1, 0.1974, 0.2105, 1, 0.72, 0.0, 135, 0, 2, 0, 0, 0, 0, 5], "semantic": {"name": "listPopDesti", "arg_names": ["self", "count"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def listPopDesti(self, count):\n # format\n self.response.headers['Content-Type'] = 'text/html'\n self.response.out.write( \\\n'''<html>\n <head>\n <meta http-equiv=\"content-type\" content=\"text/html; charset=utf-8\"/>\n <title>GAppProxy \u70ed\u95e8\u7ad9\u70b9\u7edf\u8ba1</title>"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99151:Assign_L13_C8", "label": "assign", "type": "assigned_variable", "loc": [13, 13], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99151:FunctionDef_L11_C4", "vector": [14, 2, 0.114, 0.0088, 2, 0.09, 0.0, 0, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.response.headers['Content-Type'] = 'text/html'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99151:Expr_L14_C8", "label": "write()", "type": "expression", "loc": [14, 24], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99151:FunctionDef_L11_C4", "vector": [8, 2, 0.1667, 0.0965, 2, 0.09, 0.25, 837, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "write", "arg_names": [], "import_names": [], "rhs_call_name": "write", "annotation": ""}, "snippet": " self.response.out.write( \\\n'''<html>\n <head>\n <meta http-equiv=\"content-type\" content=\"text/html; charset=utf-8\"/>\n <title>GAppProxy \u70ed\u95e8\u7ad9\u70b9\u7edf\u8ba1</title>\n </head>\n <body>\n <table width=\"800\" border=\"1\" align=\"center\">"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99151:Assign_L25_C8", "label": "ds = listPopDesti()", "type": "assigned_variable", "loc": [25, 25], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99151:FunctionDef_L11_C4", "vector": [14, 2, 0.2193, 0.0088, 2, 0.09, 0.5, 263, 3, 1, 0, 0, 135, 10, 1], "semantic": {"name": "ds", "arg_names": [], "import_names": [], "rhs_call_name": "listPopDesti", "annotation": ""}, "snippet": " ds = accesslog.listPopDesti(count)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99151:For_L26_C8", "label": "for d", "type": "for", "loc": [26, 29], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99151:FunctionDef_L11_C4", "vector": [6, 2, 0.2412, 0.0351, 2, 0.09, 0.75, 355, 2, 0, 0, 0, 0, 0, 2], "semantic": {"name": "d", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for d in ds:\n self.response.out.write( \\\n''' <tr><td>%s</td><td>%d</td></tr>\n''' % (str(d[0]), d[1]))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99151:Expr_L27_C12", "label": "write()", "type": "expression", "loc": [27, 29], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99151:For_L26_C8", "vector": [8, 3, 0.2456, 0.0263, 3, 0.3, 0.0, 837, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "write", "arg_names": [], "import_names": [], "rhs_call_name": "write", "annotation": ""}, "snippet": " self.response.out.write( \\\n''' <tr><td>%s</td><td>%d</td></tr>\n''' % (str(d[0]), d[1]))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99151:Expr_L30_C8", "label": "write()", "type": "expression", "loc": [30, 34], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99151:FunctionDef_L11_C4", "vector": [8, 2, 0.2807, 0.0439, 2, 0.09, 1.0, 837, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "write", "arg_names": [], "import_names": [], "rhs_call_name": "write", "annotation": ""}, "snippet": " self.response.out.write( \\\n''' </table>\n </body>\n</html>\n''')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99151:FunctionDef_L36_C4", "label": "listFreqFro", "type": "function", "loc": [36, 59], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99151:ClassDef_L10_C0", "vector": [2, 1, 0.4167, 0.2105, 1, 0.72, 0.5, 134, 0, 2, 0, 0, 0, 0, 5], "semantic": {"name": "listFreqFro", "arg_names": ["self", "count"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def listFreqFro(self, count):\n # format\n self.response.headers['Content-Type'] = 'text/html'\n self.response.out.write( \\\n'''<html>\n <head>\n <meta http-equiv=\"content-type\" content=\"text/html; charset=utf-8\"/>\n <title>GAppProxy \u7528\u6237\u4f7f\u7528\u7edf\u8ba1</title>"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99151:Assign_L38_C8", "label": "assign", "type": "assigned_variable", "loc": [38, 38], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99151:FunctionDef_L36_C4", "vector": [14, 2, 0.3333, 0.0088, 2, 0.75, 0.0, 0, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.response.headers['Content-Type'] = 'text/html'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99151:Expr_L39_C8", "label": "write()", "type": "expression", "loc": [39, 49], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99151:FunctionDef_L36_C4", "vector": [8, 2, 0.386, 0.0965, 2, 0.75, 0.25, 837, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "write", "arg_names": [], "import_names": [], "rhs_call_name": "write", "annotation": ""}, "snippet": " self.response.out.write( \\\n'''<html>\n <head>\n <meta http-equiv=\"content-type\" content=\"text/html; charset=utf-8\"/>\n <title>GAppProxy \u7528\u6237\u4f7f\u7528\u7edf\u8ba1</title>\n </head>\n <body>\n <table width=\"800\" border=\"1\" align=\"center\">"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99151:Assign_L50_C8", "label": "ds = listFreqFro()", "type": "assigned_variable", "loc": [50, 50], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99151:FunctionDef_L36_C4", "vector": [14, 2, 0.4386, 0.0088, 2, 0.75, 0.5, 263, 3, 1, 0, 0, 134, 10, 1], "semantic": {"name": "ds", "arg_names": [], "import_names": [], "rhs_call_name": "listFreqFro", "annotation": ""}, "snippet": " ds = accesslog.listFreqFro(count)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99151:For_L51_C8", "label": "for d", "type": "for", "loc": [51, 54], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99151:FunctionDef_L36_C4", "vector": [6, 2, 0.4605, 0.0351, 2, 0.75, 0.75, 355, 2, 0, 0, 0, 0, 0, 2], "semantic": {"name": "d", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for d in ds:\n self.response.out.write( \\\n''' <tr><td>%s</td><td>%d</td></tr>\n''' % (str(d[0]), d[1]))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99151:Expr_L52_C12", "label": "write()", "type": "expression", "loc": [52, 54], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99151:For_L51_C8", "vector": [8, 3, 0.4649, 0.0263, 3, 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": " self.response.out.write( \\\n''' <tr><td>%s</td><td>%d</td></tr>\n''' % (str(d[0]), d[1]))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99151:Expr_L55_C8", "label": "write()", "type": "expression", "loc": [55, 59], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99151:FunctionDef_L36_C4", "vector": [8, 2, 0.5, 0.0439, 2, 0.75, 1.0, 837, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "write", "arg_names": [], "import_names": [], "rhs_call_name": "write", "annotation": ""}, "snippet": " self.response.out.write( \\\n''' </table>\n </body>\n</html>\n''')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99151:FunctionDef_L61_C4", "label": "get", "type": "function", "loc": [61, 107], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99151:ClassDef_L10_C0", "vector": [2, 1, 0.7368, 0.4123, 1, 0.72, 1.0, 607, 0, 1, 0, 0, 0, 0, 23], "semantic": {"name": "get", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def get(self):\n user = users.get_current_user()\n obj = self.request.get('obj')\n cmd = self.request.get('cmd')\n # check\n if user:\n if user.email() == 'dugang@188.com':\n # OK, dispatch"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99151:Assign_L62_C8", "label": "user = get_current_user()", "type": "assigned_variable", "loc": [62, 62], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99151:FunctionDef_L61_C4", "vector": [14, 2, 0.5439, 0.0088, 2, 0.26, 0.0, 503, 3, 0, 0, 0, 722, 10, 1], "semantic": {"name": "user", "arg_names": [], "import_names": [], "rhs_call_name": "get_current_user", "annotation": ""}, "snippet": " user = users.get_current_user()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99151:Assign_L63_C8", "label": "obj = get()", "type": "assigned_variable", "loc": [63, 63], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99151:FunctionDef_L61_C4", "vector": [14, 2, 0.5526, 0.0088, 2, 0.26, 0.3333, 505, 3, 1, 0, 0, 607, 10, 1], "semantic": {"name": "obj", "arg_names": [], "import_names": [], "rhs_call_name": "get", "annotation": ""}, "snippet": " obj = self.request.get('obj')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99151:Assign_L64_C8", "label": "cmd = get()", "type": "assigned_variable", "loc": [64, 64], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99151:FunctionDef_L61_C4", "vector": [14, 2, 0.5614, 0.0088, 2, 0.26, 0.6667, 604, 3, 1, 0, 0, 607, 10, 1], "semantic": {"name": "cmd", "arg_names": [], "import_names": [], "rhs_call_name": "get", "annotation": ""}, "snippet": " cmd = self.request.get('cmd')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99151:If_L66_C8", "label": "if", "type": "if", "loc": [66, 107], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99151:FunctionDef_L61_C4", "vector": [4, 2, 0.7588, 0.3684, 2, 0.26, 1.0, 0, 2, 0, 0, 0, 0, 0, 20], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if user:\n if user.email() == 'dugang@188.com':\n # OK, dispatch\n if obj.lower() == 'accesslog':\n # for AccessLog\n if cmd.lower() == 'clear':\n # clear log\n accesslog.clearAll()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99151:If_L67_C12", "label": "if", "type": "if", "loc": [67, 91], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99151:If_L66_C8", "vector": [4, 3, 0.693, 0.2193, 3, 0.74, 0.0, 0, 0, 0, 0, 0, 0, 0, 12], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if user.email() == 'dugang@188.com':\n # OK, dispatch\n if obj.lower() == 'accesslog':\n # for AccessLog\n if cmd.lower() == 'clear':\n # clear log\n accesslog.clearAll()\n self.response.headers['Content-Type'] = 'text/plain'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99151:If_L69_C16", "label": "if", "type": "if", "loc": [69, 87], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99151:If_L67_C12", "vector": [4, 4, 0.6842, 0.1667, 4, 0.43, 0.0, 0, 0, 0, 0, 0, 0, 0, 10], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if obj.lower() == 'accesslog':\n # for AccessLog\n if cmd.lower() == 'clear':\n # clear log\n accesslog.clearAll()\n self.response.headers['Content-Type'] = 'text/plain'\n self.response.out.write('Clear OK!')\n elif cmd.lower() == 'list_pop_desti':"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99151:If_L71_C20", "label": "if", "type": "if", "loc": [71, 84], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99151:If_L69_C16", "vector": [4, 5, 0.6798, 0.1228, 5, 0.89, 0.0, 0, 0, 0, 0, 0, 0, 0, 8], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if cmd.lower() == 'clear':\n # clear log\n accesslog.clearAll()\n self.response.headers['Content-Type'] = 'text/plain'\n self.response.out.write('Clear OK!')\n elif cmd.lower() == 'list_pop_desti':\n # list the most popular destinations\n self.listPopDesti(50)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99151:Expr_L73_C24", "label": "clearAll()", "type": "expression", "loc": [73, 73], "level": 6, "parent": "ajibawa-2023/Python-Code-Large/train/row_99151:If_L71_C20", "vector": [8, 6, 0.6404, 0.0088, 6, 0.45, 0.0, 469, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "clearAll", "arg_names": [], "import_names": [], "rhs_call_name": "clearAll", "annotation": ""}, "snippet": " accesslog.clearAll()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99151:Assign_L74_C24", "label": "assign", "type": "assigned_variable", "loc": [74, 74], "level": 6, "parent": "ajibawa-2023/Python-Code-Large/train/row_99151:If_L71_C20", "vector": [14, 6, 0.6491, 0.0088, 6, 0.45, 0.3333, 0, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.response.headers['Content-Type'] = 'text/plain'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99151:Expr_L75_C24", "label": "write()", "type": "expression", "loc": [75, 75], "level": 6, "parent": "ajibawa-2023/Python-Code-Large/train/row_99151:If_L71_C20", "vector": [8, 6, 0.6579, 0.0088, 6, 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": " self.response.out.write('Clear OK!')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99151:If_L76_C20", "label": "if", "type": "if", "loc": [76, 84], "level": 6, "parent": "ajibawa-2023/Python-Code-Large/train/row_99151:If_L71_C20", "vector": [4, 6, 0.7018, 0.0789, 6, 0.45, 1.0, 0, 0, 0, 0, 0, 0, 0, 5], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " elif cmd.lower() == 'list_pop_desti':\n # list the most popular destinations\n self.listPopDesti(50)\n elif cmd.lower() == 'list_freq_fro':\n # list the most frequent user\n self.listFreqFro(50)\n else:\n self.response.headers['Content-Type'] = 'text/plain'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99151:Expr_L78_C24", "label": "listPopDesti()", "type": "expression", "loc": [78, 78], "level": 7, "parent": "ajibawa-2023/Python-Code-Large/train/row_99151:If_L76_C20", "vector": [8, 7, 0.6842, 0.0088, 7, 0.1, 0.0, 135, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "listPopDesti", "arg_names": [], "import_names": [], "rhs_call_name": "listPopDesti", "annotation": ""}, "snippet": " self.listPopDesti(50)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99151:If_L79_C20", "label": "if", "type": "if", "loc": [79, 84], "level": 7, "parent": "ajibawa-2023/Python-Code-Large/train/row_99151:If_L76_C20", "vector": [4, 7, 0.7149, 0.0526, 7, 0.1, 1.0, 0, 0, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " elif cmd.lower() == 'list_freq_fro':\n # list the most frequent user\n self.listFreqFro(50)\n else:\n self.response.headers['Content-Type'] = 'text/plain'\n self.response.out.write('Wrong cmd!')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99151:Expr_L81_C24", "label": "listFreqFro()", "type": "expression", "loc": [81, 81], "level": 8, "parent": "ajibawa-2023/Python-Code-Large/train/row_99151:If_L79_C20", "vector": [8, 8, 0.7105, 0.0088, 8, 0.95, 0.0, 134, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "listFreqFro", "arg_names": [], "import_names": [], "rhs_call_name": "listFreqFro", "annotation": ""}, "snippet": " self.listFreqFro(50)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99151:Assign_L83_C24", "label": "assign", "type": "assigned_variable", "loc": [83, 83], "level": 8, "parent": "ajibawa-2023/Python-Code-Large/train/row_99151:If_L79_C20", "vector": [14, 8, 0.7281, 0.0088, 8, 0.95, 0.5, 0, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.response.headers['Content-Type'] = 'text/plain'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99151:Expr_L84_C24", "label": "write()", "type": "expression", "loc": [84, 84], "level": 8, "parent": "ajibawa-2023/Python-Code-Large/train/row_99151:If_L79_C20", "vector": [8, 8, 0.7368, 0.0088, 8, 0.95, 1.0, 837, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "write", "arg_names": [], "import_names": [], "rhs_call_name": "write", "annotation": ""}, "snippet": " self.response.out.write('Wrong cmd!')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99151:Assign_L86_C20", "label": "assign", "type": "assigned_variable", "loc": [86, 86], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99151:If_L69_C16", "vector": [14, 5, 0.7544, 0.0088, 5, 0.89, 0.5, 0, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.response.headers['Content-Type'] = 'text/plain'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99151:Expr_L87_C20", "label": "write()", "type": "expression", "loc": [87, 87], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99151:If_L69_C16", "vector": [8, 5, 0.7632, 0.0088, 5, 0.89, 1.0, 837, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "write", "arg_names": [], "import_names": [], "rhs_call_name": "write", "annotation": ""}, "snippet": " self.response.out.write('Wrong obj!')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99151:Assign_L90_C16", "label": "assign", "type": "assigned_variable", "loc": [90, 90], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99151:If_L67_C12", "vector": [14, 4, 0.7895, 0.0088, 4, 0.43, 0.5, 0, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.response.headers['Content-Type'] = 'text/plain'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99151:Expr_L91_C16", "label": "write()", "type": "expression", "loc": [91, 91], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99151:If_L67_C12", "vector": [8, 4, 0.7982, 0.0088, 4, 0.43, 1.0, 837, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "write", "arg_names": [], "import_names": [], "rhs_call_name": "write", "annotation": ""}, "snippet": " self.response.out.write('Forbidden!')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99151:If_L94_C12", "label": "if", "type": "if", "loc": [94, 107], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99151:If_L66_C8", "vector": [4, 3, 0.8816, 0.1228, 3, 0.74, 1.0, 0, 0, 0, 0, 0, 0, 0, 8], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if obj.lower() == 'accesslog' and cmd.lower() == 'clear':\n # need magic number\n magic = self.request.get('magic')\n if False:\n #if magic == '':\n # clear log\n accesslog.clearAll()\n self.response.headers['Content-Type'] = 'text/plain'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99151:Assign_L96_C16", "label": "magic = get()", "type": "assigned_variable", "loc": [96, 96], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99151:If_L94_C12", "vector": [14, 4, 0.8421, 0.0088, 4, 0.96, 0.0, 731, 3, 1, 0, 0, 607, 10, 1], "semantic": {"name": "magic", "arg_names": [], "import_names": [], "rhs_call_name": "get", "annotation": ""}, "snippet": " magic = self.request.get('magic')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99151:If_L97_C16", "label": "if", "type": "if", "loc": [97, 105], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99151:If_L94_C12", "vector": [4, 4, 0.886, 0.0789, 4, 0.96, 0.5, 0, 1, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if False:\n #if magic == '':\n # clear log\n accesslog.clearAll()\n self.response.headers['Content-Type'] = 'text/plain'\n self.response.out.write('Clear OK!')\n else:\n self.response.headers['Content-Type'] = 'text/plain'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99151:Expr_L100_C20", "label": "clearAll()", "type": "expression", "loc": [100, 100], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99151:If_L97_C16", "vector": [8, 5, 0.8772, 0.0088, 5, 0.11, 0.0, 469, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "clearAll", "arg_names": [], "import_names": [], "rhs_call_name": "clearAll", "annotation": ""}, "snippet": " accesslog.clearAll()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99151:Assign_L101_C20", "label": "assign", "type": "assigned_variable", "loc": [101, 101], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99151:If_L97_C16", "vector": [14, 5, 0.886, 0.0088, 5, 0.11, 0.25, 0, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.response.headers['Content-Type'] = 'text/plain'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99151:Expr_L102_C20", "label": "write()", "type": "expression", "loc": [102, 102], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99151:If_L97_C16", "vector": [8, 5, 0.8947, 0.0088, 5, 0.11, 0.5, 837, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "write", "arg_names": [], "import_names": [], "rhs_call_name": "write", "annotation": ""}, "snippet": " self.response.out.write('Clear OK!')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99151:Assign_L104_C20", "label": "assign", "type": "assigned_variable", "loc": [104, 104], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99151:If_L97_C16", "vector": [14, 5, 0.9123, 0.0088, 5, 0.11, 0.75, 0, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.response.headers['Content-Type'] = 'text/plain'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99151:Expr_L105_C20", "label": "write()", "type": "expression", "loc": [105, 105], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99151:If_L97_C16", "vector": [8, 5, 0.9211, 0.0088, 5, 0.11, 1.0, 837, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "write", "arg_names": [], "import_names": [], "rhs_call_name": "write", "annotation": ""}, "snippet": " self.response.out.write('Forbidden!')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99151:Expr_L107_C16", "label": "redirect()", "type": "expression", "loc": [107, 107], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99151:If_L94_C12", "vector": [8, 4, 0.9386, 0.0088, 4, 0.96, 1.0, 206, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "redirect", "arg_names": [], "import_names": [], "rhs_call_name": "redirect", "annotation": ""}, "snippet": " self.redirect(users.create_login_url(self.request.uri))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99151:FunctionDef_L109_C0", "label": "main", "type": "function", "loc": [109, 111], "level": 0, "parent": null, "vector": [2, 0, 0.9649, 0.0263, 0, 0.66, 0.8333, 624, 0, 0, 0, 0, 0, 0, 3], "semantic": {"name": "main", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def main():\n application = webapp.WSGIApplication([('/admin.py', MainHandler)], debug=True)\n wsgiref.handlers.CGIHandler().run(application)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99151:Assign_L110_C4", "label": "application = WSGIApplication()", "type": "assigned_variable", "loc": [110, 110], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99151:FunctionDef_L109_C0", "vector": [14, 1, 0.9649, 0.0088, 1, 0.5, 0.0, 244, 3, 2, 0, 0, 623, 10, 1], "semantic": {"name": "application", "arg_names": [], "import_names": [], "rhs_call_name": "WSGIApplication", "annotation": ""}, "snippet": " application = webapp.WSGIApplication([('/admin.py', MainHandler)], debug=True)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99151:Expr_L111_C4", "label": "run()", "type": "expression", "loc": [111, 111], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99151:FunctionDef_L109_C0", "vector": [8, 1, 0.9737, 0.0088, 1, 0.5, 1.0, 679, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "run", "arg_names": [], "import_names": [], "rhs_call_name": "run", "annotation": ""}, "snippet": " wsgiref.handlers.CGIHandler().run(application)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99151:If_L113_C0", "label": "if", "type": "if", "loc": [113, 114], "level": 0, "parent": null, "vector": [4, 0, 0.9956, 0.0175, 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_99151:Expr_L114_C4", "label": "main()", "type": "expression", "loc": [114, 114], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99151:If_L113_C0", "vector": [8, 1, 1.0, 0.0088, 1, 0.41, 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_99151:ClassDef_L10_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99151:FunctionDef_L11_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99151:FunctionDef_L11_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99151:Assign_L13_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99151:FunctionDef_L11_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99151:Expr_L14_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99151:FunctionDef_L11_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99151:Assign_L25_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99151:FunctionDef_L11_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99151:For_L26_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99151:For_L26_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99151:Expr_L27_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99151:FunctionDef_L11_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99151:Expr_L30_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99151:ClassDef_L10_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99151:FunctionDef_L36_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99151:FunctionDef_L36_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99151:Assign_L38_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99151:FunctionDef_L36_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99151:Expr_L39_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99151:FunctionDef_L36_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99151:Assign_L50_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99151:FunctionDef_L36_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99151:For_L51_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99151:For_L51_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99151:Expr_L52_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99151:FunctionDef_L36_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99151:Expr_L55_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99151:ClassDef_L10_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99151:FunctionDef_L61_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99151:FunctionDef_L61_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99151:Assign_L62_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99151:FunctionDef_L61_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99151:Assign_L63_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99151:FunctionDef_L61_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99151:Assign_L64_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99151:FunctionDef_L61_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99151:If_L66_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99151:If_L66_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99151:If_L67_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99151:If_L67_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99151:If_L69_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99151:If_L69_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99151:If_L71_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99151:If_L71_C20", "t": "ajibawa-2023/Python-Code-Large/train/row_99151:Expr_L73_C24"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99151:If_L71_C20", "t": "ajibawa-2023/Python-Code-Large/train/row_99151:Assign_L74_C24"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99151:If_L71_C20", "t": "ajibawa-2023/Python-Code-Large/train/row_99151:Expr_L75_C24"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99151:If_L71_C20", "t": "ajibawa-2023/Python-Code-Large/train/row_99151:If_L76_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99151:If_L76_C20", "t": "ajibawa-2023/Python-Code-Large/train/row_99151:Expr_L78_C24"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99151:If_L76_C20", "t": "ajibawa-2023/Python-Code-Large/train/row_99151:If_L79_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99151:If_L79_C20", "t": "ajibawa-2023/Python-Code-Large/train/row_99151:Expr_L81_C24"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99151:If_L79_C20", "t": "ajibawa-2023/Python-Code-Large/train/row_99151:Assign_L83_C24"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99151:If_L79_C20", "t": "ajibawa-2023/Python-Code-Large/train/row_99151:Expr_L84_C24"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99151:If_L69_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99151:Assign_L86_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99151:If_L69_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99151:Expr_L87_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99151:If_L67_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99151:Assign_L90_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99151:If_L67_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99151:Expr_L91_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99151:If_L66_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99151:If_L94_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99151:If_L94_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99151:Assign_L96_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99151:If_L94_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99151:If_L97_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99151:If_L97_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99151:Expr_L100_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99151:If_L97_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99151:Assign_L101_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99151:If_L97_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99151:Expr_L102_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99151:If_L97_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99151:Assign_L104_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99151:If_L97_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99151:Expr_L105_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99151:If_L94_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99151:Expr_L107_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99151:FunctionDef_L109_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99151:Assign_L110_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99151:FunctionDef_L109_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99151:Expr_L111_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99151:If_L113_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99151:Expr_L114_C4"}]
#! /usr/bin/env python # coding=utf-8 import os, sys _this_file_dir = os.path.dirname(__file__) VERSION = "1.2.0" LOAD_BALANCE = 'http://gappproxy-center.appspot.com/available_fetchserver.py' GOOGLE_PROXY = 'www.google.cn:80' DEF_LISTEN_PORT = 8000 DEF_LOCAL_PROXY = '' DEF_FETCH_SERVER = 'http://nettransit4ylb.appspot.com' #DEF_FETCH_SERVER = 'http://localhost:8091' #DEF_CONF_FILE = os.path.join(dir, 'proxy.conf') DEF_CERT_FILE = os.path.join(_this_file_dir , 'ssl/LocalProxyServer.cert') DEF_KEY_FILE = os.path.join(_this_file_dir , 'ssl/LocalProxyServer.key') SUPPORTED_METHODS = set(('GET', 'HEAD', 'POST')) ENABLE_ENCRYPTION = False # ENCRYPTION_DICT: a 256 length string, use str.translate to encrypt ENCRYPTION_DICT = "" #class GAppProxyError(Exception): #def __init__(self, reason): #self.reason = reason #def __str__(self): #return '<GAppProxy Error: %s>' % self.reason # localproxy LOCALPROXY_LISTEN_ADDRESS = "0.0.0.0" LOCALPROXY_LISTEN_PORT = 8000
ajibawa-2023/Python-Code-Large/train/row_99152
15
40
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_99152:Import_L5_C0", "label": "os import os, sys", "type": "import", "loc": [5, 5], "level": 0, "parent": null, "vector": [1, 0, 0.125, 0.025, 0, 0.66, 0.0, 688, 0, 2, 0, 0, 688, 0, 0], "semantic": {"name": "os", "arg_names": [], "import_names": ["os", "sys"], "rhs_call_name": "", "annotation": ""}, "snippet": "import os, sys"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99152:Assign_L7_C0", "label": "_this_file_dir = dirname()", "type": "assigned_variable", "loc": [7, 7], "level": 0, "parent": null, "vector": [14, 0, 0.175, 0.025, 0, 0.66, 0.0714, 867, 3, 1, 0, 0, 959, 10, 1], "semantic": {"name": "_this_file_dir", "arg_names": [], "import_names": [], "rhs_call_name": "dirname", "annotation": ""}, "snippet": "_this_file_dir = os.path.dirname(__file__)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99152:Assign_L9_C0", "label": "VERSION =", "type": "assigned_variable", "loc": [9, 9], "level": 0, "parent": null, "vector": [14, 0, 0.225, 0.025, 0, 0.66, 0.1429, 557, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "VERSION", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "VERSION = \"1.2.0\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99152:Assign_L11_C0", "label": "LOAD_BALANCE =", "type": "assigned_variable", "loc": [11, 11], "level": 0, "parent": null, "vector": [14, 0, 0.275, 0.025, 0, 0.66, 0.2143, 163, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "LOAD_BALANCE", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "LOAD_BALANCE = 'http://gappproxy-center.appspot.com/available_fetchserver.py'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99152:Assign_L12_C0", "label": "GOOGLE_PROXY =", "type": "assigned_variable", "loc": [12, 12], "level": 0, "parent": null, "vector": [14, 0, 0.3, 0.025, 0, 0.66, 0.2857, 466, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "GOOGLE_PROXY", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "GOOGLE_PROXY = 'www.google.cn:80'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99152:Assign_L14_C0", "label": "DEF_LISTEN_PORT =", "type": "assigned_variable", "loc": [14, 14], "level": 0, "parent": null, "vector": [14, 0, 0.35, 0.025, 0, 0.66, 0.3571, 840, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "DEF_LISTEN_PORT", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "DEF_LISTEN_PORT = 8000"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99152:Assign_L15_C0", "label": "DEF_LOCAL_PROXY =", "type": "assigned_variable", "loc": [15, 15], "level": 0, "parent": null, "vector": [14, 0, 0.375, 0.025, 0, 0.66, 0.4286, 464, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "DEF_LOCAL_PROXY", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "DEF_LOCAL_PROXY = ''"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99152:Assign_L16_C0", "label": "DEF_FETCH_SERVER =", "type": "assigned_variable", "loc": [16, 16], "level": 0, "parent": null, "vector": [14, 0, 0.4, 0.025, 0, 0.66, 0.5, 406, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "DEF_FETCH_SERVER", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "DEF_FETCH_SERVER = 'http://nettransit4ylb.appspot.com'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99152:Assign_L19_C0", "label": "DEF_CERT_FILE = join()", "type": "assigned_variable", "loc": [19, 19], "level": 0, "parent": null, "vector": [14, 0, 0.475, 0.025, 0, 0.66, 0.5714, 437, 3, 2, 0, 0, 933, 10, 1], "semantic": {"name": "DEF_CERT_FILE", "arg_names": [], "import_names": [], "rhs_call_name": "join", "annotation": ""}, "snippet": "DEF_CERT_FILE = os.path.join(_this_file_dir , 'ssl/LocalProxyServer.cert')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99152:Assign_L20_C0", "label": "DEF_KEY_FILE = join()", "type": "assigned_variable", "loc": [20, 20], "level": 0, "parent": null, "vector": [14, 0, 0.5, 0.025, 0, 0.66, 0.6429, 552, 3, 2, 0, 0, 933, 10, 1], "semantic": {"name": "DEF_KEY_FILE", "arg_names": [], "import_names": [], "rhs_call_name": "join", "annotation": ""}, "snippet": "DEF_KEY_FILE = os.path.join(_this_file_dir , 'ssl/LocalProxyServer.key')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99152:Assign_L22_C0", "label": "SUPPORTED_METHODS = set()", "type": "assigned_variable", "loc": [22, 22], "level": 0, "parent": null, "vector": [14, 0, 0.55, 0.025, 0, 0.66, 0.7143, 125, 3, 1, 0, 0, 21, 10, 1], "semantic": {"name": "SUPPORTED_METHODS", "arg_names": [], "import_names": [], "rhs_call_name": "set", "annotation": ""}, "snippet": "SUPPORTED_METHODS = set(('GET', 'HEAD', 'POST'))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99152:Assign_L25_C0", "label": "ENABLE_ENCRYPTION =", "type": "assigned_variable", "loc": [25, 25], "level": 0, "parent": null, "vector": [14, 0, 0.625, 0.025, 0, 0.66, 0.7857, 692, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "ENABLE_ENCRYPTION", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "ENABLE_ENCRYPTION = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99152:Assign_L27_C0", "label": "ENCRYPTION_DICT =", "type": "assigned_variable", "loc": [27, 27], "level": 0, "parent": null, "vector": [14, 0, 0.675, 0.025, 0, 0.66, 0.8571, 589, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "ENCRYPTION_DICT", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "ENCRYPTION_DICT = \"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99152:Assign_L38_C0", "label": "LOCALPROXY_LISTEN_ADDRESS =", "type": "assigned_variable", "loc": [38, 38], "level": 0, "parent": null, "vector": [14, 0, 0.95, 0.025, 0, 0.66, 0.9286, 511, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "LOCALPROXY_LISTEN_ADDRESS", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "LOCALPROXY_LISTEN_ADDRESS = \"0.0.0.0\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99152:Assign_L39_C0", "label": "LOCALPROXY_LISTEN_PORT =", "type": "assigned_variable", "loc": [39, 39], "level": 0, "parent": null, "vector": [14, 0, 0.975, 0.025, 0, 0.66, 1.0, 311, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "LOCALPROXY_LISTEN_PORT", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "LOCALPROXY_LISTEN_PORT = 8000"}]
[]
#! /usr/bin/env python # coding=utf-8 from google.appengine.ext import db class AccessDestination(db.Model): desti = db.StringProperty(required=True) counter = db.IntegerProperty(required=True) class AccessFrom(db.Model): fro = db.StringProperty(required=True) counter = db.IntegerProperty(required=True) def incDestiCounter(desti): rec = db.get(db.Key.from_path('AccessDestination', 'D:%s' % desti)) if not rec: rec = AccessDestination(desti=desti, counter=1, key_name='D:%s' % desti) else: rec.counter += 1 rec.put() def incFroCounter(fro): rec = db.get(db.Key.from_path('AccessFrom', 'F:%s' % fro)) if not rec: rec = AccessFrom(fro=fro, counter=1, key_name='F:%s' % fro) else: rec.counter += 1 rec.put() def logAccess(desti, fro): try: db.run_in_transaction(incDestiCounter, desti) db.run_in_transaction(incFroCounter, fro) return True except Exception: return False def listPopDesti(count): ls = [] q = db.GqlQuery("select * from AccessDestination order by counter desc") results = q.fetch(count) for r in results: ls.append((r.desti, r.counter)) return ls def listFreqFro(count): ls = [] q = db.GqlQuery("select * from AccessFrom order by counter desc") results = q.fetch(count) for r in results: ls.append((r.fro, r.counter)) return ls def clearDesti(): recs = AccessDestination.all() for r in recs: r.delete() def clearFro(): recs = AccessFrom.all() for r in recs: r.delete() def clearAll(): clearDesti() clearFro()
ajibawa-2023/Python-Code-Large/train/row_99153
48
67
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_99153:ImportFrom_L5_C0", "label": "from google.appengine.ext import db", "type": "import", "loc": [5, 5], "level": 0, "parent": null, "vector": [1, 0, 0.0746, 0.0149, 0, 0.66, 0.0, 167, 0, 1, 0, 0, 167, 0, 0], "semantic": {"name": "google.appengine.ext", "arg_names": [], "import_names": ["db"], "rhs_call_name": "", "annotation": ""}, "snippet": "from google.appengine.ext import db"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99153:ClassDef_L7_C0", "label": "AccessDestination", "type": "class", "loc": [7, 9], "level": 0, "parent": null, "vector": [3, 0, 0.1194, 0.0448, 0, 0.66, 0.1, 296, 0, 0, 0, 0, 697, 0, 2], "semantic": {"name": "AccessDestination", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class AccessDestination(db.Model):\n desti = db.StringProperty(required=True)\n counter = db.IntegerProperty(required=True)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99153:Assign_L8_C4", "label": "desti = StringProperty()", "type": "assigned_variable", "loc": [8, 8], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99153:ClassDef_L7_C0", "vector": [14, 1, 0.1194, 0.0149, 1, 0.64, 0.0, 778, 3, 1, 0, 0, 882, 10, 1], "semantic": {"name": "desti", "arg_names": [], "import_names": [], "rhs_call_name": "StringProperty", "annotation": ""}, "snippet": " desti = db.StringProperty(required=True)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99153:Assign_L9_C4", "label": "counter = IntegerProperty()", "type": "assigned_variable", "loc": [9, 9], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99153:ClassDef_L7_C0", "vector": [14, 1, 0.1343, 0.0149, 1, 0.64, 1.0, 7, 3, 1, 0, 0, 703, 10, 1], "semantic": {"name": "counter", "arg_names": [], "import_names": [], "rhs_call_name": "IntegerProperty", "annotation": ""}, "snippet": " counter = db.IntegerProperty(required=True)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99153:ClassDef_L11_C0", "label": "AccessFrom", "type": "class", "loc": [11, 13], "level": 0, "parent": null, "vector": [3, 0, 0.1791, 0.0448, 0, 0.66, 0.2, 549, 0, 0, 0, 0, 697, 0, 2], "semantic": {"name": "AccessFrom", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class AccessFrom(db.Model):\n fro = db.StringProperty(required=True)\n counter = db.IntegerProperty(required=True)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99153:Assign_L12_C4", "label": "fro = StringProperty()", "type": "assigned_variable", "loc": [12, 12], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99153:ClassDef_L11_C0", "vector": [14, 1, 0.1791, 0.0149, 1, 0.51, 0.0, 52, 3, 1, 0, 0, 882, 10, 1], "semantic": {"name": "fro", "arg_names": [], "import_names": [], "rhs_call_name": "StringProperty", "annotation": ""}, "snippet": " fro = db.StringProperty(required=True)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99153:Assign_L13_C4", "label": "counter = IntegerProperty()", "type": "assigned_variable", "loc": [13, 13], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99153:ClassDef_L11_C0", "vector": [14, 1, 0.194, 0.0149, 1, 0.51, 1.0, 7, 3, 1, 0, 0, 703, 10, 1], "semantic": {"name": "counter", "arg_names": [], "import_names": [], "rhs_call_name": "IntegerProperty", "annotation": ""}, "snippet": " counter = db.IntegerProperty(required=True)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99153:FunctionDef_L15_C0", "label": "incDestiCounter", "type": "function", "loc": [15, 21], "level": 0, "parent": null, "vector": [2, 0, 0.2687, 0.1045, 0, 0.66, 0.3, 112, 0, 1, 0, 0, 0, 0, 4], "semantic": {"name": "incDestiCounter", "arg_names": ["desti"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def incDestiCounter(desti):\n rec = db.get(db.Key.from_path('AccessDestination', 'D:%s' % desti))\n if not rec:\n rec = AccessDestination(desti=desti, counter=1, key_name='D:%s' % desti)\n else:\n rec.counter += 1\n rec.put()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99153:Assign_L16_C4", "label": "rec = get()", "type": "assigned_variable", "loc": [16, 16], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99153:FunctionDef_L15_C0", "vector": [14, 1, 0.2388, 0.0149, 1, 0.02, 0.0, 100, 3, 1, 0, 0, 607, 10, 2], "semantic": {"name": "rec", "arg_names": [], "import_names": [], "rhs_call_name": "get", "annotation": ""}, "snippet": " rec = db.get(db.Key.from_path('AccessDestination', 'D:%s' % desti))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99153:If_L17_C4", "label": "if", "type": "if", "loc": [17, 20], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99153:FunctionDef_L15_C0", "vector": [4, 1, 0.2761, 0.0597, 1, 0.02, 0.5, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not rec:\n rec = AccessDestination(desti=desti, counter=1, key_name='D:%s' % desti)\n else:\n rec.counter += 1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99153:Assign_L18_C8", "label": "rec = AccessDestination()", "type": "assigned_variable", "loc": [18, 18], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99153:If_L17_C4", "vector": [14, 2, 0.2687, 0.0149, 2, 0.5, 0.0, 100, 3, 3, 0, 0, 296, 10, 1], "semantic": {"name": "rec", "arg_names": [], "import_names": [], "rhs_call_name": "AccessDestination", "annotation": ""}, "snippet": " rec = AccessDestination(desti=desti, counter=1, key_name='D:%s' % desti)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99153:Expr_L21_C4", "label": "put()", "type": "expression", "loc": [21, 21], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99153:FunctionDef_L15_C0", "vector": [8, 1, 0.3134, 0.0149, 1, 0.02, 1.0, 636, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "put", "arg_names": [], "import_names": [], "rhs_call_name": "put", "annotation": ""}, "snippet": " rec.put()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99153:FunctionDef_L23_C0", "label": "incFroCounter", "type": "function", "loc": [23, 29], "level": 0, "parent": null, "vector": [2, 0, 0.3881, 0.1045, 0, 0.66, 0.4, 888, 0, 1, 0, 0, 0, 0, 4], "semantic": {"name": "incFroCounter", "arg_names": ["fro"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def incFroCounter(fro):\n rec = db.get(db.Key.from_path('AccessFrom', 'F:%s' % fro))\n if not rec:\n rec = AccessFrom(fro=fro, counter=1, key_name='F:%s' % fro)\n else:\n rec.counter += 1\n rec.put()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99153:Assign_L24_C4", "label": "rec = get()", "type": "assigned_variable", "loc": [24, 24], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99153:FunctionDef_L23_C0", "vector": [14, 1, 0.3582, 0.0149, 1, 0.88, 0.0, 100, 3, 1, 0, 0, 607, 10, 2], "semantic": {"name": "rec", "arg_names": [], "import_names": [], "rhs_call_name": "get", "annotation": ""}, "snippet": " rec = db.get(db.Key.from_path('AccessFrom', 'F:%s' % fro))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99153:If_L25_C4", "label": "if", "type": "if", "loc": [25, 28], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99153:FunctionDef_L23_C0", "vector": [4, 1, 0.3955, 0.0597, 1, 0.88, 0.5, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not rec:\n rec = AccessFrom(fro=fro, counter=1, key_name='F:%s' % fro)\n else:\n rec.counter += 1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99153:Assign_L26_C8", "label": "rec = AccessFrom()", "type": "assigned_variable", "loc": [26, 26], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99153:If_L25_C4", "vector": [14, 2, 0.3881, 0.0149, 2, 0.18, 0.0, 100, 3, 3, 0, 0, 549, 10, 1], "semantic": {"name": "rec", "arg_names": [], "import_names": [], "rhs_call_name": "AccessFrom", "annotation": ""}, "snippet": " rec = AccessFrom(fro=fro, counter=1, key_name='F:%s' % fro)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99153:Expr_L29_C4", "label": "put()", "type": "expression", "loc": [29, 29], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99153:FunctionDef_L23_C0", "vector": [8, 1, 0.4328, 0.0149, 1, 0.88, 1.0, 636, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "put", "arg_names": [], "import_names": [], "rhs_call_name": "put", "annotation": ""}, "snippet": " rec.put()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99153:FunctionDef_L31_C0", "label": "logAccess", "type": "function", "loc": [31, 37], "level": 0, "parent": null, "vector": [2, 0, 0.5075, 0.1045, 0, 0.66, 0.5, 484, 0, 2, 1, 0, 0, 0, 2], "semantic": {"name": "logAccess", "arg_names": ["desti", "fro"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def logAccess(desti, fro):\n try:\n db.run_in_transaction(incDestiCounter, desti)\n db.run_in_transaction(incFroCounter, fro)\n return True\n except Exception:\n return False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99153:Try_L32_C4", "label": "try", "type": "try", "loc": [32, 37], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99153:FunctionDef_L31_C0", "vector": [7, 1, 0.5149, 0.0896, 1, 0.68, 0.0, 0, 0, 1, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " try:\n db.run_in_transaction(incDestiCounter, desti)\n db.run_in_transaction(incFroCounter, fro)\n return True\n except Exception:\n return False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99153:Expr_L33_C8", "label": "run_in_transaction()", "type": "expression", "loc": [33, 33], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99153:Try_L32_C4", "vector": [8, 2, 0.4925, 0.0149, 2, 0.44, 0.0, 653, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "run_in_transaction", "arg_names": [], "import_names": [], "rhs_call_name": "run_in_transaction", "annotation": ""}, "snippet": " db.run_in_transaction(incDestiCounter, desti)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99153:Expr_L34_C8", "label": "run_in_transaction()", "type": "expression", "loc": [34, 34], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99153:Try_L32_C4", "vector": [8, 2, 0.5075, 0.0149, 2, 0.44, 0.5, 653, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "run_in_transaction", "arg_names": [], "import_names": [], "rhs_call_name": "run_in_transaction", "annotation": ""}, "snippet": " db.run_in_transaction(incFroCounter, fro)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99153:Return_L35_C8", "label": "return", "type": "return", "loc": [35, 35], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99153:Try_L32_C4", "vector": [13, 2, 0.5224, 0.0149, 2, 0.44, 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_99153:Return_L37_C8", "label": "return", "type": "return", "loc": [37, 37], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99153:Try_L32_C4", "vector": [13, 2, 0.5522, 0.0149, 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 False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99153:FunctionDef_L39_C0", "label": "listPopDesti", "type": "function", "loc": [39, 45], "level": 0, "parent": null, "vector": [2, 0, 0.6269, 0.1045, 0, 0.66, 0.6, 135, 0, 1, 1, 0, 0, 0, 3], "semantic": {"name": "listPopDesti", "arg_names": ["count"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def listPopDesti(count):\n ls = []\n q = db.GqlQuery(\"select * from AccessDestination order by counter desc\")\n results = q.fetch(count)\n for r in results:\n ls.append((r.desti, r.counter))\n return ls"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99153:Assign_L40_C4", "label": "ls =", "type": "assigned_variable", "loc": [40, 40], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99153:FunctionDef_L39_C0", "vector": [14, 1, 0.597, 0.0149, 1, 0.41, 0.0, 174, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "ls", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ls = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99153:Assign_L41_C4", "label": "q = GqlQuery()", "type": "assigned_variable", "loc": [41, 41], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99153:FunctionDef_L39_C0", "vector": [14, 1, 0.6119, 0.0149, 1, 0.41, 0.25, 516, 3, 1, 0, 0, 420, 10, 1], "semantic": {"name": "q", "arg_names": [], "import_names": [], "rhs_call_name": "GqlQuery", "annotation": ""}, "snippet": " q = db.GqlQuery(\"select * from AccessDestination order by counter desc\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99153:Assign_L42_C4", "label": "results = fetch()", "type": "assigned_variable", "loc": [42, 42], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99153:FunctionDef_L39_C0", "vector": [14, 1, 0.6269, 0.0149, 1, 0.41, 0.5, 143, 3, 1, 0, 0, 587, 10, 1], "semantic": {"name": "results", "arg_names": [], "import_names": [], "rhs_call_name": "fetch", "annotation": ""}, "snippet": " results = q.fetch(count)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99153:For_L43_C4", "label": "for r", "type": "for", "loc": [43, 44], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99153:FunctionDef_L39_C0", "vector": [6, 1, 0.6493, 0.0299, 1, 0.41, 0.75, 436, 2, 0, 0, 0, 0, 0, 1], "semantic": {"name": "r", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for r in results:\n ls.append((r.desti, r.counter))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99153:Expr_L44_C8", "label": "append()", "type": "expression", "loc": [44, 44], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99153:For_L43_C4", "vector": [8, 2, 0.6567, 0.0149, 2, 0.74, 0.0, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " ls.append((r.desti, r.counter))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99153:Return_L45_C4", "label": "return", "type": "return", "loc": [45, 45], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99153:FunctionDef_L39_C0", "vector": [13, 1, 0.6716, 0.0149, 1, 0.41, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return ls"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99153:FunctionDef_L47_C0", "label": "listFreqFro", "type": "function", "loc": [47, 53], "level": 0, "parent": null, "vector": [2, 0, 0.7463, 0.1045, 0, 0.66, 0.7, 134, 0, 1, 1, 0, 0, 0, 3], "semantic": {"name": "listFreqFro", "arg_names": ["count"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def listFreqFro(count):\n ls = []\n q = db.GqlQuery(\"select * from AccessFrom order by counter desc\")\n results = q.fetch(count)\n for r in results:\n ls.append((r.fro, r.counter))\n return ls"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99153:Assign_L48_C4", "label": "ls =", "type": "assigned_variable", "loc": [48, 48], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99153:FunctionDef_L47_C0", "vector": [14, 1, 0.7164, 0.0149, 1, 0.11, 0.0, 174, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "ls", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ls = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99153:Assign_L49_C4", "label": "q = GqlQuery()", "type": "assigned_variable", "loc": [49, 49], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99153:FunctionDef_L47_C0", "vector": [14, 1, 0.7313, 0.0149, 1, 0.11, 0.25, 516, 3, 1, 0, 0, 420, 10, 1], "semantic": {"name": "q", "arg_names": [], "import_names": [], "rhs_call_name": "GqlQuery", "annotation": ""}, "snippet": " q = db.GqlQuery(\"select * from AccessFrom order by counter desc\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99153:Assign_L50_C4", "label": "results = fetch()", "type": "assigned_variable", "loc": [50, 50], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99153:FunctionDef_L47_C0", "vector": [14, 1, 0.7463, 0.0149, 1, 0.11, 0.5, 143, 3, 1, 0, 0, 587, 10, 1], "semantic": {"name": "results", "arg_names": [], "import_names": [], "rhs_call_name": "fetch", "annotation": ""}, "snippet": " results = q.fetch(count)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99153:For_L51_C4", "label": "for r", "type": "for", "loc": [51, 52], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99153:FunctionDef_L47_C0", "vector": [6, 1, 0.7687, 0.0299, 1, 0.11, 0.75, 436, 2, 0, 0, 0, 0, 0, 1], "semantic": {"name": "r", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for r in results:\n ls.append((r.fro, r.counter))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99153:Expr_L52_C8", "label": "append()", "type": "expression", "loc": [52, 52], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99153:For_L51_C4", "vector": [8, 2, 0.7761, 0.0149, 2, 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": " ls.append((r.fro, r.counter))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99153:Return_L53_C4", "label": "return", "type": "return", "loc": [53, 53], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99153:FunctionDef_L47_C0", "vector": [13, 1, 0.791, 0.0149, 1, 0.11, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return ls"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99153:FunctionDef_L55_C0", "label": "clearDesti", "type": "function", "loc": [55, 58], "level": 0, "parent": null, "vector": [2, 0, 0.8433, 0.0597, 0, 0.66, 0.8, 21, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "clearDesti", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def clearDesti():\n recs = AccessDestination.all()\n for r in recs:\n r.delete()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99153:Assign_L56_C4", "label": "recs = all()", "type": "assigned_variable", "loc": [56, 56], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99153:FunctionDef_L55_C0", "vector": [14, 1, 0.8358, 0.0149, 1, 0.59, 0.0, 659, 3, 0, 0, 0, 895, 10, 1], "semantic": {"name": "recs", "arg_names": [], "import_names": [], "rhs_call_name": "all", "annotation": ""}, "snippet": " recs = AccessDestination.all()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99153:For_L57_C4", "label": "for r", "type": "for", "loc": [57, 58], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99153:FunctionDef_L55_C0", "vector": [6, 1, 0.8582, 0.0299, 1, 0.59, 1.0, 436, 2, 0, 0, 0, 0, 0, 1], "semantic": {"name": "r", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for r in recs:\n r.delete()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99153:Expr_L58_C8", "label": "delete()", "type": "expression", "loc": [58, 58], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99153:For_L57_C4", "vector": [8, 2, 0.8657, 0.0149, 2, 0.86, 0.0, 266, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "delete", "arg_names": [], "import_names": [], "rhs_call_name": "delete", "annotation": ""}, "snippet": " r.delete()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99153:FunctionDef_L60_C0", "label": "clearFro", "type": "function", "loc": [60, 63], "level": 0, "parent": null, "vector": [2, 0, 0.9179, 0.0597, 0, 0.66, 0.9, 183, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "clearFro", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def clearFro():\n recs = AccessFrom.all()\n for r in recs:\n r.delete()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99153:Assign_L61_C4", "label": "recs = all()", "type": "assigned_variable", "loc": [61, 61], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99153:FunctionDef_L60_C0", "vector": [14, 1, 0.9104, 0.0149, 1, 0.5, 0.0, 659, 3, 0, 0, 0, 895, 10, 1], "semantic": {"name": "recs", "arg_names": [], "import_names": [], "rhs_call_name": "all", "annotation": ""}, "snippet": " recs = AccessFrom.all()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99153:For_L62_C4", "label": "for r", "type": "for", "loc": [62, 63], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99153:FunctionDef_L60_C0", "vector": [6, 1, 0.9328, 0.0299, 1, 0.5, 1.0, 436, 2, 0, 0, 0, 0, 0, 1], "semantic": {"name": "r", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for r in recs:\n r.delete()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99153:Expr_L63_C8", "label": "delete()", "type": "expression", "loc": [63, 63], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99153:For_L62_C4", "vector": [8, 2, 0.9403, 0.0149, 2, 0.11, 0.0, 266, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "delete", "arg_names": [], "import_names": [], "rhs_call_name": "delete", "annotation": ""}, "snippet": " r.delete()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99153:FunctionDef_L65_C0", "label": "clearAll", "type": "function", "loc": [65, 67], "level": 0, "parent": null, "vector": [2, 0, 0.9851, 0.0448, 0, 0.66, 1.0, 469, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "clearAll", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def clearAll():\n clearDesti()\n clearFro()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99153:Expr_L66_C4", "label": "clearDesti()", "type": "expression", "loc": [66, 66], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99153:FunctionDef_L65_C0", "vector": [8, 1, 0.9851, 0.0149, 1, 0.15, 0.0, 21, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "clearDesti", "arg_names": [], "import_names": [], "rhs_call_name": "clearDesti", "annotation": ""}, "snippet": " clearDesti()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99153:Expr_L67_C4", "label": "clearFro()", "type": "expression", "loc": [67, 67], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99153:FunctionDef_L65_C0", "vector": [8, 1, 1.0, 0.0149, 1, 0.15, 1.0, 183, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "clearFro", "arg_names": [], "import_names": [], "rhs_call_name": "clearFro", "annotation": ""}, "snippet": " clearFro()"}]
[{"f": "ajibawa-2023/Python-Code-Large/train/row_99153:ClassDef_L7_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99153:Assign_L8_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99153:ClassDef_L7_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99153:Assign_L9_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99153:ClassDef_L11_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99153:Assign_L12_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99153:ClassDef_L11_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99153:Assign_L13_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99153:FunctionDef_L15_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99153:Assign_L16_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99153:FunctionDef_L15_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99153:If_L17_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99153:If_L17_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99153:Assign_L18_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99153:FunctionDef_L15_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99153:Expr_L21_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99153:FunctionDef_L23_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99153:Assign_L24_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99153:FunctionDef_L23_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99153:If_L25_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99153:If_L25_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99153:Assign_L26_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99153:FunctionDef_L23_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99153:Expr_L29_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99153:FunctionDef_L31_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99153:Try_L32_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99153:Try_L32_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99153:Expr_L33_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99153:Try_L32_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99153:Expr_L34_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99153:Try_L32_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99153:Return_L35_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99153:Try_L32_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99153:Return_L37_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99153:FunctionDef_L39_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99153:Assign_L40_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99153:FunctionDef_L39_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99153:Assign_L41_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99153:FunctionDef_L39_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99153:Assign_L42_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99153:FunctionDef_L39_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99153:For_L43_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99153:For_L43_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99153:Expr_L44_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99153:FunctionDef_L39_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99153:Return_L45_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99153:FunctionDef_L47_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99153:Assign_L48_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99153:FunctionDef_L47_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99153:Assign_L49_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99153:FunctionDef_L47_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99153:Assign_L50_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99153:FunctionDef_L47_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99153:For_L51_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99153:For_L51_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99153:Expr_L52_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99153:FunctionDef_L47_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99153:Return_L53_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99153:FunctionDef_L55_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99153:Assign_L56_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99153:FunctionDef_L55_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99153:For_L57_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99153:For_L57_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99153:Expr_L58_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99153:FunctionDef_L60_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99153:Assign_L61_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99153:FunctionDef_L60_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99153:For_L62_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99153:For_L62_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99153:Expr_L63_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99153:FunctionDef_L65_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99153:Expr_L66_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99153:FunctionDef_L65_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99153:Expr_L67_C4"}]
#!/usr/bin/env python # -*- coding: utf-8 -*- class Mp3Tag: ## Read and write mp3 tag def __init__(self, mp3filepath): self.__fp = mp3filepath def read_title(self): ## Read mp3 title from file directly # @return a str object, which keeps the original binary data pass def read_artist(self): ## Read mp3 artist from file directly # @return a str object, which keeps the original binary data pass def write_title(self, title): ## Write title to mp3 file immediately, without cache # @param title[IN]: mp3 title to write # @type: str assert(isinstance(title, str)) pass def write_artist(self, artist): ## Write artist to mp3 file immediately, without cache # @param artist[IN]: mp3 title to write # @type: str assert(isinstance(artist, str)) pass # TODO: Tiger to implemente methods, and to add method for r/w album?
ajibawa-2023/Python-Code-Large/train/row_99155
7
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_99155:ClassDef_L5_C0", "label": "Mp3Tag", "type": "class", "loc": [5, 33], "level": 0, "parent": null, "vector": [3, 0, 0.5135, 0.7838, 0, 0.66, 0.0, 362, 0, 5, 0, 0, 0, 0, 2], "semantic": {"name": "Mp3Tag", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class Mp3Tag:\n\t## Read and write mp3 tag\n\n\tdef __init__(self, mp3filepath):\n\t\tself.__fp = mp3filepath\n\t\n\tdef read_title(self):\n\t\t## Read mp3 title from file directly"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99155:FunctionDef_L8_C1", "label": "__init__", "type": "function", "loc": [8, 9], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99155:ClassDef_L5_C0", "vector": [2, 1, 0.2297, 0.0541, 1, 0.67, 0.0, 555, 0, 2, 0, 0, 0, 0, 0], "semantic": {"name": "__init__", "arg_names": ["self", "mp3filepath"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tdef __init__(self, mp3filepath):\n\t\tself.__fp = mp3filepath"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99155:Assign_L9_C2", "label": "self.__fp =", "type": "assigned_variable", "loc": [9, 9], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99155:FunctionDef_L8_C1", "vector": [14, 2, 0.2432, 0.027, 2, 0.19, 0.0, 260, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.__fp", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tself.__fp = mp3filepath"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99155:FunctionDef_L11_C1", "label": "read_title", "type": "function", "loc": [11, 14], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99155:ClassDef_L5_C0", "vector": [2, 1, 0.3378, 0.1081, 1, 0.67, 0.25, 721, 0, 1, 0, 0, 0, 0, 0], "semantic": {"name": "read_title", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tdef read_title(self):\n\t\t## Read mp3 title from file directly\n\t\t# @return a str object, which keeps the original binary data\n\t\tpass"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99155:FunctionDef_L16_C1", "label": "read_artist", "type": "function", "loc": [16, 19], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99155:ClassDef_L5_C0", "vector": [2, 1, 0.473, 0.1081, 1, 0.67, 0.5, 232, 0, 1, 0, 0, 0, 0, 0], "semantic": {"name": "read_artist", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tdef read_artist(self):\n\t\t## Read mp3 artist from file directly\n\t\t# @return a str object, which keeps the original binary data\n\t\tpass"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99155:FunctionDef_L21_C1", "label": "write_title", "type": "function", "loc": [21, 26], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99155:ClassDef_L5_C0", "vector": [2, 1, 0.6351, 0.1622, 1, 0.67, 0.75, 87, 0, 2, 0, 0, 0, 0, 1], "semantic": {"name": "write_title", "arg_names": ["self", "title"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tdef write_title(self, title):\n\t\t## Write title to mp3 file immediately, without cache\n\t\t# @param title[IN]: mp3 title to write\n\t\t# @type: str\n\t\tassert(isinstance(title, str))\n\t\tpass"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99155:FunctionDef_L28_C1", "label": "write_artist", "type": "function", "loc": [28, 33], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99155:ClassDef_L5_C0", "vector": [2, 1, 0.8243, 0.1622, 1, 0.67, 1.0, 695, 0, 2, 0, 0, 0, 0, 1], "semantic": {"name": "write_artist", "arg_names": ["self", "artist"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tdef write_artist(self, artist):\n\t\t## Write artist to mp3 file immediately, without cache\n\t\t# @param artist[IN]: mp3 title to write\n\t\t# @type: str\n\t\tassert(isinstance(artist, str))\n\t\tpass"}]
[{"f": "ajibawa-2023/Python-Code-Large/train/row_99155:ClassDef_L5_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99155:FunctionDef_L8_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99155:FunctionDef_L8_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99155:Assign_L9_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99155:ClassDef_L5_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99155:FunctionDef_L11_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99155:ClassDef_L5_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99155:FunctionDef_L16_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99155:ClassDef_L5_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99155:FunctionDef_L21_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99155:ClassDef_L5_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99155:FunctionDef_L28_C1"}]
#!/usr/bin/env python # coding=utf-8 import os import ID3 from optparse import OptionParser from glob import glob from PinyinConverter import PinyinConverter fencs = ('utf-8', 'cp936', 'cp932', 'utf-16le', 'utf-16be') # Oh! OO class Mp3Info: pinyinConverter = PinyinConverter() def __init__(self, filepath): if not os.path.isfile(filepath): raise IOError("No such file or directory: '%s'" % (filepath)) self.__fp = self._cvt2unicode(filepath) #self.__id3info = ID3.ID3(self.__fp) #def tag2utf8(self): #title_and_artist = self._get_tag() #self.__id3info.title = title_and_artist[0].encode('utf-8') #self.__id3info.artist = title_and_artist[1].encode('utf-8') def tag2pinyin(self): pass def filename2pinyin(self): folder, filename = os.path.split(self.__fp) pinyin = self.pinyinConverter.str2pinyin(filename) new_fp = os.path.join(folder, pinyin) os.rename(self.__fp, new_fp) self.__fp = new_fp def _cvt2unicode(self, s): for fenc in fencs: try: r = s.decode(fenc) return r except: pass raise UnicodeError() #def _get_tag(self): ## return unicode #return [self._cvt2unicode(self.__id3info.title), self._cvt2unicode(self.__id3info.artist)] def _get_filename(self): # return unicode pass def parse_args(): parser = OptionParser() parser.add_option('-t', '--mp3tag', action="store_true", dest="cvtMp3tag", default=False, help="Convert mp3tag to unicode") parser.add_option('-g', '--mp3tag2p', action="store_true", dest="cvtMp3tagPinyin", default=False, help="Convert mp3tag to pinyin") parser.add_option('-p', '--filename2p', action="store_true", dest="cvtFilenamePinyin", default=False, help="Convert filename to pinyin") parser.add_option('-f', '--files', action='append', dest='filenames', help="Given files to convert, support filename pattern", metavar="FILEs") (options, args) = parser.parse_args() return options def process(opts): filenames = [] if not opts.filenames: return for fpt in opts.filenames: filenames += glob(fpt) print(fpt) print(glob(fpt)) print(filenames) for fn in filenames: print(fn) mp3info = Mp3Info(fn) #if opts.cvtMp3tag: #mp3info.tag2utf8() #if opts.cvtMp3tagPinyin: #mp3info.tag2pinyin() if opts.cvtFilenamePinyin: mp3info.filename2pinyin() def main(): opts = parse_args() process(opts) if __name__ == '__main__': main()
ajibawa-2023/Python-Code-Large/train/row_99156
50
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_99156:Import_L4_C0", "label": "os import os", "type": "import", "loc": [4, 4], "level": 0, "parent": null, "vector": [1, 0, 0.0435, 0.0109, 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_99156:Import_L5_C0", "label": "ID3 import ID3", "type": "import", "loc": [5, 5], "level": 0, "parent": null, "vector": [1, 0, 0.0543, 0.0109, 0, 0.66, 0.1, 904, 0, 1, 0, 0, 904, 0, 0], "semantic": {"name": "ID3", "arg_names": [], "import_names": ["ID3"], "rhs_call_name": "", "annotation": ""}, "snippet": "import ID3"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99156:ImportFrom_L6_C0", "label": "from optparse import OptionParser", "type": "import", "loc": [6, 6], "level": 0, "parent": null, "vector": [1, 0, 0.0652, 0.0109, 0, 0.66, 0.2, 323, 0, 1, 0, 0, 323, 0, 0], "semantic": {"name": "optparse", "arg_names": [], "import_names": ["OptionParser"], "rhs_call_name": "", "annotation": ""}, "snippet": "from optparse import OptionParser"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99156:ImportFrom_L7_C0", "label": "from glob import glob", "type": "import", "loc": [7, 7], "level": 0, "parent": null, "vector": [1, 0, 0.0761, 0.0109, 0, 0.66, 0.3, 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_99156:ImportFrom_L8_C0", "label": "from PinyinConverter import PinyinConverter", "type": "import", "loc": [8, 8], "level": 0, "parent": null, "vector": [1, 0, 0.087, 0.0109, 0, 0.66, 0.4, 429, 0, 1, 0, 0, 429, 0, 0], "semantic": {"name": "PinyinConverter", "arg_names": [], "import_names": ["PinyinConverter"], "rhs_call_name": "", "annotation": ""}, "snippet": "from PinyinConverter import PinyinConverter"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99156:Assign_L10_C0", "label": "fencs =", "type": "assigned_variable", "loc": [10, 10], "level": 0, "parent": null, "vector": [14, 0, 0.1087, 0.0109, 0, 0.66, 0.5, 529, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "fencs", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "fencs = ('utf-8', 'cp936', 'cp932', 'utf-16le', 'utf-16be')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99156:ClassDef_L13_C0", "label": "Mp3Info", "type": "class", "loc": [13, 51], "level": 0, "parent": null, "vector": [3, 0, 0.3478, 0.4239, 0, 0.66, 0.6, 209, 0, 5, 0, 0, 0, 0, 10], "semantic": {"name": "Mp3Info", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class Mp3Info:\n\tpinyinConverter = PinyinConverter()\n\tdef __init__(self, filepath):\n\t\tif not os.path.isfile(filepath):\n\t\t\traise IOError(\"No such file or directory: '%s'\" % (filepath))\n\t\tself.__fp = self._cvt2unicode(filepath)\n\t\t#self.__id3info = ID3.ID3(self.__fp)\n"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99156:Assign_L14_C1", "label": "pinyinConverter = PinyinConverter()", "type": "assigned_variable", "loc": [14, 14], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99156:ClassDef_L13_C0", "vector": [14, 1, 0.1522, 0.0109, 1, 0.75, 0.0, 696, 3, 0, 0, 0, 429, 10, 1], "semantic": {"name": "pinyinConverter", "arg_names": [], "import_names": [], "rhs_call_name": "PinyinConverter", "annotation": ""}, "snippet": "\tpinyinConverter = PinyinConverter()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99156:FunctionDef_L15_C1", "label": "__init__", "type": "function", "loc": [15, 18], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99156:ClassDef_L13_C0", "vector": [2, 1, 0.1793, 0.0435, 1, 0.75, 0.2, 555, 0, 2, 0, 0, 0, 0, 3], "semantic": {"name": "__init__", "arg_names": ["self", "filepath"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tdef __init__(self, filepath):\n\t\tif not os.path.isfile(filepath):\n\t\t\traise IOError(\"No such file or directory: '%s'\" % (filepath))\n\t\tself.__fp = self._cvt2unicode(filepath)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99156:If_L16_C2", "label": "if", "type": "if", "loc": [16, 17], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99156:FunctionDef_L15_C1", "vector": [4, 2, 0.1793, 0.0217, 2, 0.03, 0.0, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tif not os.path.isfile(filepath):\n\t\t\traise IOError(\"No such file or directory: '%s'\" % (filepath))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99156:Assign_L18_C2", "label": "self.__fp = _cvt2unicode()", "type": "assigned_variable", "loc": [18, 18], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99156:FunctionDef_L15_C1", "vector": [14, 2, 0.1957, 0.0109, 2, 0.03, 1.0, 260, 3, 1, 0, 0, 857, 10, 1], "semantic": {"name": "self.__fp", "arg_names": [], "import_names": [], "rhs_call_name": "_cvt2unicode", "annotation": ""}, "snippet": "\t\tself.__fp = self._cvt2unicode(filepath)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99156:FunctionDef_L26_C1", "label": "tag2pinyin", "type": "function", "loc": [26, 27], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99156:ClassDef_L13_C0", "vector": [2, 1, 0.288, 0.0217, 1, 0.75, 0.4, 279, 0, 1, 0, 0, 0, 0, 0], "semantic": {"name": "tag2pinyin", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tdef tag2pinyin(self):\n\t\tpass"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99156:FunctionDef_L29_C1", "label": "filename2pinyin", "type": "function", "loc": [29, 34], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99156:ClassDef_L13_C0", "vector": [2, 1, 0.3424, 0.0652, 1, 0.75, 0.6, 842, 0, 1, 0, 0, 0, 0, 4], "semantic": {"name": "filename2pinyin", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tdef filename2pinyin(self):\n\t\tfolder, filename = os.path.split(self.__fp)\n\t\tpinyin = self.pinyinConverter.str2pinyin(filename)\n\t\tnew_fp = os.path.join(folder, pinyin)\n\t\tos.rename(self.__fp, new_fp)\n\t\tself.__fp = new_fp"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99156:Assign_L30_C2", "label": "folder, filename = split()", "type": "assigned_variable", "loc": [30, 30], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99156:FunctionDef_L29_C1", "vector": [14, 2, 0.3261, 0.0109, 2, 0.63, 0.0, 300, 3, 1, 0, 0, 908, 10, 1], "semantic": {"name": "folder, filename", "arg_names": [], "import_names": [], "rhs_call_name": "split", "annotation": ""}, "snippet": "\t\tfolder, filename = os.path.split(self.__fp)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99156:Assign_L31_C2", "label": "pinyin = str2pinyin()", "type": "assigned_variable", "loc": [31, 31], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99156:FunctionDef_L29_C1", "vector": [14, 2, 0.337, 0.0109, 2, 0.63, 0.25, 546, 3, 1, 0, 0, 483, 10, 1], "semantic": {"name": "pinyin", "arg_names": [], "import_names": [], "rhs_call_name": "str2pinyin", "annotation": ""}, "snippet": "\t\tpinyin = self.pinyinConverter.str2pinyin(filename)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99156:Assign_L32_C2", "label": "new_fp = join()", "type": "assigned_variable", "loc": [32, 32], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99156:FunctionDef_L29_C1", "vector": [14, 2, 0.3478, 0.0109, 2, 0.63, 0.5, 876, 3, 2, 0, 0, 933, 10, 1], "semantic": {"name": "new_fp", "arg_names": [], "import_names": [], "rhs_call_name": "join", "annotation": ""}, "snippet": "\t\tnew_fp = os.path.join(folder, pinyin)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99156:Expr_L33_C2", "label": "rename()", "type": "expression", "loc": [33, 33], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99156:FunctionDef_L29_C1", "vector": [8, 2, 0.3587, 0.0109, 2, 0.63, 0.75, 508, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "rename", "arg_names": [], "import_names": [], "rhs_call_name": "rename", "annotation": ""}, "snippet": "\t\tos.rename(self.__fp, new_fp)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99156:Assign_L34_C2", "label": "self.__fp =", "type": "assigned_variable", "loc": [34, 34], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99156:FunctionDef_L29_C1", "vector": [14, 2, 0.3696, 0.0109, 2, 0.63, 1.0, 260, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.__fp", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tself.__fp = new_fp"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99156:FunctionDef_L36_C1", "label": "_cvt2unicode", "type": "function", "loc": [36, 43], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99156:ClassDef_L13_C0", "vector": [2, 1, 0.4293, 0.087, 1, 0.75, 0.8, 857, 0, 2, 1, 0, 0, 0, 2], "semantic": {"name": "_cvt2unicode", "arg_names": ["self", "s"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tdef _cvt2unicode(self, s):\n\t\tfor fenc in fencs:\n\t\t\ttry:\n\t\t\t\tr = s.decode(fenc)\n\t\t\t\treturn r\n\t\t\texcept:\n\t\t\t\tpass\n\t\traise UnicodeError()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99156:For_L37_C2", "label": "for fenc", "type": "for", "loc": [37, 42], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99156:FunctionDef_L36_C1", "vector": [6, 2, 0.4293, 0.0652, 2, 0.75, 0.0, 17, 2, 0, 0, 0, 0, 0, 1], "semantic": {"name": "fenc", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tfor fenc in fencs:\n\t\t\ttry:\n\t\t\t\tr = s.decode(fenc)\n\t\t\t\treturn r\n\t\t\texcept:\n\t\t\t\tpass"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99156:Try_L38_C3", "label": "try", "type": "try", "loc": [38, 42], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99156:For_L37_C2", "vector": [7, 3, 0.4348, 0.0543, 3, 0.69, 0.0, 0, 0, 1, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\ttry:\n\t\t\t\tr = s.decode(fenc)\n\t\t\t\treturn r\n\t\t\texcept:\n\t\t\t\tpass"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99156:Assign_L39_C4", "label": "r = decode()", "type": "assigned_variable", "loc": [39, 39], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99156:Try_L38_C3", "vector": [14, 4, 0.4239, 0.0109, 4, 0.28, 0.0, 436, 3, 1, 0, 0, 528, 10, 1], "semantic": {"name": "r", "arg_names": [], "import_names": [], "rhs_call_name": "decode", "annotation": ""}, "snippet": "\t\t\t\tr = s.decode(fenc)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99156:Return_L40_C4", "label": "return", "type": "return", "loc": [40, 40], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99156:Try_L38_C3", "vector": [13, 4, 0.4348, 0.0109, 4, 0.28, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\t\treturn r"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99156:FunctionDef_L49_C1", "label": "_get_filename", "type": "function", "loc": [49, 51], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99156:ClassDef_L13_C0", "vector": [2, 1, 0.5435, 0.0326, 1, 0.75, 1.0, 182, 0, 1, 0, 0, 0, 0, 0], "semantic": {"name": "_get_filename", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tdef _get_filename(self):\n\t\t# return unicode\n\t\tpass"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99156:FunctionDef_L53_C0", "label": "parse_args", "type": "function", "loc": [53, 64], "level": 0, "parent": null, "vector": [2, 0, 0.6359, 0.1304, 0, 0.66, 0.7, 187, 0, 0, 1, 0, 0, 0, 6], "semantic": {"name": "parse_args", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def parse_args():\n\tparser = OptionParser()\n\tparser.add_option('-t', '--mp3tag', action=\"store_true\", dest=\"cvtMp3tag\", default=False,\n\t\t\thelp=\"Convert mp3tag to unicode\")\n\tparser.add_option('-g', '--mp3tag2p', action=\"store_true\", dest=\"cvtMp3tagPinyin\", default=False,\n\t\t\thelp=\"Convert mp3tag to pinyin\")\n\tparser.add_option('-p', '--filename2p', action=\"store_true\", dest=\"cvtFilenamePinyin\", default=False,\n\t\t\thelp=\"Convert filename to pinyin\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99156:Assign_L54_C1", "label": "parser = OptionParser()", "type": "assigned_variable", "loc": [54, 54], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99156:FunctionDef_L53_C0", "vector": [14, 1, 0.587, 0.0109, 1, 0.66, 0.0, 968, 3, 0, 0, 0, 894, 10, 1], "semantic": {"name": "parser", "arg_names": [], "import_names": [], "rhs_call_name": "OptionParser", "annotation": ""}, "snippet": "\tparser = OptionParser()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99156:Expr_L55_C1", "label": "add_option()", "type": "expression", "loc": [55, 56], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99156:FunctionDef_L53_C0", "vector": [8, 1, 0.6033, 0.0217, 1, 0.66, 0.1667, 176, 3, 6, 0, 0, 0, 0, 1], "semantic": {"name": "add_option", "arg_names": [], "import_names": [], "rhs_call_name": "add_option", "annotation": ""}, "snippet": "\tparser.add_option('-t', '--mp3tag', action=\"store_true\", dest=\"cvtMp3tag\", default=False,\n\t\t\thelp=\"Convert mp3tag to unicode\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99156:Expr_L57_C1", "label": "add_option()", "type": "expression", "loc": [57, 58], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99156:FunctionDef_L53_C0", "vector": [8, 1, 0.625, 0.0217, 1, 0.66, 0.3333, 176, 3, 6, 0, 0, 0, 0, 1], "semantic": {"name": "add_option", "arg_names": [], "import_names": [], "rhs_call_name": "add_option", "annotation": ""}, "snippet": "\tparser.add_option('-g', '--mp3tag2p', action=\"store_true\", dest=\"cvtMp3tagPinyin\", default=False,\n\t\t\thelp=\"Convert mp3tag to pinyin\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99156:Expr_L59_C1", "label": "add_option()", "type": "expression", "loc": [59, 60], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99156:FunctionDef_L53_C0", "vector": [8, 1, 0.6467, 0.0217, 1, 0.66, 0.5, 176, 3, 6, 0, 0, 0, 0, 1], "semantic": {"name": "add_option", "arg_names": [], "import_names": [], "rhs_call_name": "add_option", "annotation": ""}, "snippet": "\tparser.add_option('-p', '--filename2p', action=\"store_true\", dest=\"cvtFilenamePinyin\", default=False,\n\t\t\thelp=\"Convert filename to pinyin\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99156:Expr_L61_C1", "label": "add_option()", "type": "expression", "loc": [61, 62], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99156:FunctionDef_L53_C0", "vector": [8, 1, 0.6685, 0.0217, 1, 0.66, 0.6667, 176, 3, 6, 0, 0, 0, 0, 1], "semantic": {"name": "add_option", "arg_names": [], "import_names": [], "rhs_call_name": "add_option", "annotation": ""}, "snippet": "\tparser.add_option('-f', '--files', action='append', dest='filenames',\n\t\t\thelp=\"Given files to convert, support filename pattern\", metavar=\"FILEs\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99156:Assign_L63_C1", "label": "options, args = parse_args()", "type": "assigned_variable", "loc": [63, 63], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99156:FunctionDef_L53_C0", "vector": [14, 1, 0.6848, 0.0109, 1, 0.66, 0.8333, 584, 3, 0, 0, 0, 187, 10, 1], "semantic": {"name": "options, args", "arg_names": [], "import_names": [], "rhs_call_name": "parse_args", "annotation": ""}, "snippet": "\t(options, args) = parser.parse_args()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99156:Return_L64_C1", "label": "return", "type": "return", "loc": [64, 64], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99156:FunctionDef_L53_C0", "vector": [13, 1, 0.6957, 0.0109, 1, 0.66, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\treturn options"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99156:FunctionDef_L66_C0", "label": "process", "type": "function", "loc": [66, 83], "level": 0, "parent": null, "vector": [2, 0, 0.8098, 0.1957, 0, 0.66, 0.8, 712, 0, 1, 0, 0, 0, 0, 8], "semantic": {"name": "process", "arg_names": ["opts"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def process(opts):\n\tfilenames = []\n\tif not opts.filenames:\n\t\treturn\n\tfor fpt in opts.filenames:\n\t\tfilenames += glob(fpt)\n\tprint(fpt)\n\tprint(glob(fpt))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99156:Assign_L67_C1", "label": "filenames =", "type": "assigned_variable", "loc": [67, 67], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99156:FunctionDef_L66_C0", "vector": [14, 1, 0.7283, 0.0109, 1, 0.18, 0.0, 94, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "filenames", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tfilenames = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99156:If_L68_C1", "label": "if", "type": "if", "loc": [68, 69], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99156:FunctionDef_L66_C0", "vector": [4, 1, 0.7446, 0.0217, 1, 0.18, 0.1667, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tif not opts.filenames:\n\t\treturn"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99156:Return_L69_C2", "label": "return", "type": "return", "loc": [69, 69], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99156:If_L68_C1", "vector": [13, 2, 0.75, 0.0109, 2, 0.54, 0.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\treturn"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99156:For_L70_C1", "label": "for fpt", "type": "for", "loc": [70, 71], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99156:FunctionDef_L66_C0", "vector": [6, 1, 0.7663, 0.0217, 1, 0.18, 0.3333, 919, 7, 0, 0, 0, 0, 0, 1], "semantic": {"name": "fpt", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tfor fpt in opts.filenames:\n\t\tfilenames += glob(fpt)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99156:Expr_L72_C1", "label": "print()", "type": "expression", "loc": [72, 72], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99156:FunctionDef_L66_C0", "vector": [8, 1, 0.7826, 0.0109, 1, 0.18, 0.5, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": "\tprint(fpt)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99156:Expr_L73_C1", "label": "print()", "type": "expression", "loc": [73, 73], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99156:FunctionDef_L66_C0", "vector": [8, 1, 0.7935, 0.0109, 1, 0.18, 0.6667, 535, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": "\tprint(glob(fpt))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99156:Expr_L74_C1", "label": "print()", "type": "expression", "loc": [74, 74], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99156:FunctionDef_L66_C0", "vector": [8, 1, 0.8043, 0.0109, 1, 0.18, 0.8333, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": "\tprint(filenames)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99156:For_L75_C1", "label": "for fn", "type": "for", "loc": [75, 83], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99156:FunctionDef_L66_C0", "vector": [6, 1, 0.8587, 0.0978, 1, 0.18, 1.0, 59, 2, 0, 0, 0, 0, 0, 3], "semantic": {"name": "fn", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tfor fn in filenames:\n\t\tprint(fn)\n\t\tmp3info = Mp3Info(fn)\n\t\t#if opts.cvtMp3tag:\n\t\t\t#mp3info.tag2utf8()\n\t\t#if opts.cvtMp3tagPinyin:\n\t\t\t#mp3info.tag2pinyin()\n\t\tif opts.cvtFilenamePinyin:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99156:Expr_L76_C2", "label": "print()", "type": "expression", "loc": [76, 76], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99156:For_L75_C1", "vector": [8, 2, 0.8261, 0.0109, 2, 0.25, 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(fn)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99156:Assign_L77_C2", "label": "mp3info = Mp3Info()", "type": "assigned_variable", "loc": [77, 77], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99156:For_L75_C1", "vector": [14, 2, 0.837, 0.0109, 2, 0.25, 0.5, 316, 3, 1, 0, 0, 209, 10, 1], "semantic": {"name": "mp3info", "arg_names": [], "import_names": [], "rhs_call_name": "Mp3Info", "annotation": ""}, "snippet": "\t\tmp3info = Mp3Info(fn)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99156:If_L82_C2", "label": "if", "type": "if", "loc": [82, 83], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99156:For_L75_C1", "vector": [4, 2, 0.8967, 0.0217, 2, 0.25, 1.0, 0, 7, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tif opts.cvtFilenamePinyin:\n\t\t\tmp3info.filename2pinyin()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99156:Expr_L83_C3", "label": "filename2pinyin()", "type": "expression", "loc": [83, 83], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99156:If_L82_C2", "vector": [8, 3, 0.9022, 0.0109, 3, 0.21, 0.0, 842, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "filename2pinyin", "arg_names": [], "import_names": [], "rhs_call_name": "filename2pinyin", "annotation": ""}, "snippet": "\t\t\tmp3info.filename2pinyin()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99156:FunctionDef_L86_C0", "label": "main", "type": "function", "loc": [86, 88], "level": 0, "parent": null, "vector": [2, 0, 0.9457, 0.0326, 0, 0.66, 0.9, 624, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "main", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def main():\n\topts = parse_args()\n\tprocess(opts)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99156:Assign_L87_C1", "label": "opts = parse_args()", "type": "assigned_variable", "loc": [87, 87], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99156:FunctionDef_L86_C0", "vector": [14, 1, 0.9457, 0.0109, 1, 0.16, 0.0, 631, 3, 0, 0, 0, 187, 10, 1], "semantic": {"name": "opts", "arg_names": [], "import_names": [], "rhs_call_name": "parse_args", "annotation": ""}, "snippet": "\topts = parse_args()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99156:Expr_L88_C1", "label": "process()", "type": "expression", "loc": [88, 88], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99156:FunctionDef_L86_C0", "vector": [8, 1, 0.9565, 0.0109, 1, 0.16, 1.0, 712, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "process", "arg_names": [], "import_names": [], "rhs_call_name": "process", "annotation": ""}, "snippet": "\tprocess(opts)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99156:If_L90_C0", "label": "if", "type": "if", "loc": [90, 91], "level": 0, "parent": null, "vector": [4, 0, 0.9837, 0.0217, 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\tmain()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99156:Expr_L91_C1", "label": "main()", "type": "expression", "loc": [91, 91], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99156:If_L90_C0", "vector": [8, 1, 0.9891, 0.0109, 1, 0.61, 0.0, 624, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "main", "arg_names": [], "import_names": [], "rhs_call_name": "main", "annotation": ""}, "snippet": "\tmain()"}]
[{"f": "ajibawa-2023/Python-Code-Large/train/row_99156:ClassDef_L13_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99156:Assign_L14_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99156:ClassDef_L13_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99156:FunctionDef_L15_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99156:FunctionDef_L15_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99156:If_L16_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99156:FunctionDef_L15_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99156:Assign_L18_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99156:ClassDef_L13_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99156:FunctionDef_L26_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99156:ClassDef_L13_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99156:FunctionDef_L29_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99156:FunctionDef_L29_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99156:Assign_L30_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99156:FunctionDef_L29_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99156:Assign_L31_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99156:FunctionDef_L29_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99156:Assign_L32_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99156:FunctionDef_L29_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99156:Expr_L33_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99156:FunctionDef_L29_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99156:Assign_L34_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99156:ClassDef_L13_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99156:FunctionDef_L36_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99156:FunctionDef_L36_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99156:For_L37_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99156:For_L37_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99156:Try_L38_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99156:Try_L38_C3", "t": "ajibawa-2023/Python-Code-Large/train/row_99156:Assign_L39_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99156:Try_L38_C3", "t": "ajibawa-2023/Python-Code-Large/train/row_99156:Return_L40_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99156:ClassDef_L13_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99156:FunctionDef_L49_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99156:FunctionDef_L53_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99156:Assign_L54_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99156:FunctionDef_L53_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99156:Expr_L55_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99156:FunctionDef_L53_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99156:Expr_L57_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99156:FunctionDef_L53_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99156:Expr_L59_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99156:FunctionDef_L53_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99156:Expr_L61_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99156:FunctionDef_L53_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99156:Assign_L63_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99156:FunctionDef_L53_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99156:Return_L64_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99156:FunctionDef_L66_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99156:Assign_L67_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99156:FunctionDef_L66_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99156:If_L68_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99156:If_L68_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99156:Return_L69_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99156:FunctionDef_L66_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99156:For_L70_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99156:FunctionDef_L66_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99156:Expr_L72_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99156:FunctionDef_L66_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99156:Expr_L73_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99156:FunctionDef_L66_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99156:Expr_L74_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99156:FunctionDef_L66_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99156:For_L75_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99156:For_L75_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99156:Expr_L76_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99156:For_L75_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99156:Assign_L77_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99156:For_L75_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99156:If_L82_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99156:If_L82_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99156:Expr_L83_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99156:FunctionDef_L86_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99156:Assign_L87_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99156:FunctionDef_L86_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99156:Expr_L88_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99156:If_L90_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99156:Expr_L91_C1"}]
#!/usr/bin/env python # coding=utf-8 import codecs class PinyinConverter: def __init__(self): self._pinyinTable = PINYIN_TABLE def char2pinyin(self, c): ## convert Chinese character to pinyin ## @exception: AssertionError, KeyError assert isinstance(c, unicode) assert len(c) == 1 return self._pinyinTable[c] def str2pinyin(self, s): ## convert string to pinyin ret = u'' for c in s: if self._pinyinTable.has_key(c): ret += self._pinyinTable[c].capitalize() else: ret += c return ret # pinyin table PINYIN_TABLE = { u'一': u'yi1', u'丁': u'ding1', u'丂': u'kao3', u'七': u'qi1', u'丄': u'shang4', u'丅': u'xia4', u'丆': u'han1', u'万': u'wan4', u'丈': u'zhang4', u'三': u'san1', u'上': u'shang4', u'下': u'xia4', u'丌': u'ji1', u'不': u'bu4', u'与': u'yu3', u'丏': u'mian3', u'丐': u'gai4', u'丑': u'chou3', u'丒': u'chou3', u'专': u'zhuan1', u'且': u'qie3', u'丕': u'pi1', u'世': u'shi4', u'丗': u'shi4', u'丘': u'qiu1', u'丙': u'bing3', u'业': u'ye4', u'丛': u'cong2', u'东': u'dong1', u'丝': u'si1', u'丞': u'cheng2', u'丟': u'diu1', u'丠': u'qiu1', u'両': u'liang3', u'丢': u'diu1', u'丣': u'you3', u'两': u'liang3', u'严': u'yan2', u'並': u'bing4', u'丧': u'sang4', u'丨': u'shu4', u'丩': u'jiu1', u'个': u'ge', u'丫': u'ya1', u'丬': u'pan2', u'中': u'zhong1', u'丮': u'ji3', u'丯': u'jie4', u'丰': u'feng1', u'丱': u'guan4', u'串': u'chuan4', u'丳': u'chan3', u'临': u'lin2', u'丵': u'zhuo2', u'丶': u'dian3', u'丷': u'ba1', u'丸': u'wan2', u'丹': u'dan1', u'为': u'wei4', u'主': u'zhu3', u'丼': u'jing3', u'丽': u'li4', u'举': u'ju3', u'丿': u'pie3', u'乀': u'fu2', u'乁': u'yi2', u'乂': u'yi4', u'乃': u'nai3', u'乄': u'shi1', u'久': u'jiu3', u'乆': u'jiu3', u'乇': u'tuo1', u'么': u'ma', u'义': u'yi4', u'乊': u'yin1', u'之': u'zhi1', u'乌': u'wu1', u'乍': u'zha4', u'乎': u'hu1', u'乏': u'fa2', u'乐': u'le4', u'乑': u'yin2', u'乒': u'ping1', u'乓': u'pang1', u'乔': u'qiao2', u'乕': u'hu3', u'乖': u'guai1', u'乗': u'cheng2', u'乘': u'cheng2', u'乙': u'yi3', u'乚': u'hao2', u'乛': u'wan', u'乜': u'mie1', u'九': u'jiu3', u'乞': u'qi3', u'也': u'ye3', u'习': u'xi2', u'乡': u'xiang1', u'乢': u'gai4', u'乣': u'jiu3', u'乤': u'hari', u'乥': u'huo', u'书': u'shu1', u'乧': u'dou', u'乨': u'shi3', u'乩': u'ji1', u'乪': u'nang2', u'乫': u'gari', u'乬': u'geri', u'乭': u'daori', u'乮': u'mori', u'乯': u'o', u'买': u'mai3', u'乱': u'luan4', u'乲': u'ca', u'乳': u'ru3', u'乴': u'xue2', u'乵': u'yan3', u'乶': u'pori', u'乷': u'da', u'乸': u'na3', u'乹': u'gan1', u'乺': u'saori', u'乻': u'er1', u'乼': u'ri', u'乽': u'zari', u'乾': u'qian2', u'乿': u'zhi4', u'亀': u'gui1', u'亁': u'gan1', u'亂': u'luan4', u'亃': u'lin3', u'亄': u'yi4', u'亅': u'jue2', u'了': u'le', u'亇': u'ma1', u'予': u'yu3', u'争': u'zheng1', u'亊': u'shi4', u'事': u'shi4', u'二': u'er4', u'亍': u'chu4', u'于': u'yu2', u'亏': u'kui1', u'亐': u'yu2', u'云': u'yun2', u'互': u'hu4', u'亓': u'qi2', u'五': u'wu3', u'井': u'jing3', u'亖': u'si4', u'亗': u'sui4', u'亘': u'gen4', u'亙': u'gen4', u'亚': u'ya4', u'些': u'xie1', u'亜': u'ya4', u'亝': u'zhai1', u'亞': u'ya4', u'亟': u'ji2', u'亠': u'tou2', u'亡': u'wang2', u'亢': u'kang4', u'亣': u'da4', u'交': u'jiao1', u'亥': u'hai4', u'亦': u'yi4', u'产': u'chan3', u'亨': u'heng1', u'亩': u'mu3', u'亪': u'ye', u'享': u'xiang3', u'京': u'jing1', u'亭': u'ting2', u'亮': u'liang4', u'亯': u'xiang3', u'亰': u'jing1', u'亱': u'ye4', u'亲': u'qin1', u'亳': u'bo2', u'亴': u'you4', u'亵': u'xie4', u'亶': u'dan3', u'亷': u'lian2', u'亸': u'duo3', u'亹': u'wei3', u'人': u'ren2', u'亻': u'ren2', u'亼': u'ji2', u'亽': u'ji2', u'亾': u'wang2', u'亿': u'yi4', u'什': u'shi2', u'仁': u'ren2', u'仂': u'le4', u'仃': u'ding1', u'仄': u'ze4', u'仅': u'jin3', u'仆': u'pu2', u'仇': u'chou2', u'仈': u'ba1', u'仉': u'zhang3', u'今': u'jin1', u'介': u'jie4', u'仌': u'bing1', u'仍': u'reng2', u'从': u'cong2', u'仏': u'fo2', u'仐': u'jin1', u'仑': u'lun2', u'仒': u'bing1', u'仓': u'cang1', u'仔': u'zi3', u'仕': u'shi4', u'他': u'ta1', u'仗': u'zhang4', u'付': u'fu4', u'仙': u'xian1', u'仚': u'xian1', u'仛': u'tuo1', u'仜': u'hong2', u'仝': u'tong2', u'仞': u'ren4', u'仟': u'qian1', u'仠': u'gan3', u'仡': u'ge1', u'仢': u'bo2', u'代': u'dai4', u'令': u'ling4', u'以': u'yi3', u'仦': u'chao4', u'仧': u'chang2', u'仨': u'sa1', u'仩': u'chang2', u'仪': u'yi2', u'仫': u'mu4', u'们': u'men', u'仭': u'ren4', u'仮': u'fan3', u'仯': u'chao4', u'仰': u'yang3', u'仱': u'qian2', u'仲': u'zhong4', u'仳': u'pi3', u'仴': u'wo4', u'仵': u'wu3', u'件': u'jian4', u'价': u'jia4', u'仸': u'yao3', u'仹': u'feng1', u'仺': u'cang1', u'任': u'ren4', u'仼': u'wang2', u'份': u'fen4', u'仾': u'di1', u'仿': u'fang3', u'伀': u'zhong1', u'企': u'qi3', u'伂': u'pei4', u'伃': u'yu2', u'伄': u'diao4', u'伅': u'dun4', u'伆': u'wen3', u'伇': u'yi4', u'伈': u'xin3', u'伉': u'kang4', u'伊': u'yi1', u'伋': u'ji2', u'伌': u'ai4', u'伍': u'wu3', u'伎': u'ji4', u'伏': u'fu2', u'伐': u'fa2', u'休': u'xiu1', u'伒': u'jin4', u'伓': u'pi1', u'伔': u'dan3', u'伕': u'fu1', u'伖': u'tang3', u'众': u'zhong4', u'优': u'you1', u'伙': u'huo3', u'会': u'hui4', u'伛': u'yu3', u'伜': u'cui4', u'伝': u'yun2', u'伞': u'san3', u'伟': u'wei3', u'传': u'zhuan4', u'伡': u'che1', u'伢': u'ya2', u'伣': u'qian4', u'伤': u'shang1', u'伥': u'chang1', u'伦': u'lun2', u'伧': u'cang1', u'伨': u'xun4', u'伩': u'xin4', u'伪': u'wei3', u'伫': u'zhu4', u'伬': u'chi3', u'伭': u'xian2', u'伮': u'nu2', u'伯': u'bo2', u'估': u'gu1', u'伱': u'ni3', u'伲': u'ni4', u'伳': u'xie4', u'伴': u'ban4', u'伵': u'xu4', u'伶': u'ling2', u'伷': u'zhou4', u'伸': u'shen1', u'伹': u'qu1', u'伺': u'ci4', u'伻': u'beng1', u'似': u'si4', u'伽': u'jia1', u'伾': u'pi1', u'伿': u'zhi4', u'佀': u'si4', u'佁': u'ai3', u'佂': u'zheng1', u'佃': u'dian4', u'佄': u'han1', u'佅': u'mai4', u'但': u'dan4', u'佇': u'zhu4', u'佈': u'bu4', u'佉': u'qu1', u'佊': u'bi3', u'佋': u'zhao1', u'佌': u'ci3', u'位': u'wei4', u'低': u'di1', u'住': u'zhu4', u'佐': u'zuo3', u'佑': u'you4', u'佒': u'yang3', u'体': u'ti3', u'佔': u'zhan4', u'何': u'he2', u'佖': u'bi4', u'佗': u'tuo2', u'佘': u'she2', u'余': u'yu2', u'佚': u'yi4', u'佛': u'fo2', u'作': u'zuo4', u'佝': u'gou1', u'佞': u'ning4', u'佟': u'tong2', u'你': u'ni3', u'佡': u'xian1', u'佢': u'qu2', u'佣': u'yong1', u'佤': u'wa3', u'佥': u'qian1', u'佦': u'shi', u'佧': u'ka3', u'佨': u'bao', u'佩': u'pei4', u'佪': u'huai2', u'佫': u'he4', u'佬': u'lao3', u'佭': u'xiang2', u'佮': u'ge2', u'佯': u'yang2', u'佰': u'bai3', u'佱': u'fa3', u'佲': u'ming3', u'佳': u'jia1', u'佴': u'er4', u'併': u'bing4', u'佶': u'ji2', u'佷': u'hen3', u'佸': u'huo2', u'佹': u'gui3', u'佺': u'quan2', u'佻': u'tiao1', u'佼': u'jiao3', u'佽': u'ci4', u'佾': u'yi4', u'使': u'shi3', u'侀': u'xing2', u'侁': u'shen1', u'侂': u'tuo1', u'侃': u'kan3', u'侄': u'zhi2', u'侅': u'gai1', u'來': u'lai2', u'侇': u'yi2', u'侈': u'chi3', u'侉': u'kua3', u'侊': u'gong1', u'例': u'li4', u'侌': u'yin1', u'侍': u'shi4', u'侎': u'mi3', u'侏': u'zhu1', u'侐': u'xu4', u'侑': u'you4', u'侒': u'an1', u'侓': u'lu4', u'侔': u'mou2', u'侕': u'er2', u'侖': u'lun2', u'侗': u'dong4', u'侘': u'cha4', u'侙': u'chi4', u'侚': u'xun4', u'供': u'gong4', u'侜': u'zhou1', u'依': u'yi1', u'侞': u'ru2', u'侟': u'cun2', u'侠': u'xia2', u'価': u'si4', u'侢': u'dai4', u'侣': u'lv3', u'侤': u'ta', u'侥': u'jiao3', u'侦': u'zhen1', u'侧': u'ce4', u'侨': u'qiao2', u'侩': u'kuai4', u'侪': u'chai2', u'侫': u'ning4', u'侬': u'nong2', u'侭': u'jin3', u'侮': u'wu3', u'侯': u'hou2', u'侰': u'jiong3', u'侱': u'cheng3', u'侲': u'zhen4', u'侳': u'zuo4', u'侴': u'hao4', u'侵': u'qin1', u'侶': u'lv3', u'侷': u'ju2', u'侸': u'shu4', u'侹': u'ting3', u'侺': u'shen4', u'侻': u'tui4', u'侼': u'bo2', u'侽': u'nan2', u'侾': u'xiao1', u'便': u'bian4', u'俀': u'tui3', u'俁': u'yu3', u'係': u'xi4', u'促': u'cu4', u'俄': u'e2', u'俅': u'qiu2', u'俆': u'xu2', u'俇': u'guang4', u'俈': u'ku4', u'俉': u'wu4', u'俊': u'jun4', u'俋': u'yi4', u'俌': u'fu3', u'俍': u'liang2', u'俎': u'zu3', u'俏': u'qiao4', u'俐': u'li4', u'俑': u'yong3', u'俒': u'hun4', u'俓': u'jing4', u'俔': u'qian4', u'俕': u'san4', u'俖': u'pei3', u'俗': u'su2', u'俘': u'fu2', u'俙': u'xi1', u'俚': u'li3', u'俛': u'fu3', u'俜': u'ping1', u'保': u'bao3', u'俞': u'yu2', u'俟': u'si4', u'俠': u'xia2', u'信': u'xin4', u'俢': u'xiu1', u'俣': u'yu3', u'俤': u'di4', u'俥': u'che1', u'俦': u'chou2', u'俧': u'zhi', u'俨': u'yan3', u'俩': u'lia3', u'俪': u'li4', u'俫': u'lai2', u'俬': u'si1', u'俭': u'jian3', u'修': u'xiu1', u'俯': u'fu3', u'俰': u'huo4', u'俱': u'ju4', u'俲': u'xiao4', u'俳': u'pai2', u'俴': u'jian4', u'俵': u'biao4', u'俶': u'chu4', u'俷': u'fei4', u'俸': u'feng4', u'俹': u'ya4', u'俺': u'an3', u'俻': u'bei4', u'俼': u'yu4', u'俽': u'xin1', u'俾': u'bi3', u'俿': u'hu3', u'倀': u'chang1', u'倁': u'zhi1', u'倂': u'bing4', u'倃': u'jiu4', u'倄': u'yao2', u'倅': u'cui4', u'倆': u'lia3', u'倇': u'wan3', u'倈': u'lai2', u'倉': u'cang1', u'倊': u'zong3', u'個': u'ge', u'倌': u'guan1', u'倍': u'bei4', u'倎': u'tian3', u'倏': u'shu1', u'倐': u'shu1', u'們': u'men', u'倒': u'dao3', u'倓': u'tan2', u'倔': u'jue4', u'倕': u'chui2', u'倖': u'xing4', u'倗': u'peng2', u'倘': u'tang3', u'候': u'hou4', u'倚': u'yi3', u'倛': u'qi1', u'倜': u'ti4', u'倝': u'gan4', u'倞': u'jing4', u'借': u'jie4', u'倠': u'sui1', u'倡': u'chang4', u'倢': u'jie2', u'倣': u'fang3', u'値': u'zhi2', u'倥': u'kong1', u'倦': u'juan4', u'倧': u'zong1', u'倨': u'ju4', u'倩': u'qian4', u'倪': u'ni2', u'倫': u'lun2', u'倬': u'zhuo1', u'倭': u'wo1', u'倮': u'luo3', u'倯': u'song1', u'倰': u'leng4', u'倱': u'hun4', u'倲': u'dong1', u'倳': u'zi4', u'倴': u'ben4', u'倵': u'wu3', u'倶': u'ju4', u'倷': u'nai3', u'倸': u'cai3', u'倹': u'jian3', u'债': u'zhai4', u'倻': u'ye1', u'值': u'zhi2', u'倽': u'sha4', u'倾': u'qing1', u'倿': u'ning4', u'偀': u'ying1', u'偁': u'cheng1', u'偂': u'qian2', u'偃': u'yan3', u'偄': u'ruan3', u'偅': u'zhong4', u'偆': u'chun3', u'假': u'jia4', u'偈': u'jie2', u'偉': u'wei3', u'偊': u'yu3', u'偋': u'bing3', u'偌': u'ruo4', u'偍': u'ti2', u'偎': u'wei1', u'偏': u'pian1', u'偐': u'yan4', u'偑': u'feng1', u'偒': u'tang3', u'偓': u'wo4', u'偔': u'e4', u'偕': u'xie2', u'偖': u'che3', u'偗': u'sheng3', u'偘': u'kan3', u'偙': u'di4', u'做': u'zuo4', u'偛': u'cha1', u'停': u'ting2', u'偝': u'bei4', u'偞': u'xie4', u'偟': u'huang2', u'偠': u'yao3', u'偡': u'zhan4', u'偢': u'chou3', u'偣': u'an1', u'偤': u'you2', u'健': u'jian4', u'偦': u'xu1', u'偧': u'zha1', u'偨': u'ci1', u'偩': u'fu4', u'偪': u'bi1', u'偫': u'zhi4', u'偬': u'zong3', u'偭': u'mian3', u'偮': u'ji2', u'偯': u'yi3', u'偰': u'xie4', u'偱': u'xun2', u'偲': u'cai1', u'偳': u'duan1', u'側': u'ce4', u'偵': u'zhen1', u'偶': u'ou3', u'偷': u'tou1', u'偸': u'tou1', u'偹': u'bei4', u'偺': u'zan2', u'偻': u'lou2', u'偼': u'jie2', u'偽': u'wei3', u'偾': u'fen4', u'偿': u'chang2', u'傀': u'kui3', u'傁': u'sou3', u'傂': u'zhi4', u'傃': u'su4', u'傄': u'xia1', u'傅': u'fu4', u'傆': u'yuan4', u'傇': u'rong3', u'傈': u'li4', u'傉': u'nu4', u'傊': u'yun4', u'傋': u'jiang3', u'傌': u'ma4', u'傍': u'bang4', u'傎': u'dian1', u'傏': u'tang2', u'傐': u'hao4', u'傑': u'jie2', u'傒': u'xi1', u'傓': u'shan1', u'傔': u'qian4', u'傕': u'jue2', u'傖': u'cang1', u'傗': u'chu4', u'傘': u'san3', u'備': u'bei4', u'傚': u'xiao4', u'傛': u'rong2', u'傜': u'yao2', u'傝': u'ta4', u'傞': u'suo1', u'傟': u'yang3', u'傠': u'fa2', u'傡': u'bing4', u'傢': u'jia1', u'傣': u'dai3', u'傤': u'zai4', u'傥': u'tang3', u'傦': u'gu', u'傧': u'bin1', u'储': u'chu3', u'傩': u'nuo2', u'傪': u'can1', u'傫': u'lei2', u'催': u'cui1', u'傭': u'yong1', u'傮': u'zao1', u'傯': u'zong3', u'傰': u'peng2', u'傱': u'song3', u'傲': u'ao4', u'傳': u'zhuan4', u'傴': u'yu3', u'債': u'zhai4', u'傶': u'qi1', u'傷': u'shang1', u'傸': u'chuang3', u'傹': u'jing4', u'傺': u'chi4', u'傻': u'sha3', u'傼': u'han4', u'傽': u'zhang1', u'傾': u'qing1', u'傿': u'yan1', u'僀': u'di4', u'僁': u'xie4', u'僂': u'lou2', u'僃': u'bei4', u'僄': u'piao4', u'僅': u'jin3', u'僆': u'lian4', u'僇': u'lu4', u'僈': u'man4', u'僉': u'qian1', u'僊': u'xian1', u'僋': u'tan3', u'僌': u'ying2', u'働': u'dong4', u'僎': u'zhuan4', u'像': u'xiang4', u'僐': u'shan4', u'僑': u'qiao2', u'僒': u'jiong3', u'僓': u'tui3', u'僔': u'zun3', u'僕': u'pu2', u'僖': u'xi1', u'僗': u'lao2', u'僘': u'chang3', u'僙': u'guang1', u'僚': u'liao2', u'僛': u'qi1', u'僜': u'deng1', u'僝': u'chan2', u'僞': u'wei3', u'僟': u'ji1', u'僠': u'bo1', u'僡': u'hui4', u'僢': u'chuan3', u'僣': u'tie3', u'僤': u'dan4', u'僥': u'jiao3', u'僦': u'jiu4', u'僧': u'seng1', u'僨': u'fen4', u'僩': u'xian4', u'僪': u'yu4', u'僫': u'e4', u'僬': u'jiao1', u'僭': u'jian4', u'僮': u'tong2', u'僯': u'lin3', u'僰': u'bo2', u'僱': u'gu4', u'僲': u'xian1', u'僳': u'su4', u'僴': u'xian4', u'僵': u'jiang1', u'僶': u'min3', u'僷': u'ye4', u'僸': u'jin4', u'價': u'jia4', u'僺': u'qiao4', u'僻': u'pi4', u'僼': u'feng1', u'僽': u'zhou4', u'僾': u'ai4', u'僿': u'sai1', u'儀': u'yi2', u'儁': u'jun4', u'儂': u'nong2', u'儃': u'chan2', u'億': u'yi4', u'儅': u'dang1', u'儆': u'jing3', u'儇': u'xuan1', u'儈': u'kuai4', u'儉': u'jian3', u'儊': u'chu4', u'儋': u'dan1', u'儌': u'jiao3', u'儍': u'sha3', u'儎': u'zai4', u'儏': u'can', u'儐': u'bin1', u'儑': u'an2', u'儒': u'ru2', u'儓': u'tai2', u'儔': u'chou2', u'儕': u'chai2', u'儖': u'lan2', u'儗': u'ni3', u'儘': u'jin4', u'儙': u'qian4', u'儚': u'meng2', u'儛': u'wu3', u'儜': u'ning2', u'儝': u'qiong2', u'儞': u'ni3', u'償': u'chang2', u'儠': u'lie4', u'儡': u'lei3', u'儢': u'lv3', u'儣': u'kuang3', u'儤': u'bao4', u'儥': u'yu4', u'儦': u'biao1', u'儧': u'zan3', u'儨': u'zhi4', u'儩': u'si4', u'優': u'you1', u'儫': u'hao2', u'儬': u'qing4', u'儭': u'chen4', u'儮': u'li4', u'儯': u'teng2', u'儰': u'wei3', u'儱': u'long3', u'儲': u'chu3', u'儳': u'chan2', u'儴': u'rang2', u'儵': u'shu1', u'儶': u'hui4', u'儷': u'li4', u'儸': u'luo2', u'儹': u'zan3', u'儺': u'nuo2', u'儻': u'tang3', u'儼': u'yan3', u'儽': u'lei2', u'儾': u'nang4', u'儿': u'er2', u'兀': u'wu4', u'允': u'yun3', u'兂': u'zan1', u'元': u'yuan2', u'兄': u'xiong1', u'充': u'chong1', u'兆': u'zhao4', u'兇': u'xiong1', u'先': u'xian1', u'光': u'guang1', u'兊': u'dui4', u'克': u'ke4', u'兌': u'dui4', u'免': u'mian3', u'兎': u'tu4', u'兏': u'chang2', u'児': u'er2', u'兑': u'dui4', u'兒': u'er2', u'兓': u'jin1', u'兔': u'tu4', u'兕': u'si4', u'兖': u'yan3', u'兗': u'yan3', u'兘': u'shi3', u'兙': u'shi2ke4', u'党': u'dang3', u'兛': u'qian1ke4', u'兜': u'dou1', u'兝': u'gong1fen1', u'兞': u'hao2ke4', u'兟': u'shen1', u'兠': u'dou1', u'兡': u'bai3ke4', u'兢': u'jing1', u'兣': u'gong1li2', u'兤': u'huang3', u'入': u'ru4', u'兦': u'wang2', u'內': u'nei4', u'全': u'quan2', u'兩': u'liang3', u'兪': u'yu2', u'八': u'ba1', u'公': u'gong1', u'六': u'liu4', u'兮': u'xi1', u'兯': u'han', u'兰': u'lan2', u'共': u'gong4', u'兲': u'tian1', u'关': u'guan1', u'兴': u'xing1', u'兵': u'bing1', u'其': u'qi2', u'具': u'ju4', u'典': u'dian3', u'兹': u'zi1', u'兺': u'ben1', u'养': u'yang3', u'兼': u'jian1', u'兽': u'shou4', u'兾': u'ji4', u'兿': u'yi4', u'冀': u'ji4', u'冁': u'chan3', u'冂': u'jiong1', u'冃': u'mao4', u'冄': u'ran3', u'内': u'nei4', u'円': u'yuan2', u'冇': u'mao3', u'冈': u'gang1', u'冉': u'ran3', u'冊': u'ce4', u'冋': u'jiong1', u'册': u'ce4', u'再': u'zai4', u'冎': u'gua3', u'冏': u'jiong3', u'冐': u'mao4', u'冑': u'zhou4', u'冒': u'mao4', u'冓': u'gou4', u'冔': u'xu2', u'冕': u'mian3', u'冖': u'mi4', u'冗': u'rong3', u'冘': u'yin2', u'写': u'xie3', u'冚': u'kan3', u'军': u'jun1', u'农': u'nong2', u'冝': u'yi2', u'冞': u'shen1', u'冟': u'shi4', u'冠': u'guan1', u'冡': u'meng3', u'冢': u'zhong3', u'冣': u'zui4', u'冤': u'yuan1', u'冥': u'ming2', u'冦': u'kou4', u'冧': u'lin2', u'冨': u'fu4', u'冩': u'xie3', u'冪': u'mi4', u'冫': u'bing1', u'冬': u'dong1', u'冭': u'tai4', u'冮': u'gang1', u'冯': u'feng2', u'冰': u'bing1', u'冱': u'hu4', u'冲': u'chong1', u'决': u'jue2', u'冴': u'ya4', u'况': u'kuang4', u'冶': u'ye3', u'冷': u'leng3', u'冸': u'pan4', u'冹': u'fa1', u'冺': u'min3', u'冻': u'dong4', u'冼': u'xian3', u'冽': u'lie4', u'冾': u'qia4', u'冿': u'jian1', u'净': u'jing4', u'凁': u'sou1', u'凂': u'mei3', u'凃': u'tu2', u'凄': u'qi1', u'凅': u'gu4', u'准': u'zhun3', u'凇': u'song1', u'凈': u'jing4', u'凉': u'liang2', u'凊': u'qing4', u'凋': u'diao1', u'凌': u'ling2', u'凍': u'dong4', u'凎': u'gan4', u'减': u'jian3', u'凐': u'yin1', u'凑': u'cou4', u'凒': u'ai2', u'凓': u'li4', u'凔': u'cang1', u'凕': u'ming3', u'凖': u'zhun3', u'凗': u'cui1', u'凘': u'si1', u'凙': u'duo2', u'凚': u'jin4', u'凛': u'lin3', u'凜': u'lin3', u'凝': u'ning2', u'凞': u'xi1', u'凟': u'du2', u'几': u'ji3', u'凡': u'fan2', u'凢': u'fan2', u'凣': u'fan2', u'凤': u'feng4', u'凥': u'ju1', u'処': u'chu2', u'凧': u'yi', u'凨': u'feng1', u'凩': u'kuo1ga1la1xi1', u'凪': u'na1ji1', u'凫': u'fu2', u'凬': u'feng1', u'凭': u'ping2', u'凮': u'feng1', u'凯': u'kai3', u'凰': u'huang2', u'凱': u'kai3', u'凲': u'gan1', u'凳': u'deng4', u'凴': u'ping2', u'凵': u'kan3', u'凶': u'xiong1', u'凷': u'kuai4', u'凸': u'tu1', u'凹': u'ao1', u'出': u'chu1', u'击': u'ji1', u'凼': u'dang4', u'函': u'han2', u'凾': u'han2', u'凿': u'zao2', u'刀': u'dao1', u'刁': u'diao1', u'刂': u'dao1', u'刃': u'ren4', u'刄': u'ren4', u'刅': u'chuang1', u'分': u'fen1', u'切': u'qie1', u'刈': u'yi4', u'刉': u'ji1', u'刊': u'kan1', u'刋': u'qian4', u'刌': u'cun3', u'刍': u'chu2', u'刎': u'wen3', u'刏': u'ji1', u'刐': u'dan3', u'刑': u'xing2', u'划': u'hua2', u'刓': u'wan2', u'刔': u'jue2', u'刕': u'li2', u'刖': u'yue4', u'列': u'lie4', u'刘': u'liu2', u'则': u'ze2', u'刚': u'gang1', u'创': u'chuang4', u'刜': u'fu2', u'初': u'chu1', u'刞': u'qu4', u'刟': u'diao1', u'删': u'shan1', u'刡': u'min3', u'刢': u'ling2', u'刣': u'zhong1', u'判': u'pan4', u'別': u'bie2', u'刦': u'jie2', u'刧': u'jie2', u'刨': u'pao2', u'利': u'li4', u'刪': u'shan1', u'别': u'bie2', u'刬': u'chan3', u'刭': u'jing3', u'刮': u'gua1', u'刯': u'geng1', u'到': u'dao4', u'刱': u'chuang4', u'刲': u'kui1', u'刳': u'ku1', u'刴': u'duo4', u'刵': u'er4', u'制': u'zhi4', u'刷': u'shua1', u'券': u'quan4', u'刹': u'sha1', u'刺': u'ci4', u'刻': u'ke4', u'刼': u'jie2', u'刽': u'gui4', u'刾': u'ci4', u'刿': u'gui4', u'剀': u'kai3', u'剁': u'duo4', u'剂': u'ji4', u'剃': u'ti4', u'剄': u'jing3', u'剅': u'dou1', u'剆': u'luo3', u'則': u'ze2', u'剈': u'yuan1', u'剉': u'cuo4', u'削': u'xiao1', u'剋': u'ke4', u'剌': u'la4', u'前': u'qian2', u'剎': u'sha1', u'剏': u'chuang4', u'剐': u'gua3', u'剑': u'jian4', u'剒': u'cuo4', u'剓': u'li2', u'剔': u'ti1', u'剕': u'fei4', u'剖': u'pou1', u'剗': u'chan3', u'剘': u'qi2', u'剙': u'chuang4', u'剚': u'zi4', u'剛': u'gang1', u'剜': u'wan1', u'剝': u'bao1', u'剞': u'ji1', u'剟': u'duo1', u'剠': u'qing2', u'剡': u'shan4', u'剢': u'du1', u'剣': u'jian4', u'剤': u'ji4', u'剥': u'bao1', u'剦': u'yan', u'剧': u'ju4', u'剨': u'huo4', u'剩': u'sheng4', u'剪': u'jian3', u'剫': u'duo2', u'剬': u'zhi4', u'剭': u'wu1', u'剮': u'gua3', u'副': u'fu4', u'剰': u'sheng4', u'剱': u'jian4', u'割': u'ge1', u'剳': u'zha2', u'剴': u'kai3', u'創': u'chuang4', u'剶': u'chuan2', u'剷': u'chan3', u'剸': u'tuan2', u'剹': u'lu4', u'剺': u'li2', u'剻': u'peng1', u'剼': u'shan1', u'剽': u'piao1', u'剾': u'kou1', u'剿': u'jiao3', u'劀': u'gua1', u'劁': u'qiao1', u'劂': u'jue2', u'劃': u'hua2', u'劄': u'zha2', u'劅': u'zhuo2', u'劆': u'lian2', u'劇': u'ju4', u'劈': u'pi1', u'劉': u'liu2', u'劊': u'gui4', u'劋': u'jiao3', u'劌': u'gui4', u'劍': u'jian4', u'劎': u'jian4', u'劏': u'tang1', u'劐': u'huo1', u'劑': u'ji4', u'劒': u'jian4', u'劓': u'yi4', u'劔': u'jian4', u'劕': u'zhi4', u'劖': u'chan2', u'劗': u'zuan1', u'劘': u'mo2', u'劙': u'li2', u'劚': u'zhu2', u'力': u'li4', u'劜': u'ya4', u'劝': u'quan4', u'办': u'ban4', u'功': u'gong1', u'加': u'jia1', u'务': u'wu4', u'劢': u'mai4', u'劣': u'lie4', u'劤': u'jin4', u'劥': u'keng1', u'劦': u'xie2', u'劧': u'zhi3', u'动': u'dong4', u'助': u'zhu4', u'努': u'nu3', u'劫': u'jie2', u'劬': u'qu2', u'劭': u'shao4', u'劮': u'yi4', u'劯': u'zhu3', u'劰': u'miao3', u'励': u'li4', u'劲': u'jin4', u'劳': u'lao2', u'労': u'lao2', u'劵': u'juan4', u'劶': u'kou3', u'劷': u'yang2', u'劸': u'wa1', u'効': u'xiao4', u'劺': u'mou2', u'劻': u'kuang1', u'劼': u'jie2', u'劽': u'lie4', u'劾': u'he2', u'势': u'shi4', u'勀': u'ke4', u'勁': u'jin4', u'勂': u'gao4', u'勃': u'bo2', u'勄': u'min3', u'勅': u'chi4', u'勆': u'lang2', u'勇': u'yong3', u'勈': u'yong3', u'勉': u'mian3', u'勊': u'ke4', u'勋': u'xun1', u'勌': u'juan4', u'勍': u'qing2', u'勎': u'lu4', u'勏': u'bu4', u'勐': u'meng3', u'勑': u'lai4', u'勒': u'le4', u'勓': u'kai4', u'勔': u'mian3', u'動': u'dong4', u'勖': u'xu4', u'勗': u'xu4', u'勘': u'kan1', u'務': u'wu4', u'勚': u'yi4', u'勛': u'xun1', u'勜': u'weng3', u'勝': u'sheng4', u'勞': u'lao2', u'募': u'mu4', u'勠': u'lu4', u'勡': u'piao1', u'勢': u'shi4', u'勣': u'ji1', u'勤': u'qin2', u'勥': u'jiang4', u'勦': u'jiao3', u'勧': u'quan4', u'勨': u'xiang4', u'勩': u'yi4', u'勪': u'qiao1', u'勫': u'fan1', u'勬': u'juan1', u'勭': u'tong2', u'勮': u'ju4', u'勯': u'dan1', u'勰': u'xie2', u'勱': u'mai4', u'勲': u'xun1', u'勳': u'xun1', u'勴': u'lv4', u'勵': u'li4', u'勶': u'che4', u'勷': u'rang2', u'勸': u'quan4', u'勹': u'bao1', u'勺': u'shao2', u'勻': u'yun2', u'勼': u'jiu1', u'勽': u'bao4', u'勾': u'gou1', u'勿': u'wu4', u'匀': u'yun2', u'匁': u'moneme', u'匂': u'xiong1', u'匃': u'gai4', u'匄': u'gai4', u'包': u'bao1', u'匆': u'cong1', u'匇': u'yi', u'匈': u'xiong1', u'匉': u'peng1', u'匊': u'ju1', u'匋': u'tao2', u'匌': u'ge2', u'匍': u'pu2', u'匎': u'e4', u'匏': u'pao2', u'匐': u'fu2', u'匑': u'gong1', u'匒': u'da2', u'匓': u'jiu4', u'匔': u'gong1', u'匕': u'bi3', u'化': u'hua4', u'北': u'bei3', u'匘': u'nao3', u'匙': u'chi2', u'匚': u'fang1', u'匛': u'jiu4', u'匜': u'yi2', u'匝': u'za1', u'匞': u'jiang4', u'匟': u'kang4', u'匠': u'jiang4', u'匡': u'kuang1', u'匢': u'hu1', u'匣': u'xia2', u'匤': u'qu1', u'匥': u'fan2', u'匦': u'gui3', u'匧': u'qie4', u'匨': u'zang1', u'匩': u'kuang1', u'匪': u'fei3', u'匫': u'hu1', u'匬': u'yu3', u'匭': u'gui3', u'匮': u'kui4', u'匯': u'hui4', u'匰': u'dan1', u'匱': u'kui4', u'匲': u'lian2', u'匳': u'lian2', u'匴': u'suan3', u'匵': u'du2', u'匶': u'jiu4', u'匷': u'jue2', u'匸': u'xi4', u'匹': u'pi3', u'区': u'qu1', u'医': u'yi1', u'匼': u'ke1', u'匽': u'yan3', u'匾': u'bian3', u'匿': u'ni4', u'區': u'qu1', u'十': u'shi2', u'卂': u'xun4', u'千': u'qian1', u'卄': u'nian4', u'卅': u'sa4', u'卆': u'zu2', u'升': u'sheng1', u'午': u'wu3', u'卉': u'hui4', u'半': u'ban4', u'卋': u'shi4', u'卌': u'xi4', u'卍': u'wan4', u'华': u'hua2', u'协': u'xie2', u'卐': u'wan4', u'卑': u'bei1', u'卒': u'zu2', u'卓': u'zhuo1', u'協': u'xie2', u'单': u'dan1', u'卖': u'mai4', u'南': u'nan2', u'単': u'dan1', u'卙': u'ji2', u'博': u'bo2', u'卛': u'shuai4', u'卜': u'bu3', u'卝': u'guan4', u'卞': u'bian4', u'卟': u'bu3', u'占': u'zhan4', u'卡': u'ka3', u'卢': u'lu2', u'卣': u'you3', u'卤': u'lu3', u'卥': u'xi1', u'卦': u'gua4', u'卧': u'wo4', u'卨': u'xie4', u'卩': u'jie2', u'卪': u'jie2', u'卫': u'wei4', u'卬': u'ang2', u'卭': u'qiong2', u'卮': u'zhi1', u'卯': u'mao3', u'印': u'yin4', u'危': u'wei1', u'卲': u'shao4', u'即': u'ji2', u'却': u'que4', u'卵': u'luan3', u'卶': u'chi3', u'卷': u'juan3', u'卸': u'xie4', u'卹': u'xu4', u'卺': u'jin3', u'卻': u'que4', u'卼': u'wu4', u'卽': u'ji2', u'卾': u'e4', u'卿': u'qing1', u'厀': u'xi1', u'厁': u'san1', u'厂': u'chang3', u'厃': u'wei1', u'厄': u'e4', u'厅': u'ting1', u'历': u'li4', u'厇': u'zhe2', u'厈': u'han4', u'厉': u'li4', u'厊': u'ya3', u'压': u'ya1', u'厌': u'yan4', u'厍': u'she4', u'厎': u'di3', u'厏': u'zha3', u'厐': u'pang2', u'厑': u'ya2', u'厒': u'qie4', u'厓': u'ya2', u'厔': u'zhi4', u'厕': u'ce4', u'厖': u'mang2', u'厗': u'ti2', u'厘': u'li2', u'厙': u'she4', u'厚': u'hou4', u'厛': u'ting1', u'厜': u'zui1', u'厝': u'cuo4', u'厞': u'fei4', u'原': u'yuan2', u'厠': u'ce4', u'厡': u'yuan2', u'厢': u'xiang1', u'厣': u'yan3', u'厤': u'li4', u'厥': u'jue2', u'厦': u'sha4', u'厧': u'dian1', u'厨': u'chu2', u'厩': u'jiu4', u'厪': u'jin3', u'厫': u'ao2', u'厬': u'gui3', u'厭': u'yan4', u'厮': u'si1', u'厯': u'li4', u'厰': u'chang3', u'厱': u'qian1', u'厲': u'li4', u'厳': u'yan2', u'厴': u'yan3', u'厵': u'yuan2', u'厶': u'si1', u'厷': u'gong1', u'厸': u'lin2', u'厹': u'rou2', u'厺': u'qu4', u'去': u'qu4', u'厼': u'kewumu', u'厽': u'lei3', u'厾': u'du1', u'县': u'xian4', u'叀': u'hui4', u'叁': u'san1', u'参': u'can1', u'參': u'can1', u'叄': u'can1', u'叅': u'can1', u'叆': u'ai4', u'叇': u'dai4', u'又': u'you4', u'叉': u'cha1', u'及': u'ji2', u'友': u'you3', u'双': u'shuang1', u'反': u'fan3', u'収': u'shou1', u'叏': u'guai2', u'叐': u'ba2', u'发': u'fa1', u'叒': u'ruo4', u'叓': u'li4', u'叔': u'shu1', u'叕': u'zhuo2', u'取': u'qu3', u'受': u'shou4', u'变': u'bian4', u'叙': u'xu4', u'叚': u'jia3', u'叛': u'pan4', u'叜': u'sou3', u'叝': u'ji2', u'叞': u'wei4', u'叟': u'sou3', u'叠': u'die2', u'叡': u'rui4', u'叢': u'cong2', u'口': u'kou3', u'古': u'gu3', u'句': u'ju4', u'另': u'ling4', u'叧': u'gua3', u'叨': u'dao1', u'叩': u'kou4', u'只': u'zhi1', u'叫': u'jiao4', u'召': u'zhao4', u'叭': u'ba1', u'叮': u'ding1', u'可': u'ke3', u'台': u'tai2', u'叱': u'chi4', u'史': u'shi3', u'右': u'you4', u'叴': u'qiu2', u'叵': u'po3', u'叶': u'ye4', u'号': u'hao4', u'司': u'si1', u'叹': u'tan4', u'叺': u'chi3', u'叻': u'le4', u'叼': u'diao1', u'叽': u'ji1', u'叾': u'duge', u'叿': u'hong1', u'吀': u'mie1', u'吁': u'xu1', u'吂': u'mang2', u'吃': u'chi1', u'各': u'ge4', u'吅': u'xuan1', u'吆': u'yao1', u'吇': u'zi3', u'合': u'he2', u'吉': u'ji2', u'吊': u'diao4', u'吋': u'cun4', u'同': u'tong2', u'名': u'ming2', u'后': u'hou4', u'吏': u'li4', u'吐': u'tu3', u'向': u'xiang4', u'吒': u'zha4', u'吓': u'xia4', u'吔': u'ye1', u'吕': u'lv3', u'吖': u'a1', u'吗': u'ma', u'吘': u'ou3', u'吙': u'huo1', u'吚': u'yi1', u'君': u'jun1', u'吜': u'chou3', u'吝': u'lin4', u'吞': u'tun1', u'吟': u'yin2', u'吠': u'fei4', u'吡': u'bi3', u'吢': u'qin4', u'吣': u'qin4', u'吤': u'jie4', u'吥': u'bu4', u'否': u'fou3', u'吧': u'ba', u'吨': u'dun1', u'吩': u'fen1', u'吪': u'e2', u'含': u'han2', u'听': u'ting1', u'吭': u'keng1', u'吮': u'shun3', u'启': u'qi3', u'吰': u'hong2', u'吱': u'zhi1', u'吲': u'yin3', u'吳': u'wu2', u'吴': u'wu2', u'吵': u'chao3', u'吶': u'na4', u'吷': u'xue4', u'吸': u'xi1', u'吹': u'chui1', u'吺': u'dou1', u'吻': u'wen3', u'吼': u'hou3', u'吽': u'hong1', u'吾': u'wu2', u'吿': u'gao', u'呀': u'ya1', u'呁': u'jun4', u'呂': u'lv3', u'呃': u'e4', u'呄': u'ge2', u'呅': u'wen3', u'呆': u'dai1', u'呇': u'qi3', u'呈': u'cheng2', u'呉': u'wu2', u'告': u'gao4', u'呋': u'fu1', u'呌': u'jiao4', u'呍': u'hong1', u'呎': u'chi3', u'呏': u'sheng1', u'呐': u'na4', u'呑': u'tun1', u'呒': u'mu2', u'呓': u'yi4', u'呔': u'tai3', u'呕': u'ou3', u'呖': u'li4', u'呗': u'bei', u'员': u'yuan2', u'呙': u'guo1', u'呚': u'hua2', u'呛': u'qiang4', u'呜': u'wu1', u'呝': u'e4', u'呞': u'shi1', u'呟': u'juan3', u'呠': u'pen3', u'呡': u'wen3', u'呢': u'ne', u'呣': u'mu2', u'呤': u'ling4', u'呥': u'ran2', u'呦': u'you1', u'呧': u'di3', u'周': u'zhou1', u'呩': u'shi4', u'呪': u'zhou4', u'呫': u'tie4', u'呬': u'xi4', u'呭': u'yi4', u'呮': u'qi4', u'呯': u'ping2', u'呰': u'zi3', u'呱': u'gua1', u'呲': u'ci1', u'味': u'wei4', u'呴': u'xu3', u'呵': u'a1', u'呶': u'nao2', u'呷': u'xia1', u'呸': u'pei1', u'呹': u'yi4', u'呺': u'xiao1', u'呻': u'shen1', u'呼': u'hu1', u'命': u'ming4', u'呾': u'da2', u'呿': u'qu4', u'咀': u'ju3', u'咁': u'xian2', u'咂': u'za1', u'咃': u'tuo1', u'咄': u'duo1', u'咅': u'pou3', u'咆': u'pao2', u'咇': u'bi4', u'咈': u'fu2', u'咉': u'yang3', u'咊': u'he2', u'咋': u'za3', u'和': u'he2', u'咍': u'hai1', u'咎': u'jiu4', u'咏': u'yong3', u'咐': u'fu4', u'咑': u'da1', u'咒': u'zhou4', u'咓': u'wa3', u'咔': u'ka1', u'咕': u'gu1', u'咖': u'ka1', u'咗': u'zuo', u'咘': u'bu4', u'咙': u'long2', u'咚': u'dong1', u'咛': u'ning2', u'咜': u'tuo1', u'咝': u'si1', u'咞': u'xian', u'咟': u'huo4', u'咠': u'qi4', u'咡': u'er4', u'咢': u'e4', u'咣': u'guang1', u'咤': u'zha4', u'咥': u'die2', u'咦': u'yi2', u'咧': u'lie3', u'咨': u'zi1', u'咩': u'mie1', u'咪': u'mi1', u'咫': u'zhi3', u'咬': u'yao3', u'咭': u'ji1', u'咮': u'zhou4', u'咯': u'ge1', u'咰': u'shu4', u'咱': u'zan2', u'咲': u'xiao4', u'咳': u'hai1', u'咴': u'hui1', u'咵': u'kua3', u'咶': u'guo1', u'咷': u'tao2', u'咸': u'xian2', u'咹': u'e4', u'咺': u'xuan3', u'咻': u'xiu1', u'咼': u'guo1', u'咽': u'yan4', u'咾': u'lao3', u'咿': u'yi1', u'哀': u'ai1', u'品': u'pin3', u'哂': u'shen3', u'哃': u'tong2', u'哄': u'hong3', u'哅': u'xiong1', u'哆': u'duo1', u'哇': u'wa1', u'哈': u'ha1', u'哉': u'zai1', u'哊': u'you4', u'哋': u'die4', u'哌': u'pai4', u'响': u'xiang3', u'哎': u'ai1', u'哏': u'gen2', u'哐': u'kuang1', u'哑': u'ya3', u'哒': u'da1', u'哓': u'xiao1', u'哔': u'bi4', u'哕': u'hui4', u'哖': u'nian2', u'哗': u'hua2', u'哘': u'xing', u'哙': u'kuai4', u'哚': u'duo3', u'哛': u'popuni', u'哜': u'ji4', u'哝': u'nong2', u'哞': u'mou1', u'哟': u'yo1', u'哠': u'hao4', u'員': u'yuan2', u'哢': u'long4', u'哣': u'pou3', u'哤': u'mang2', u'哥': u'ge1', u'哦': u'o2', u'哧': u'chi1', u'哨': u'shao4', u'哩': u'li1', u'哪': u'na3', u'哫': u'zu2', u'哬': u'he4', u'哭': u'ku1', u'哮': u'xiao4', u'哯': u'xian4', u'哰': u'lao2', u'哱': u'bo1', u'哲': u'zhe2', u'哳': u'zha1', u'哴': u'liang4', u'哵': u'ba1', u'哶': u'mie1', u'哷': u'lie4', u'哸': u'sui1', u'哹': u'fu2', u'哺': u'bu3', u'哻': u'han1', u'哼': u'heng1', u'哽': u'geng3', u'哾': u'chou4', u'哿': u'ge3', u'唀': u'you4', u'唁': u'yan4', u'唂': u'gu1', u'唃': u'gu1', u'唄': u'bei', u'唅': u'han2', u'唆': u'suo1', u'唇': u'chun2', u'唈': u'yi4', u'唉': u'ai4', u'唊': u'jia2', u'唋': u'tu3', u'唌': u'dan4', u'唍': u'wan3', u'唎': u'li', u'唏': u'xi1', u'唐': u'tang2', u'唑': u'zuo4', u'唒': u'qiu2', u'唓': u'che1', u'唔': u'wu2', u'唕': u'zao4', u'唖': u'ya3', u'唗': u'dou1', u'唘': u'qi3', u'唙': u'di2', u'唚': u'qin4', u'唛': u'ma4', u'唜': u'masi', u'唝': u'gong4', u'唞': u'dou2', u'唟': u'gexi', u'唠': u'lao2', u'唡': u'liang3', u'唢': u'suo3', u'唣': u'zao4', u'唤': u'huan4', u'唥': u'leng2', u'唦': u'sha1', u'唧': u'ji1', u'唨': u'zu3', u'唩': u'wo1', u'唪': u'feng3', u'唫': u'jin4', u'唬': u'hu3', u'唭': u'qi4', u'售': u'shou4', u'唯': u'wei2', u'唰': u'shua1', u'唱': u'chang4', u'唲': u'er2', u'唳': u'li4', u'唴': u'qiang4', u'唵': u'an3', u'唶': u'jie4', u'唷': u'yo1', u'唸': u'nian4', u'唹': u'yu1', u'唺': u'tian3', u'唻': u'lai4', u'唼': u'sha4', u'唽': u'xi1', u'唾': u'tuo4', u'唿': u'hu1', u'啀': u'ai2', u'啁': u'zhou1', u'啂': u'gou4', u'啃': u'ken3', u'啄': u'zhuo2', u'啅': u'zhuo2', u'商': u'shang1', u'啇': u'di2', u'啈': u'heng4', u'啉': u'lin2', u'啊': u'a1', u'啋': u'cai3', u'啌': u'qiang1', u'啍': u'zhun1', u'啎': u'wu3', u'問': u'wen4', u'啐': u'cui4', u'啑': u'die2', u'啒': u'gu3', u'啓': u'qi3', u'啔': u'qi3', u'啕': u'tao2', u'啖': u'dan4', u'啗': u'dan4', u'啘': u'wa1', u'啙': u'zi3', u'啚': u'bi3', u'啛': u'cui4', u'啜': u'chuo4', u'啝': u'he2', u'啞': u'ya3', u'啟': u'qi3', u'啠': u'zhe2', u'啡': u'fei1', u'啢': u'liang3', u'啣': u'xian2', u'啤': u'pi2', u'啥': u'sha2', u'啦': u'la1', u'啧': u'ze2', u'啨': u'qing2', u'啩': u'gua4', u'啪': u'pa1', u'啫': u'ze2', u'啬': u'se4', u'啭': u'zhuan4', u'啮': u'nie4', u'啯': u'guo1', u'啰': u'luo1', u'啱': u'yan2', u'啲': u'di1', u'啳': u'quan2', u'啴': u'tan1', u'啵': u'bo', u'啶': u'ding4', u'啷': u'lang1', u'啸': u'xiao4', u'啹': u'ju2', u'啺': u'tang2', u'啻': u'chi4', u'啼': u'ti2', u'啽': u'an2', u'啾': u'jiu1', u'啿': u'dan4', u'喀': u'ka1', u'喁': u'yong2', u'喂': u'wei4', u'喃': u'nan2', u'善': u'shan4', u'喅': u'yu4', u'喆': u'zhe2', u'喇': u'la3', u'喈': u'jie1', u'喉': u'hou2', u'喊': u'han3', u'喋': u'die2', u'喌': u'zhou1', u'喍': u'chai2', u'喎': u'wai1', u'喏': u'nuo4', u'喐': u'huo4', u'喑': u'yin1', u'喒': u'zan2', u'喓': u'yao1', u'喔': u'wo1', u'喕': u'mian3', u'喖': u'hu2', u'喗': u'yun3', u'喘': u'chuan3', u'喙': u'hui4', u'喚': u'huan4', u'喛': u'huan4', u'喜': u'xi3', u'喝': u'he1', u'喞': u'ji1', u'喟': u'kui4', u'喠': u'zhong3', u'喡': u'wei2', u'喢': u'sha4', u'喣': u'xu3', u'喤': u'huang2', u'喥': u'duo2', u'喦': u'yan2', u'喧': u'xuan1', u'喨': u'liang4', u'喩': u'yu4', u'喪': u'sang4', u'喫': u'chi1', u'喬': u'qiao2', u'喭': u'yan4', u'單': u'dan1', u'喯': u'pen4', u'喰': u'can1', u'喱': u'li2', u'喲': u'yo1', u'喳': u'zha1', u'喴': u'wei1', u'喵': u'miao1', u'営': u'ying2', u'喷': u'pen1', u'喸': u'paoxi', u'喹': u'kui2', u'喺': u'xi2', u'喻': u'yu4', u'喼': u'jie1', u'喽': u'lou', u'喾': u'ku4', u'喿': u'zao4', u'嗀': u'hu4', u'嗁': u'ti2', u'嗂': u'yao2', u'嗃': u'he4', u'嗄': u'a2', u'嗅': u'xiu4', u'嗆': u'qiang4', u'嗇': u'se4', u'嗈': u'yong1', u'嗉': u'su4', u'嗊': u'gong4', u'嗋': u'xie2', u'嗌': u'ai4', u'嗍': u'suo1', u'嗎': u'ma', u'嗏': u'cha1', u'嗐': u'hai4', u'嗑': u'ke4', u'嗒': u'da1', u'嗓': u'sang3', u'嗔': u'chen1', u'嗕': u'ru4', u'嗖': u'sou1', u'嗗': u'wa1', u'嗘': u'ji1', u'嗙': u'pang3', u'嗚': u'wu1', u'嗛': u'qian1', u'嗜': u'shi4', u'嗝': u'ge2', u'嗞': u'zi1', u'嗟': u'jie1', u'嗠': u'lao4', u'嗡': u'weng1', u'嗢': u'wa4', u'嗣': u'si4', u'嗤': u'chi1', u'嗥': u'hao2', u'嗦': u'suo1', u'嗧': u'jia1lun2', u'嗨': u'hai1', u'嗩': u'suo3', u'嗪': u'qin2', u'嗫': u'nie4', u'嗬': u'he1', u'嗭': u'zi', u'嗮': u'sai', u'嗯': u'en', u'嗰': u'ge3', u'嗱': u'na2', u'嗲': u'dia3', u'嗳': u'ai3', u'嗴': u'qiang1', u'嗵': u'tong1', u'嗶': u'bi4', u'嗷': u'ao2', u'嗸': u'ao2', u'嗹': u'lian2', u'嗺': u'zui1', u'嗻': u'zhe1', u'嗼': u'mo4', u'嗽': u'sou4', u'嗾': u'sou3', u'嗿': u'tan3', u'嘀': u'di2', u'嘁': u'qi1', u'嘂': u'jiao4', u'嘃': u'chong1', u'嘄': u'jiao4', u'嘅': u'kai3', u'嘆': u'tan4', u'嘇': u'shan1', u'嘈': u'cao2', u'嘉': u'jia1', u'嘊': u'ai2', u'嘋': u'xiao4', u'嘌': u'piao4', u'嘍': u'lou', u'嘎': u'ga1', u'嘏': u'gu3', u'嘐': u'xiao1', u'嘑': u'hu1', u'嘒': u'hui4', u'嘓': u'guo1', u'嘔': u'ou3', u'嘕': u'xian1', u'嘖': u'ze2', u'嘗': u'chang2', u'嘘': u'xu1', u'嘙': u'po2', u'嘚': u'de1', u'嘛': u'ma', u'嘜': u'ma4', u'嘝': u'hu2', u'嘞': u'lei', u'嘟': u'du1', u'嘠': u'ga3', u'嘡': u'tang1', u'嘢': u'ye3', u'嘣': u'beng1', u'嘤': u'ying1', u'嘥': u'sai1', u'嘦': u'jiao4', u'嘧': u'mi4', u'嘨': u'xiao4', u'嘩': u'hua2', u'嘪': u'mai3', u'嘫': u'ran2', u'嘬': u'zuo1', u'嘭': u'peng1', u'嘮': u'lao2', u'嘯': u'xiao4', u'嘰': u'ji1', u'嘱': u'zhu3', u'嘲': u'chao2', u'嘳': u'kui4', u'嘴': u'zui3', u'嘵': u'xiao1', u'嘶': u'si1', u'嘷': u'hao2', u'嘸': u'mu2', u'嘹': u'liao2', u'嘺': u'qiao2', u'嘻': u'xi1', u'嘼': u'chu4', u'嘽': u'tan1', u'嘾': u'dan4', u'嘿': u'hei1', u'噀': u'xun4', u'噁': u'e4', u'噂': u'zun3', u'噃': u'fan1', u'噄': u'chi1', u'噅': u'hui1', u'噆': u'zan3', u'噇': u'chuang2', u'噈': u'cu4', u'噉': u'dan4', u'噊': u'jue2', u'噋': u'tun1', u'噌': u'ceng1', u'噍': u'jiao4', u'噎': u'ye1', u'噏': u'xi1', u'噐': u'qi4', u'噑': u'hao2', u'噒': u'lian2', u'噓': u'xu1', u'噔': u'deng1', u'噕': u'hui1', u'噖': u'yin2', u'噗': u'pu1', u'噘': u'jue1', u'噙': u'qin2', u'噚': u'xun2', u'噛': u'nie4', u'噜': u'lu1', u'噝': u'si1', u'噞': u'yan3', u'噟': u'ying1', u'噠': u'da1', u'噡': u'zhan1', u'噢': u'wo1', u'噣': u'zhou4', u'噤': u'jin4', u'噥': u'nong2', u'噦': u'hui4', u'噧': u'xie4', u'器': u'qi4', u'噩': u'e4', u'噪': u'zao4', u'噫': u'yi4', u'噬': u'shi4', u'噭': u'jiao4', u'噮': u'yuan4', u'噯': u'ai3', u'噰': u'yong1', u'噱': u'xue2', u'噲': u'kuai4', u'噳': u'yu3', u'噴': u'pen1', u'噵': u'dao4', u'噶': u'ga2', u'噷': u'xin1', u'噸': u'dun1', u'噹': u'dang1', u'噺': u'hanaxi', u'噻': u'sai1', u'噼': u'pi1', u'噽': u'pi3', u'噾': u'yin1', u'噿': u'zui3', u'嚀': u'ning2', u'嚁': u'di2', u'嚂': u'lan4', u'嚃': u'ta4', u'嚄': u'huo1', u'嚅': u'ru2', u'嚆': u'hao1', u'嚇': u'xia4', u'嚈': u'yan4', u'嚉': u'duo1', u'嚊': u'xiu4', u'嚋': u'zhou1', u'嚌': u'ji4', u'嚍': u'jin4', u'嚎': u'hao2', u'嚏': u'ti4', u'嚐': u'chang2', u'嚑': u'xun', u'嚒': u'me', u'嚓': u'ca1', u'嚔': u'ti4', u'嚕': u'lu1', u'嚖': u'hui4', u'嚗': u'bo2', u'嚘': u'you1', u'嚙': u'nie4', u'嚚': u'yin2', u'嚛': u'hu4', u'嚜': u'me', u'嚝': u'hong1', u'嚞': u'zhe2', u'嚟': u'li2', u'嚠': u'liu2', u'嚡': u'xie2', u'嚢': u'nang2', u'嚣': u'xiao1', u'嚤': u'mo1', u'嚥': u'yan4', u'嚦': u'li4', u'嚧': u'lu2', u'嚨': u'long2', u'嚩': u'po2', u'嚪': u'dan4', u'嚫': u'chen4', u'嚬': u'pin2', u'嚭': u'pi3', u'嚮': u'xiang4', u'嚯': u'huo4', u'嚰': u'me', u'嚱': u'xi1', u'嚲': u'duo3', u'嚳': u'ku4', u'嚴': u'yan2', u'嚵': u'chan2', u'嚶': u'ying1', u'嚷': u'rang1', u'嚸': u'dian3', u'嚹': u'la2', u'嚺': u'ta4', u'嚻': u'xiao1', u'嚼': u'jiao2', u'嚽': u'chuo4', u'嚾': u'huan1', u'嚿': u'huo4', u'囀': u'zhuan4', u'囁': u'nie4', u'囂': u'xiao1', u'囃': u'za2', u'囄': u'li2', u'囅': u'chan3', u'囆': u'chai4', u'囇': u'li4', u'囈': u'yi4', u'囉': u'luo2', u'囊': u'nang2', u'囋': u'za2', u'囌': u'su1', u'囍': u'xi3', u'囎': u'zeng4', u'囏': u'jian1', u'囐': u'yan4', u'囑': u'zhu3', u'囒': u'lan2', u'囓': u'nie4', u'囔': u'nang1', u'囕': u'die2', u'囖': u'luo2', u'囗': u'wei2', u'囘': u'hui2', u'囙': u'yin1', u'囚': u'qiu2', u'四': u'si4', u'囜': u'nin2', u'囝': u'nan1', u'回': u'hui2', u'囟': u'xin4', u'因': u'yin1', u'囡': u'nan1', u'团': u'tuan2', u'団': u'tuan2', u'囤': u'dun4', u'囥': u'kang4', u'囦': u'yuan1', u'囧': u'jiong3', u'囨': u'pian1', u'囩': u'yun2', u'囪': u'cong1', u'囫': u'hu2', u'囬': u'hui2', u'园': u'yuan2', u'囮': u'e2', u'囯': u'guo2', u'困': u'kun4', u'囱': u'cong1', u'囲': u'wei2', u'図': u'tu2', u'围': u'wei2', u'囵': u'lun2', u'囶': u'guo2', u'囷': u'qun1', u'囸': u'ri4', u'囹': u'ling2', u'固': u'gu4', u'囻': u'guo2', u'囼': u'tai1', u'国': u'guo2', u'图': u'tu2', u'囿': u'you4', u'圀': u'guo2', u'圁': u'yin2', u'圂': u'hun4', u'圃': u'pu3', u'圄': u'yu3', u'圅': u'han2', u'圆': u'yuan2', u'圇': u'lun2', u'圈': u'quan1', u'圉': u'yu3', u'圊': u'qing1', u'國': u'guo2', u'圌': u'chuan2', u'圍': u'wei2', u'圎': u'yuan2', u'圏': u'quan1', u'圐': u'ku1', u'圑': u'pu3', u'園': u'yuan2', u'圓': u'yuan2', u'圔': u'ya4', u'圕': u'tuan1', u'圖': u'tu2', u'圗': u'tu2', u'團': u'tuan2', u'圙': u'lue4', u'圚': u'hui4', u'圛': u'yi4', u'圜': u'yuan2', u'圝': u'luan2', u'圞': u'luan2', u'土': u'tu3', u'圠': u'ya4', u'圡': u'tu3', u'圢': u'ting3', u'圣': u'sheng4', u'圤': u'pu2', u'圥': u'lu4', u'圦': u'kuai', u'圧': u'ya1', u'在': u'zai4', u'圩': u'wei2', u'圪': u'ge1', u'圫': u'yu4', u'圬': u'wu1', u'圭': u'gui1', u'圮': u'pi3', u'圯': u'yi2', u'地': u'di4', u'圱': u'qian1', u'圲': u'qian1', u'圳': u'zhen4', u'圴': u'zhuo2', u'圵': u'dang4', u'圶': u'qia4', u'圷': u'xia', u'圸': u'shan', u'圹': u'kuang4', u'场': u'chang3', u'圻': u'qi2', u'圼': u'nie4', u'圽': u'mo4', u'圾': u'ji1', u'圿': u'jia2', u'址': u'zhi3', u'坁': u'zhi3', u'坂': u'ban3', u'坃': u'xun1', u'坄': u'yi4', u'坅': u'qin3', u'坆': u'mei2', u'均': u'jun1', u'坈': u'rong3', u'坉': u'tun2', u'坊': u'fang1', u'坋': u'fen4', u'坌': u'ben4', u'坍': u'tan1', u'坎': u'kan3', u'坏': u'huai4', u'坐': u'zuo4', u'坑': u'keng1', u'坒': u'bi4', u'坓': u'jing3', u'坔': u'di4', u'坕': u'jing1', u'坖': u'ji4', u'块': u'kuai4', u'坘': u'di3', u'坙': u'jing1', u'坚': u'jian1', u'坛': u'tan2', u'坜': u'li4', u'坝': u'ba4', u'坞': u'wu4', u'坟': u'fen2', u'坠': u'zhui4', u'坡': u'po1', u'坢': u'ban4', u'坣': u'tang2', u'坤': u'kun1', u'坥': u'qu1', u'坦': u'tan3', u'坧': u'zhi3', u'坨': u'tuo2', u'坩': u'gan1', u'坪': u'ping2', u'坫': u'dian4', u'坬': u'gua4', u'坭': u'ni2', u'坮': u'tai2', u'坯': u'pi1', u'坰': u'shang3', u'坱': u'yang3', u'坲': u'fo2', u'坳': u'ao4', u'坴': u'lu4', u'坵': u'qiu1', u'坶': u'mu4', u'坷': u'ke1', u'坸': u'gou4', u'坹': u'xue4', u'坺': u'fa2', u'坻': u'di3', u'坼': u'che4', u'坽': u'ling2', u'坾': u'zhu4', u'坿': u'fu4', u'垀': u'hu1', u'垁': u'zhi4', u'垂': u'chui2', u'垃': u'la1', u'垄': u'long3', u'垅': u'long3', u'垆': u'lu2', u'垇': u'ao4', u'垈': u'dai4', u'垉': u'pao2', u'垊': u'min', u'型': u'xing2', u'垌': u'dong4', u'垍': u'ji4', u'垎': u'he4', u'垏': u'lv4', u'垐': u'ci2', u'垑': u'chi3', u'垒': u'lei3', u'垓': u'gai1', u'垔': u'yin1', u'垕': u'hou4', u'垖': u'dui1', u'垗': u'zhao4', u'垘': u'fu2', u'垙': u'guang1', u'垚': u'yao2', u'垛': u'duo4', u'垜': u'duo3', u'垝': u'gui3', u'垞': u'cha2', u'垟': u'yang2', u'垠': u'yin2', u'垡': u'fa2', u'垢': u'gou4', u'垣': u'yuan2', u'垤': u'die2', u'垥': u'xie2', u'垦': u'ken3', u'垧': u'shang3', u'垨': u'shou3', u'垩': u'e4', u'垪': u'bing', u'垫': u'dian4', u'垬': u'hong2', u'垭': u'ya4', u'垮': u'kua3', u'垯': u'da4', u'垰': u'ka', u'垱': u'dang4', u'垲': u'kai3', u'垳': u'hang', u'垴': u'nao3', u'垵': u'an3', u'垶': u'xing1', u'垷': u'xian4', u'垸': u'yuan4', u'垹': u'bang1', u'垺': u'pou2', u'垻': u'ba4', u'垼': u'yi4', u'垽': u'yin4', u'垾': u'han4', u'垿': u'xu4', u'埀': u'chui2', u'埁': u'cen2', u'埂': u'geng3', u'埃': u'ai1', u'埄': u'beng3', u'埅': u'di4', u'埆': u'que4', u'埇': u'yong3', u'埈': u'jun4', u'埉': u'xia2', u'埊': u'di4', u'埋': u'mai2', u'埌': u'lang4', u'埍': u'juan3', u'城': u'cheng2', u'埏': u'shan1', u'埐': u'qin2', u'埑': u'zhe2', u'埒': u'lie4', u'埓': u'lie4', u'埔': u'bu3', u'埕': u'cheng2', u'埖': u'hua', u'埗': u'bu4', u'埘': u'shi2', u'埙': u'xun1', u'埚': u'guo1', u'埛': u'jiong1', u'埜': u'ye3', u'埝': u'nian4', u'埞': u'di1', u'域': u'yu4', u'埠': u'bu4', u'埡': u'ya4', u'埢': u'quan2', u'埣': u'sui4', u'埤': u'pi2', u'埥': u'qing1', u'埦': u'wan3', u'埧': u'ju4', u'埨': u'lun3', u'埩': u'zheng1', u'埪': u'kong1', u'埫': u'chong3', u'埬': u'dong1', u'埭': u'dai4', u'埮': u'tan2', u'埯': u'an3', u'埰': u'cai4', u'埱': u'chu4', u'埲': u'beng3', u'埳': u'xian4', u'埴': u'zhi2', u'埵': u'duo3', u'埶': u'yi4', u'執': u'zhi2', u'埸': u'yi4', u'培': u'pei2', u'基': u'ji1', u'埻': u'zhun3', u'埼': u'qi2', u'埽': u'sao4', u'埾': u'ju4', u'埿': u'ni2', u'堀': u'ku1', u'堁': u'ke4', u'堂': u'tang2', u'堃': u'kun1', u'堄': u'ni4', u'堅': u'jian1', u'堆': u'dui1', u'堇': u'jin3', u'堈': u'gang1', u'堉': u'yu4', u'堊': u'e4', u'堋': u'peng2', u'堌': u'gu4', u'堍': u'tu4', u'堎': u'leng4', u'堏': u'fang', u'堐': u'ya2', u'堑': u'qian4', u'堒': u'kun', u'堓': u'an4', u'堔': u'shen', u'堕': u'duo4', u'堖': u'nao3', u'堗': u'tu1', u'堘': u'cheng2', u'堙': u'yin1', u'堚': u'huan2', u'堛': u'bi4', u'堜': u'lian4', u'堝': u'guo1', u'堞': u'die2', u'堟': u'zhuan4', u'堠': u'hou4', u'堡': u'bao3', u'堢': u'bao3', u'堣': u'yu2', u'堤': u'di1', u'堥': u'mao2', u'堦': u'jie1', u'堧': u'ruan2', u'堨': u'e4', u'堩': u'geng4', u'堪': u'kan1', u'堫': u'zong1', u'堬': u'yu2', u'堭': u'huang2', u'堮': u'e4', u'堯': u'yao2', u'堰': u'yan4', u'報': u'bao4', u'堲': u'ji2', u'堳': u'mei2', u'場': u'chang3', u'堵': u'du3', u'堶': u'tuo2', u'堷': u'yin4', u'堸': u'feng2', u'堹': u'zhong4', u'堺': u'jie4', u'堻': u'jin1', u'堼': u'feng1', u'堽': u'gang1', u'堾': u'chun1', u'堿': u'jian3', u'塀': u'ping2', u'塁': u'lei3', u'塂': u'jiang3', u'塃': u'huang1', u'塄': u'leng2', u'塅': u'duan4', u'塆': u'wan1', u'塇': u'xuan1', u'塈': u'xi4', u'塉': u'ji2', u'塊': u'kuai4', u'塋': u'ying2', u'塌': u'ta1', u'塍': u'cheng2', u'塎': u'yong3', u'塏': u'kai3', u'塐': u'su4', u'塑': u'su4', u'塒': u'shi2', u'塓': u'mi4', u'塔': u'ta3', u'塕': u'weng3', u'塖': u'cheng2', u'塗': u'tu2', u'塘': u'tang2', u'塙': u'que4', u'塚': u'zhong3', u'塛': u'li4', u'塜': u'peng2', u'塝': u'bang4', u'塞': u'sai1', u'塟': u'zang4', u'塠': u'dui1', u'塡': u'tian2', u'塢': u'wu4', u'塣': u'zheng4', u'塤': u'xun1', u'塥': u'ge2', u'塦': u'zhen4', u'塧': u'ai4', u'塨': u'gong1', u'塩': u'yan2', u'塪': u'xian4', u'填': u'tian2', u'塬': u'yuan2', u'塭': u'wen', u'塮': u'xie4', u'塯': u'liu4', u'塰': u'hai', u'塱': u'lang3', u'塲': u'chang2', u'塳': u'peng2', u'塴': u'beng4', u'塵': u'chen2', u'塶': u'lu4', u'塷': u'lu3', u'塸': u'ou1', u'塹': u'qian4', u'塺': u'mei2', u'塻': u'mo4', u'塼': u'zhuan1', u'塽': u'shuang3', u'塾': u'shu2', u'塿': u'lou3', u'墀': u'chi2', u'墁': u'man4', u'墂': u'biao1', u'境': u'jing4', u'墄': u'qi1', u'墅': u'shu4', u'墆': u'zhi4', u'墇': u'zhang4', u'墈': u'kan4', u'墉': u'yong1', u'墊': u'dian4', u'墋': u'chen3', u'墌': u'zhi3', u'墍': u'xi4', u'墎': u'guo1', u'墏': u'qiang3', u'墐': u'jin4', u'墑': u'shang1', u'墒': u'shang1', u'墓': u'mu4', u'墔': u'cui1', u'墕': u'yan4', u'墖': u'ta3', u'増': u'zeng1', u'墘': u'qian2', u'墙': u'qiang2', u'墚': u'liang2', u'墛': u'wei', u'墜': u'zhui4', u'墝': u'qiao1', u'增': u'zeng1', u'墟': u'xu1', u'墠': u'shan4', u'墡': u'shan4', u'墢': u'fa2', u'墣': u'pu2', u'墤': u'kuai4', u'墥': u'tuan3', u'墦': u'fan2', u'墧': u'qiao2', u'墨': u'mo4', u'墩': u'dun1', u'墪': u'dun1', u'墫': u'cun1', u'墬': u'di4', u'墭': u'sheng4', u'墮': u'duo4', u'墯': u'duo4', u'墰': u'tan2', u'墱': u'deng4', u'墲': u'wu2', u'墳': u'fen2', u'墴': u'huang2', u'墵': u'tan2', u'墶': u'da4', u'墷': u'ye4', u'墸': u'zhu', u'墹': u'jian', u'墺': u'ao4', u'墻': u'qiang2', u'墼': u'ji1', u'墽': u'qiao1', u'墾': u'ken3', u'墿': u'yi4', u'壀': u'pi2', u'壁': u'bi4', u'壂': u'dian4', u'壃': u'jiang1', u'壄': u'ye3', u'壅': u'yong1', u'壆': u'xue2', u'壇': u'tan2', u'壈': u'lan3', u'壉': u'ju4', u'壊': u'huai4', u'壋': u'dang4', u'壌': u'rang3', u'壍': u'qian4', u'壎': u'xun1', u'壏': u'xian4', u'壐': u'xi3', u'壑': u'he4', u'壒': u'ai4', u'壓': u'ya1', u'壔': u'dao3', u'壕': u'hao2', u'壖': u'ruan2', u'壗': u'jin', u'壘': u'lei3', u'壙': u'kuang4', u'壚': u'lu2', u'壛': u'yan2', u'壜': u'tan2', u'壝': u'wei2', u'壞': u'huai4', u'壟': u'long3', u'壠': u'long3', u'壡': u'rui3', u'壢': u'li4', u'壣': u'lin2', u'壤': u'rang3', u'壥': u'chan2', u'壦': u'xun1', u'壧': u'yan2', u'壨': u'lei3', u'壩': u'ba4', u'壪': u'wan1', u'士': u'shi4', u'壬': u'ren2', u'壭': u'san', u'壮': u'zhuang4', u'壯': u'zhuang4', u'声': u'sheng1', u'壱': u'yi1', u'売': u'mai4', u'壳': u'ke2', u'壴': u'zhu4', u'壵': u'zhuang4', u'壶': u'hu2', u'壷': u'hu2', u'壸': u'kun3', u'壹': u'yi1', u'壺': u'hu2', u'壻': u'xu4', u'壼': u'kun3', u'壽': u'shou4', u'壾': u'mang3', u'壿': u'dun', u'夀': u'shou4', u'夁': u'yi1', u'夂': u'zhi3', u'夃': u'gu3', u'处': u'chu4', u'夅': u'jiang4', u'夆': u'feng2', u'备': u'bei4', u'夈': u'zhai1', u'変': u'bian4', u'夊': u'sui1', u'夋': u'qun1', u'夌': u'ling2', u'复': u'fu4', u'夎': u'cuo4', u'夏': u'xia4', u'夐': u'xiong4', u'夑': u'xie4', u'夒': u'nao2', u'夓': u'xia4', u'夔': u'kui2', u'夕': u'xi1', u'外': u'wai4', u'夗': u'yuan4', u'夘': u'mao3', u'夙': u'su4', u'多': u'duo1', u'夛': u'duo1', u'夜': u'ye4', u'夝': u'qing2', u'夞': u'yixi', u'够': u'gou4', u'夠': u'gou4', u'夡': u'qi4', u'夢': u'meng4', u'夣': u'meng4', u'夤': u'yin2', u'夥': u'huo3', u'夦': u'chen3', u'大': u'da4', u'夨': u'ce4', u'天': u'tian1', u'太': u'tai4', u'夫': u'fu1', u'夬': u'guai4', u'夭': u'yao1', u'央': u'yang1', u'夯': u'hang1', u'夰': u'gao3', u'失': u'shi1', u'夲': u'tao1', u'夳': u'tai4', u'头': u'tou2', u'夵': u'yan3', u'夶': u'bi3', u'夷': u'yi2', u'夸': u'kua1', u'夹': u'jia1', u'夺': u'duo2', u'夻': u'hua4', u'夼': u'kuang3', u'夽': u'yun3', u'夾': u'jia1', u'夿': u'ba1', u'奀': u'en1', u'奁': u'lian2', u'奂': u'huan4', u'奃': u'di1', u'奄': u'yan3', u'奅': u'pao4', u'奆': u'juan4', u'奇': u'qi2', u'奈': u'nai4', u'奉': u'feng4', u'奊': u'xie2', u'奋': u'fen4', u'奌': u'dian3', u'奍': u'quan1', u'奎': u'kui2', u'奏': u'zou4', u'奐': u'huan4', u'契': u'qi4', u'奒': u'kai1', u'奓': u'zha1', u'奔': u'ben4', u'奕': u'yi4', u'奖': u'jiang3', u'套': u'tao4', u'奘': u'zang4', u'奙': u'ben3', u'奚': u'xi1', u'奛': u'huang3', u'奜': u'fei3', u'奝': u'diao1', u'奞': u'xun4', u'奟': u'beng1', u'奠': u'dian4', u'奡': u'ao4', u'奢': u'she1', u'奣': u'weng3', u'奤': u'ha3', u'奥': u'ao4', u'奦': u'wu4', u'奧': u'ao4', u'奨': u'jiang3', u'奩': u'lian2', u'奪': u'duo2', u'奫': u'yun1', u'奬': u'jiang3', u'奭': u'shi4', u'奮': u'fen4', u'奯': u'huo4', u'奰': u'bi4', u'奱': u'luan2', u'奲': u'duo3', u'女': u'nv3', u'奴': u'nu2', u'奵': u'ding3', u'奶': u'nai3', u'奷': u'qian1', u'奸': u'jian1', u'她': u'ta1', u'奺': u'jiu3', u'奻': u'nuan2', u'奼': u'cha4', u'好': u'hao3', u'奾': u'xian1', u'奿': u'fan4', u'妀': u'ji3', u'妁': u'shuo4', u'如': u'ru2', u'妃': u'fei1', u'妄': u'wang4', u'妅': u'hong2', u'妆': u'zhuang1', u'妇': u'fu4', u'妈': u'ma1', u'妉': u'dan1', u'妊': u'ren4', u'妋': u'fu1', u'妌': u'jing4', u'妍': u'yan2', u'妎': u'hai4', u'妏': u'wen4', u'妐': u'zhong1', u'妑': u'pa1', u'妒': u'du4', u'妓': u'ji4', u'妔': u'keng1', u'妕': u'zhong4', u'妖': u'yao1', u'妗': u'jin4', u'妘': u'yun2', u'妙': u'miao4', u'妚': u'fou3', u'妛': u'chi1', u'妜': u'yue4', u'妝': u'zhuang1', u'妞': u'niu1', u'妟': u'yan4', u'妠': u'na4', u'妡': u'xin1', u'妢': u'fen2', u'妣': u'bi3', u'妤': u'yu2', u'妥': u'tuo3', u'妦': u'feng1', u'妧': u'wan4', u'妨': u'fang2', u'妩': u'wu3', u'妪': u'yu4', u'妫': u'gui1', u'妬': u'du4', u'妭': u'ba2', u'妮': u'ni2', u'妯': u'zhou2', u'妰': u'zhuo2', u'妱': u'zhao1', u'妲': u'da2', u'妳': u'ni3', u'妴': u'yuan4', u'妵': u'tou3', u'妶': u'xian2', u'妷': u'zhi2', u'妸': u'e1', u'妹': u'mei4', u'妺': u'mo4', u'妻': u'qi1', u'妼': u'bi4', u'妽': u'shen1', u'妾': u'qie4', u'妿': u'e1', u'姀': u'he2', u'姁': u'xu3', u'姂': u'fa2', u'姃': u'zheng1', u'姄': u'min2', u'姅': u'ban4', u'姆': u'mu3', u'姇': u'fu1', u'姈': u'ling2', u'姉': u'zi3', u'姊': u'zi3', u'始': u'shi3', u'姌': u'ran3', u'姍': u'shan1', u'姎': u'yang1', u'姏': u'gan1', u'姐': u'jie3', u'姑': u'gu1', u'姒': u'si4', u'姓': u'xing4', u'委': u'wei3', u'姕': u'zi1', u'姖': u'ju4', u'姗': u'shan1', u'姘': u'pin1', u'姙': u'ren4', u'姚': u'yao2', u'姛': u'dong4', u'姜': u'jiang1', u'姝': u'shu1', u'姞': u'ji2', u'姟': u'gai1', u'姠': u'xiang4', u'姡': u'hua2', u'姢': u'juan1', u'姣': u'jiao1', u'姤': u'gou4', u'姥': u'lao3', u'姦': u'jian1', u'姧': u'jian1', u'姨': u'yi2', u'姩': u'nian2', u'姪': u'zhi2', u'姫': u'zhen3', u'姬': u'ji1', u'姭': u'xian4', u'姮': u'heng2', u'姯': u'guang1', u'姰': u'jun1', u'姱': u'kua1', u'姲': u'yan4', u'姳': u'ming3', u'姴': u'lie4', u'姵': u'pei4', u'姶': u'e4', u'姷': u'you4', u'姸': u'yan2', u'姹': u'cha4', u'姺': u'shen1', u'姻': u'yin1', u'姼': u'shi2', u'姽': u'gui3', u'姾': u'quan2', u'姿': u'zi1', u'娀': u'song1', u'威': u'wei1', u'娂': u'hong2', u'娃': u'wa2', u'娄': u'lou2', u'娅': u'ya4', u'娆': u'rao2', u'娇': u'jiao1', u'娈': u'luan2', u'娉': u'ping1', u'娊': u'xian4', u'娋': u'shao4', u'娌': u'li3', u'娍': u'cheng2', u'娎': u'xie1', u'娏': u'mang2', u'娐': u'fu1', u'娑': u'suo1', u'娒': u'mu3', u'娓': u'wei3', u'娔': u'ke4', u'娕': u'chuo4', u'娖': u'chuo4', u'娗': u'ting3', u'娘': u'niang2', u'娙': u'xing2', u'娚': u'nan2', u'娛': u'yu2', u'娜': u'na4', u'娝': u'pou1', u'娞': u'nei3', u'娟': u'juan1', u'娠': u'shen1', u'娡': u'zhi4', u'娢': u'han2', u'娣': u'di4', u'娤': u'zhuang1', u'娥': u'e2', u'娦': u'pin2', u'娧': u'tui4', u'娨': u'man3', u'娩': u'mian3', u'娪': u'wu2', u'娫': u'yan2', u'娬': u'wu3', u'娭': u'ai1', u'娮': u'yan2', u'娯': u'yu2', u'娰': u'si4', u'娱': u'yu2', u'娲': u'wa1', u'娳': u'li4', u'娴': u'xian2', u'娵': u'ju1', u'娶': u'qu3', u'娷': u'zhui4', u'娸': u'qi1', u'娹': u'xian2', u'娺': u'zhuo2', u'娻': u'dong1', u'娼': u'chang1', u'娽': u'lu4', u'娾': u'ai3', u'娿': u'e1', u'婀': u'e1', u'婁': u'lou2', u'婂': u'mian2', u'婃': u'cong2', u'婄': u'pou3', u'婅': u'ju2', u'婆': u'po2', u'婇': u'cai3', u'婈': u'ling2', u'婉': u'wan3', u'婊': u'biao3', u'婋': u'xiao1', u'婌': u'shu1', u'婍': u'qi3', u'婎': u'hui1', u'婏': u'fu4', u'婐': u'wo3', u'婑': u'wo3', u'婒': u'tan2', u'婓': u'fei1', u'婔': u'fei1', u'婕': u'jie2', u'婖': u'tian1', u'婗': u'ni2', u'婘': u'quan2', u'婙': u'jing4', u'婚': u'hun1', u'婛': u'jing1', u'婜': u'qian1', u'婝': u'dian4', u'婞': u'xing4', u'婟': u'hu4', u'婠': u'wan1', u'婡': u'lai2', u'婢': u'bi4', u'婣': u'yin1', u'婤': u'zhou1', u'婥': u'chuo4', u'婦': u'fu4', u'婧': u'jing4', u'婨': u'lun2', u'婩': u'an4', u'婪': u'lan2', u'婫': u'hun4', u'婬': u'yin2', u'婭': u'ya4', u'婮': u'ju1', u'婯': u'li4', u'婰': u'dian3', u'婱': u'xian2', u'婲': u'hua', u'婳': u'hua4', u'婴': u'ying1', u'婵': u'chan2', u'婶': u'shen3', u'婷': u'ting2', u'婸': u'dang4', u'婹': u'yao3', u'婺': u'wu4', u'婻': u'nan4', u'婼': u'chuo4', u'婽': u'jia3', u'婾': u'tou1', u'婿': u'xu4', u'媀': u'yu4', u'媁': u'wei2', u'媂': u'di4', u'媃': u'rou2', u'媄': u'mei3', u'媅': u'dan1', u'媆': u'ruan3', u'媇': u'qin1', u'媈': u'hui1', u'媉': u'wo4', u'媊': u'qian2', u'媋': u'chun1', u'媌': u'miao2', u'媍': u'fu4', u'媎': u'jie3', u'媏': u'duan1', u'媐': u'yi2', u'媑': u'zhong4', u'媒': u'mei2', u'媓': u'huang2', u'媔': u'mian2', u'媕': u'an1', u'媖': u'ying1', u'媗': u'xuan1', u'媘': u'jie1', u'媙': u'wei1', u'媚': u'mei4', u'媛': u'yuan2', u'媜': u'zheng1', u'媝': u'qiu1', u'媞': u'ti2', u'媟': u'xie4', u'媠': u'duo4', u'媡': u'lian4', u'媢': u'mao4', u'媣': u'ran3', u'媤': u'si1', u'媥': u'pian1', u'媦': u'wei4', u'媧': u'wa1', u'媨': u'cu4', u'媩': u'hu2', u'媪': u'ao3', u'媫': u'jie2', u'媬': u'bao3', u'媭': u'xu1', u'媮': u'tou1', u'媯': u'gui1', u'媰': u'chu2', u'媱': u'yao2', u'媲': u'pi4', u'媳': u'xi2', u'媴': u'yuan2', u'媵': u'ying4', u'媶': u'rong2', u'媷': u'ru4', u'媸': u'chi1', u'媹': u'liu2', u'媺': u'mei3', u'媻': u'pan2', u'媼': u'ao3', u'媽': u'ma1', u'媾': u'gou4', u'媿': u'kui4', u'嫀': u'qin2', u'嫁': u'jia4', u'嫂': u'sao3', u'嫃': u'zhen1', u'嫄': u'yuan2', u'嫅': u'jie1', u'嫆': u'rong2', u'嫇': u'ming2', u'嫈': u'ying1', u'嫉': u'ji2', u'嫊': u'su4', u'嫋': u'niao3', u'嫌': u'xian2', u'嫍': u'tao1', u'嫎': u'pang2', u'嫏': u'lang2', u'嫐': u'nao3', u'嫑': u'biao2', u'嫒': u'ai4', u'嫓': u'pi4', u'嫔': u'pin2', u'嫕': u'yi4', u'嫖': u'piao2', u'嫗': u'yu4', u'嫘': u'lei2', u'嫙': u'xuan2', u'嫚': u'man1', u'嫛': u'yi1', u'嫜': u'zhang1', u'嫝': u'kang1', u'嫞': u'yong1', u'嫟': u'ni4', u'嫠': u'li2', u'嫡': u'di2', u'嫢': u'gui1', u'嫣': u'yan1', u'嫤': u'jin3', u'嫥': u'zhuan1', u'嫦': u'chang2', u'嫧': u'ze2', u'嫨': u'han1', u'嫩': u'nen4', u'嫪': u'lao4', u'嫫': u'mo2', u'嫬': u'zhe1', u'嫭': u'hu4', u'嫮': u'hu4', u'嫯': u'ao4', u'嫰': u'nen4', u'嫱': u'qiang2', u'嫲': u'ma1', u'嫳': u'pie4', u'嫴': u'gu1', u'嫵': u'wu3', u'嫶': u'qiao2', u'嫷': u'tuo3', u'嫸': u'zhan3', u'嫹': u'miao2', u'嫺': u'xian2', u'嫻': u'xian2', u'嫼': u'mo4', u'嫽': u'liao2', u'嫾': u'lian2', u'嫿': u'hua4', u'嬀': u'gui1', u'嬁': u'deng1', u'嬂': u'zhi2', u'嬃': u'xu1', u'嬄': u'yi1', u'嬅': u'hua4', u'嬆': u'xi1', u'嬇': u'kui4', u'嬈': u'rao2', u'嬉': u'xi1', u'嬊': u'yan4', u'嬋': u'chan2', u'嬌': u'jiao1', u'嬍': u'mei3', u'嬎': u'fan4', u'嬏': u'fan1', u'嬐': u'xian1', u'嬑': u'yi4', u'嬒': u'hui4', u'嬓': u'jiao4', u'嬔': u'fu4', u'嬕': u'shi4', u'嬖': u'bi4', u'嬗': u'shan4', u'嬘': u'sui4', u'嬙': u'qiang2', u'嬚': u'lian3', u'嬛': u'huan2', u'嬜': u'xin1', u'嬝': u'niao3', u'嬞': u'dong3', u'嬟': u'yi3', u'嬠': u'can1', u'嬡': u'ai4', u'嬢': u'niang2', u'嬣': u'ning2', u'嬤': u'mo2', u'嬥': u'tiao3', u'嬦': u'chou2', u'嬧': u'jin4', u'嬨': u'ci2', u'嬩': u'yu2', u'嬪': u'pin2', u'嬫': u'rong2', u'嬬': u'ru2', u'嬭': u'nai3', u'嬮': u'yan1', u'嬯': u'tai2', u'嬰': u'ying1', u'嬱': u'qian4', u'嬲': u'niao3', u'嬳': u'yue4', u'嬴': u'ying2', u'嬵': u'mian2', u'嬶': u'ka1ka1a1', u'嬷': u'mo2', u'嬸': u'shen3', u'嬹': u'xing4', u'嬺': u'ni4', u'嬻': u'du2', u'嬼': u'liu3', u'嬽': u'yuan1', u'嬾': u'lan3', u'嬿': u'yan4', u'孀': u'shuang1', u'孁': u'ling2', u'孂': u'jiao3', u'孃': u'niang2', u'孄': u'lan3', u'孅': u'xian1', u'孆': u'ying1', u'孇': u'shuang1', u'孈': u'xie2', u'孉': u'huan1', u'孊': u'mi3', u'孋': u'li2', u'孌': u'luan2', u'孍': u'yan3', u'孎': u'zhu2', u'孏': u'lan4', u'子': u'zi3', u'孑': u'jie2', u'孒': u'jue2', u'孓': u'jue2', u'孔': u'kong3', u'孕': u'yun4', u'孖': u'ma1', u'字': u'zi4', u'存': u'cun2', u'孙': u'sun1', u'孚': u'fu2', u'孛': u'bei4', u'孜': u'zi1', u'孝': u'xiao4', u'孞': u'xin4', u'孟': u'meng4', u'孠': u'si4', u'孡': u'tai1', u'孢': u'bao1', u'季': u'ji4', u'孤': u'gu1', u'孥': u'nu2', u'学': u'xue2', u'孧': u'you', u'孨': u'zhuan3', u'孩': u'hai2', u'孪': u'luan2', u'孫': u'sun1', u'孬': u'nao1', u'孭': u'mie1', u'孮': u'cong2', u'孯': u'qian1', u'孰': u'shu2', u'孱': u'chan2', u'孲': u'ya1', u'孳': u'zi1', u'孴': u'ni3', u'孵': u'fu1', u'孶': u'zi1', u'孷': u'li2', u'學': u'xue2', u'孹': u'bo4', u'孺': u'ru2', u'孻': u'nai2', u'孼': u'nie4', u'孽': u'nie4', u'孾': u'ying1', u'孿': u'luan2', u'宀': u'mian2', u'宁': u'ning2', u'宂': u'rong3', u'它': u'ta1', u'宄': u'gui3', u'宅': u'zhai2', u'宆': u'qiong2', u'宇': u'yu3', u'守': u'shou3', u'安': u'an1', u'宊': u'tu1', u'宋': u'song4', u'完': u'wan2', u'宍': u'rou4', u'宎': u'yao3', u'宏': u'hong2', u'宐': u'yi2', u'宑': u'jing3', u'宒': u'zhun1', u'宓': u'mi4', u'宔': u'zhu3', u'宕': u'dang4', u'宖': u'hong2', u'宗': u'zong1', u'官': u'guan1', u'宙': u'zhou4', u'定': u'ding4', u'宛': u'wan3', u'宜': u'yi2', u'宝': u'bao3', u'实': u'shi2', u'実': u'shi2', u'宠': u'chong3', u'审': u'shen3', u'客': u'ke4', u'宣': u'xuan1', u'室': u'shi4', u'宥': u'you4', u'宦': u'huan4', u'宧': u'yi2', u'宨': u'tiao3', u'宩': u'shi3', u'宪': u'xian4', u'宫': u'gong1', u'宬': u'cheng2', u'宭': u'qun2', u'宮': u'gong1', u'宯': u'xiao1', u'宰': u'zai3', u'宱': u'zha4', u'宲': u'bao3', u'害': u'hai4', u'宴': u'yan4', u'宵': u'xiao1', u'家': u'jia1', u'宷': u'cai4', u'宸': u'chen2', u'容': u'rong2', u'宺': u'huang1', u'宻': u'mi4', u'宼': u'kou4', u'宽': u'kuan1', u'宾': u'bin1', u'宿': u'su4', u'寀': u'cai4', u'寁': u'zan3', u'寂': u'ji4', u'寃': u'yuan1', u'寄': u'ji4', u'寅': u'yin2', u'密': u'mi4', u'寇': u'kou4', u'寈': u'qing1', u'寉': u'he4', u'寊': u'zhen1', u'寋': u'jian4', u'富': u'fu4', u'寍': u'ning2', u'寎': u'bing3', u'寏': u'huan2', u'寐': u'mei4', u'寑': u'qin3', u'寒': u'han2', u'寓': u'yu4', u'寔': u'shi2', u'寕': u'ning4', u'寖': u'jin4', u'寗': u'ning2', u'寘': u'zhi4', u'寙': u'yu3', u'寚': u'bao3', u'寛': u'kuan1', u'寜': u'ning4', u'寝': u'qin3', u'寞': u'mo4', u'察': u'cha2', u'寠': u'ju4', u'寡': u'gua3', u'寢': u'qin3', u'寣': u'hu1', u'寤': u'wu4', u'寥': u'liao2', u'實': u'shi2', u'寧': u'ning2', u'寨': u'zhai4', u'審': u'shen3', u'寪': u'wei3', u'寫': u'xie3', u'寬': u'kuan1', u'寭': u'hui4', u'寮': u'liao2', u'寯': u'jun4', u'寰': u'huan2', u'寱': u'yi4', u'寲': u'yi2', u'寳': u'bao3', u'寴': u'qin1', u'寵': u'chong3', u'寶': u'bao3', u'寷': u'feng1', u'寸': u'cun4', u'对': u'dui4', u'寺': u'si4', u'寻': u'xun2', u'导': u'dao3', u'寽': u'lue4', u'対': u'dui4', u'寿': u'shou4', u'尀': u'po3', u'封': u'feng1', u'専': u'zhuan1', u'尃': u'fu1', u'射': u'she4', u'尅': u'ke4', u'将': u'jiang1', u'將': u'jiang1', u'專': u'zhuan1', u'尉': u'wei4', u'尊': u'zun1', u'尋': u'xun2', u'尌': u'shu4', u'對': u'dui4', u'導': u'dao3', u'小': u'xiao3', u'尐': u'jie2', u'少': u'shao3', u'尒': u'er3', u'尓': u'er3', u'尔': u'er3', u'尕': u'ga3', u'尖': u'jian1', u'尗': u'shu1', u'尘': u'chen2', u'尙': u'shang4', u'尚': u'shang4', u'尛': u'mo2', u'尜': u'ga2', u'尝': u'chang2', u'尞': u'liao2', u'尟': u'xian3', u'尠': u'xian3', u'尡': u'hun4', u'尢': u'you2', u'尣': u'wang1', u'尤': u'you2', u'尥': u'liao4', u'尦': u'liao4', u'尧': u'yao2', u'尨': u'mang2', u'尩': u'wang1', u'尪': u'wang1', u'尫': u'wang1', u'尬': u'ga4', u'尭': u'yao2', u'尮': u'duo4', u'尯': u'kui4', u'尰': u'zhong3', u'就': u'jiu4', u'尲': u'gan1', u'尳': u'gu3', u'尴': u'gan1', u'尵': u'tui2', u'尶': u'gan1', u'尷': u'gan1', u'尸': u'shi1', u'尹': u'yin3', u'尺': u'chi3', u'尻': u'kao1', u'尼': u'ni2', u'尽': u'jin4', u'尾': u'wei3', u'尿': u'niao4', u'局': u'ju2', u'屁': u'pi4', u'层': u'ceng2', u'屃': u'xi4', u'屄': u'bi1', u'居': u'ju1', u'屆': u'jie4', u'屇': u'tian2', u'屈': u'qu1', u'屉': u'ti4', u'届': u'jie4', u'屋': u'wu1', u'屌': u'diao3', u'屍': u'shi1', u'屎': u'shi3', u'屏': u'ping2', u'屐': u'ji1', u'屑': u'xie4', u'屒': u'zhen3', u'屓': u'xi4', u'屔': u'ni2', u'展': u'zhan3', u'屖': u'xi1', u'屗': u'wu', u'屘': u'man3', u'屙': u'e1', u'屚': u'lou4', u'屛': u'ping3', u'屜': u'ti4', u'屝': u'fei1', u'属': u'shu3', u'屟': u'ti4', u'屠': u'tu2', u'屡': u'lv3', u'屢': u'lv3', u'屣': u'xi3', u'層': u'ceng2', u'履': u'lv3', u'屦': u'ju4', u'屧': u'xie4', u'屨': u'ju4', u'屩': u'jue1', u'屪': u'liao2', u'屫': u'jue1', u'屬': u'shu3', u'屭': u'xi4', u'屮': u'che4', u'屯': u'tun2', u'屰': u'ni4', u'山': u'shan1', u'屲': u'wa1', u'屳': u'xian1', u'屴': u'li4', u'屵': u'an4', u'屶': u'hui4', u'屷': u'hui4', u'屸': u'hong2', u'屹': u'yi4', u'屺': u'qi3', u'屻': u'ren4', u'屼': u'wu4', u'屽': u'han4', u'屾': u'shen1', u'屿': u'yu3', u'岀': u'chu1', u'岁': u'sui4', u'岂': u'qi3', u'岃': u'yin', u'岄': u'yue4', u'岅': u'ban3', u'岆': u'yao3', u'岇': u'ang2', u'岈': u'ya2', u'岉': u'wu4', u'岊': u'jie2', u'岋': u'e4', u'岌': u'ji2', u'岍': u'qian1', u'岎': u'fen2', u'岏': u'wan2', u'岐': u'qi2', u'岑': u'cen2', u'岒': u'qian2', u'岓': u'qi2', u'岔': u'cha4', u'岕': u'jie4', u'岖': u'qu1', u'岗': u'gang3', u'岘': u'xian4', u'岙': u'ao4', u'岚': u'lan2', u'岛': u'dao3', u'岜': u'ba1', u'岝': u'zuo4', u'岞': u'zuo4', u'岟': u'yang3', u'岠': u'ju4', u'岡': u'gang1', u'岢': u'ke3', u'岣': u'gou3', u'岤': u'xue4', u'岥': u'po1', u'岦': u'li4', u'岧': u'tiao2', u'岨': u'ju1', u'岩': u'yan2', u'岪': u'fu2', u'岫': u'xiu4', u'岬': u'jia3', u'岭': u'ling3', u'岮': u'tuo2', u'岯': u'pi1', u'岰': u'ao4', u'岱': u'dai4', u'岲': u'kuang4', u'岳': u'yue4', u'岴': u'qu1', u'岵': u'hu4', u'岶': u'po4', u'岷': u'min2', u'岸': u'an4', u'岹': u'tiao2', u'岺': u'ling3', u'岻': u'di1', u'岼': u'ping', u'岽': u'dong1', u'岾': u'zai', u'岿': u'kui1', u'峀': u'xiu4', u'峁': u'mao3', u'峂': u'tong2', u'峃': u'xue2', u'峄': u'yi4', u'峅': u'bian', u'峆': u'he2', u'峇': u'ke4', u'峈': u'luo4', u'峉': u'e2', u'峊': u'fu4', u'峋': u'xun2', u'峌': u'die2', u'峍': u'lu4', u'峎': u'en3', u'峏': u'er2', u'峐': u'gai1', u'峑': u'quan2', u'峒': u'dong4', u'峓': u'yi2', u'峔': u'mu3', u'峕': u'shi2', u'峖': u'an1', u'峗': u'wei2', u'峘': u'huan2', u'峙': u'zhi4', u'峚': u'mi4', u'峛': u'li3', u'峜': u'fa3', u'峝': u'tong2', u'峞': u'wei2', u'峟': u'you4', u'峠': u'qia3', u'峡': u'xia2', u'峢': u'li3', u'峣': u'yao2', u'峤': u'qiao2', u'峥': u'zheng1', u'峦': u'luan2', u'峧': u'jiao1', u'峨': u'e2', u'峩': u'e2', u'峪': u'yu4', u'峫': u'xie2', u'峬': u'bu1', u'峭': u'qiao4', u'峮': u'qun2', u'峯': u'feng1', u'峰': u'feng1', u'峱': u'nao2', u'峲': u'li3', u'峳': u'you1', u'峴': u'xian4', u'峵': u'rong2', u'島': u'dao3', u'峷': u'shen1', u'峸': u'cheng2', u'峹': u'tu2', u'峺': u'geng3', u'峻': u'jun4', u'峼': u'gao4', u'峽': u'xia2', u'峾': u'yin2', u'峿': u'wu2', u'崀': u'lang4', u'崁': u'kan4', u'崂': u'lao2', u'崃': u'lai2', u'崄': u'xian3', u'崅': u'que4', u'崆': u'kong1', u'崇': u'chong2', u'崈': u'chong2', u'崉': u'ta4', u'崊': u'lin2', u'崋': u'hua4', u'崌': u'ju1', u'崍': u'lai2', u'崎': u'qi2', u'崏': u'min2', u'崐': u'kun1', u'崑': u'kun1', u'崒': u'zu2', u'崓': u'gu4', u'崔': u'cui1', u'崕': u'ya2', u'崖': u'ya2', u'崗': u'gang3', u'崘': u'lun2', u'崙': u'lun2', u'崚': u'ling2', u'崛': u'jue2', u'崜': u'duo3', u'崝': u'zheng1', u'崞': u'guo1', u'崟': u'yin2', u'崠': u'dong1', u'崡': u'han2', u'崢': u'zheng1', u'崣': u'wei3', u'崤': u'xiao2', u'崥': u'pi2', u'崦': u'yan1', u'崧': u'song1', u'崨': u'jie2', u'崩': u'beng1', u'崪': u'zu2', u'崫': u'jue2', u'崬': u'dong1', u'崭': u'zhan3', u'崮': u'gu4', u'崯': u'yin2', u'崰': u'zi1', u'崱': u'ze4', u'崲': u'huang2', u'崳': u'yu2', u'崴': u'wai3', u'崵': u'yang2', u'崶': u'feng1', u'崷': u'qiu2', u'崸': u'yang2', u'崹': u'ti2', u'崺': u'yi3', u'崻': u'zhi4', u'崼': u'shi4', u'崽': u'zai3', u'崾': u'yao3', u'崿': u'e4', u'嵀': u'zhu4', u'嵁': u'kan1', u'嵂': u'lv4', u'嵃': u'yan3', u'嵄': u'mei3', u'嵅': u'han2', u'嵆': u'ji1', u'嵇': u'ji1', u'嵈': u'huan4', u'嵉': u'ting2', u'嵊': u'sheng4', u'嵋': u'mei2', u'嵌': u'qian4', u'嵍': u'wu4', u'嵎': u'yu2', u'嵏': u'zong1', u'嵐': u'lan2', u'嵑': u'ke3', u'嵒': u'yan2', u'嵓': u'yan2', u'嵔': u'wei1', u'嵕': u'zong1', u'嵖': u'cha2', u'嵗': u'sui4', u'嵘': u'rong2', u'嵙': u'ke', u'嵚': u'qin1', u'嵛': u'yu2', u'嵜': u'qi1', u'嵝': u'lou3', u'嵞': u'tu2', u'嵟': u'cui1', u'嵠': u'xi1', u'嵡': u'weng3', u'嵢': u'cang1', u'嵣': u'dang4', u'嵤': u'rong2', u'嵥': u'jie2', u'嵦': u'kai3', u'嵧': u'liu2', u'嵨': u'wu4', u'嵩': u'song1', u'嵪': u'kao1', u'嵫': u'zi1', u'嵬': u'wei2', u'嵭': u'beng1', u'嵮': u'dian1', u'嵯': u'cuo2', u'嵰': u'qin1', u'嵱': u'yong3', u'嵲': u'nie4', u'嵳': u'cuo2', u'嵴': u'ji2', u'嵵': u'shi1', u'嵶': u'ruo', u'嵷': u'song3', u'嵸': u'zong1', u'嵹': u'jiang4', u'嵺': u'liao2', u'嵻': u'kang1', u'嵼': u'yan3', u'嵽': u'di4', u'嵾': u'cen1', u'嵿': u'ding3', u'嶀': u'tu1', u'嶁': u'lou3', u'嶂': u'zhang4', u'嶃': u'zhan3', u'嶄': u'zhan3', u'嶅': u'ao2', u'嶆': u'cao2', u'嶇': u'qu1', u'嶈': u'qiang1', u'嶉': u'wei3', u'嶊': u'zui3', u'嶋': u'dao3', u'嶌': u'dao3', u'嶍': u'xi2', u'嶎': u'yu4', u'嶏': u'pi3', u'嶐': u'long2', u'嶑': u'xiang4', u'嶒': u'ceng2', u'嶓': u'bo1', u'嶔': u'qin1', u'嶕': u'jiao1', u'嶖': u'yan1', u'嶗': u'lao2', u'嶘': u'zhan4', u'嶙': u'lin2', u'嶚': u'liao2', u'嶛': u'liao2', u'嶜': u'qin2', u'嶝': u'deng4', u'嶞': u'tuo4', u'嶟': u'zun1', u'嶠': u'qiao2', u'嶡': u'jue2', u'嶢': u'yao2', u'嶣': u'jiao1', u'嶤': u'yao2', u'嶥': u'jue2', u'嶦': u'zhan1', u'嶧': u'yi4', u'嶨': u'xue2', u'嶩': u'nao2', u'嶪': u'ye4', u'嶫': u'ye4', u'嶬': u'yi2', u'嶭': u'nie4', u'嶮': u'xian3', u'嶯': u'ji2', u'嶰': u'xie4', u'嶱': u'ke3', u'嶲': u'gui1', u'嶳': u'di4', u'嶴': u'ao4', u'嶵': u'zui4', u'嶶': u'wei', u'嶷': u'yi2', u'嶸': u'rong2', u'嶹': u'dao3', u'嶺': u'ling3', u'嶻': u'jie2', u'嶼': u'yu3', u'嶽': u'yue4', u'嶾': u'yin3', u'嶿': u'ru', u'巀': u'jie2', u'巁': u'li4', u'巂': u'xi1', u'巃': u'long2', u'巄': u'long2', u'巅': u'dian1', u'巆': u'ying2', u'巇': u'xi1', u'巈': u'ju2', u'巉': u'chan2', u'巊': u'ying3', u'巋': u'kui1', u'巌': u'yan2', u'巍': u'wei1', u'巎': u'nao2', u'巏': u'quan2', u'巐': u'chao3', u'巑': u'li2', u'巒': u'luan2', u'巓': u'dian1', u'巔': u'dian1', u'巕': u'nie4', u'巖': u'yan2', u'巗': u'yan2', u'巘': u'yan3', u'巙': u'kui', u'巚': u'yan3', u'巛': u'chuan1', u'巜': u'kuai4', u'川': u'chuan1', u'州': u'zhou1', u'巟': u'huang1', u'巠': u'jing1', u'巡': u'xun2', u'巢': u'chao2', u'巣': u'chao2', u'巤': u'lie4', u'工': u'gong1', u'左': u'zuo3', u'巧': u'qiao3', u'巨': u'ju4', u'巩': u'gong3', u'巪': u'gexi', u'巫': u'wu1', u'巬': u'pu', u'巭': u'bu', u'差': u'cha4', u'巯': u'qiu2', u'巰': u'qiu2', u'己': u'ji3', u'已': u'yi3', u'巳': u'si4', u'巴': u'ba1', u'巵': u'zhi1', u'巶': u'zhao1', u'巷': u'xiang4', u'巸': u'yi2', u'巹': u'jin3', u'巺': u'xun4', u'巻': u'juan4', u'巼': u'paxi', u'巽': u'xun4', u'巾': u'jin1', u'巿': u'fu2', u'帀': u'za1', u'币': u'bi4', u'市': u'shi4', u'布': u'bu4', u'帄': u'ding1', u'帅': u'shuai4', u'帆': u'fan1', u'帇': u'nie4', u'师': u'shi1', u'帉': u'fen1', u'帊': u'pa4', u'帋': u'zhi3', u'希': u'xi1', u'帍': u'hu4', u'帎': u'dan4', u'帏': u'wei2', u'帐': u'zhang4', u'帑': u'tang3', u'帒': u'dai4', u'帓': u'mo4', u'帔': u'pei4', u'帕': u'pa4', u'帖': u'tie4', u'帗': u'fu2', u'帘': u'lian2', u'帙': u'zhi4', u'帚': u'zhou3', u'帛': u'bo2', u'帜': u'zhi4', u'帝': u'di4', u'帞': u'mo4', u'帟': u'yi4', u'帠': u'yi4', u'帡': u'ping2', u'帢': u'qia4', u'帣': u'juan3', u'帤': u'ru2', u'帥': u'shuai4', u'带': u'dai4', u'帧': u'zheng4', u'帨': u'shui4', u'帩': u'qiao4', u'帪': u'zhen1', u'師': u'shi1', u'帬': u'qun2', u'席': u'xi2', u'帮': u'bang1', u'帯': u'dai4', u'帰': u'gui1', u'帱': u'chou2', u'帲': u'ping2', u'帳': u'zhang4', u'帴': u'jian3', u'帵': u'wan1', u'帶': u'dai4', u'帷': u'wei2', u'常': u'chang2', u'帹': u'sha4', u'帺': u'qi2', u'帻': u'ze2', u'帼': u'guo2', u'帽': u'mao4', u'帾': u'zhu3', u'帿': u'hou2', u'幀': u'zheng4', u'幁': u'zheng4', u'幂': u'mi4', u'幃': u'wei2', u'幄': u'wo4', u'幅': u'fu2', u'幆': u'yi4', u'幇': u'bang1', u'幈': u'ping2', u'幉': u'die', u'幊': u'gong1', u'幋': u'pan2', u'幌': u'huang3', u'幍': u'tao1', u'幎': u'mi4', u'幏': u'jia4', u'幐': u'teng2', u'幑': u'hui1', u'幒': u'zhong1', u'幓': u'shan1', u'幔': u'man4', u'幕': u'mu4', u'幖': u'biao1', u'幗': u'guo2', u'幘': u'ze2', u'幙': u'mu4', u'幚': u'bang1', u'幛': u'zhang4', u'幜': u'jing3', u'幝': u'chan3', u'幞': u'fu2', u'幟': u'zhi4', u'幠': u'hu1', u'幡': u'fan1', u'幢': u'zhuang4', u'幣': u'bi4', u'幤': u'bi4', u'幥': u'zhang', u'幦': u'mi4', u'幧': u'qiao1', u'幨': u'chan1', u'幩': u'fen2', u'幪': u'meng2', u'幫': u'bang1', u'幬': u'chou2', u'幭': u'mie4', u'幮': u'chu2', u'幯': u'jie2', u'幰': u'xian3', u'幱': u'lan2', u'干': u'gan4', u'平': u'ping2', u'年': u'nian2', u'幵': u'jian1', u'并': u'bing4', u'幷': u'bing4', u'幸': u'xing4', u'幹': u'gan4', u'幺': u'yao1', u'幻': u'huan4', u'幼': u'you4', u'幽': u'you1', u'幾': u'ji3', u'广': u'guang3', u'庀': u'pi3', u'庁': u'ting1', u'庂': u'ze4', u'広': u'guang3', u'庄': u'zhuang1', u'庅': u'me', u'庆': u'qing4', u'庇': u'bi4', u'庈': u'qin2', u'庉': u'dun4', u'床': u'chuang2', u'庋': u'gui3', u'庌': u'ya3', u'庍': u'bai4', u'庎': u'jie4', u'序': u'xu4', u'庐': u'lu2', u'庑': u'wu3', u'庒': u'zhuang1', u'库': u'ku4', u'应': u'ying1', u'底': u'di3', u'庖': u'pao2', u'店': u'dian4', u'庘': u'ya1', u'庙': u'miao4', u'庚': u'geng1', u'庛': u'ci4', u'府': u'fu3', u'庝': u'tong2', u'庞': u'pang2', u'废': u'fei4', u'庠': u'xiang2', u'庡': u'yi3', u'庢': u'zhi4', u'庣': u'tiao1', u'庤': u'zhi4', u'庥': u'xiu1', u'度': u'du4', u'座': u'zuo4', u'庨': u'xiao1', u'庩': u'tu2', u'庪': u'gui3', u'庫': u'ku4', u'庬': u'mang2', u'庭': u'ting2', u'庮': u'you2', u'庯': u'bu1', u'庰': u'bing4', u'庱': u'cheng3', u'庲': u'lai2', u'庳': u'bi4', u'庴': u'ji1', u'庵': u'an1', u'庶': u'shu4', u'康': u'kang1', u'庸': u'yong1', u'庹': u'tuo3', u'庺': u'song1', u'庻': u'shu4', u'庼': u'qing3', u'庽': u'yu4', u'庾': u'yu3', u'庿': u'miao4', u'廀': u'sou1', u'廁': u'ce4', u'廂': u'xiang1', u'廃': u'fei4', u'廄': u'jiu4', u'廅': u'e4', u'廆': u'gui1', u'廇': u'liu4', u'廈': u'sha4', u'廉': u'lian2', u'廊': u'lang2', u'廋': u'sou1', u'廌': u'zhi4', u'廍': u'bu4', u'廎': u'qing3', u'廏': u'jiu4', u'廐': u'jiu4', u'廑': u'jin3', u'廒': u'ao2', u'廓': u'kuo4', u'廔': u'lou2', u'廕': u'yin4', u'廖': u'liao4', u'廗': u'dai4', u'廘': u'lu4', u'廙': u'yi4', u'廚': u'chu2', u'廛': u'chan2', u'廜': u'tu2', u'廝': u'si1', u'廞': u'xin1', u'廟': u'miao4', u'廠': u'chang3', u'廡': u'wu3', u'廢': u'fei4', u'廣': u'guang3', u'廤': u'kaoxi', u'廥': u'kuai4', u'廦': u'bi4', u'廧': u'qiang2', u'廨': u'xie4', u'廩': u'lin3', u'廪': u'lin3', u'廫': u'liao2', u'廬': u'lu2', u'廭': u'ji', u'廮': u'ying3', u'廯': u'xian1', u'廰': u'ting1', u'廱': u'yong1', u'廲': u'li2', u'廳': u'ting1', u'廴': u'yin3', u'廵': u'xun2', u'延': u'yan2', u'廷': u'ting2', u'廸': u'di2', u'廹': u'po4', u'建': u'jian4', u'廻': u'hui2', u'廼': u'nai3', u'廽': u'hui2', u'廾': u'gong3', u'廿': u'nian4', u'开': u'kai1', u'弁': u'bian4', u'异': u'yi4', u'弃': u'qi4', u'弄': u'nong4', u'弅': u'fen4', u'弆': u'ju3', u'弇': u'yan3', u'弈': u'yi4', u'弉': u'zang4', u'弊': u'bi4', u'弋': u'yi4', u'弌': u'yi1', u'弍': u'er4', u'弎': u'san1', u'式': u'shi4', u'弐': u'er4', u'弑': u'shi4', u'弒': u'shi4', u'弓': u'gong1', u'弔': u'diao4', u'引': u'yin3', u'弖': u'hu4', u'弗': u'fu2', u'弘': u'hong2', u'弙': u'wu1', u'弚': u'tui2', u'弛': u'chi2', u'弜': u'jiang4', u'弝': u'ba4', u'弞': u'shen3', u'弟': u'di4', u'张': u'zhang1', u'弡': u'jue2', u'弢': u'tao1', u'弣': u'fu3', u'弤': u'di3', u'弥': u'mi2', u'弦': u'xian2', u'弧': u'hu2', u'弨': u'chao1', u'弩': u'nu3', u'弪': u'jing4', u'弫': u'zhen3', u'弬': u'yi', u'弭': u'mi3', u'弮': u'quan1', u'弯': u'wan1', u'弰': u'shao1', u'弱': u'ruo4', u'弲': u'xuan1', u'弳': u'jing4', u'弴': u'diao1', u'張': u'zhang1', u'弶': u'jiang4', u'強': u'qiang2', u'弸': u'peng2', u'弹': u'tan2', u'强': u'qiang2', u'弻': u'bi4', u'弼': u'bi4', u'弽': u'she4', u'弾': u'dan4', u'弿': u'jian3', u'彀': u'gou4', u'彁': u'ge', u'彂': u'fa1', u'彃': u'bi4', u'彄': u'kou1', u'彅': u'jian', u'彆': u'bie2', u'彇': u'xiao1', u'彈': u'tan2', u'彉': u'guo1', u'彊': u'qiang2', u'彋': u'hong2', u'彌': u'mi2', u'彍': u'guo1', u'彎': u'wan1', u'彏': u'jue2', u'彐': u'xue3', u'彑': u'ji4', u'归': u'gui1', u'当': u'dang1', u'彔': u'lu4', u'录': u'lu4', u'彖': u'tuan4', u'彗': u'hui4', u'彘': u'zhi4', u'彙': u'hui4', u'彚': u'hui4', u'彛': u'yi2', u'彜': u'yi2', u'彝': u'yi2', u'彞': u'yi2', u'彟': u'huo4', u'彠': u'huo4', u'彡': u'shan1', u'形': u'xing2', u'彣': u'wen2', u'彤': u'tong2', u'彥': u'yan4', u'彦': u'yan4', u'彧': u'yu4', u'彨': u'chi1', u'彩': u'cai3', u'彪': u'biao1', u'彫': u'diao1', u'彬': u'bin1', u'彭': u'peng2', u'彮': u'yong3', u'彯': u'piao1', u'彰': u'zhang1', u'影': u'ying3', u'彲': u'chi1', u'彳': u'chi4', u'彴': u'zhuo2', u'彵': u'tuo3', u'彶': u'ji2', u'彷': u'pang2', u'彸': u'zhong1', u'役': u'yi4', u'彺': u'wang3', u'彻': u'che4', u'彼': u'bi3', u'彽': u'di1', u'彾': u'ling2', u'彿': u'fo2', u'往': u'wang3', u'征': u'zheng1', u'徂': u'cu2', u'徃': u'wang3', u'径': u'jing4', u'待': u'dai4', u'徆': u'xi1', u'徇': u'xun4', u'很': u'hen3', u'徉': u'yang2', u'徊': u'huai2', u'律': u'lv4', u'後': u'hou4', u'徍': u'wang4', u'徎': u'cheng3', u'徏': u'zhi4', u'徐': u'xu2', u'徑': u'jing4', u'徒': u'tu2', u'従': u'cong2', u'徔': u'cong2', u'徕': u'lai2', u'徖': u'cong2', u'得': u'de', u'徘': u'pai2', u'徙': u'xi3', u'徚': u'wu', u'徛': u'ji4', u'徜': u'chang2', u'徝': u'zhi4', u'從': u'cong2', u'徟': u'zhou1', u'徠': u'lai2', u'御': u'yu4', u'徢': u'xie4', u'徣': u'jie4', u'徤': u'jian4', u'徥': u'shi4', u'徦': u'jia3', u'徧': u'bian4', u'徨': u'huang2', u'復': u'fu4', u'循': u'xun2', u'徫': u'wei3', u'徬': u'pang2', u'徭': u'yao2', u'微': u'wei1', u'徯': u'xi1', u'徰': u'zheng1', u'徱': u'piao4', u'徲': u'ti2', u'徳': u'de2', u'徴': u'zheng1', u'徵': u'zheng1', u'徶': u'bie2', u'德': u'de2', u'徸': u'zhong3', u'徹': u'che4', u'徺': u'jiao3', u'徻': u'hui4', u'徼': u'jiao3', u'徽': u'hui1', u'徾': u'mei2', u'徿': u'long4', u'忀': u'xiang1', u'忁': u'bao4', u'忂': u'qu2', u'心': u'xin1', u'忄': u'xin1', u'必': u'bi4', u'忆': u'yi4', u'忇': u'le4', u'忈': u'ren2', u'忉': u'dao1', u'忊': u'ding4', u'忋': u'gai3', u'忌': u'ji4', u'忍': u'ren3', u'忎': u'ren2', u'忏': u'chan4', u'忐': u'tan3', u'忑': u'te4', u'忒': u'te4', u'忓': u'gan1', u'忔': u'yi4', u'忕': u'shi4', u'忖': u'cun3', u'志': u'zhi4', u'忘': u'wang4', u'忙': u'mang2', u'忚': u'xi1', u'忛': u'fan1', u'応': u'ying1', u'忝': u'tian3', u'忞': u'min3', u'忟': u'min3', u'忠': u'zhong1', u'忡': u'chong1', u'忢': u'wu4', u'忣': u'ji2', u'忤': u'wu3', u'忥': u'xi4', u'忦': u'jia2', u'忧': u'you1', u'忨': u'wan4', u'忩': u'cong1', u'忪': u'song1', u'快': u'kuai4', u'忬': u'yu4', u'忭': u'bian4', u'忮': u'zhi4', u'忯': u'qi2', u'忰': u'cui4', u'忱': u'chen2', u'忲': u'tai4', u'忳': u'tun2', u'忴': u'qian2', u'念': u'nian4', u'忶': u'hun2', u'忷': u'xiong1', u'忸': u'niu3', u'忹': u'kuang2', u'忺': u'xian1', u'忻': u'xin1', u'忼': u'kang1', u'忽': u'hu1', u'忾': u'kai4', u'忿': u'fen4', u'怀': u'huai2', u'态': u'tai4', u'怂': u'song3', u'怃': u'wu3', u'怄': u'ou4', u'怅': u'chang4', u'怆': u'chuang4', u'怇': u'ju4', u'怈': u'yi4', u'怉': u'bao3', u'怊': u'chao1', u'怋': u'min2', u'怌': u'pei1', u'怍': u'zuo4', u'怎': u'zen3', u'怏': u'yang4', u'怐': u'kou4', u'怑': u'ban4', u'怒': u'nu4', u'怓': u'nao2', u'怔': u'zheng4', u'怕': u'pa4', u'怖': u'bu4', u'怗': u'tie1', u'怘': u'hu4', u'怙': u'hu4', u'怚': u'cu1', u'怛': u'da2', u'怜': u'lian2', u'思': u'si1', u'怞': u'you2', u'怟': u'di4', u'怠': u'dai4', u'怡': u'yi2', u'怢': u'tu1', u'怣': u'you2', u'怤': u'fu1', u'急': u'ji2', u'怦': u'peng1', u'性': u'xing4', u'怨': u'yuan4', u'怩': u'ni2', u'怪': u'guai4', u'怫': u'fu2', u'怬': u'xi4', u'怭': u'bi4', u'怮': u'you1', u'怯': u'qie4', u'怰': u'xuan4', u'怱': u'cong1', u'怲': u'bing3', u'怳': u'huang3', u'怴': u'xu4', u'怵': u'chu4', u'怶': u'bi4', u'怷': u'shu4', u'怸': u'xi1', u'怹': u'tan1', u'怺': u'yong3', u'总': u'zong3', u'怼': u'dui4', u'怽': u'mi4', u'怾': u'ji', u'怿': u'yi4', u'恀': u'shi4', u'恁': u'nen4', u'恂': u'xun2', u'恃': u'shi4', u'恄': u'xi4', u'恅': u'lao3', u'恆': u'heng2', u'恇': u'kuang1', u'恈': u'mou2', u'恉': u'zhi3', u'恊': u'xie2', u'恋': u'lian4', u'恌': u'tiao1', u'恍': u'huang3', u'恎': u'die2', u'恏': u'hao4', u'恐': u'kong3', u'恑': u'gui3', u'恒': u'heng2', u'恓': u'qi1', u'恔': u'xiao4', u'恕': u'shu4', u'恖': u'si1', u'恗': u'hu1', u'恘': u'qiu1', u'恙': u'yang4', u'恚': u'hui4', u'恛': u'hui2', u'恜': u'chi4', u'恝': u'jia2', u'恞': u'yi2', u'恟': u'xiong1', u'恠': u'guai4', u'恡': u'lin4', u'恢': u'hui1', u'恣': u'zi4', u'恤': u'xu4', u'恥': u'chi3', u'恦': u'shang4', u'恧': u'nv4', u'恨': u'hen4', u'恩': u'en1', u'恪': u'ke4', u'恫': u'dong4', u'恬': u'tian2', u'恭': u'gong1', u'恮': u'quan2', u'息': u'xi1', u'恰': u'qia4', u'恱': u'yue4', u'恲': u'peng1', u'恳': u'ken3', u'恴': u'de2', u'恵': u'hui4', u'恶': u'e4', u'恷': u'qiu1', u'恸': u'tong4', u'恹': u'yan1', u'恺': u'kai3', u'恻': u'ce4', u'恼': u'nao3', u'恽': u'yun4', u'恾': u'mang2', u'恿': u'yong3', u'悀': u'yong3', u'悁': u'juan4', u'悂': u'pi1', u'悃': u'kun3', u'悄': u'qiao1', u'悅': u'yue4', u'悆': u'yu4', u'悇': u'tu2', u'悈': u'jie4', u'悉': u'xi1', u'悊': u'zhe2', u'悋': u'lin4', u'悌': u'ti4', u'悍': u'han4', u'悎': u'hao4', u'悏': u'qie4', u'悐': u'ti4', u'悑': u'bu4', u'悒': u'yi4', u'悓': u'qian4', u'悔': u'hui3', u'悕': u'xi1', u'悖': u'bei4', u'悗': u'man2', u'悘': u'yi1', u'悙': u'heng1', u'悚': u'song3', u'悛': u'quan1', u'悜': u'cheng3', u'悝': u'li3', u'悞': u'wu4', u'悟': u'wu4', u'悠': u'you1', u'悡': u'li2', u'悢': u'liang4', u'患': u'huan4', u'悤': u'cong1', u'悥': u'yi4', u'悦': u'yue4', u'悧': u'li4', u'您': u'nin2', u'悩': u'nao3', u'悪': u'e4', u'悫': u'que4', u'悬': u'xuan2', u'悭': u'qian1', u'悮': u'wu4', u'悯': u'min3', u'悰': u'cong2', u'悱': u'fei3', u'悲': u'bei1', u'悳': u'de2', u'悴': u'cui4', u'悵': u'chang4', u'悶': u'men1', u'悷': u'li4', u'悸': u'ji4', u'悹': u'guan4', u'悺': u'guan4', u'悻': u'xing4', u'悼': u'dao4', u'悽': u'qi1', u'悾': u'kong1', u'悿': u'tian3', u'惀': u'lun3', u'惁': u'xi1', u'惂': u'kan3', u'惃': u'gun3', u'惄': u'ni4', u'情': u'qing2', u'惆': u'chou2', u'惇': u'dun1', u'惈': u'guo3', u'惉': u'zhan1', u'惊': u'jing1', u'惋': u'wan3', u'惌': u'yuan1', u'惍': u'jin1', u'惎': u'ji4', u'惏': u'lan2', u'惐': u'yu4', u'惑': u'huo4', u'惒': u'he2', u'惓': u'quan2', u'惔': u'tan2', u'惕': u'ti4', u'惖': u'ti4', u'惗': u'nian4', u'惘': u'wang3', u'惙': u'chuo4', u'惚': u'hu1', u'惛': u'hun1', u'惜': u'xi1', u'惝': u'chang3', u'惞': u'xin1', u'惟': u'wei2', u'惠': u'hui4', u'惡': u'e4', u'惢': u'suo3', u'惣': u'zong3', u'惤': u'jian1', u'惥': u'yong3', u'惦': u'dian4', u'惧': u'ju4', u'惨': u'can3', u'惩': u'cheng2', u'惪': u'de2', u'惫': u'bei4', u'惬': u'qie4', u'惭': u'can2', u'惮': u'dan4', u'惯': u'guan4', u'惰': u'duo4', u'惱': u'nao3', u'惲': u'yun4', u'想': u'xiang3', u'惴': u'zhui4', u'惵': u'die2', u'惶': u'huang2', u'惷': u'chun3', u'惸': u'qiong2', u'惹': u're3', u'惺': u'xing1', u'惻': u'ce4', u'惼': u'bian3', u'惽': u'hun1', u'惾': u'zong1', u'惿': u'ti2', u'愀': u'qiao3', u'愁': u'chou2', u'愂': u'bei4', u'愃': u'xuan1', u'愄': u'wei1', u'愅': u'ge2', u'愆': u'qian1', u'愇': u'wei3', u'愈': u'yu4', u'愉': u'yu2', u'愊': u'bi4', u'愋': u'xuan1', u'愌': u'huan4', u'愍': u'min3', u'愎': u'bi4', u'意': u'yi4', u'愐': u'mian3', u'愑': u'yong3', u'愒': u'qi4', u'愓': u'dang4', u'愔': u'yin1', u'愕': u'e4', u'愖': u'chen2', u'愗': u'mao4', u'愘': u'ke4', u'愙': u'ke4', u'愚': u'yu2', u'愛': u'ai4', u'愜': u'qie4', u'愝': u'yan3', u'愞': u'nuo4', u'感': u'gan3', u'愠': u'yun4', u'愡': u'cong4', u'愢': u'sai1', u'愣': u'leng4', u'愤': u'fen4', u'愥': u'ying', u'愦': u'kui4', u'愧': u'kui4', u'愨': u'que4', u'愩': u'gong1', u'愪': u'yun2', u'愫': u'su4', u'愬': u'su4', u'愭': u'qi2', u'愮': u'yao2', u'愯': u'song3', u'愰': u'huang4', u'愱': u'ji2', u'愲': u'gu3', u'愳': u'ju4', u'愴': u'chuang4', u'愵': u'ni4', u'愶': u'xie2', u'愷': u'kai3', u'愸': u'zheng3', u'愹': u'yong3', u'愺': u'cao3', u'愻': u'xun4', u'愼': u'shen4', u'愽': u'bo2', u'愾': u'kai4', u'愿': u'yuan4', u'慀': u'xi4', u'慁': u'hun4', u'慂': u'yong3', u'慃': u'yang3', u'慄': u'li4', u'慅': u'sao1', u'慆': u'tao1', u'慇': u'yin1', u'慈': u'ci2', u'慉': u'xu4', u'慊': u'qian4', u'態': u'tai4', u'慌': u'huang1', u'慍': u'yun4', u'慎': u'shen4', u'慏': u'ming3', u'慐': u'gong1', u'慑': u'she4', u'慒': u'cao2', u'慓': u'piao4', u'慔': u'mu4', u'慕': u'mu4', u'慖': u'guo2', u'慗': u'chi4', u'慘': u'can3', u'慙': u'can2', u'慚': u'can2', u'慛': u'cui1', u'慜': u'min3', u'慝': u'te4', u'慞': u'zhang1', u'慟': u'tong4', u'慠': u'ao4', u'慡': u'shuang3', u'慢': u'man4', u'慣': u'guan4', u'慤': u'que4', u'慥': u'zao4', u'慦': u'jiu4', u'慧': u'hui4', u'慨': u'kai3', u'慩': u'lian2', u'慪': u'ou4', u'慫': u'song3', u'慬': u'qin2', u'慭': u'yin4', u'慮': u'lv4', u'慯': u'shang1', u'慰': u'wei4', u'慱': u'tuan2', u'慲': u'man2', u'慳': u'qian1', u'慴': u'she4', u'慵': u'yong1', u'慶': u'qing4', u'慷': u'kang1', u'慸': u'di4', u'慹': u'zhi2', u'慺': u'lou2', u'慻': u'juan4', u'慼': u'qi1', u'慽': u'qi1', u'慾': u'yu4', u'慿': u'ping2', u'憀': u'liao2', u'憁': u'cong4', u'憂': u'you1', u'憃': u'chong1', u'憄': u'zhi1', u'憅': u'tong4', u'憆': u'cheng1', u'憇': u'qi4', u'憈': u'qu1', u'憉': u'peng2', u'憊': u'bei4', u'憋': u'bie1', u'憌': u'qiong2', u'憍': u'jiao1', u'憎': u'zeng1', u'憏': u'chi4', u'憐': u'lian2', u'憑': u'ping2', u'憒': u'kui4', u'憓': u'hui4', u'憔': u'qiao2', u'憕': u'cheng2', u'憖': u'yin4', u'憗': u'yin4', u'憘': u'xi3', u'憙': u'xi3', u'憚': u'dan4', u'憛': u'tan2', u'憜': u'duo4', u'憝': u'dui4', u'憞': u'dui4', u'憟': u'su4', u'憠': u'jue2', u'憡': u'ce4', u'憢': u'xiao1', u'憣': u'fan1', u'憤': u'fen4', u'憥': u'lao2', u'憦': u'lao4', u'憧': u'chong1', u'憨': u'han1', u'憩': u'qi4', u'憪': u'xian2', u'憫': u'min3', u'憬': u'jing3', u'憭': u'liao3', u'憮': u'wu3', u'憯': u'can3', u'憰': u'jue2', u'憱': u'cu4', u'憲': u'xian4', u'憳': u'tan3', u'憴': u'sheng2', u'憵': u'pi1', u'憶': u'yi4', u'憷': u'chu4', u'憸': u'xian1', u'憹': u'nao2', u'憺': u'dan4', u'憻': u'tan3', u'憼': u'jing3', u'憽': u'song1', u'憾': u'han4', u'憿': u'jiao3', u'懀': u'wei4', u'懁': u'xuan1', u'懂': u'dong3', u'懃': u'qin2', u'懄': u'qin2', u'懅': u'ju4', u'懆': u'cao3', u'懇': u'ken3', u'懈': u'xie4', u'應': u'ying1', u'懊': u'ao4', u'懋': u'mao4', u'懌': u'yi4', u'懍': u'lin3', u'懎': u'se4', u'懏': u'jun4', u'懐': u'huai2', u'懑': u'men4', u'懒': u'lan3', u'懓': u'ai4', u'懔': u'lin3', u'懕': u'yan1', u'懖': u'guo1', u'懗': u'xia4', u'懘': u'chi4', u'懙': u'yu3', u'懚': u'yin4', u'懛': u'dai1', u'懜': u'meng4', u'懝': u'ni3', u'懞': u'meng2', u'懟': u'dui4', u'懠': u'qi2', u'懡': u'mo3', u'懢': u'lan2', u'懣': u'men4', u'懤': u'chou2', u'懥': u'zhi4', u'懦': u'nuo4', u'懧': u'nuo4', u'懨': u'yan1', u'懩': u'yang3', u'懪': u'bo2', u'懫': u'zhi4', u'懬': u'kuang4', u'懭': u'kuang3', u'懮': u'you1', u'懯': u'fu1', u'懰': u'liu2', u'懱': u'mie4', u'懲': u'cheng2', u'懳': u'hui4', u'懴': u'chan4', u'懵': u'meng3', u'懶': u'lan3', u'懷': u'huai2', u'懸': u'xuan2', u'懹': u'rang4', u'懺': u'chan4', u'懻': u'ji4', u'懼': u'ju4', u'懽': u'huan1', u'懾': u'she4', u'懿': u'yi4', u'戀': u'lian4', u'戁': u'nan3', u'戂': u'mi2', u'戃': u'tang3', u'戄': u'jue2', u'戅': u'gang4', u'戆': u'gang4', u'戇': u'gang4', u'戈': u'ge1', u'戉': u'yue4', u'戊': u'wu4', u'戋': u'jian1', u'戌': u'xu1', u'戍': u'shu4', u'戎': u'rong2', u'戏': u'xi4', u'成': u'cheng2', u'我': u'wo3', u'戒': u'jie4', u'戓': u'ge1', u'戔': u'jian1', u'戕': u'qiang1', u'或': u'huo4', u'戗': u'qiang1', u'战': u'zhan4', u'戙': u'dong4', u'戚': u'qi1', u'戛': u'jia2', u'戜': u'die2', u'戝': u'zei2', u'戞': u'jia2', u'戟': u'ji3', u'戠': u'zhi2', u'戡': u'kan1', u'戢': u'ji2', u'戣': u'kui2', u'戤': u'gai4', u'戥': u'deng3', u'戦': u'zhan4', u'戧': u'qiang1', u'戨': u'ge1', u'戩': u'jian3', u'截': u'jie2', u'戫': u'yu4', u'戬': u'jian3', u'戭': u'yan3', u'戮': u'lu4', u'戯': u'hu1', u'戰': u'zhan4', u'戱': u'xi4', u'戲': u'xi4', u'戳': u'chuo1', u'戴': u'dai4', u'戵': u'qu2', u'戶': u'hu4', u'户': u'hu4', u'戸': u'hu4', u'戹': u'e4', u'戺': u'shi4', u'戻': u'ti4', u'戼': u'mao3', u'戽': u'hu4', u'戾': u'li4', u'房': u'fang2', u'所': u'suo3', u'扁': u'bian3', u'扂': u'dian4', u'扃': u'jiong1', u'扄': u'shang3', u'扅': u'yi2', u'扆': u'yi3', u'扇': u'shan4', u'扈': u'hu4', u'扉': u'fei1', u'扊': u'yan3', u'手': u'shou3', u'扌': u'shou3', u'才': u'cai2', u'扎': u'zha1', u'扏': u'qiu2', u'扐': u'le4', u'扑': u'pu1', u'扒': u'ba1', u'打': u'da3', u'扔': u'reng1', u'払': u'fan3', u'扖': u'hameru', u'扗': u'zai4', u'托': u'tuo1', u'扙': u'zhang4', u'扚': u'diao3', u'扛': u'kang2', u'扜': u'yu1', u'扝': u'yu1', u'扞': u'han4', u'扟': u'shen1', u'扠': u'cha1', u'扡': u'tuo1', u'扢': u'qian1', u'扣': u'kou4', u'扤': u'wu4', u'扥': u'den4', u'扦': u'qian1', u'执': u'zhi2', u'扨': u'sate', u'扩': u'kuo4', u'扪': u'men2', u'扫': u'sao3', u'扬': u'yang2', u'扭': u'niu3', u'扮': u'ban4', u'扯': u'che3', u'扰': u'rao3', u'扱': u'cha1', u'扲': u'qian2', u'扳': u'ban1', u'扴': u'jia2', u'扵': u'yu2', u'扶': u'fu2', u'扷': u'ba1', u'扸': u'xi1', u'批': u'pi1', u'扺': u'di3', u'扻': u'zhi4', u'扼': u'e4', u'扽': u'den4', u'找': u'zhao3', u'承': u'cheng2', u'技': u'ji4', u'抁': u'yan3', u'抂': u'kuang2', u'抃': u'pin1', u'抄': u'chao1', u'抅': u'ju1', u'抆': u'ca1', u'抇': u'hu2', u'抈': u'yue4', u'抉': u'jue2', u'把': u'ba3', u'抋': u'qin4', u'抌': u'dan3', u'抍': u'zheng3', u'抎': u'yun3', u'抏': u'wan2', u'抐': u'ne4', u'抑': u'yi4', u'抒': u'shu1', u'抓': u'zhua1', u'抔': u'pou2', u'投': u'tou2', u'抖': u'dou3', u'抗': u'kang4', u'折': u'zhe2', u'抙': u'pou2', u'抚': u'fu3', u'抛': u'pao1', u'抜': u'ba', u'抝': u'ao3', u'択': u'ze', u'抟': u'tuan2', u'抠': u'kou1', u'抡': u'lun1', u'抢': u'qiang3', u'抣': u'yun', u'护': u'hu4', u'报': u'bao4', u'抦': u'bing3', u'抧': u'zhi3', u'抨': u'peng1', u'抩': u'nan2', u'抪': u'pu1', u'披': u'pi1', u'抬': u'tai2', u'抭': u'yao3', u'抮': u'zhen3', u'抯': u'zha1', u'抰': u'yang1', u'抱': u'bao4', u'抲': u'he1', u'抳': u'ni3', u'抴': u'ye4', u'抵': u'di3', u'抶': u'chi4', u'抷': u'pi1', u'抸': u'jia1', u'抹': u'mo3', u'抺': u'mei4', u'抻': u'chen1', u'押': u'ya1', u'抽': u'chou1', u'抾': u'qu1', u'抿': u'min3', u'拀': u'zhu4', u'拁': u'jia1', u'拂': u'fu2', u'拃': u'zha3', u'拄': u'zhu3', u'担': u'dan1', u'拆': u'chai1', u'拇': u'mu3', u'拈': u'nian1', u'拉': u'la1', u'拊': u'fu3', u'拋': u'pao1', u'拌': u'ban4', u'拍': u'pai1', u'拎': u'lin1', u'拏': u'na2', u'拐': u'guai3', u'拑': u'qian2', u'拒': u'ju4', u'拓': u'tuo4', u'拔': u'ba2', u'拕': u'tuo1', u'拖': u'tuo1', u'拗': u'niu4', u'拘': u'ju1', u'拙': u'zhuo1', u'拚': u'pin1', u'招': u'zhao1', u'拜': u'bai4', u'拝': u'bai4', u'拞': u'di3', u'拟': u'ni3', u'拠': u'ju4', u'拡': u'kuo4', u'拢': u'long3', u'拣': u'jian3', u'拤': u'qia2', u'拥': u'yong1', u'拦': u'lan2', u'拧': u'ning2', u'拨': u'bo1', u'择': u'ze2', u'拪': u'qian1', u'拫': u'hen2', u'括': u'kuo4', u'拭': u'shi4', u'拮': u'jie2', u'拯': u'zheng3', u'拰': u'nin3', u'拱': u'gong3', u'拲': u'gong3', u'拳': u'quan2', u'拴': u'shuan1', u'拵': u'cun2', u'拶': u'za1', u'拷': u'kao3', u'拸': u'yi2', u'拹': u'xie2', u'拺': u'ce4', u'拻': u'hui1', u'拼': u'pin1', u'拽': u'zhuai4', u'拾': u'shi2', u'拿': u'na2', u'挀': u'bai1', u'持': u'chi2', u'挂': u'gua4', u'挃': u'zhi4', u'挄': u'kuo4', u'挅': u'duo4', u'挆': u'duo3', u'指': u'zhi3', u'挈': u'qie4', u'按': u'an4', u'挊': u'nong4', u'挋': u'zhen4', u'挌': u'ge2', u'挍': u'jiao4', u'挎': u'kua4', u'挏': u'dong4', u'挐': u'na2', u'挑': u'tiao1', u'挒': u'lie4', u'挓': u'zha1', u'挔': u'lv3', u'挕': u'die2', u'挖': u'wa1', u'挗': u'jue2', u'挘': u'lieri', u'挙': u'ju3', u'挚': u'zhi4', u'挛': u'luan2', u'挜': u'ya4', u'挝': u'wo1', u'挞': u'ta4', u'挟': u'xie2', u'挠': u'nao2', u'挡': u'dang3', u'挢': u'jia3', u'挣': u'zheng4', u'挤': u'ji3', u'挥': u'hui1', u'挦': u'xian2', u'挧': u'yu3', u'挨': u'ai1', u'挩': u'tuo1', u'挪': u'nuo2', u'挫': u'cuo4', u'挬': u'bo2', u'挭': u'geng3', u'挮': u'ti3', u'振': u'zhen4', u'挰': u'cheng2', u'挱': u'sha1', u'挲': u'suo1', u'挳': u'keng1', u'挴': u'mei3', u'挵': u'nong4', u'挶': u'ju2', u'挷': u'bang4', u'挸': u'jian3', u'挹': u'yi4', u'挺': u'ting3', u'挻': u'shan1', u'挼': u'ruo2', u'挽': u'wan3', u'挾': u'xie2', u'挿': u'cha1', u'捀': u'peng2', u'捁': u'jiao3', u'捂': u'wu3', u'捃': u'jun4', u'捄': u'jiu4', u'捅': u'tong3', u'捆': u'kun3', u'捇': u'huo4', u'捈': u'tu2', u'捉': u'zhuo1', u'捊': u'pou2', u'捋': u'lv3', u'捌': u'ba1', u'捍': u'han4', u'捎': u'shao1', u'捏': u'nie1', u'捐': u'juan1', u'捑': u'ze4', u'捒': u'shu4', u'捓': u'ye2', u'捔': u'jue2', u'捕': u'bu3', u'捖': u'wan2', u'捗': u'bu4', u'捘': u'zun4', u'捙': u'ye4', u'捚': u'zhai1', u'捛': u'lv3', u'捜': u'sou1', u'捝': u'tuo1', u'捞': u'lao1', u'损': u'sun3', u'捠': u'bang1', u'捡': u'jian3', u'换': u'huan4', u'捣': u'dao3', u'捤': u'wei', u'捥': u'wan4', u'捦': u'qin2', u'捧': u'peng3', u'捨': u'she3', u'捩': u'lie4', u'捪': u'min2', u'捫': u'men2', u'捬': u'fu3', u'捭': u'bai3', u'据': u'ju4', u'捯': u'dao2', u'捰': u'wo3', u'捱': u'ai2', u'捲': u'juan3', u'捳': u'yue4', u'捴': u'zong3', u'捵': u'chen1', u'捶': u'chui2', u'捷': u'jie2', u'捸': u'tu1', u'捹': u'ben4', u'捺': u'na4', u'捻': u'nian3', u'捼': u'ruo2', u'捽': u'zuo2', u'捾': u'wo4', u'捿': u'qi1', u'掀': u'xian1', u'掁': u'cheng2', u'掂': u'dian1', u'掃': u'sao3', u'掄': u'lun1', u'掅': u'qing4', u'掆': u'gang1', u'掇': u'duo1', u'授': u'shou4', u'掉': u'diao4', u'掊': u'pou2', u'掋': u'di3', u'掌': u'zhang3', u'掍': u'hun4', u'掎': u'ji3', u'掏': u'tao1', u'掐': u'qia1', u'掑': u'qi2', u'排': u'pai2', u'掓': u'shu1', u'掔': u'qian1', u'掕': u'ling2', u'掖': u'ye1', u'掗': u'ya4', u'掘': u'jue2', u'掙': u'zheng4', u'掚': u'liang3', u'掛': u'gua4', u'掜': u'ni3', u'掝': u'huo4', u'掞': u'shan4', u'掟': u'zheng3', u'掠': u'lue4', u'採': u'cai3', u'探': u'tan4', u'掣': u'che4', u'掤': u'bing1', u'接': u'jie1', u'掦': u'ti4', u'控': u'kong4', u'推': u'tui1', u'掩': u'yan3', u'措': u'cuo4', u'掫': u'zou1', u'掬': u'ju1', u'掭': u'tian4', u'掮': u'qian2', u'掯': u'ken4', u'掰': u'bai1', u'掱': u'pa2', u'掲': u'jie1', u'掳': u'lu3', u'掴': u'guo2', u'掵': u'ming', u'掶': u'jie2', u'掷': u'zhi4', u'掸': u'dan3', u'掹': u'meng1', u'掺': u'chan1', u'掻': u'sao1', u'掼': u'guan4', u'掽': u'peng4', u'掾': u'yuan4', u'掿': u'nuo4', u'揀': u'jian3', u'揁': u'zheng1', u'揂': u'jiu1', u'揃': u'jian3', u'揄': u'yu2', u'揅': u'yan2', u'揆': u'kui2', u'揇': u'nan3', u'揈': u'hong1', u'揉': u'rou2', u'揊': u'pi4', u'揋': u'wei1', u'揌': u'sai1', u'揍': u'zou4', u'揎': u'xuan1', u'描': u'miao2', u'提': u'ti2', u'揑': u'nie1', u'插': u'cha1', u'揓': u'shi4', u'揔': u'zong3', u'揕': u'zhen4', u'揖': u'yi1', u'揗': u'xun2', u'揘': u'huang2', u'揙': u'bian4', u'揚': u'yang2', u'換': u'huan4', u'揜': u'yan3', u'揝': u'zan3', u'揞': u'an3', u'揟': u'xu1', u'揠': u'ya4', u'握': u'wo4', u'揢': u'ke2', u'揣': u'chuai1', u'揤': u'ji2', u'揥': u'di4', u'揦': u'la2', u'揧': u'la4', u'揨': u'cheng2', u'揩': u'kai1', u'揪': u'jiu1', u'揫': u'jiu1', u'揬': u'tu2', u'揭': u'jie1', u'揮': u'hui1', u'揯': u'gen4', u'揰': u'chong4', u'揱': u'xiao1', u'揲': u'die2', u'揳': u'xie1', u'援': u'yuan2', u'揵': u'qian2', u'揶': u'ye2', u'揷': u'cha1', u'揸': u'zha1', u'揹': u'bei4', u'揺': u'yao2', u'揻': u'wei1', u'揼': u'beng4', u'揽': u'lan3', u'揾': u'wen4', u'揿': u'qin4', u'搀': u'chan1', u'搁': u'ge1', u'搂': u'lou3', u'搃': u'zong3', u'搄': u'gen4', u'搅': u'jiao3', u'搆': u'gou4', u'搇': u'qin4', u'搈': u'rong2', u'搉': u'que4', u'搊': u'chou1', u'搋': u'chuai1', u'搌': u'zhan3', u'損': u'sun3', u'搎': u'sun1', u'搏': u'bo2', u'搐': u'chu4', u'搑': u'rong2', u'搒': u'bang4', u'搓': u'cuo1', u'搔': u'sao1', u'搕': u'ke1', u'搖': u'yao2', u'搗': u'dao3', u'搘': u'zhi1', u'搙': u'nu4', u'搚': u'la1', u'搛': u'jian1', u'搜': u'sou1', u'搝': u'qiu3', u'搞': u'gao3', u'搟': u'gan3', u'搠': u'shuo4', u'搡': u'sang3', u'搢': u'jin4', u'搣': u'mie4', u'搤': u'e4', u'搥': u'chui2', u'搦': u'nuo4', u'搧': u'shan1', u'搨': u'ta4', u'搩': u'jie2', u'搪': u'tang2', u'搫': u'pan2', u'搬': u'ban1', u'搭': u'da1', u'搮': u'li4', u'搯': u'tao1', u'搰': u'hu2', u'搱': u'zhi4', u'搲': u'wa1', u'搳': u'hua2', u'搴': u'qian1', u'搵': u'wen4', u'搶': u'qiang3', u'搷': u'tian2', u'搸': u'zhen1', u'搹': u'e4', u'携': u'xie2', u'搻': u'na2', u'搼': u'quan2', u'搽': u'cha2', u'搾': u'zha4', u'搿': u'ge2', u'摀': u'wu3', u'摁': u'en4', u'摂': u'she4', u'摃': u'gang1', u'摄': u'she4', u'摅': u'shu1', u'摆': u'bai3', u'摇': u'yao2', u'摈': u'bin4', u'摉': u'sou1', u'摊': u'tan1', u'摋': u'sa4', u'摌': u'chan3', u'摍': u'suo1', u'摎': u'jiu1', u'摏': u'chong1', u'摐': u'chuang1', u'摑': u'guo2', u'摒': u'bing4', u'摓': u'feng2', u'摔': u'shuai1', u'摕': u'di4', u'摖': u'qi4', u'摗': u'sou1', u'摘': u'zhai1', u'摙': u'lian3', u'摚': u'cheng1', u'摛': u'chi1', u'摜': u'guan4', u'摝': u'lu4', u'摞': u'luo4', u'摟': u'lou3', u'摠': u'zong3', u'摡': u'gai4', u'摢': u'hu4', u'摣': u'zha1', u'摤': u'qiang1', u'摥': u'tang4', u'摦': u'hua4', u'摧': u'cui1', u'摨': u'zhi4', u'摩': u'mo2', u'摪': u'jiang1', u'摫': u'gui1', u'摬': u'ying3', u'摭': u'zhi2', u'摮': u'qiao4', u'摯': u'zhi4', u'摰': u'nie4', u'摱': u'man2', u'摲': u'chan4', u'摳': u'kou1', u'摴': u'chu1', u'摵': u'se4', u'摶': u'tuan2', u'摷': u'jiao3', u'摸': u'mo1', u'摹': u'mo2', u'摺': u'zhe2', u'摻': u'chan1', u'摼': u'keng1', u'摽': u'biao1', u'摾': u'jiang4', u'摿': u'yao2', u'撀': u'gou4', u'撁': u'qian1', u'撂': u'liao4', u'撃': u'ji1', u'撄': u'ying1', u'撅': u'jue1', u'撆': u'pie1', u'撇': u'pie1', u'撈': u'lao1', u'撉': u'dun1', u'撊': u'xian4', u'撋': u'ruan2', u'撌': u'gui4', u'撍': u'zan3', u'撎': u'yi1', u'撏': u'xian2', u'撐': u'cheng1', u'撑': u'cheng1', u'撒': u'sa3', u'撓': u'nao2', u'撔': u'hong4', u'撕': u'si1', u'撖': u'han4', u'撗': u'heng2', u'撘': u'da1', u'撙': u'zun3', u'撚': u'nian3', u'撛': u'lin3', u'撜': u'zheng3', u'撝': u'hui1', u'撞': u'zhuang4', u'撟': u'jia3', u'撠': u'ji3', u'撡': u'cao1', u'撢': u'dan3', u'撣': u'dan3', u'撤': u'che4', u'撥': u'bo1', u'撦': u'che3', u'撧': u'jue1', u'撨': u'xiao1', u'撩': u'liao1', u'撪': u'ben4', u'撫': u'fu3', u'撬': u'qiao4', u'播': u'bo1', u'撮': u'cuo1', u'撯': u'zhuo2', u'撰': u'zhuan4', u'撱': u'wei3', u'撲': u'pu1', u'撳': u'qin4', u'撴': u'dun1', u'撵': u'nian3', u'撶': u'hua2', u'撷': u'xie2', u'撸': u'lu1', u'撹': u'jiao3', u'撺': u'cuan1', u'撻': u'ta4', u'撼': u'han4', u'撽': u'qiao4', u'撾': u'wo1', u'撿': u'jian3', u'擀': u'gan3', u'擁': u'yong1', u'擂': u'lei1', u'擃': u'nang3', u'擄': u'lu3', u'擅': u'shan4', u'擆': u'zhuo2', u'擇': u'ze2', u'擈': u'pu3', u'擉': u'chuo4', u'擊': u'ji1', u'擋': u'dang3', u'擌': u'se4', u'操': u'cao1', u'擎': u'qing2', u'擏': u'qing2', u'擐': u'huan4', u'擑': u'jie1', u'擒': u'qin2', u'擓': u'kuai3', u'擔': u'dan1', u'擕': u'xie2', u'擖': u'qia1', u'擗': u'pi3', u'擘': u'bo4', u'擙': u'ao4', u'據': u'ju4', u'擛': u'ye4', u'擜': u'e4', u'擝': u'meng1', u'擞': u'sou3', u'擟': u'mi2', u'擠': u'ji3', u'擡': u'tai2', u'擢': u'zhuo2', u'擣': u'dao3', u'擤': u'xing3', u'擥': u'lan3', u'擦': u'ca1', u'擧': u'ju3', u'擨': u'ye1', u'擩': u'ru3', u'擪': u'ye4', u'擫': u'ye4', u'擬': u'ni3', u'擭': u'huo4', u'擮': u'huo4', u'擯': u'bin4', u'擰': u'ning2', u'擱': u'ge1', u'擲': u'zhi4', u'擳': u'zhi4', u'擴': u'kuo4', u'擵': u'mo2', u'擶': u'jian4', u'擷': u'xie2', u'擸': u'lie4', u'擹': u'tan1', u'擺': u'bai3', u'擻': u'sou3', u'擼': u'lu1', u'擽': u'li4', u'擾': u'rao3', u'擿': u'ti1', u'攀': u'pan1', u'攁': u'yang3', u'攂': u'lei4', u'攃': u'ca1', u'攄': u'shu1', u'攅': u'cuan2', u'攆': u'nian3', u'攇': u'xian3', u'攈': u'jun4', u'攉': u'huo1', u'攊': u'li4', u'攋': u'la4', u'攌': u'huan4', u'攍': u'ying2', u'攎': u'lu2', u'攏': u'long3', u'攐': u'qian1', u'攑': u'qian1', u'攒': u'zan3', u'攓': u'qian1', u'攔': u'lan2', u'攕': u'xian1', u'攖': u'ying1', u'攗': u'mei2', u'攘': u'rang3', u'攙': u'chan1', u'攚': u'weng3', u'攛': u'cuan1', u'攜': u'xie2', u'攝': u'she4', u'攞': u'luo2', u'攟': u'jun4', u'攠': u'mi2', u'攡': u'chi1', u'攢': u'zan3', u'攣': u'luan2', u'攤': u'tan1', u'攥': u'zuan4', u'攦': u'li4', u'攧': u'dian1', u'攨': u'wa1', u'攩': u'dang3', u'攪': u'jiao3', u'攫': u'jue2', u'攬': u'lan3', u'攭': u'li4', u'攮': u'nang3', u'支': u'zhi1', u'攰': u'gui4', u'攱': u'gui3', u'攲': u'qi1', u'攳': u'xun2', u'攴': u'po1', u'攵': u'pu1', u'收': u'shou1', u'攷': u'kao3', u'攸': u'you1', u'改': u'gai3', u'攺': u'yi3', u'攻': u'gong1', u'攼': u'gan1', u'攽': u'ban1', u'放': u'fang4', u'政': u'zheng4', u'敀': u'po4', u'敁': u'dian1', u'敂': u'kou4', u'敃': u'min3', u'敄': u'wu4', u'故': u'gu4', u'敆': u'he2', u'敇': u'ce4', u'效': u'xiao4', u'敉': u'mi3', u'敊': u'chu4', u'敋': u'ge2', u'敌': u'di2', u'敍': u'xu4', u'敎': u'jiao4', u'敏': u'min3', u'敐': u'chen2', u'救': u'jiu4', u'敒': u'shen1', u'敓': u'duo2', u'敔': u'yu3', u'敕': u'chi4', u'敖': u'ao2', u'敗': u'bai4', u'敘': u'xu4', u'教': u'jiao4', u'敚': u'duo2', u'敛': u'lian3', u'敜': u'nie4', u'敝': u'bi4', u'敞': u'chang3', u'敟': u'dian3', u'敠': u'duo1', u'敡': u'yi4', u'敢': u'gan3', u'散': u'san4', u'敤': u'ke3', u'敥': u'yan4', u'敦': u'dun1', u'敧': u'qi1', u'敨': u'tou3', u'敩': u'xiao4', u'敪': u'duo1', u'敫': u'jiao3', u'敬': u'jing4', u'敭': u'yang2', u'敮': u'xia2', u'敯': u'min3', u'数': u'shu4', u'敱': u'ai2', u'敲': u'qiao1', u'敳': u'ai2', u'整': u'zheng3', u'敵': u'di2', u'敶': u'chen2', u'敷': u'fu1', u'數': u'shu4', u'敹': u'liao2', u'敺': u'qu1', u'敻': u'xiong4', u'敼': u'yi3', u'敽': u'jiao3', u'敾': u'shan4', u'敿': u'jiao3', u'斀': u'jiao3', u'斁': u'du4', u'斂': u'lian3', u'斃': u'bi4', u'斄': u'li2', u'斅': u'xiao4', u'斆': u'xiao4', u'文': u'wen2', u'斈': u'xue2', u'斉': u'qi2', u'斊': u'qi2', u'斋': u'zhai1', u'斌': u'bin1', u'斍': u'jue2', u'斎': u'zhai1', u'斏': u'lang2', u'斐': u'fei3', u'斑': u'ban1', u'斒': u'ban1', u'斓': u'lan2', u'斔': u'yu3', u'斕': u'lan2', u'斖': u'wei3', u'斗': u'dou4', u'斘': u'sheng1', u'料': u'liao4', u'斚': u'jia3', u'斛': u'hu2', u'斜': u'xie2', u'斝': u'jia3', u'斞': u'yu3', u'斟': u'zhen1', u'斠': u'jiao4', u'斡': u'wo4', u'斢': u'tiao3', u'斣': u'dou4', u'斤': u'jin1', u'斥': u'chi4', u'斦': u'yin2', u'斧': u'fu3', u'斨': u'qiang1', u'斩': u'zhan3', u'斪': u'qu2', u'斫': u'zhuo2', u'斬': u'zhan3', u'断': u'duan4', u'斮': u'zhuo2', u'斯': u'si1', u'新': u'xin1', u'斱': u'zhuo2', u'斲': u'zhuo2', u'斳': u'qin2', u'斴': u'lin2', u'斵': u'zhuo2', u'斶': u'chu4', u'斷': u'duan4', u'斸': u'zhu2', u'方': u'fang1', u'斺': u'chan3', u'斻': u'hang2', u'於': u'yu2', u'施': u'shi1', u'斾': u'pei4', u'斿': u'liu2', u'旀': u'mie', u'旁': u'pang2', u'旂': u'qi2', u'旃': u'zhan1', u'旄': u'mao2', u'旅': u'lv3', u'旆': u'pei4', u'旇': u'pi1', u'旈': u'liu2', u'旉': u'fu1', u'旊': u'fang3', u'旋': u'xuan2', u'旌': u'jing1', u'旍': u'jing1', u'旎': u'ni3', u'族': u'zu2', u'旐': u'zhao4', u'旑': u'yi3', u'旒': u'liu2', u'旓': u'shao1', u'旔': u'jian4', u'旕': u'osi', u'旖': u'yi3', u'旗': u'qi2', u'旘': u'zhi4', u'旙': u'fan1', u'旚': u'piao1', u'旛': u'fan1', u'旜': u'zhan1', u'旝': u'kuai4', u'旞': u'kuai4', u'旟': u'yu2', u'无': u'wu2', u'旡': u'ji4', u'既': u'ji4', u'旣': u'ji4', u'旤': u'huo4', u'日': u'ri4', u'旦': u'dan4', u'旧': u'jiu4', u'旨': u'zhi3', u'早': u'zao3', u'旪': u'xie2', u'旫': u'tiao1', u'旬': u'xun2', u'旭': u'xu4', u'旮': u'ga1', u'旯': u'la2', u'旰': u'gan4', u'旱': u'han4', u'旲': u'tai2', u'旳': u'di4', u'旴': u'xu4', u'旵': u'chan3', u'时': u'shi2', u'旷': u'kuang4', u'旸': u'yang2', u'旹': u'shi2', u'旺': u'wang4', u'旻': u'min2', u'旼': u'min2', u'旽': u'tun1', u'旾': u'chun1', u'旿': u'wu4', u'昀': u'yun2', u'昁': u'bei4', u'昂': u'ang2', u'昃': u'ze4', u'昄': u'ban3', u'昅': u'jie2', u'昆': u'kun1', u'昇': u'sheng1', u'昈': u'hu4', u'昉': u'fang3', u'昊': u'hao4', u'昋': u'gui4', u'昌': u'chang1', u'昍': u'xuan1', u'明': u'ming2', u'昏': u'hun1', u'昐': u'fen1', u'昑': u'qin3', u'昒': u'hu1', u'易': u'yi4', u'昔': u'xi1', u'昕': u'xin1', u'昖': u'yan2', u'昗': u'ze4', u'昘': u'fang3', u'昙': u'tan2', u'昚': u'shen4', u'昛': u'ju4', u'昜': u'yang2', u'昝': u'zan3', u'昞': u'bing3', u'星': u'xing1', u'映': u'ying4', u'昡': u'xuan4', u'昢': u'po4', u'昣': u'zhen3', u'昤': u'ling2', u'春': u'chun1', u'昦': u'hao4', u'昧': u'mei4', u'昨': u'zuo2', u'昩': u'mo4', u'昪': u'bian4', u'昫': u'xu4', u'昬': u'hun1', u'昭': u'zhao1', u'昮': u'zong4', u'是': u'shi4', u'昰': u'shi4', u'昱': u'yu4', u'昲': u'fei4', u'昳': u'die2', u'昴': u'mao3', u'昵': u'ni4', u'昶': u'chang3', u'昷': u'wen1', u'昸': u'dong1', u'昹': u'ai3', u'昺': u'bing3', u'昻': u'ang2', u'昼': u'zhou4', u'昽': u'long2', u'显': u'xian3', u'昿': u'kuang4', u'晀': u'tiao3', u'晁': u'chao2', u'時': u'shi2', u'晃': u'huang4', u'晄': u'huang3', u'晅': u'xuan3', u'晆': u'kui2', u'晇': u'xu4', u'晈': u'jiao3', u'晉': u'jin4', u'晊': u'zhi4', u'晋': u'jin4', u'晌': u'shang3', u'晍': u'tong2', u'晎': u'hong3', u'晏': u'yan4', u'晐': u'gai1', u'晑': u'xiang3', u'晒': u'shai4', u'晓': u'xiao3', u'晔': u'ye4', u'晕': u'yun1', u'晖': u'hui1', u'晗': u'han2', u'晘': u'han4', u'晙': u'jun4', u'晚': u'wan3', u'晛': u'xian4', u'晜': u'kun1', u'晝': u'zhou4', u'晞': u'xi1', u'晟': u'sheng4', u'晠': u'sheng4', u'晡': u'bu1', u'晢': u'zhe2', u'晣': u'zhe2', u'晤': u'wu4', u'晥': u'wan3', u'晦': u'hui4', u'晧': u'hao4', u'晨': u'chen2', u'晩': u'wan3', u'晪': u'tian3', u'晫': u'zhuo2', u'晬': u'zui4', u'晭': u'zhou3', u'普': u'pu3', u'景': u'jing3', u'晰': u'xi1', u'晱': u'shan3', u'晲': u'ni3', u'晳': u'xi1', u'晴': u'qing2', u'晵': u'qi3', u'晶': u'jing1', u'晷': u'gui3', u'晸': u'zheng3', u'晹': u'yi4', u'智': u'zhi4', u'晻': u'an3', u'晼': u'wan3', u'晽': u'lin2', u'晾': u'liang4', u'晿': u'cheng1', u'暀': u'wang3', u'暁': u'xiao3', u'暂': u'zan4', u'暃': u'fei1', u'暄': u'xuan1', u'暅': u'geng4', u'暆': u'yi2', u'暇': u'xia2', u'暈': u'yun1', u'暉': u'hui1', u'暊': u'xu3', u'暋': u'min3', u'暌': u'kui2', u'暍': u'ye1', u'暎': u'ying4', u'暏': u'shu3', u'暐': u'wei3', u'暑': u'shu3', u'暒': u'qing2', u'暓': u'mao4', u'暔': u'nan2', u'暕': u'jian2', u'暖': u'nuan3', u'暗': u'an4', u'暘': u'yang2', u'暙': u'chun1', u'暚': u'yao2', u'暛': u'suo3', u'暜': u'pu3', u'暝': u'ming2', u'暞': u'jiao3', u'暟': u'kai3', u'暠': u'gao3', u'暡': u'weng3', u'暢': u'chang4', u'暣': u'qi4', u'暤': u'hao4', u'暥': u'yan4', u'暦': u'li4', u'暧': u'ai4', u'暨': u'ji4', u'暩': u'ji4', u'暪': u'men4', u'暫': u'zan4', u'暬': u'xie4', u'暭': u'hao4', u'暮': u'mu4', u'暯': u'mu4', u'暰': u'cong1', u'暱': u'ni4', u'暲': u'zhang1', u'暳': u'hui4', u'暴': u'bao4', u'暵': u'han4', u'暶': u'xuan2', u'暷': u'chuan2', u'暸': u'le', u'暹': u'xian1', u'暺': u'tan3', u'暻': u'jing3', u'暼': u'pie1', u'暽': u'lin2', u'暾': u'tun1', u'暿': u'xi1', u'曀': u'yi4', u'曁': u'ji4', u'曂': u'huang4', u'曃': u'dai4', u'曄': u'ye4', u'曅': u'ye4', u'曆': u'li4', u'曇': u'tan2', u'曈': u'tong2', u'曉': u'xiao3', u'曊': u'fei4', u'曋': u'shen3', u'曌': u'zhao4', u'曍': u'hao4', u'曎': u'yi4', u'曏': u'xiang4', u'曐': u'xing1', u'曑': u'shen1', u'曒': u'jiao3', u'曓': u'bao4', u'曔': u'jing4', u'曕': u'yan4', u'曖': u'ai4', u'曗': u'ye4', u'曘': u'ru2', u'曙': u'shu3', u'曚': u'meng2', u'曛': u'xun1', u'曜': u'yao4', u'曝': u'bao4', u'曞': u'li4', u'曟': u'chen2', u'曠': u'kuang4', u'曡': u'die2', u'曢': u'liao3', u'曣': u'yan4', u'曤': u'huo4', u'曥': u'lu2', u'曦': u'xi1', u'曧': u'rong2', u'曨': u'long2', u'曩': u'nang3', u'曪': u'luo3', u'曫': u'luan2', u'曬': u'shai4', u'曭': u'tang3', u'曮': u'yan3', u'曯': u'zhu2', u'曰': u'yue1', u'曱': u'yue1', u'曲': u'qu3', u'曳': u'ye4', u'更': u'geng4', u'曵': u'ye4', u'曶': u'hu1', u'曷': u'he2', u'書': u'shu1', u'曹': u'cao2', u'曺': u'cao2', u'曻': u'sheng', u'曼': u'man4', u'曽': u'zeng1', u'曾': u'ceng2', u'替': u'ti4', u'最': u'zui4', u'朁': u'can3', u'朂': u'xu4', u'會': u'hui4', u'朄': u'yin3', u'朅': u'qie4', u'朆': u'fen1', u'朇': u'bi4', u'月': u'yue4', u'有': u'you3', u'朊': u'ruan3', u'朋': u'peng2', u'朌': u'fen2', u'服': u'fu2', u'朎': u'ling2', u'朏': u'fei3', u'朐': u'qu2', u'朑': u'ti4', u'朒': u'nv4', u'朓': u'tiao3', u'朔': u'shuo4', u'朕': u'zhen4', u'朖': u'lang3', u'朗': u'lang3', u'朘': u'juan1', u'朙': u'ming2', u'朚': u'huang1', u'望': u'wang4', u'朜': u'tun1', u'朝': u'chao2', u'朞': u'ji1', u'期': u'qi1', u'朠': u'ying1', u'朡': u'zong1', u'朢': u'wang4', u'朣': u'tong2', u'朤': u'lang3', u'朥': u'lao', u'朦': u'meng2', u'朧': u'long2', u'木': u'mu4', u'朩': u'pin', u'未': u'wei4', u'末': u'mo4', u'本': u'ben3', u'札': u'zha2', u'朮': u'shu4', u'术': u'shu4', u'朰': u'tewule', u'朱': u'zhu1', u'朲': u'ren2', u'朳': u'ba1', u'朴': u'pu3', u'朵': u'duo3', u'朶': u'duo3', u'朷': u'dao1', u'朸': u'li4', u'朹': u'qiu2', u'机': u'ji1', u'朻': u'jiu1', u'朼': u'bi3', u'朽': u'xiu3', u'朾': u'cheng2', u'朿': u'ci4', u'杀': u'sha1', u'杁': u'ru', u'杂': u'za2', u'权': u'quan2', u'杄': u'qian1', u'杅': u'yu2', u'杆': u'gan3', u'杇': u'wu1', u'杈': u'cha4', u'杉': u'shan1', u'杊': u'xun2', u'杋': u'fan2', u'杌': u'wu4', u'杍': u'zi3', u'李': u'li3', u'杏': u'xing4', u'材': u'cai2', u'村': u'cun1', u'杒': u'ren4', u'杓': u'shao2', u'杔': u'tuo1', u'杕': u'di4', u'杖': u'zhang4', u'杗': u'mang2', u'杘': u'chi4', u'杙': u'yi4', u'杚': u'gu1', u'杛': u'gong1', u'杜': u'du4', u'杝': u'yi2', u'杞': u'qi3', u'束': u'shu4', u'杠': u'gang4', u'条': u'tiao2', u'杢': u'jie2', u'杣': u'mian2', u'杤': u'wan', u'来': u'lai2', u'杦': u'jiu', u'杧': u'mang2', u'杨': u'yang2', u'杩': u'ma4', u'杪': u'miao3', u'杫': u'si4', u'杬': u'yuan2', u'杭': u'hang2', u'杮': u'fei4', u'杯': u'bei1', u'杰': u'jie2', u'東': u'dong1', u'杲': u'gao3', u'杳': u'yao3', u'杴': u'xian1', u'杵': u'chu3', u'杶': u'chun1', u'杷': u'pa2', u'杸': u'shu1', u'杹': u'hua4', u'杺': u'xin1', u'杻': u'chou3', u'杼': u'zhu4', u'杽': u'chou3', u'松': u'song1', u'板': u'ban3', u'枀': u'song1', u'极': u'ji2', u'枂': u'wo4', u'枃': u'jin4', u'构': u'gou4', u'枅': u'ji1', u'枆': u'mao2', u'枇': u'pi2', u'枈': u'pi1', u'枉': u'wang3', u'枊': u'ang4', u'枋': u'fang1', u'枌': u'fen2', u'枍': u'yi4', u'枎': u'fu2', u'枏': u'nan2', u'析': u'xi1', u'枑': u'hu4', u'枒': u'ya1', u'枓': u'dou3', u'枔': u'xin2', u'枕': u'zhen3', u'枖': u'yao3', u'林': u'lin2', u'枘': u'rui4', u'枙': u'zhi1', u'枚': u'mei2', u'枛': u'zhao4', u'果': u'guo3', u'枝': u'zhi1', u'枞': u'cong1', u'枟': u'yun4', u'枠': u'hua4', u'枡': u'sheng1', u'枢': u'shu1', u'枣': u'zao3', u'枤': u'di4', u'枥': u'li4', u'枦': u'lu2', u'枧': u'jian3', u'枨': u'cheng2', u'枩': u'song1', u'枪': u'qiang1', u'枫': u'feng1', u'枬': u'zhan1', u'枭': u'xiao1', u'枮': u'xian1', u'枯': u'ku1', u'枰': u'ping2', u'枱': u'si4', u'枲': u'xi3', u'枳': u'zhi3', u'枴': u'guai3', u'枵': u'xiao1', u'架': u'jia4', u'枷': u'jia1', u'枸': u'gou3', u'枹': u'bao1', u'枺': u'mo4', u'枻': u'yi4', u'枼': u'ye4', u'枽': u'ye4', u'枾': u'shi4', u'枿': u'nie4', u'柀': u'bi3', u'柁': u'duo4', u'柂': u'yi2', u'柃': u'ling2', u'柄': u'bing3', u'柅': u'ni3', u'柆': u'la1', u'柇': u'he2', u'柈': u'ban4', u'柉': u'fan2', u'柊': u'zhong1', u'柋': u'dai4', u'柌': u'ci2', u'柍': u'yang3', u'柎': u'fu1', u'柏': u'bai3', u'某': u'mou3', u'柑': u'gan1', u'柒': u'qi1', u'染': u'ran3', u'柔': u'rou2', u'柕': u'mao4', u'柖': u'shao2', u'柗': u'song1', u'柘': u'zhe4', u'柙': u'xia2', u'柚': u'you4', u'柛': u'shen1', u'柜': u'gui4', u'柝': u'tuo4', u'柞': u'zha4', u'柟': u'nan2', u'柠': u'ning2', u'柡': u'yong3', u'柢': u'di3', u'柣': u'zhi4', u'柤': u'zha1', u'查': u'cha2', u'柦': u'dan4', u'柧': u'gu1', u'柨': u'bu4', u'柩': u'jiu4', u'柪': u'ao1', u'柫': u'fu2', u'柬': u'jian3', u'柭': u'ba1', u'柮': u'duo4', u'柯': u'ke1', u'柰': u'nai4', u'柱': u'zhu4', u'柲': u'bi4', u'柳': u'liu3', u'柴': u'chai2', u'柵': u'shan1', u'柶': u'si4', u'柷': u'zhu4', u'柸': u'bei1', u'柹': u'shi4', u'柺': u'guai3', u'査': u'cha2', u'柼': u'yao3', u'柽': u'cheng1', u'柾': u'jiu4', u'柿': u'shi4', u'栀': u'zhi1', u'栁': u'liu3', u'栂': u'mei2', u'栃': u'li4', u'栄': u'rong2', u'栅': u'shan1', u'栆': u'zao', u'标': u'biao1', u'栈': u'zhan4', u'栉': u'zhi4', u'栊': u'long2', u'栋': u'dong4', u'栌': u'lu2', u'栍': u'saying', u'栎': u'li4', u'栏': u'lan2', u'栐': u'yong3', u'树': u'shu4', u'栒': u'xun2', u'栓': u'shuan1', u'栔': u'qi4', u'栕': u'chen2', u'栖': u'qi1', u'栗': u'li4', u'栘': u'yi2', u'栙': u'xiang2', u'栚': u'zhen4', u'栛': u'li4', u'栜': u'se4', u'栝': u'gua1', u'栞': u'kan1', u'栟': u'bing1', u'栠': u'ren3', u'校': u'xiao4', u'栢': u'bai3', u'栣': u'ren3', u'栤': u'bing4', u'栥': u'zi1', u'栦': u'chou2', u'栧': u'yi4', u'栨': u'yi4', u'栩': u'xu3', u'株': u'zhu1', u'栫': u'jian4', u'栬': u'zui4', u'栭': u'er2', u'栮': u'er3', u'栯': u'you3', u'栰': u'fa2', u'栱': u'gong3', u'栲': u'kao3', u'栳': u'lao3', u'栴': u'zhan1', u'栵': u'lie4', u'栶': u'yin1', u'样': u'yang4', u'核': u'he2', u'根': u'gen1', u'栺': u'zhi1', u'栻': u'shi4', u'格': u'ge2', u'栽': u'zai1', u'栾': u'luan2', u'栿': u'fu2', u'桀': u'jie2', u'桁': u'heng2', u'桂': u'gui4', u'桃': u'tao2', u'桄': u'guang1', u'桅': u'wei2', u'框': u'kuang1', u'桇': u'ru2', u'案': u'an4', u'桉': u'an1', u'桊': u'juan4', u'桋': u'yi2', u'桌': u'zhuo1', u'桍': u'ku1', u'桎': u'zhi4', u'桏': u'qiong2', u'桐': u'tong2', u'桑': u'sang1', u'桒': u'sang1', u'桓': u'huan2', u'桔': u'ju2', u'桕': u'jiu4', u'桖': u'xue4', u'桗': u'duo4', u'桘': u'chui2', u'桙': u'yu2', u'桚': u'za1', u'桛': u'sui', u'桜': u'ying', u'桝': u'jie', u'桞': u'liu3', u'桟': u'zhan4', u'桠': u'ya1', u'桡': u'rao2', u'桢': u'zhen1', u'档': u'dang4', u'桤': u'qi1', u'桥': u'qiao2', u'桦': u'hua4', u'桧': u'gui4', u'桨': u'jiang3', u'桩': u'zhuang1', u'桪': u'xun2', u'桫': u'suo1', u'桬': u'sha1', u'桭': u'chen2', u'桮': u'bei1', u'桯': u'ting1', u'桰': u'gua1', u'桱': u'jing4', u'桲': u'po', u'桳': u'ben4', u'桴': u'fu2', u'桵': u'rui3', u'桶': u'tong3', u'桷': u'jue2', u'桸': u'xi1', u'桹': u'lang2', u'桺': u'liu3', u'桻': u'feng1', u'桼': u'qi1', u'桽': u'wen3', u'桾': u'jun1', u'桿': u'gan3', u'梀': u'su4', u'梁': u'liang2', u'梂': u'qiu2', u'梃': u'ting3', u'梄': u'you3', u'梅': u'mei2', u'梆': u'bang1', u'梇': u'long4', u'梈': u'peng1', u'梉': u'zhuang1', u'梊': u'di4', u'梋': u'xuan1', u'梌': u'tu2', u'梍': u'zao4', u'梎': u'ao1', u'梏': u'gu4', u'梐': u'bi4', u'梑': u'di2', u'梒': u'han2', u'梓': u'zi3', u'梔': u'zhi1', u'梕': u'ren4', u'梖': u'bei4', u'梗': u'geng3', u'梘': u'jian3', u'梙': u'huan4', u'梚': u'wan3', u'梛': u'nuo2', u'梜': u'jia1', u'條': u'tiao2', u'梞': u'ji4', u'梟': u'xiao1', u'梠': u'lv3', u'梡': u'kuan3', u'梢': u'shao1', u'梣': u'cen2', u'梤': u'fen1', u'梥': u'song1', u'梦': u'meng4', u'梧': u'wu2', u'梨': u'li2', u'梩': u'si4', u'梪': u'dou4', u'梫': u'qin3', u'梬': u'ying3', u'梭': u'suo1', u'梮': u'ju1', u'梯': u'ti1', u'械': u'xie4', u'梱': u'kun3', u'梲': u'zhuo1', u'梳': u'shu1', u'梴': u'chan1', u'梵': u'fan4', u'梶': u'wei3', u'梷': u'jing4', u'梸': u'li2', u'梹': u'bin1', u'梺': u'xia', u'梻': u'ximi', u'梼': u'tao2', u'梽': u'zhi4', u'梾': u'lai2', u'梿': u'lian2', u'检': u'jian3', u'棁': u'zhuo1', u'棂': u'ling2', u'棃': u'li2', u'棄': u'qi4', u'棅': u'bing3', u'棆': u'lun2', u'棇': u'cong1', u'棈': u'qian4', u'棉': u'mian2', u'棊': u'qi2', u'棋': u'qi2', u'棌': u'cai3', u'棍': u'gun4', u'棎': u'chan2', u'棏': u'de2', u'棐': u'fei3', u'棑': u'pai2', u'棒': u'bang4', u'棓': u'bang4', u'棔': u'hun1', u'棕': u'zong1', u'棖': u'cheng2', u'棗': u'zao3', u'棘': u'ji2', u'棙': u'li4', u'棚': u'peng2', u'棛': u'yu4', u'棜': u'yu4', u'棝': u'gu4', u'棞': u'jun4', u'棟': u'dong4', u'棠': u'tang2', u'棡': u'gang1', u'棢': u'wang3', u'棣': u'di4', u'棤': u'que4', u'棥': u'fan2', u'棦': u'cheng1', u'棧': u'zhan4', u'棨': u'qi3', u'棩': u'yuan1', u'棪': u'yan3', u'棫': u'yu4', u'棬': u'quan1', u'棭': u'yi4', u'森': u'sen1', u'棯': u'shen1', u'棰': u'chui2', u'棱': u'leng2', u'棲': u'qi1', u'棳': u'zhuo1', u'棴': u'fu2', u'棵': u'ke1', u'棶': u'lai2', u'棷': u'zou1', u'棸': u'zou1', u'棹': u'zhao4', u'棺': u'guan1', u'棻': u'fen1', u'棼': u'fen2', u'棽': u'chen1', u'棾': u'qing2', u'棿': u'ni2', u'椀': u'wan3', u'椁': u'guo3', u'椂': u'lu4', u'椃': u'hao2', u'椄': u'jie1', u'椅': u'yi3', u'椆': u'chou2', u'椇': u'ju3', u'椈': u'ju2', u'椉': u'cheng2', u'椊': u'zu2', u'椋': u'liang2', u'椌': u'qiang1', u'植': u'zhi2', u'椎': u'zhui2', u'椏': u'ya1', u'椐': u'ju1', u'椑': u'bei1', u'椒': u'jiao1', u'椓': u'zhuo2', u'椔': u'zi1', u'椕': u'bin1', u'椖': u'peng2', u'椗': u'ding4', u'椘': u'chu3', u'椙': u'chang', u'椚': u'men', u'椛': u'hua', u'検': u'jian3', u'椝': u'gui1', u'椞': u'xi4', u'椟': u'du2', u'椠': u'qian4', u'椡': u'dao', u'椢': u'gui4', u'椣': u'dian', u'椤': u'luo2', u'椥': u'zhi1', u'椦': u'quan1', u'椧': u'mi', u'椨': u'fu', u'椩': u'geng', u'椪': u'peng4', u'椫': u'shan4', u'椬': u'yi2', u'椭': u'tuo3', u'椮': u'sen1', u'椯': u'duo3', u'椰': u'ye1', u'椱': u'fu4', u'椲': u'wei3', u'椳': u'wei1', u'椴': u'duan4', u'椵': u'jia3', u'椶': u'zong1', u'椷': u'jian1', u'椸': u'yi2', u'椹': u'shen4', u'椺': u'xi2', u'椻': u'yan4', u'椼': u'yan3', u'椽': u'chuan2', u'椾': u'jian1', u'椿': u'chun1', u'楀': u'yu3', u'楁': u'he2', u'楂': u'zha1', u'楃': u'wo4', u'楄': u'pian2', u'楅': u'bi1', u'楆': u'yao1', u'楇': u'guo1', u'楈': u'xu1', u'楉': u'ruo4', u'楊': u'yang2', u'楋': u'la4', u'楌': u'yan2', u'楍': u'ben3', u'楎': u'hui1', u'楏': u'kui2', u'楐': u'jie4', u'楑': u'kui2', u'楒': u'si1', u'楓': u'feng1', u'楔': u'xie1', u'楕': u'tuo3', u'楖': u'ji2', u'楗': u'jian4', u'楘': u'mu4', u'楙': u'mao2', u'楚': u'chu3', u'楛': u'hu4', u'楜': u'hu2', u'楝': u'lian4', u'楞': u'leng4', u'楟': u'ting2', u'楠': u'nan2', u'楡': u'yu2', u'楢': u'you2', u'楣': u'mei2', u'楤': u'cong1', u'楥': u'xuan4', u'楦': u'xuan4', u'楧': u'yang3', u'楨': u'zhen1', u'楩': u'pian2', u'楪': u'die2', u'楫': u'ji2', u'楬': u'jie2', u'業': u'ye4', u'楮': u'chu3', u'楯': u'dun4', u'楰': u'yu2', u'楱': u'cou4', u'楲': u'wei1', u'楳': u'mei2', u'楴': u'di4', u'極': u'ji2', u'楶': u'jie2', u'楷': u'kai3', u'楸': u'qiu1', u'楹': u'ying2', u'楺': u'rou2', u'楻': u'huang2', u'楼': u'lou2', u'楽': u'le4', u'楾': u'hanizawu', u'楿': u'tuila', u'榀': u'pin3', u'榁': u'mule', u'概': u'gai4', u'榃': u'tan2', u'榄': u'lan3', u'榅': u'wen1', u'榆': u'yu2', u'榇': u'chen4', u'榈': u'lv', u'榉': u'ju3', u'榊': u'shen', u'榋': u'chu', u'榌': u'bi1', u'榍': u'xie4', u'榎': u'jia3', u'榏': u'yi4', u'榐': u'zhan3', u'榑': u'fu2', u'榒': u'nuo4', u'榓': u'mi4', u'榔': u'lang2', u'榕': u'rong2', u'榖': u'gu3', u'榗': u'jian4', u'榘': u'ju4', u'榙': u'ta1', u'榚': u'yao3', u'榛': u'zhen1', u'榜': u'bang3', u'榝': u'sha1', u'榞': u'yuan2', u'榟': u'zi3', u'榠': u'ming2', u'榡': u'su4', u'榢': u'jia4', u'榣': u'yao2', u'榤': u'jie2', u'榥': u'huang4', u'榦': u'gan4', u'榧': u'fei3', u'榨': u'zha4', u'榩': u'qian2', u'榪': u'ma4', u'榫': u'sun3', u'榬': u'yuan2', u'榭': u'xie4', u'榮': u'rong2', u'榯': u'shi2', u'榰': u'zhi1', u'榱': u'cui1', u'榲': u'wen1', u'榳': u'ting2', u'榴': u'liu2', u'榵': u'rong2', u'榶': u'tang2', u'榷': u'que4', u'榸': u'zhai1', u'榹': u'si4', u'榺': u'sheng4', u'榻': u'ta4', u'榼': u'ke1', u'榽': u'xi1', u'榾': u'gu3', u'榿': u'qi1', u'槀': u'gao3', u'槁': u'gao3', u'槂': u'sun1', u'槃': u'pan2', u'槄': u'tao1', u'槅': u'ge2', u'槆': u'chun1', u'槇': u'dian1', u'槈': u'nou4', u'槉': u'ji2', u'槊': u'shuo4', u'構': u'gou4', u'槌': u'chui2', u'槍': u'qiang1', u'槎': u'cha2', u'槏': u'qian3', u'槐': u'huai2', u'槑': u'mei2', u'槒': u'xu4', u'槓': u'gang4', u'槔': u'gao1', u'槕': u'zhuo1', u'槖': u'tuo2', u'槗': u'qiao2', u'様': u'yang4', u'槙': u'dian1', u'槚': u'jia3', u'槛': u'kan3', u'槜': u'zui4', u'槝': u'dao', u'槞': u'long2', u'槟': u'bin1', u'槠': u'zhu1', u'槡': u'sang1', u'槢': u'xi2', u'槣': u'ji1', u'槤': u'lian2', u'槥': u'hui4', u'槦': u'rong2', u'槧': u'qian4', u'槨': u'guo3', u'槩': u'gai4', u'槪': u'gai4', u'槫': u'tuan2', u'槬': u'hua4', u'槭': u'qi4', u'槮': u'sen1', u'槯': u'cui1', u'槰': u'peng4', u'槱': u'you3', u'槲': u'hu2', u'槳': u'jiang3', u'槴': u'hu4', u'槵': u'huan4', u'槶': u'gui4', u'槷': u'nie4', u'槸': u'yi4', u'槹': u'gao1', u'槺': u'kang1', u'槻': u'gui1', u'槼': u'gui1', u'槽': u'cao2', u'槾': u'man4', u'槿': u'jin3', u'樀': u'di2', u'樁': u'zhuang1', u'樂': u'le4', u'樃': u'lang2', u'樄': u'chen2', u'樅': u'cong1', u'樆': u'li2', u'樇': u'xiu1', u'樈': u'qing2', u'樉': u'shang3', u'樊': u'fan2', u'樋': u'tong1', u'樌': u'guan4', u'樍': u'ze2', u'樎': u'su4', u'樏': u'lei2', u'樐': u'lu3', u'樑': u'liang2', u'樒': u'mi4', u'樓': u'lou2', u'樔': u'chao2', u'樕': u'su4', u'樖': u'ke1', u'樗': u'chu1', u'樘': u'tang2', u'標': u'biao1', u'樚': u'lu4', u'樛': u'jiu1', u'樜': u'zhe4', u'樝': u'zha1', u'樞': u'shu1', u'樟': u'zhang1', u'樠': u'man2', u'模': u'mo2', u'樢': u'niao3', u'樣': u'yang4', u'樤': u'tiao2', u'樥': u'peng2', u'樦': u'zhu4', u'樧': u'sha1', u'樨': u'xi1', u'権': u'quan2', u'横': u'heng2', u'樫': u'jian1', u'樬': u'cong1', u'樭': u'ji', u'樮': u'yan', u'樯': u'qiang2', u'樰': u'xue', u'樱': u'ying1', u'樲': u'er4', u'樳': u'xun2', u'樴': u'zhi2', u'樵': u'qiao2', u'樶': u'zui1', u'樷': u'cong2', u'樸': u'pu3', u'樹': u'shu4', u'樺': u'hua4', u'樻': u'gui4', u'樼': u'zhen1', u'樽': u'zun1', u'樾': u'yue4', u'樿': u'shan4', u'橀': u'xi1', u'橁': u'chun1', u'橂': u'dian4', u'橃': u'fa2', u'橄': u'gan3', u'橅': u'mo2', u'橆': u'wu2', u'橇': u'qiao1', u'橈': u'rao2', u'橉': u'lin4', u'橊': u'liu2', u'橋': u'qiao2', u'橌': u'xian4', u'橍': u'run4', u'橎': u'fan3', u'橏': u'zhan3', u'橐': u'tuo2', u'橑': u'liao2', u'橒': u'yun2', u'橓': u'shun4', u'橔': u'tui2', u'橕': u'cheng1', u'橖': u'tang2', u'橗': u'meng2', u'橘': u'ju2', u'橙': u'cheng2', u'橚': u'su4', u'橛': u'jue2', u'橜': u'jue2', u'橝': u'tan2', u'橞': u'hui4', u'機': u'ji1', u'橠': u'nuo2', u'橡': u'xiang4', u'橢': u'tuo3', u'橣': u'ning2', u'橤': u'rui3', u'橥': u'zhu1', u'橦': u'tong2', u'橧': u'zeng1', u'橨': u'fen2', u'橩': u'qiong2', u'橪': u'ran3', u'橫': u'heng2', u'橬': u'qian2', u'橭': u'gu1', u'橮': u'liu3', u'橯': u'lao4', u'橰': u'gao1', u'橱': u'chu2', u'橲': u'xi', u'橳': u'sheng', u'橴': u'za', u'橵': u'zan1', u'橶': u'ji3', u'橷': u'dou1', u'橸': u'jing', u'橹': u'lu3', u'橺': u'xian4', u'橻': u'cu1', u'橼': u'yuan2', u'橽': u'ta4', u'橾': u'shu1', u'橿': u'jiang1', u'檀': u'tan2', u'檁': u'lin3', u'檂': u'nong2', u'檃': u'yin3', u'檄': u'xi2', u'檅': u'hui4', u'檆': u'shan1', u'檇': u'zui4', u'檈': u'xuan2', u'檉': u'cheng1', u'檊': u'gan4', u'檋': u'ju1', u'檌': u'zui4', u'檍': u'yi4', u'檎': u'qin2', u'檏': u'pu3', u'檐': u'yan2', u'檑': u'lei2', u'檒': u'feng1', u'檓': u'hui3', u'檔': u'dang4', u'檕': u'ji4', u'檖': u'sui4', u'檗': u'bo4', u'檘': u'ping2', u'檙': u'cheng2', u'檚': u'chu3', u'檛': u'zhua1', u'檜': u'gui4', u'檝': u'ji2', u'檞': u'jie3', u'檟': u'jia3', u'檠': u'qing2', u'檡': u'zhai2', u'檢': u'jian3', u'檣': u'qiang2', u'檤': u'dao4', u'檥': u'yi1', u'檦': u'biao3', u'檧': u'song1', u'檨': u'she1', u'檩': u'lin3', u'檪': u'li4', u'檫': u'cha2', u'檬': u'meng2', u'檭': u'yin2', u'檮': u'chou2', u'檯': u'tai2', u'檰': u'mian2', u'檱': u'qi2', u'檲': u'tuan2', u'檳': u'bin1', u'檴': u'huo4', u'檵': u'ji4', u'檶': u'qian1', u'檷': u'ni4', u'檸': u'ning2', u'檹': u'yi1', u'檺': u'gao3', u'檻': u'kan3', u'檼': u'yin3', u'檽': u'nou4', u'檾': u'qing3', u'檿': u'yan3', u'櫀': u'qi2', u'櫁': u'mi4', u'櫂': u'zhao4', u'櫃': u'gui4', u'櫄': u'chun1', u'櫅': u'ji1', u'櫆': u'kui2', u'櫇': u'po2', u'櫈': u'deng4', u'櫉': u'chu2', u'櫊': u'ge', u'櫋': u'mian2', u'櫌': u'you1', u'櫍': u'zhi4', u'櫎': u'huang3', u'櫏': u'qian1', u'櫐': u'lei3', u'櫑': u'lei2', u'櫒': u'sa4', u'櫓': u'lu3', u'櫔': u'li4', u'櫕': u'cuan2', u'櫖': u'lv4', u'櫗': u'mie4', u'櫘': u'hui4', u'櫙': u'ou1', u'櫚': u'lv', u'櫛': u'zhi4', u'櫜': u'gao1', u'櫝': u'du2', u'櫞': u'yuan2', u'櫟': u'li4', u'櫠': u'fei4', u'櫡': u'zhuo2', u'櫢': u'sou3', u'櫣': u'lian2', u'櫤': u'jiang', u'櫥': u'chu2', u'櫦': u'qing', u'櫧': u'zhu1', u'櫨': u'lu2', u'櫩': u'yan2', u'櫪': u'li4', u'櫫': u'zhu1', u'櫬': u'chen4', u'櫭': u'jue2', u'櫮': u'e4', u'櫯': u'su1', u'櫰': u'huai2', u'櫱': u'nie4', u'櫲': u'yu4', u'櫳': u'long2', u'櫴': u'la4', u'櫵': u'qiao2', u'櫶': u'xian3', u'櫷': u'gui', u'櫸': u'ju3', u'櫹': u'xiao1', u'櫺': u'ling2', u'櫻': u'ying1', u'櫼': u'jian1', u'櫽': u'jin3', u'櫾': u'you4', u'櫿': u'ying2', u'欀': u'xiang1', u'欁': u'nong2', u'欂': u'bo2', u'欃': u'chan2', u'欄': u'lan2', u'欅': u'ju3', u'欆': u'shuang1', u'欇': u'she4', u'欈': u'wei2', u'欉': u'cong2', u'權': u'quan2', u'欋': u'qu2', u'欌': u'zang', u'欍': u'jiu', u'欎': u'yu4', u'欏': u'luo2', u'欐': u'li4', u'欑': u'cuan2', u'欒': u'luan2', u'欓': u'dang3', u'欔': u'qu2', u'欕': u'mi', u'欖': u'lan3', u'欗': u'lan2', u'欘': u'zhu2', u'欙': u'lei2', u'欚': u'li3', u'欛': u'ba4', u'欜': u'nang2', u'欝': u'yu4', u'欞': u'ling2', u'欟': u'guan4', u'欠': u'qian4', u'次': u'ci4', u'欢': u'huan1', u'欣': u'xin1', u'欤': u'yu2', u'欥': u'yu4', u'欦': u'qian1', u'欧': u'ou1', u'欨': u'xu1', u'欩': u'chao1', u'欪': u'chu4', u'欫': u'qi4', u'欬': u'kai4', u'欭': u'yi4', u'欮': u'jue2', u'欯': u'xi4', u'欰': u'xu4', u'欱': u'he1', u'欲': u'yu4', u'欳': u'kuai4', u'欴': u'lang2', u'欵': u'kuan3', u'欶': u'shuo4', u'欷': u'xi1', u'欸': u'ai3', u'欹': u'qi1', u'欺': u'qi1', u'欻': u'chua1', u'欼': u'chi3', u'欽': u'qin1', u'款': u'kuan3', u'欿': u'kan3', u'歀': u'kuan3', u'歁': u'kan3', u'歂': u'chuan3', u'歃': u'sha4', u'歄': u'gua1', u'歅': u'yan1', u'歆': u'xin1', u'歇': u'xie1', u'歈': u'yu2', u'歉': u'qian4', u'歊': u'xiao1', u'歋': u'ye1', u'歌': u'ge1', u'歍': u'wu1', u'歎': u'tan4', u'歏': u'jin4', u'歐': u'ou1', u'歑': u'hu1', u'歒': u'ti4', u'歓': u'huan1', u'歔': u'xu1', u'歕': u'pen1', u'歖': u'xi3', u'歗': u'xiao4', u'歘': u'xu1', u'歙': u'she4', u'歚': u'shan4', u'歛': u'lian3', u'歜': u'chu4', u'歝': u'yi4', u'歞': u'e4', u'歟': u'yu2', u'歠': u'chuo4', u'歡': u'huan1', u'止': u'zhi3', u'正': u'zheng4', u'此': u'ci3', u'步': u'bu4', u'武': u'wu3', u'歧': u'qi2', u'歨': u'bu4', u'歩': u'bu4', u'歪': u'wai1', u'歫': u'ju4', u'歬': u'qian2', u'歭': u'zhi4', u'歮': u'se4', u'歯': u'chi3', u'歰': u'se4', u'歱': u'zhong3', u'歲': u'sui4', u'歳': u'sui4', u'歴': u'li4', u'歵': u'ze2', u'歶': u'yu2', u'歷': u'li4', u'歸': u'gui1', u'歹': u'dai3', u'歺': u'dai3', u'死': u'si3', u'歼': u'jian1', u'歽': u'zhe2', u'歾': u'mo4', u'歿': u'mo4', u'殀': u'yao1', u'殁': u'mo4', u'殂': u'cu2', u'殃': u'yang1', u'殄': u'tian3', u'殅': u'sheng1', u'殆': u'dai4', u'殇': u'shang1', u'殈': u'xu4', u'殉': u'xun4', u'殊': u'shu1', u'残': u'can2', u'殌': u'jing3', u'殍': u'piao3', u'殎': u'qia4', u'殏': u'qiu2', u'殐': u'su4', u'殑': u'qing2', u'殒': u'yun3', u'殓': u'lian4', u'殔': u'yi4', u'殕': u'fou3', u'殖': u'zhi2', u'殗': u'ye4', u'殘': u'can2', u'殙': u'hun1', u'殚': u'dan1', u'殛': u'ji2', u'殜': u'die2', u'殝': u'zhen1', u'殞': u'yun3', u'殟': u'wen1', u'殠': u'chou4', u'殡': u'bin4', u'殢': u'ti4', u'殣': u'jin4', u'殤': u'shang1', u'殥': u'yin2', u'殦': u'chi1', u'殧': u'jiu4', u'殨': u'kui4', u'殩': u'cuan4', u'殪': u'yi4', u'殫': u'dan1', u'殬': u'du4', u'殭': u'jiang1', u'殮': u'lian4', u'殯': u'bin4', u'殰': u'du2', u'殱': u'jian1', u'殲': u'jian1', u'殳': u'shu1', u'殴': u'ou1', u'段': u'duan4', u'殶': u'zhu4', u'殷': u'yin1', u'殸': u'qing4', u'殹': u'yi4', u'殺': u'sha1', u'殻': u'ke2', u'殼': u'ke2', u'殽': u'xiao2', u'殾': u'xun4', u'殿': u'dian4', u'毀': u'hui3', u'毁': u'hui3', u'毂': u'gu1', u'毃': u'qiao1', u'毄': u'ji1', u'毅': u'yi4', u'毆': u'ou1', u'毇': u'hui3', u'毈': u'duan4', u'毉': u'yi1', u'毊': u'xiao1', u'毋': u'wu2', u'毌': u'wu2', u'母': u'mu3', u'毎': u'mei3', u'每': u'mei3', u'毐': u'ai3', u'毑': u'jie3', u'毒': u'du2', u'毓': u'yu4', u'比': u'bi3', u'毕': u'bi4', u'毖': u'bi4', u'毗': u'pi2', u'毘': u'pi2', u'毙': u'bi4', u'毚': u'chan2', u'毛': u'mao2', u'毜': u'hao4', u'毝': u'cai3', u'毞': u'bi3', u'毟': u'mao', u'毠': u'jia1', u'毡': u'zhan1', u'毢': u'sai1', u'毣': u'mu4', u'毤': u'tuo4', u'毥': u'xun2', u'毦': u'er3', u'毧': u'rong2', u'毨': u'xian3', u'毩': u'ju1', u'毪': u'mu2', u'毫': u'hao2', u'毬': u'qiu2', u'毭': u'dou4', u'毮': u'wu', u'毯': u'tan3', u'毰': u'pei2', u'毱': u'ju1', u'毲': u'duo1', u'毳': u'cui4', u'毴': u'bi1', u'毵': u'san1', u'毶': u'san1', u'毷': u'mao4', u'毸': u'sai1', u'毹': u'shu1', u'毺': u'shu1', u'毻': u'tuo4', u'毼': u'he2', u'毽': u'jian4', u'毾': u'ta4', u'毿': u'san1', u'氀': u'lv2', u'氁': u'mu2', u'氂': u'mao2', u'氃': u'tong2', u'氄': u'rong3', u'氅': u'chang3', u'氆': u'pu3', u'氇': u'lu', u'氈': u'zhan1', u'氉': u'sao4', u'氊': u'zhan1', u'氋': u'meng2', u'氌': u'lu', u'氍': u'qu2', u'氎': u'die2', u'氏': u'shi4', u'氐': u'di3', u'民': u'min2', u'氒': u'jue2', u'氓': u'mang2', u'气': u'qi4', u'氕': u'pie1', u'氖': u'nai3', u'気': u'qi4', u'氘': u'dao1', u'氙': u'xian1', u'氚': u'chuan1', u'氛': u'fen1', u'氜': u'yang2', u'氝': u'nei4', u'氞': u'nei4', u'氟': u'fu2', u'氠': u'shen1', u'氡': u'dong1', u'氢': u'qing1', u'氣': u'qi4', u'氤': u'yin1', u'氥': u'xi1', u'氦': u'hai4', u'氧': u'yang3', u'氨': u'an1', u'氩': u'ya4', u'氪': u'ke4', u'氫': u'qing1', u'氬': u'ya4', u'氭': u'dong1', u'氮': u'dan4', u'氯': u'lv4', u'氰': u'qing2', u'氱': u'yang3', u'氲': u'yun1', u'氳': u'yun1', u'水': u'shui3', u'氵': u'shui3', u'氶': u'yang3', u'氷': u'bing1', u'永': u'yong3', u'氹': u'dang4', u'氺': u'shui3', u'氻': u'le4', u'氼': u'ni4', u'氽': u'tun3', u'氾': u'fan4', u'氿': u'gui3', u'汀': u'ting1', u'汁': u'zhi1', u'求': u'qiu2', u'汃': u'pa1', u'汄': u'ze4', u'汅': u'mian3', u'汆': u'cuan1', u'汇': u'hui4', u'汈': u'diao1', u'汉': u'han4', u'汊': u'cha4', u'汋': u'zhuo2', u'汌': u'chuan4', u'汍': u'wan2', u'汎': u'fan4', u'汏': u'da4', u'汐': u'xi1', u'汑': u'tuo1', u'汒': u'mang2', u'汓': u'qiu2', u'汔': u'qi4', u'汕': u'shan4', u'汖': u'pin4', u'汗': u'han4', u'汘': u'qian1', u'汙': u'wu1', u'汚': u'wu1', u'汛': u'xun4', u'汜': u'si4', u'汝': u'ru3', u'汞': u'gong3', u'江': u'jiang1', u'池': u'chi2', u'污': u'wu1', u'汢': u'tu', u'汣': u'jiu3', u'汤': u'tang1', u'汥': u'zhi1', u'汦': u'zhi1', u'汧': u'qian1', u'汨': u'mi4', u'汩': u'gu3', u'汪': u'wang1', u'汫': u'jing3', u'汬': u'jing3', u'汭': u'rui4', u'汮': u'jun1', u'汯': u'hong2', u'汰': u'tai4', u'汱': u'tai4', u'汲': u'ji2', u'汳': u'bian4', u'汴': u'bian4', u'汵': u'bian4', u'汶': u'wen4', u'汷': u'zhong1', u'汸': u'fang1', u'汹': u'xiong1', u'決': u'jue2', u'汻': u'hu3', u'汼': u'niu2', u'汽': u'qi4', u'汾': u'fen2', u'汿': u'xu4', u'沀': u'xu4', u'沁': u'qin4', u'沂': u'yi2', u'沃': u'wo4', u'沄': u'yun2', u'沅': u'yuan2', u'沆': u'hang4', u'沇': u'yan3', u'沈': u'shen3', u'沉': u'chen2', u'沊': u'dan4', u'沋': u'you2', u'沌': u'dun4', u'沍': u'hu4', u'沎': u'huo4', u'沏': u'qi1', u'沐': u'mu4', u'沑': u'nv4', u'沒': u'mei2', u'沓': u'ta4', u'沔': u'mian3', u'沕': u'mi4', u'沖': u'chong1', u'沗': u'hong2', u'沘': u'bi3', u'沙': u'sha1', u'沚': u'zhi3', u'沛': u'pei4', u'沜': u'pan4', u'沝': u'zhui3', u'沞': u'za1', u'沟': u'gou1', u'沠': u'pai4', u'没': u'mei2', u'沢': u'ze2', u'沣': u'feng1', u'沤': u'ou1', u'沥': u'li4', u'沦': u'lun2', u'沧': u'cang1', u'沨': u'feng2', u'沩': u'wei2', u'沪': u'hu4', u'沫': u'mo4', u'沬': u'mei4', u'沭': u'shu4', u'沮': u'ju3', u'沯': u'za2', u'沰': u'tuo1', u'沱': u'tuo2', u'沲': u'duo4', u'河': u'he2', u'沴': u'li4', u'沵': u'mi3', u'沶': u'yi2', u'沷': u'fa1', u'沸': u'fei4', u'油': u'you2', u'沺': u'tian2', u'治': u'zhi4', u'沼': u'zhao3', u'沽': u'gu1', u'沾': u'zhan1', u'沿': u'yan2', u'泀': u'si1', u'況': u'kuang4', u'泂': u'jiong3', u'泃': u'ju1', u'泄': u'xie4', u'泅': u'qiu2', u'泆': u'yi4', u'泇': u'jia1', u'泈': u'zhong1', u'泉': u'quan2', u'泊': u'bo4', u'泋': u'hui4', u'泌': u'mi4', u'泍': u'ben1', u'泎': u'ze2', u'泏': u'chu4', u'泐': u'le4', u'泑': u'you1', u'泒': u'gu1', u'泓': u'hong2', u'泔': u'gan1', u'法': u'fa3', u'泖': u'mao3', u'泗': u'si4', u'泘': u'hu1', u'泙': u'peng1', u'泚': u'ci3', u'泛': u'fan4', u'泜': u'zhi1', u'泝': u'su4', u'泞': u'ning4', u'泟': u'cheng1', u'泠': u'ling2', u'泡': u'pao4', u'波': u'bo1', u'泣': u'qi4', u'泤': u'si4', u'泥': u'ni2', u'泦': u'ju2', u'泧': u'yue4', u'注': u'zhu4', u'泩': u'sheng1', u'泪': u'lei4', u'泫': u'xuan4', u'泬': u'jue2', u'泭': u'fu2', u'泮': u'pan4', u'泯': u'min3', u'泰': u'tai4', u'泱': u'yang1', u'泲': u'ji3', u'泳': u'yong3', u'泴': u'guan4', u'泵': u'beng4', u'泶': u'xue2', u'泷': u'long2', u'泸': u'lu2', u'泹': u'dan4', u'泺': u'luo4', u'泻': u'xie4', u'泼': u'po1', u'泽': u'ze2', u'泾': u'jing1', u'泿': u'yin2', u'洀': u'yin2', u'洁': u'jie2', u'洂': u'ye4', u'洃': u'hui1', u'洄': u'hui2', u'洅': u'zai4', u'洆': u'cheng2', u'洇': u'yin1', u'洈': u'wei2', u'洉': u'hou4', u'洊': u'jian4', u'洋': u'yang2', u'洌': u'lie4', u'洍': u'si4', u'洎': u'ji4', u'洏': u'er2', u'洐': u'xing2', u'洑': u'fu2', u'洒': u'sa3', u'洓': u'se4', u'洔': u'zhi3', u'洕': u'yin4', u'洖': u'wu2', u'洗': u'xi3', u'洘': u'kao3', u'洙': u'zhu1', u'洚': u'jiang4', u'洛': u'luo4', u'洜': u'luo4', u'洝': u'an4', u'洞': u'dong4', u'洟': u'ti4', u'洠': u'si4', u'洡': u'lei3', u'洢': u'yi1', u'洣': u'mi3', u'洤': u'quan2', u'津': u'jin1', u'洦': u'po4', u'洧': u'wei3', u'洨': u'xiao2', u'洩': u'xie4', u'洪': u'hong2', u'洫': u'xu4', u'洬': u'su4', u'洭': u'kuang1', u'洮': u'tao2', u'洯': u'qie4', u'洰': u'ju4', u'洱': u'er3', u'洲': u'zhou1', u'洳': u'ru4', u'洴': u'ping2', u'洵': u'xun2', u'洶': u'xiong1', u'洷': u'zhi4', u'洸': u'guang1', u'洹': u'huan2', u'洺': u'ming2', u'活': u'huo2', u'洼': u'wa1', u'洽': u'qia4', u'派': u'pai4', u'洿': u'wu1', u'浀': u'qu1', u'流': u'liu2', u'浂': u'yi4', u'浃': u'jia1', u'浄': u'jing4', u'浅': u'qian3', u'浆': u'jiang1', u'浇': u'jiao1', u'浈': u'zhen1', u'浉': u'shi1', u'浊': u'zhuo2', u'测': u'ce4', u'浌': u'fa2', u'浍': u'hui4', u'济': u'ji4', u'浏': u'liu2', u'浐': u'chan3', u'浑': u'hun2', u'浒': u'hu3', u'浓': u'nong2', u'浔': u'xun2', u'浕': u'jin4', u'浖': u'lie4', u'浗': u'qiu2', u'浘': u'wei3', u'浙': u'zhe4', u'浚': u'jun4', u'浛': u'han2', u'浜': u'bang1', u'浝': u'mang2', u'浞': u'zhuo2', u'浟': u'you1', u'浠': u'xi1', u'浡': u'bo2', u'浢': u'dou4', u'浣': u'huan4', u'浤': u'hong2', u'浥': u'yi4', u'浦': u'pu3', u'浧': u'ying3', u'浨': u'lan3', u'浩': u'hao4', u'浪': u'lang4', u'浫': u'han3', u'浬': u'li3', u'浭': u'geng1', u'浮': u'fu2', u'浯': u'wu2', u'浰': u'li4', u'浱': u'chun2', u'浲': u'feng2', u'浳': u'yi4', u'浴': u'yu4', u'浵': u'tong2', u'浶': u'lao2', u'海': u'hai3', u'浸': u'jin4', u'浹': u'jia1', u'浺': u'chong1', u'浻': u'jiong3', u'浼': u'mei3', u'浽': u'sui1', u'浾': u'cheng1', u'浿': u'pei4', u'涀': u'xian4', u'涁': u'shen4', u'涂': u'tu2', u'涃': u'kun4', u'涄': u'ping1', u'涅': u'nie4', u'涆': u'han4', u'涇': u'jing1', u'消': u'xiao1', u'涉': u'she4', u'涊': u'nian3', u'涋': u'tu1', u'涌': u'yong3', u'涍': u'xiao4', u'涎': u'xian2', u'涏': u'ting3', u'涐': u'e2', u'涑': u'su4', u'涒': u'tun1', u'涓': u'juan1', u'涔': u'cen2', u'涕': u'ti4', u'涖': u'li4', u'涗': u'shui4', u'涘': u'si4', u'涙': u'lei4', u'涚': u'shui4', u'涛': u'tao1', u'涜': u'tuo', u'涝': u'lao4', u'涞': u'lai2', u'涟': u'lian2', u'涠': u'wei2', u'涡': u'wo1', u'涢': u'yun2', u'涣': u'huan4', u'涤': u'di2', u'涥': u'heng1', u'润': u'run4', u'涧': u'jian4', u'涨': u'zhang3', u'涩': u'se4', u'涪': u'fu2', u'涫': u'guan4', u'涬': u'xing4', u'涭': u'shou4', u'涮': u'shuan4', u'涯': u'ya2', u'涰': u'chuo4', u'涱': u'zhang4', u'液': u'ye4', u'涳': u'kong1', u'涴': u'wo4', u'涵': u'han2', u'涶': u'tuo1', u'涷': u'dong1', u'涸': u'he2', u'涹': u'wo1', u'涺': u'ju1', u'涻': u'she4', u'涼': u'liang2', u'涽': u'hun1', u'涾': u'ta4', u'涿': u'zhuo1', u'淀': u'dian4', u'淁': u'qie4', u'淂': u'de2', u'淃': u'juan4', u'淄': u'zi1', u'淅': u'xi1', u'淆': u'xiao2', u'淇': u'qi2', u'淈': u'gu3', u'淉': u'guo3', u'淊': u'yan1', u'淋': u'lin2', u'淌': u'tang3', u'淍': u'zhou1', u'淎': u'peng3', u'淏': u'hao4', u'淐': u'chang1', u'淑': u'shu1', u'淒': u'qi1', u'淓': u'fang1', u'淔': u'zhi2', u'淕': u'lu4', u'淖': u'nao4', u'淗': u'ju2', u'淘': u'tao2', u'淙': u'cong2', u'淚': u'lei4', u'淛': u'zhe4', u'淜': u'ping2', u'淝': u'fei2', u'淞': u'song1', u'淟': u'tian3', u'淠': u'pi4', u'淡': u'dan4', u'淢': u'yu4', u'淣': u'ni2', u'淤': u'yu1', u'淥': u'lu4', u'淦': u'gan4', u'淧': u'mi4', u'淨': u'jing4', u'淩': u'ling2', u'淪': u'lun2', u'淫': u'yin2', u'淬': u'cui4', u'淭': u'qu2', u'淮': u'huai2', u'淯': u'yu4', u'淰': u'nian3', u'深': u'shen1', u'淲': u'biao1', u'淳': u'chun2', u'淴': u'hu1', u'淵': u'yuan1', u'淶': u'lai2', u'混': u'hun4', u'淸': u'qing1', u'淹': u'yan1', u'淺': u'qian3', u'添': u'tian1', u'淼': u'miao3', u'淽': u'zhi3', u'淾': u'yin3', u'淿': u'bo2', u'渀': u'ben4', u'渁': u'yuan1', u'渂': u'wen4', u'渃': u'ruo4', u'渄': u'fei1', u'清': u'qing1', u'渆': u'yuan1', u'渇': u'ke3', u'済': u'ji4', u'渉': u'she4', u'渊': u'yuan1', u'渋': u'se4', u'渌': u'lu4', u'渍': u'zi4', u'渎': u'du2', u'渏': u'yi1', u'渐': u'jian4', u'渑': u'mian3', u'渒': u'pai4', u'渓': u'xi1', u'渔': u'yu2', u'渕': u'yuan1', u'渖': u'shen3', u'渗': u'shen4', u'渘': u'rou2', u'渙': u'huan4', u'渚': u'zhu3', u'減': u'jian3', u'渜': u'nuan3', u'渝': u'yu2', u'渞': u'qiu2', u'渟': u'ting2', u'渠': u'qu2', u'渡': u'du4', u'渢': u'feng2', u'渣': u'zha1', u'渤': u'bo2', u'渥': u'wo4', u'渦': u'wo1', u'渧': u'ti2', u'渨': u'wei3', u'温': u'wen1', u'渪': u'ru2', u'渫': u'xie4', u'測': u'ce4', u'渭': u'wei4', u'渮': u'he2', u'港': u'gang3', u'渰': u'yan3', u'渱': u'hong2', u'渲': u'xuan4', u'渳': u'mi3', u'渴': u'ke3', u'渵': u'mao2', u'渶': u'ying1', u'渷': u'yan3', u'游': u'you2', u'渹': u'hong1', u'渺': u'miao3', u'渻': u'sheng3', u'渼': u'mei3', u'渽': u'zai1', u'渾': u'hun2', u'渿': u'nai4', u'湀': u'gui3', u'湁': u'chi4', u'湂': u'e4', u'湃': u'pai4', u'湄': u'mei2', u'湅': u'lian4', u'湆': u'qi4', u'湇': u'qi4', u'湈': u'mei2', u'湉': u'tian2', u'湊': u'cou4', u'湋': u'wei2', u'湌': u'can1', u'湍': u'tuan1', u'湎': u'mian3', u'湏': u'hui4', u'湐': u'po4', u'湑': u'xu1', u'湒': u'ji2', u'湓': u'pen2', u'湔': u'jian1', u'湕': u'jian3', u'湖': u'hu2', u'湗': u'feng4', u'湘': u'xiang1', u'湙': u'yi4', u'湚': u'yin4', u'湛': u'zhan4', u'湜': u'shi2', u'湝': u'jie1', u'湞': u'zhen1', u'湟': u'huang2', u'湠': u'tan4', u'湡': u'yu2', u'湢': u'bi4', u'湣': u'min3', u'湤': u'shi1', u'湥': u'tu1', u'湦': u'sheng1', u'湧': u'yong3', u'湨': u'ju2', u'湩': u'dong4', u'湪': u'tuan4', u'湫': u'qiu1', u'湬': u'qiu1', u'湭': u'qiu2', u'湮': u'yan1', u'湯': u'tang1', u'湰': u'long2', u'湱': u'huo4', u'湲': u'yuan2', u'湳': u'nan3', u'湴': u'ban4', u'湵': u'you3', u'湶': u'quan2', u'湷': u'zhuang1', u'湸': u'liang4', u'湹': u'chan2', u'湺': u'xian2', u'湻': u'chun2', u'湼': u'nie4', u'湽': u'zi1', u'湾': u'wan1', u'湿': u'shi1', u'満': u'man3', u'溁': u'ying2', u'溂': u'la', u'溃': u'kui4', u'溄': u'feng2', u'溅': u'jian4', u'溆': u'xu4', u'溇': u'lou2', u'溈': u'wei2', u'溉': u'gai4', u'溊': u'bo1', u'溋': u'ying2', u'溌': u'ha1tu1', u'溍': u'jin4', u'溎': u'yan4', u'溏': u'tang2', u'源': u'yuan2', u'溑': u'suo3', u'溒': u'yuan2', u'溓': u'lian2', u'溔': u'yao3', u'溕': u'meng2', u'準': u'zhun3', u'溗': u'cheng2', u'溘': u'ke4', u'溙': u'tai4', u'溚': u'ta3', u'溛': u'wa1', u'溜': u'liu1', u'溝': u'gou1', u'溞': u'sao1', u'溟': u'ming2', u'溠': u'zha1', u'溡': u'shi2', u'溢': u'yi4', u'溣': u'lun4', u'溤': u'ma3', u'溥': u'pu3', u'溦': u'wei1', u'溧': u'li4', u'溨': u'zai1', u'溩': u'wu4', u'溪': u'xi1', u'溫': u'wen1', u'溬': u'qiang1', u'溭': u'ze2', u'溮': u'shi1', u'溯': u'su4', u'溰': u'ai2', u'溱': u'qin2', u'溲': u'sou1', u'溳': u'yun2', u'溴': u'xiu4', u'溵': u'yin1', u'溶': u'rong2', u'溷': u'hun4', u'溸': u'su4', u'溹': u'suo4', u'溺': u'ni4', u'溻': u'ta1', u'溼': u'shi1', u'溽': u'ru4', u'溾': u'ai1', u'溿': u'pan4', u'滀': u'chu4', u'滁': u'chu2', u'滂': u'pang1', u'滃': u'weng1', u'滄': u'cang1', u'滅': u'mie4', u'滆': u'ge2', u'滇': u'dian1', u'滈': u'hao4', u'滉': u'huang4', u'滊': u'qi4', u'滋': u'zi1', u'滌': u'di2', u'滍': u'zhi4', u'滎': u'ying2', u'滏': u'fu3', u'滐': u'jie2', u'滑': u'hua2', u'滒': u'ge1', u'滓': u'zi3', u'滔': u'tao1', u'滕': u'teng2', u'滖': u'sui1', u'滗': u'bi4', u'滘': u'jiao4', u'滙': u'hui4', u'滚': u'gun3', u'滛': u'yin2', u'滜': u'ze2', u'滝': u'long2', u'滞': u'zhi4', u'滟': u'yan4', u'滠': u'she4', u'满': u'man3', u'滢': u'ying2', u'滣': u'chun2', u'滤': u'lv4', u'滥': u'lan4', u'滦': u'luan2', u'滧': u'yao2', u'滨': u'bin1', u'滩': u'tan1', u'滪': u'yu4', u'滫': u'xiu3', u'滬': u'hu4', u'滭': u'bi4', u'滮': u'biao1', u'滯': u'zhi4', u'滰': u'jiang4', u'滱': u'kou4', u'滲': u'shen4', u'滳': u'shang1', u'滴': u'di1', u'滵': u'mi4', u'滶': u'ao2', u'滷': u'lu3', u'滸': u'hu3', u'滹': u'hu1', u'滺': u'you1', u'滻': u'chan3', u'滼': u'fan4', u'滽': u'yong1', u'滾': u'gun3', u'滿': u'man3', u'漀': u'qing3', u'漁': u'yu2', u'漂': u'piao1', u'漃': u'ji4', u'漄': u'ya2', u'漅': u'chao2', u'漆': u'qi1', u'漇': u'xi3', u'漈': u'ji4', u'漉': u'lu4', u'漊': u'lou2', u'漋': u'long2', u'漌': u'jin3', u'漍': u'guo2', u'漎': u'cong2', u'漏': u'lou4', u'漐': u'zhi2', u'漑': u'gai4', u'漒': u'qiang2', u'漓': u'li2', u'演': u'yan3', u'漕': u'cao2', u'漖': u'jiao4', u'漗': u'cong1', u'漘': u'chun2', u'漙': u'tuan2', u'漚': u'ou1', u'漛': u'teng2', u'漜': u'ye3', u'漝': u'xi2', u'漞': u'mi4', u'漟': u'tang2', u'漠': u'mo4', u'漡': u'shang1', u'漢': u'han4', u'漣': u'lian2', u'漤': u'lan3', u'漥': u'wa1', u'漦': u'chi2', u'漧': u'gan1', u'漨': u'feng2', u'漩': u'xuan2', u'漪': u'yi1', u'漫': u'man4', u'漬': u'zi4', u'漭': u'mang3', u'漮': u'kang1', u'漯': u'luo4', u'漰': u'peng1', u'漱': u'shu4', u'漲': u'zhang3', u'漳': u'zhang1', u'漴': u'chong2', u'漵': u'xu4', u'漶': u'huan4', u'漷': u'huo3', u'漸': u'jian4', u'漹': u'yan1', u'漺': u'shuang3', u'漻': u'liao2', u'漼': u'cui3', u'漽': u'ti2', u'漾': u'yang4', u'漿': u'jiang1', u'潀': u'cong2', u'潁': u'ying3', u'潂': u'hong2', u'潃': u'xiu3', u'潄': u'shu4', u'潅': u'guan4', u'潆': u'ying2', u'潇': u'xiao1', u'潈': u'zong1', u'潉': u'kun', u'潊': u'xu4', u'潋': u'lian4', u'潌': u'zhi', u'潍': u'wei2', u'潎': u'pi4', u'潏': u'yu4', u'潐': u'jiao4', u'潑': u'po1', u'潒': u'dang4', u'潓': u'hui4', u'潔': u'jie2', u'潕': u'wu3', u'潖': u'pa2', u'潗': u'ji2', u'潘': u'pan1', u'潙': u'gui1', u'潚': u'su4', u'潛': u'qian2', u'潜': u'qian2', u'潝': u'xi1', u'潞': u'lu4', u'潟': u'xie4', u'潠': u'sun4', u'潡': u'dun4', u'潢': u'huang2', u'潣': u'min3', u'潤': u'run4', u'潥': u'su4', u'潦': u'liao3', u'潧': u'zhen1', u'潨': u'cong1', u'潩': u'yi4', u'潪': u'zhi2', u'潫': u'wan1', u'潬': u'tan1', u'潭': u'tan2', u'潮': u'chao2', u'潯': u'xun2', u'潰': u'kui4', u'潱': u'ye1', u'潲': u'shao4', u'潳': u'tu2', u'潴': u'zhu1', u'潵': u'sa3', u'潶': u'hei1', u'潷': u'bi4', u'潸': u'shan1', u'潹': u'chan2', u'潺': u'chan2', u'潻': u'shu3', u'潼': u'tong2', u'潽': u'pu1', u'潾': u'lin2', u'潿': u'wei2', u'澀': u'se4', u'澁': u'se4', u'澂': u'cheng2', u'澃': u'jiong3', u'澄': u'cheng2', u'澅': u'hua4', u'澆': u'jiao1', u'澇': u'lao4', u'澈': u'che4', u'澉': u'gan3', u'澊': u'cun1', u'澋': u'jing3', u'澌': u'si1', u'澍': u'shu4', u'澎': u'peng2', u'澏': u'han2', u'澐': u'yun2', u'澑': u'liu1', u'澒': u'hong4', u'澓': u'fu2', u'澔': u'hao4', u'澕': u'he2', u'澖': u'xian2', u'澗': u'jian4', u'澘': u'shan1', u'澙': u'xi4', u'澚': u'ao', u'澛': u'lu3', u'澜': u'lan2', u'澝': u'ning4', u'澞': u'yu2', u'澟': u'lin3', u'澠': u'mian3', u'澡': u'zao3', u'澢': u'dang1', u'澣': u'huan4', u'澤': u'ze2', u'澥': u'xie4', u'澦': u'yu4', u'澧': u'li3', u'澨': u'shi4', u'澩': u'xue2', u'澪': u'ling2', u'澫': u'wan4', u'澬': u'zi1', u'澭': u'yong1', u'澮': u'hui4', u'澯': u'can4', u'澰': u'lian4', u'澱': u'dian4', u'澲': u'ye4', u'澳': u'ao4', u'澴': u'huan2', u'澵': u'zhen1', u'澶': u'chan2', u'澷': u'man4', u'澸': u'gan3', u'澹': u'dan4', u'澺': u'yi4', u'澻': u'sui4', u'澼': u'pi4', u'澽': u'ju4', u'澾': u'ta4', u'澿': u'qin2', u'激': u'ji1', u'濁': u'zhuo2', u'濂': u'lian2', u'濃': u'nong2', u'濄': u'guo1', u'濅': u'jin4', u'濆': u'fen2', u'濇': u'se4', u'濈': u'ji2', u'濉': u'sui1', u'濊': u'hui4', u'濋': u'chu3', u'濌': u'ta4', u'濍': u'song1', u'濎': u'ding3', u'濏': u'se4', u'濐': u'zhu3', u'濑': u'lai4', u'濒': u'bin1', u'濓': u'lian2', u'濔': u'mi3', u'濕': u'shi1', u'濖': u'shu4', u'濗': u'mi4', u'濘': u'ning4', u'濙': u'ying2', u'濚': u'ying2', u'濛': u'meng2', u'濜': u'jin4', u'濝': u'qi2', u'濞': u'bi4', u'濟': u'ji4', u'濠': u'hao2', u'濡': u'ru2', u'濢': u'cui4', u'濣': u'wo4', u'濤': u'tao1', u'濥': u'yin3', u'濦': u'yin1', u'濧': u'dui4', u'濨': u'ci2', u'濩': u'huo4', u'濪': u'qing4', u'濫': u'lan4', u'濬': u'jun4', u'濭': u'ai3', u'濮': u'pu2', u'濯': u'zhuo2', u'濰': u'wei2', u'濱': u'bin1', u'濲': u'gu3', u'濳': u'qian2', u'濴': u'ying2', u'濵': u'bin1', u'濶': u'kuo4', u'濷': u'fei4', u'濸': u'cang', u'濹': u'boku', u'濺': u'jian4', u'濻': u'wei3', u'濼': u'luo4', u'濽': u'zan4', u'濾': u'lv4', u'濿': u'li4', u'瀀': u'you1', u'瀁': u'yang3', u'瀂': u'lu3', u'瀃': u'si4', u'瀄': u'zhi4', u'瀅': u'ying2', u'瀆': u'du2', u'瀇': u'wang3', u'瀈': u'hui1', u'瀉': u'xie4', u'瀊': u'pan2', u'瀋': u'shen3', u'瀌': u'biao1', u'瀍': u'chan2', u'瀎': u'mie4', u'瀏': u'liu2', u'瀐': u'jian1', u'瀑': u'pu4', u'瀒': u'se4', u'瀓': u'cheng2', u'瀔': u'gu3', u'瀕': u'bin1', u'瀖': u'huo4', u'瀗': u'xian4', u'瀘': u'lu2', u'瀙': u'qin4', u'瀚': u'han4', u'瀛': u'ying2', u'瀜': u'rong2', u'瀝': u'li4', u'瀞': u'jing4', u'瀟': u'xiao1', u'瀠': u'ying2', u'瀡': u'sui3', u'瀢': u'wei3', u'瀣': u'xie4', u'瀤': u'huai2', u'瀥': u'xue4', u'瀦': u'zhu1', u'瀧': u'long2', u'瀨': u'lai4', u'瀩': u'dui4', u'瀪': u'fan2', u'瀫': u'hu2', u'瀬': u'lai4', u'瀭': u'shu', u'瀮': u'lian2', u'瀯': u'ying2', u'瀰': u'mi2', u'瀱': u'ji4', u'瀲': u'lian4', u'瀳': u'jian4', u'瀴': u'ying1', u'瀵': u'fen4', u'瀶': u'lin2', u'瀷': u'yi4', u'瀸': u'jian1', u'瀹': u'yue4', u'瀺': u'chan2', u'瀻': u'dai4', u'瀼': u'rang2', u'瀽': u'jian3', u'瀾': u'lan2', u'瀿': u'fan2', u'灀': u'shuang4', u'灁': u'yuan1', u'灂': u'zhuo2', u'灃': u'feng1', u'灄': u'she4', u'灅': u'lei3', u'灆': u'lan2', u'灇': u'cong2', u'灈': u'qu2', u'灉': u'yong1', u'灊': u'qian2', u'灋': u'fa3', u'灌': u'guan4', u'灍': u'jue2', u'灎': u'yan4', u'灏': u'hao4', u'灐': u'ying2', u'灑': u'sa3', u'灒': u'zan4', u'灓': u'luan2', u'灔': u'yan4', u'灕': u'li2', u'灖': u'mi3', u'灗': u'shan4', u'灘': u'tan1', u'灙': u'dang3', u'灚': u'jiao3', u'灛': u'chan3', u'灜': u'ying2', u'灝': u'hao4', u'灞': u'ba4', u'灟': u'zhu2', u'灠': u'lan4', u'灡': u'lan2', u'灢': u'nang3', u'灣': u'wan1', u'灤': u'luan2', u'灥': u'xun2', u'灦': u'xian3', u'灧': u'yan4', u'灨': u'gan4', u'灩': u'yan4', u'灪': u'yu4', u'火': u'huo3', u'灬': u'huo3', u'灭': u'mie4', u'灮': u'guang1', u'灯': u'deng1', u'灰': u'hui1', u'灱': u'xiao1', u'灲': u'xiao1', u'灳': u'hui1', u'灴': u'hong1', u'灵': u'ling2', u'灶': u'zao4', u'灷': u'zhuan4', u'灸': u'jiu3', u'灹': u'zha4', u'灺': u'xie4', u'灻': u'chi4', u'灼': u'zhuo2', u'災': u'zai1', u'灾': u'zai1', u'灿': u'can4', u'炀': u'yang2', u'炁': u'qi4', u'炂': u'zhong1', u'炃': u'fen2', u'炄': u'niu3', u'炅': u'gui4', u'炆': u'wen2', u'炇': u'pu1', u'炈': u'yi4', u'炉': u'lu2', u'炊': u'chui1', u'炋': u'pi1', u'炌': u'kai4', u'炍': u'pan4', u'炎': u'yan2', u'炏': u'yan2', u'炐': u'pang4', u'炑': u'mu4', u'炒': u'chao3', u'炓': u'liao4', u'炔': u'que1', u'炕': u'kang4', u'炖': u'dun4', u'炗': u'guang1', u'炘': u'xin1', u'炙': u'zhi4', u'炚': u'guang1', u'炛': u'guang1', u'炜': u'wei3', u'炝': u'qiang4', u'炞': u'bian1', u'炟': u'da2', u'炠': u'xia2', u'炡': u'zheng1', u'炢': u'zhu2', u'炣': u'ke3', u'炤': u'zhao1', u'炥': u'fu2', u'炦': u'ba2', u'炧': u'xie4', u'炨': u'xie4', u'炩': u'ling4', u'炪': u'zhuo1', u'炫': u'xuan4', u'炬': u'ju4', u'炭': u'tan4', u'炮': u'pao4', u'炯': u'jiong3', u'炰': u'pao2', u'炱': u'tai2', u'炲': u'tai2', u'炳': u'bing3', u'炴': u'yang3', u'炵': u'tong1', u'炶': u'shan3', u'炷': u'zhu4', u'炸': u'zha4', u'点': u'dian3', u'為': u'wei4', u'炻': u'shi2', u'炼': u'lian4', u'炽': u'chi4', u'炾': u'huang3', u'炿': u'zhou1', u'烀': u'hu1', u'烁': u'shuo4', u'烂': u'lan4', u'烃': u'ting1', u'烄': u'jiao3', u'烅': u'xu4', u'烆': u'heng2', u'烇': u'quan3', u'烈': u'lie4', u'烉': u'huan4', u'烊': u'yang2', u'烋': u'xiao1', u'烌': u'xiu1', u'烍': u'xian3', u'烎': u'yin2', u'烏': u'wu1', u'烐': u'zhou1', u'烑': u'yao2', u'烒': u'shi4', u'烓': u'wei1', u'烔': u'tong2', u'烕': u'mie4', u'烖': u'zai1', u'烗': u'kai4', u'烘': u'hong1', u'烙': u'lao4', u'烚': u'xia2', u'烛': u'zhu2', u'烜': u'xuan3', u'烝': u'zheng1', u'烞': u'po4', u'烟': u'yan1', u'烠': u'hui2', u'烡': u'guang1', u'烢': u'che4', u'烣': u'hui1', u'烤': u'kao3', u'烥': u'chen', u'烦': u'fan2', u'烧': u'shao1', u'烨': u'ye4', u'烩': u'hui4', u'烪': u'wu', u'烫': u'tang4', u'烬': u'jin4', u'热': u're4', u'烮': u'lie4', u'烯': u'xi1', u'烰': u'fu2', u'烱': u'jiong3', u'烲': u'xie4', u'烳': u'pu3', u'烴': u'ting1', u'烵': u'zhuo2', u'烶': u'ting3', u'烷': u'wan2', u'烸': u'hai3', u'烹': u'peng1', u'烺': u'lang3', u'烻': u'yan4', u'烼': u'xu4', u'烽': u'feng1', u'烾': u'chi4', u'烿': u'rong2', u'焀': u'hu2', u'焁': u'xi1', u'焂': u'shu1', u'焃': u'he4', u'焄': u'xun1', u'焅': u'kao4', u'焆': u'juan1', u'焇': u'xiao1', u'焈': u'xi1', u'焉': u'yan1', u'焊': u'han4', u'焋': u'zhuang4', u'焌': u'jun4', u'焍': u'di4', u'焎': u'xie4', u'焏': u'ji2', u'焐': u'wu4', u'焑': u'yan1', u'焒': u'lv', u'焓': u'han2', u'焔': u'yan4', u'焕': u'huan4', u'焖': u'men4', u'焗': u'ju2', u'焘': u'tao1', u'焙': u'bei4', u'焚': u'fen2', u'焛': u'lin4', u'焜': u'kun1', u'焝': u'hun4', u'焞': u'tun1', u'焟': u'xi1', u'焠': u'cui4', u'無': u'wu2', u'焢': u'hong1', u'焣': u'chao3', u'焤': u'fu3', u'焥': u'wo4', u'焦': u'jiao1', u'焧': u'zong3', u'焨': u'feng4', u'焩': u'ping2', u'焪': u'qiong2', u'焫': u'ruo4', u'焬': u'xi1', u'焭': u'qiong2', u'焮': u'xin4', u'焯': u'chao1', u'焰': u'yan4', u'焱': u'yan4', u'焲': u'yi4', u'焳': u'jue2', u'焴': u'yu4', u'焵': u'gang4', u'然': u'ran2', u'焷': u'pi2', u'焸': u'xiong3', u'焹': u'gang4', u'焺': u'sheng1', u'焻': u'chang4', u'焼': u'shao1', u'焽': u'xiong3', u'焾': u'nian3', u'焿': u'geng1', u'煀': u'qu1', u'煁': u'chen2', u'煂': u'he4', u'煃': u'kui3', u'煄': u'zhong3', u'煅': u'duan4', u'煆': u'xia1', u'煇': u'hui1', u'煈': u'feng4', u'煉': u'lian4', u'煊': u'xuan1', u'煋': u'xing1', u'煌': u'huang2', u'煍': u'jiao3', u'煎': u'jian1', u'煏': u'bi4', u'煐': u'ying1', u'煑': u'zhu3', u'煒': u'wei3', u'煓': u'tuan1', u'煔': u'shan3', u'煕': u'xi1', u'煖': u'nuan3', u'煗': u'nuan3', u'煘': u'chan2', u'煙': u'yan1', u'煚': u'jiong3', u'煛': u'jiong3', u'煜': u'yu4', u'煝': u'mei4', u'煞': u'sha4', u'煟': u'wei4', u'煠': u'zha1', u'煡': u'jin4', u'煢': u'qiong2', u'煣': u'rou2', u'煤': u'mei2', u'煥': u'huan4', u'煦': u'xu4', u'照': u'zhao4', u'煨': u'wei1', u'煩': u'fan2', u'煪': u'qiu2', u'煫': u'sui4', u'煬': u'yang2', u'煭': u'lie4', u'煮': u'zhu3', u'煯': u'jie1', u'煰': u'zao4', u'煱': u'gua1', u'煲': u'bao1', u'煳': u'hu2', u'煴': u'yun1', u'煵': u'nan3', u'煶': u'shi', u'煷': u'huo3', u'煸': u'bian1', u'煹': u'gou4', u'煺': u'tui4', u'煻': u'tang2', u'煼': u'chao3', u'煽': u'shan1', u'煾': u'en1', u'煿': u'bo2', u'熀': u'huang3', u'熁': u'xie2', u'熂': u'xi4', u'熃': u'wu4', u'熄': u'xi1', u'熅': u'yun1', u'熆': u'he2', u'熇': u'he4', u'熈': u'xi1', u'熉': u'yun2', u'熊': u'xiong2', u'熋': u'xiong2', u'熌': u'shan3', u'熍': u'qiong2', u'熎': u'yao4', u'熏': u'xun1', u'熐': u'mi4', u'熑': u'lian2', u'熒': u'ying2', u'熓': u'wu3', u'熔': u'rong2', u'熕': u'gong4', u'熖': u'yan4', u'熗': u'qiang4', u'熘': u'liu1', u'熙': u'xi1', u'熚': u'bi4', u'熛': u'biao1', u'熜': u'cong1', u'熝': u'lu4', u'熞': u'jian1', u'熟': u'shu2', u'熠': u'yi4', u'熡': u'lou2', u'熢': u'peng2', u'熣': u'sui1', u'熤': u'yi4', u'熥': u'tong1', u'熦': u'jue2', u'熧': u'zong1', u'熨': u'yun4', u'熩': u'hu4', u'熪': u'yi2', u'熫': u'zhi4', u'熬': u'ao2', u'熭': u'wei4', u'熮': u'liu3', u'熯': u'han4', u'熰': u'ou1', u'熱': u're4', u'熲': u'jiong3', u'熳': u'man4', u'熴': u'kun1', u'熵': u'shang1', u'熶': u'cuan4', u'熷': u'zeng4', u'熸': u'jian1', u'熹': u'xi1', u'熺': u'xi1', u'熻': u'xi1', u'熼': u'yi4', u'熽': u'xiao4', u'熾': u'chi4', u'熿': u'huang2', u'燀': u'chan3', u'燁': u'ye4', u'燂': u'tan2', u'燃': u'ran2', u'燄': u'yan4', u'燅': u'xun2', u'燆': u'qiao1', u'燇': u'jun4', u'燈': u'deng1', u'燉': u'dun4', u'燊': u'shen1', u'燋': u'qiao2', u'燌': u'fen2', u'燍': u'si1', u'燎': u'liao2', u'燏': u'yu4', u'燐': u'lin2', u'燑': u'tong2', u'燒': u'shao1', u'燓': u'fen2', u'燔': u'fan2', u'燕': u'yan4', u'燖': u'xun2', u'燗': u'lan4', u'燘': u'mei3', u'燙': u'tang4', u'燚': u'yi4', u'燛': u'jiong3', u'燜': u'men4', u'燝': u'zhu3', u'燞': u'jiao3', u'營': u'ying2', u'燠': u'yu4', u'燡': u'yi4', u'燢': u'xue2', u'燣': u'lan2', u'燤': u'tai4', u'燥': u'zao4', u'燦': u'can4', u'燧': u'sui4', u'燨': u'xi1', u'燩': u'que4', u'燪': u'zong3', u'燫': u'lian2', u'燬': u'hui3', u'燭': u'zhu2', u'燮': u'xie4', u'燯': u'ling2', u'燰': u'wei1', u'燱': u'yi4', u'燲': u'xie2', u'燳': u'zhao4', u'燴': u'hui4', u'燵': u'ta1tui1', u'燶': u'nong2', u'燷': u'lan2', u'燸': u'xu1', u'燹': u'xian3', u'燺': u'he4', u'燻': u'xun1', u'燼': u'jin4', u'燽': u'chou2', u'燾': u'tao1', u'燿': u'yao4', u'爀': u'he4', u'爁': u'lan4', u'爂': u'biao1', u'爃': u'rong2', u'爄': u'li4', u'爅': u'mo4', u'爆': u'bao4', u'爇': u'ruo4', u'爈': u'lv4', u'爉': u'la4', u'爊': u'ao1', u'爋': u'xun1', u'爌': u'kuang4', u'爍': u'shuo4', u'爎': u'liao2', u'爏': u'li4', u'爐': u'lu2', u'爑': u'jue2', u'爒': u'liao2', u'爓': u'yan4', u'爔': u'xi1', u'爕': u'xie4', u'爖': u'long2', u'爗': u'ye4', u'爘': u'can', u'爙': u'rang3', u'爚': u'yue4', u'爛': u'lan4', u'爜': u'cong2', u'爝': u'jue2', u'爞': u'chong2', u'爟': u'guan4', u'爠': u'qu2', u'爡': u'che4', u'爢': u'mi2', u'爣': u'tang3', u'爤': u'lan4', u'爥': u'zhu2', u'爦': u'lan3', u'爧': u'ling2', u'爨': u'cuan4', u'爩': u'yu4', u'爪': u'zhao3', u'爫': u'zhao3', u'爬': u'pa2', u'爭': u'zheng1', u'爮': u'pao2', u'爯': u'cheng1', u'爰': u'yuan2', u'爱': u'ai4', u'爲': u'wei2', u'爳': u'han', u'爴': u'jue2', u'爵': u'jue2', u'父': u'fu4', u'爷': u'ye2', u'爸': u'ba4', u'爹': u'die1', u'爺': u'ye2', u'爻': u'yao2', u'爼': u'zu3', u'爽': u'shuang3', u'爾': u'er3', u'爿': u'pan2', u'牀': u'chuang2', u'牁': u'ke1', u'牂': u'zang1', u'牃': u'die2', u'牄': u'qiang1', u'牅': u'yong1', u'牆': u'qiang2', u'片': u'pian4', u'版': u'ban3', u'牉': u'pan4', u'牊': u'chao2', u'牋': u'jian1', u'牌': u'pai2', u'牍': u'du2', u'牎': u'chuang1', u'牏': u'yu2', u'牐': u'zha2', u'牑': u'bian1', u'牒': u'die2', u'牓': u'bang3', u'牔': u'bo2', u'牕': u'chuang1', u'牖': u'you3', u'牗': u'you3', u'牘': u'du2', u'牙': u'ya2', u'牚': u'cheng1', u'牛': u'niu2', u'牜': u'niu2', u'牝': u'pin4', u'牞': u'jiu1', u'牟': u'mou2', u'牠': u'ta1', u'牡': u'mu3', u'牢': u'lao2', u'牣': u'ren4', u'牤': u'mang1', u'牥': u'fang1', u'牦': u'mao2', u'牧': u'mu4', u'牨': u'gang1', u'物': u'wu4', u'牪': u'bie3', u'牫': u'ge1', u'牬': u'bei4', u'牭': u'si4', u'牮': u'jian4', u'牯': u'gu3', u'牰': u'you4', u'牱': u'ke1', u'牲': u'sheng1', u'牳': u'mu3', u'牴': u'di3', u'牵': u'qian1', u'牶': u'quan4', u'牷': u'quan2', u'牸': u'zi4', u'特': u'te4', u'牺': u'xi1', u'牻': u'mang2', u'牼': u'keng1', u'牽': u'qian1', u'牾': u'wu3', u'牿': u'gu4', u'犀': u'xi1', u'犁': u'li2', u'犂': u'li2', u'犃': u'pou3', u'犄': u'ji1', u'犅': u'gang1', u'犆': u'zhi2', u'犇': u'ben1', u'犈': u'quan2', u'犉': u'chun2', u'犊': u'du2', u'犋': u'ju4', u'犌': u'jia1', u'犍': u'jian1', u'犎': u'feng1', u'犏': u'pian1', u'犐': u'ke1', u'犑': u'ju2', u'犒': u'kao4', u'犓': u'chu2', u'犔': u'xi4', u'犕': u'bei4', u'犖': u'luo4', u'犗': u'jie4', u'犘': u'ma2', u'犙': u'san1', u'犚': u'wei4', u'犛': u'li2', u'犜': u'dun1', u'犝': u'tong2', u'犞': u'qiao2', u'犟': u'jiang4', u'犠': u'xi1', u'犡': u'li4', u'犢': u'du2', u'犣': u'lie4', u'犤': u'bai2', u'犥': u'piao1', u'犦': u'bao4', u'犧': u'xi1', u'犨': u'chou1', u'犩': u'wei2', u'犪': u'kui2', u'犫': u'chou1', u'犬': u'quan3', u'犭': u'quan3', u'犮': u'quan3', u'犯': u'fan4', u'犰': u'qiu2', u'犱': u'ji3', u'犲': u'chai2', u'犳': u'zhuo2', u'犴': u'an4', u'犵': u'ge1', u'状': u'zhuang4', u'犷': u'guang3', u'犸': u'ma3', u'犹': u'you2', u'犺': u'kang4', u'犻': u'pei4', u'犼': u'hou3', u'犽': u'ya4', u'犾': u'yin2', u'犿': u'huan1', u'狀': u'zhuang4', u'狁': u'yun3', u'狂': u'kuang2', u'狃': u'niu3', u'狄': u'di2', u'狅': u'kuang2', u'狆': u'zhong4', u'狇': u'mu4', u'狈': u'bei4', u'狉': u'pi1', u'狊': u'ju2', u'狋': u'yi2', u'狌': u'sheng1', u'狍': u'pao2', u'狎': u'xia2', u'狏': u'tuo2', u'狐': u'hu2', u'狑': u'ling2', u'狒': u'fei4', u'狓': u'pi1', u'狔': u'ni3', u'狕': u'yao3', u'狖': u'you4', u'狗': u'gou3', u'狘': u'xue4', u'狙': u'ju1', u'狚': u'dan4', u'狛': u'bo2', u'狜': u'ku3', u'狝': u'xian3', u'狞': u'ning2', u'狟': u'huan1', u'狠': u'hen3', u'狡': u'jiao3', u'狢': u'he2', u'狣': u'zhao4', u'狤': u'jie2', u'狥': u'xun4', u'狦': u'shan1', u'狧': u'ta4', u'狨': u'rong2', u'狩': u'shou4', u'狪': u'tong2', u'狫': u'lao3', u'独': u'du2', u'狭': u'xia2', u'狮': u'shi1', u'狯': u'kuai4', u'狰': u'zheng1', u'狱': u'yu4', u'狲': u'sun1', u'狳': u'yu2', u'狴': u'bi4', u'狵': u'mang2', u'狶': u'xi1', u'狷': u'juan4', u'狸': u'li2', u'狹': u'xia2', u'狺': u'yin2', u'狻': u'suan1', u'狼': u'lang2', u'狽': u'bei4', u'狾': u'zhi4', u'狿': u'yan2', u'猀': u'sha1', u'猁': u'li4', u'猂': u'han4', u'猃': u'xian3', u'猄': u'jing1', u'猅': u'pai2', u'猆': u'fei1', u'猇': u'xiao1', u'猈': u'bai4', u'猉': u'qi2', u'猊': u'ni2', u'猋': u'biao1', u'猌': u'yin4', u'猍': u'lai2', u'猎': u'lie4', u'猏': u'jian1', u'猐': u'qiang1', u'猑': u'kun1', u'猒': u'yan4', u'猓': u'guo3', u'猔': u'zong4', u'猕': u'mi2', u'猖': u'chang1', u'猗': u'yi1', u'猘': u'zhi4', u'猙': u'zheng1', u'猚': u'ya2', u'猛': u'meng3', u'猜': u'cai1', u'猝': u'cu4', u'猞': u'she1', u'猟': u'lie4', u'猠': u'ce', u'猡': u'luo2', u'猢': u'hu2', u'猣': u'zong1', u'猤': u'gui4', u'猥': u'wei3', u'猦': u'feng1', u'猧': u'wo1', u'猨': u'yuan2', u'猩': u'xing1', u'猪': u'zhu1', u'猫': u'mao1', u'猬': u'wei4', u'猭': u'chuan4', u'献': u'xian4', u'猯': u'tuan1', u'猰': u'ya4', u'猱': u'nao2', u'猲': u'he4', u'猳': u'jia1', u'猴': u'hou2', u'猵': u'bian1', u'猶': u'you2', u'猷': u'you2', u'猸': u'mei2', u'猹': u'cha2', u'猺': u'yao2', u'猻': u'sun1', u'猼': u'bo2', u'猽': u'ming2', u'猾': u'hua2', u'猿': u'yuan2', u'獀': u'sou1', u'獁': u'ma3', u'獂': u'huan2', u'獃': u'dai1', u'獄': u'yu4', u'獅': u'shi1', u'獆': u'hao2', u'獇': u'qiang1', u'獈': u'yi4', u'獉': u'zhen1', u'獊': u'cang1', u'獋': u'hao2', u'獌': u'man4', u'獍': u'jing4', u'獎': u'jiang3', u'獏': u'mo4', u'獐': u'zhang1', u'獑': u'chan2', u'獒': u'ao2', u'獓': u'ao2', u'獔': u'hao2', u'獕': u'cui1', u'獖': u'fen2', u'獗': u'jue2', u'獘': u'bi4', u'獙': u'bi4', u'獚': u'huang2', u'獛': u'pu2', u'獜': u'lin2', u'獝': u'xu4', u'獞': u'tong2', u'獟': u'yao4', u'獠': u'liao2', u'獡': u'shuo4', u'獢': u'xiao1', u'獣': u'shou4', u'獤': u'dun1', u'獥': u'jiao4', u'獦': u'ge2', u'獧': u'juan4', u'獨': u'du2', u'獩': u'hui4', u'獪': u'kuai4', u'獫': u'xian3', u'獬': u'xie4', u'獭': u'ta3', u'獮': u'mi2', u'獯': u'xun1', u'獰': u'ning2', u'獱': u'bian1', u'獲': u'huo4', u'獳': u'nou4', u'獴': u'meng3', u'獵': u'lie4', u'獶': u'nao2', u'獷': u'guang3', u'獸': u'shou4', u'獹': u'lu2', u'獺': u'ta3', u'獻': u'xian4', u'獼': u'mi2', u'獽': u'rang2', u'獾': u'huan1', u'獿': u'nao2', u'玀': u'luo2', u'玁': u'xian3', u'玂': u'qi2', u'玃': u'jue2', u'玄': u'xuan2', u'玅': u'miao4', u'玆': u'zi1', u'率': u'shuai4', u'玈': u'lu2', u'玉': u'yu4', u'玊': u'su4', u'王': u'wang2', u'玌': u'qiu2', u'玍': u'ga3', u'玎': u'ding1', u'玏': u'le4', u'玐': u'ba1', u'玑': u'ji1', u'玒': u'hong2', u'玓': u'di4', u'玔': u'chuan4', u'玕': u'gan1', u'玖': u'jiu3', u'玗': u'yu2', u'玘': u'qi3', u'玙': u'yu2', u'玚': u'chang4', u'玛': u'ma3', u'玜': u'hong2', u'玝': u'wu3', u'玞': u'fu1', u'玟': u'min2', u'玠': u'jie4', u'玡': u'ya2', u'玢': u'fen1', u'玣': u'bian4', u'玤': u'bang4', u'玥': u'yue4', u'玦': u'jue2', u'玧': u'men2', u'玨': u'jue2', u'玩': u'wan2', u'玪': u'jian1', u'玫': u'mei2', u'玬': u'dan3', u'玭': u'pin2', u'玮': u'wei3', u'环': u'huan2', u'现': u'xian4', u'玱': u'qiang1', u'玲': u'ling2', u'玳': u'dai4', u'玴': u'yi4', u'玵': u'an2', u'玶': u'ping2', u'玷': u'dian4', u'玸': u'fu2', u'玹': u'xuan2', u'玺': u'xi3', u'玻': u'bo1', u'玼': u'ci1', u'玽': u'gou3', u'玾': u'jia3', u'玿': u'shao2', u'珀': u'po4', u'珁': u'ci2', u'珂': u'ke1', u'珃': u'ran3', u'珄': u'sheng1', u'珅': u'shen1', u'珆': u'yi2', u'珇': u'zu3', u'珈': u'jia1', u'珉': u'min2', u'珊': u'shan1', u'珋': u'liu3', u'珌': u'bi4', u'珍': u'zhen1', u'珎': u'zhen1', u'珏': u'jue2', u'珐': u'fa4', u'珑': u'long2', u'珒': u'jin1', u'珓': u'jiao4', u'珔': u'jian4', u'珕': u'li4', u'珖': u'guang1', u'珗': u'xian1', u'珘': u'zhou1', u'珙': u'gong3', u'珚': u'yan1', u'珛': u'xiu4', u'珜': u'yang2', u'珝': u'xu3', u'珞': u'luo4', u'珟': u'su4', u'珠': u'zhu1', u'珡': u'qin2', u'珢': u'yin2', u'珣': u'xun2', u'珤': u'bao3', u'珥': u'er3', u'珦': u'xiang4', u'珧': u'yao2', u'珨': u'xia2', u'珩': u'hang2', u'珪': u'gui1', u'珫': u'chong1', u'珬': u'xu4', u'班': u'ban1', u'珮': u'pei4', u'珯': u'lao3', u'珰': u'dang1', u'珱': u'ying1', u'珲': u'hui1', u'珳': u'wen2', u'珴': u'e2', u'珵': u'cheng2', u'珶': u'di4', u'珷': u'wu3', u'珸': u'wu2', u'珹': u'cheng2', u'珺': u'jun4', u'珻': u'mei2', u'珼': u'bei4', u'珽': u'ting3', u'現': u'xian4', u'珿': u'chu4', u'琀': u'han2', u'琁': u'xuan2', u'琂': u'yan2', u'球': u'qiu2', u'琄': u'xuan4', u'琅': u'lang2', u'理': u'li3', u'琇': u'xiu4', u'琈': u'fu2', u'琉': u'liu2', u'琊': u'ya2', u'琋': u'xi1', u'琌': u'ling2', u'琍': u'li2', u'琎': u'jin1', u'琏': u'lian3', u'琐': u'suo3', u'琑': u'suo', u'琒': u'feng', u'琓': u'wan', u'琔': u'dian4', u'琕': u'pin2', u'琖': u'zhan3', u'琗': u'cui4', u'琘': u'min2', u'琙': u'yu4', u'琚': u'ju1', u'琛': u'chen1', u'琜': u'lai2', u'琝': u'min2', u'琞': u'sheng4', u'琟': u'wei2', u'琠': u'tian3', u'琡': u'shu1', u'琢': u'zhuo2', u'琣': u'beng3', u'琤': u'cheng1', u'琥': u'hu3', u'琦': u'qi2', u'琧': u'e4', u'琨': u'kun1', u'琩': u'chang1', u'琪': u'qi2', u'琫': u'beng3', u'琬': u'wan3', u'琭': u'lu4', u'琮': u'cong2', u'琯': u'guan3', u'琰': u'yan3', u'琱': u'diao1', u'琲': u'bei4', u'琳': u'lin2', u'琴': u'qin2', u'琵': u'pi2', u'琶': u'pa', u'琷': u'que4', u'琸': u'zhuo2', u'琹': u'qin2', u'琺': u'fa4', u'琻': u'jin', u'琼': u'qiong2', u'琽': u'du3', u'琾': u'jie4', u'琿': u'hui1', u'瑀': u'yu3', u'瑁': u'mao4', u'瑂': u'mei2', u'瑃': u'chun1', u'瑄': u'xuan1', u'瑅': u'ti2', u'瑆': u'xing1', u'瑇': u'dai4', u'瑈': u'rou2', u'瑉': u'min2', u'瑊': u'jian1', u'瑋': u'wei3', u'瑌': u'ruan3', u'瑍': u'huan4', u'瑎': u'xie2', u'瑏': u'chuan1', u'瑐': u'jian3', u'瑑': u'zhuan4', u'瑒': u'chang4', u'瑓': u'lian4', u'瑔': u'quan2', u'瑕': u'xia2', u'瑖': u'duan4', u'瑗': u'yuan4', u'瑘': u'ye2', u'瑙': u'nao3', u'瑚': u'hu2', u'瑛': u'ying1', u'瑜': u'yu2', u'瑝': u'huang2', u'瑞': u'rui4', u'瑟': u'se4', u'瑠': u'liu2', u'瑡': u'shi1', u'瑢': u'rong2', u'瑣': u'suo3', u'瑤': u'yao2', u'瑥': u'wen1', u'瑦': u'wu3', u'瑧': u'zhen1', u'瑨': u'jin4', u'瑩': u'ying2', u'瑪': u'ma3', u'瑫': u'tao1', u'瑬': u'liu2', u'瑭': u'tang2', u'瑮': u'li4', u'瑯': u'lang2', u'瑰': u'gui1', u'瑱': u'tian3', u'瑲': u'qiang1', u'瑳': u'cuo1', u'瑴': u'jue2', u'瑵': u'zhao3', u'瑶': u'yao2', u'瑷': u'ai4', u'瑸': u'bin1', u'瑹': u'tu2', u'瑺': u'chang2', u'瑻': u'kun1', u'瑼': u'zhuan1', u'瑽': u'cong1', u'瑾': u'jin3', u'瑿': u'yi1', u'璀': u'cui3', u'璁': u'cong1', u'璂': u'qi2', u'璃': u'li2', u'璄': u'jing3', u'璅': u'suo3', u'璆': u'qiu2', u'璇': u'xuan2', u'璈': u'ao2', u'璉': u'lian3', u'璊': u'men2', u'璋': u'zhang1', u'璌': u'yin2', u'璍': u'ye4', u'璎': u'ying1', u'璏': u'zhi4', u'璐': u'lu4', u'璑': u'wu2', u'璒': u'deng1', u'璓': u'xiu4', u'璔': u'zeng1', u'璕': u'xun2', u'璖': u'qu2', u'璗': u'dang4', u'璘': u'lin2', u'璙': u'liao2', u'璚': u'qiong2', u'璛': u'su4', u'璜': u'huang2', u'璝': u'gui1', u'璞': u'pu2', u'璟': u'jing3', u'璠': u'fan2', u'璡': u'jin1', u'璢': u'liu2', u'璣': u'ji1', u'璤': u'hui', u'璥': u'jing3', u'璦': u'ai4', u'璧': u'bi4', u'璨': u'can4', u'璩': u'qu2', u'璪': u'zao3', u'璫': u'dang1', u'璬': u'jiao3', u'璭': u'guan3', u'璮': u'tan3', u'璯': u'hui4', u'環': u'huan2', u'璱': u'se4', u'璲': u'sui4', u'璳': u'tian2', u'璴': u'chu', u'璵': u'yu2', u'璶': u'jin4', u'璷': u'lu2', u'璸': u'bin1', u'璹': u'shu2', u'璺': u'wen2', u'璻': u'zui3', u'璼': u'lan2', u'璽': u'xi3', u'璾': u'ji4', u'璿': u'xuan2', u'瓀': u'ruan3', u'瓁': u'wo4', u'瓂': u'gai4', u'瓃': u'lei2', u'瓄': u'du2', u'瓅': u'li4', u'瓆': u'zhi4', u'瓇': u'rou2', u'瓈': u'li2', u'瓉': u'zan4', u'瓊': u'qiong2', u'瓋': u'ti4', u'瓌': u'gui1', u'瓍': u'sui2', u'瓎': u'la4', u'瓏': u'long2', u'瓐': u'lu2', u'瓑': u'li4', u'瓒': u'zan4', u'瓓': u'lan4', u'瓔': u'ying1', u'瓕': u'mi2', u'瓖': u'xiang1', u'瓗': u'qiong2', u'瓘': u'guan4', u'瓙': u'dao4', u'瓚': u'zan4', u'瓛': u'huan2', u'瓜': u'gua1', u'瓝': u'bo2', u'瓞': u'die2', u'瓟': u'bo2', u'瓠': u'hu4', u'瓡': u'zhi2', u'瓢': u'piao2', u'瓣': u'ban4', u'瓤': u'rang2', u'瓥': u'li4', u'瓦': u'wa3', u'瓧': u'shi2wa3', u'瓨': u'xiang2', u'瓩': u'qian1wa3', u'瓪': u'ban3', u'瓫': u'pen2', u'瓬': u'fang3', u'瓭': u'dan3', u'瓮': u'weng4', u'瓯': u'ou1', u'瓰': u'fen1wa3', u'瓱': u'mao2wa3', u'瓲': u'tong', u'瓳': u'hu2', u'瓴': u'ling2', u'瓵': u'yi2', u'瓶': u'ping2', u'瓷': u'ci2', u'瓸': u'bai2wa3', u'瓹': u'juan4', u'瓺': u'chang2', u'瓻': u'chi1', u'瓼': u'li2wa3', u'瓽': u'dang4', u'瓾': u'wa1', u'瓿': u'bu4', u'甀': u'zhui4', u'甁': u'ping2', u'甂': u'bian1', u'甃': u'zhou4', u'甄': u'zhen1', u'甅': u'li2wa3', u'甆': u'ci2', u'甇': u'ying1', u'甈': u'qi4', u'甉': u'xian2', u'甊': u'lou3', u'甋': u'di4', u'甌': u'ou1', u'甍': u'meng2', u'甎': u'zhuan1', u'甏': u'beng4', u'甐': u'lin4', u'甑': u'zeng4', u'甒': u'wu3', u'甓': u'pi4', u'甔': u'dan1', u'甕': u'weng4', u'甖': u'ying1', u'甗': u'yan3', u'甘': u'gan1', u'甙': u'dai4', u'甚': u'shen4', u'甛': u'tian2', u'甜': u'tian2', u'甝': u'han2', u'甞': u'chang2', u'生': u'sheng1', u'甠': u'qing2', u'甡': u'shen1', u'產': u'chan3', u'産': u'chan3', u'甤': u'rui2', u'甥': u'sheng1', u'甦': u'su1', u'甧': u'shen1', u'用': u'yong4', u'甩': u'shuai3', u'甪': u'lu4', u'甫': u'fu3', u'甬': u'yong3', u'甭': u'beng2', u'甮': u'beng2', u'甯': u'ning2', u'田': u'tian2', u'由': u'you2', u'甲': u'jia3', u'申': u'shen1', u'甴': u'you2', u'电': u'dian4', u'甶': u'fu2', u'男': u'nan2', u'甸': u'dian4', u'甹': u'ping1', u'町': u'ding1', u'画': u'hua4', u'甼': u'ting3', u'甽': u'zhen4', u'甾': u'zai1', u'甿': u'meng2', u'畀': u'bi4', u'畁': u'bi4', u'畂': u'mu3', u'畃': u'xun2', u'畄': u'liu2', u'畅': u'chang4', u'畆': u'mu3', u'畇': u'yun2', u'畈': u'fan4', u'畉': u'fu2', u'畊': u'geng1', u'畋': u'tian2', u'界': u'jie4', u'畍': u'jie4', u'畎': u'quan3', u'畏': u'wei4', u'畐': u'bi1', u'畑': u'tian2', u'畒': u'mu3', u'畓': u'da1bo', u'畔': u'pan4', u'畕': u'jiang1', u'畖': u'wa1', u'畗': u'da2', u'畘': u'nan2', u'留': u'liu2', u'畚': u'ben3', u'畛': u'zhen3', u'畜': u'chu4', u'畝': u'mu3', u'畞': u'mu3', u'畟': u'ji1', u'畠': u'tian2', u'畡': u'gai1', u'畢': u'bi4', u'畣': u'da2', u'畤': u'zhi4', u'略': u'lue4', u'畦': u'qi2', u'畧': u'lue4', u'畨': u'fan1', u'畩': u'yi', u'番': u'fan1', u'畫': u'hua4', u'畬': u'she1', u'畭': u'she1', u'畮': u'mu3', u'畯': u'jun4', u'異': u'yi4', u'畱': u'liu2', u'畲': u'she1', u'畳': u'die2', u'畴': u'chou2', u'畵': u'hua4', u'當': u'dang1', u'畷': u'zhui4', u'畸': u'ji1', u'畹': u'wan3', u'畺': u'jiang1', u'畻': u'cheng2', u'畼': u'chang4', u'畽': u'tuan3', u'畾': u'lei2', u'畿': u'ji1', u'疀': u'cha1', u'疁': u'liu2', u'疂': u'die2', u'疃': u'tuan3', u'疄': u'lin2', u'疅': u'jiang1', u'疆': u'jiang1', u'疇': u'chou2', u'疈': u'pi4', u'疉': u'die2', u'疊': u'die2', u'疋': u'pi3', u'疌': u'jie2', u'疍': u'dan4', u'疎': u'shu1', u'疏': u'shu1', u'疐': u'zhi4', u'疑': u'yi2', u'疒': u'ne4', u'疓': u'nai3', u'疔': u'ding1', u'疕': u'bi3', u'疖': u'jie1', u'疗': u'liao2', u'疘': u'gang1', u'疙': u'ge1', u'疚': u'jiu4', u'疛': u'zhou3', u'疜': u'xia4', u'疝': u'shan4', u'疞': u'xu1', u'疟': u'nue4', u'疠': u'li4', u'疡': u'yang2', u'疢': u'chen4', u'疣': u'you2', u'疤': u'ba1', u'疥': u'jie4', u'疦': u'jue2', u'疧': u'qi2', u'疨': u'ya3', u'疩': u'cui4', u'疪': u'bi4', u'疫': u'yi4', u'疬': u'li4', u'疭': u'zong4', u'疮': u'chuang1', u'疯': u'feng1', u'疰': u'zhu4', u'疱': u'pao4', u'疲': u'pi2', u'疳': u'gan1', u'疴': u'ke1', u'疵': u'ci1', u'疶': u'xue1', u'疷': u'zhi1', u'疸': u'dan3', u'疹': u'zhen3', u'疺': u'fa2', u'疻': u'zhi3', u'疼': u'teng2', u'疽': u'ju1', u'疾': u'ji2', u'疿': u'fei4', u'痀': u'gou1', u'痁': u'shan1', u'痂': u'jia1', u'痃': u'xuan2', u'痄': u'zha4', u'病': u'bing4', u'痆': u'nie4', u'症': u'zheng4', u'痈': u'yong1', u'痉': u'jing4', u'痊': u'quan2', u'痋': u'teng2', u'痌': u'tong1', u'痍': u'yi2', u'痎': u'jie1', u'痏': u'wei3', u'痐': u'hui2', u'痑': u'tan1', u'痒': u'yang3', u'痓': u'zhi4', u'痔': u'zhi4', u'痕': u'hen2', u'痖': u'ya3', u'痗': u'mei4', u'痘': u'dou4', u'痙': u'jing4', u'痚': u'xiao1', u'痛': u'tong4', u'痜': u'tu1', u'痝': u'mang2', u'痞': u'pi3', u'痟': u'xiao1', u'痠': u'suan1', u'痡': u'pu1', u'痢': u'li4', u'痣': u'zhi4', u'痤': u'cuo2', u'痥': u'duo2', u'痦': u'wu4', u'痧': u'sha1', u'痨': u'lao2', u'痩': u'shou4', u'痪': u'huan4', u'痫': u'xian2', u'痬': u'yi4', u'痭': u'beng1', u'痮': u'zhang4', u'痯': u'guan3', u'痰': u'tan2', u'痱': u'fei4', u'痲': u'ma2', u'痳': u'ma2', u'痴': u'chi1', u'痵': u'ji4', u'痶': u'tian3', u'痷': u'an1', u'痸': u'chi4', u'痹': u'bi4', u'痺': u'bi4', u'痻': u'min2', u'痼': u'gu4', u'痽': u'dui1', u'痾': u'ke1', u'痿': u'wei3', u'瘀': u'yu1', u'瘁': u'cui4', u'瘂': u'ya3', u'瘃': u'zhu2', u'瘄': u'cu4', u'瘅': u'dan1', u'瘆': u'shen4', u'瘇': u'zhong3', u'瘈': u'chi4', u'瘉': u'yu4', u'瘊': u'hou2', u'瘋': u'feng1', u'瘌': u'la4', u'瘍': u'yang2', u'瘎': u'chen2', u'瘏': u'tu2', u'瘐': u'yu3', u'瘑': u'guo1', u'瘒': u'wen2', u'瘓': u'huan4', u'瘔': u'ku4', u'瘕': u'jia3', u'瘖': u'yin1', u'瘗': u'yi4', u'瘘': u'lou4', u'瘙': u'sao4', u'瘚': u'jue2', u'瘛': u'chi4', u'瘜': u'xi1', u'瘝': u'guan1', u'瘞': u'yi4', u'瘟': u'wen1', u'瘠': u'ji2', u'瘡': u'chuang1', u'瘢': u'ban1', u'瘣': u'hui4', u'瘤': u'liu2', u'瘥': u'cuo2', u'瘦': u'shou4', u'瘧': u'nue4', u'瘨': u'dian1', u'瘩': u'da2', u'瘪': u'bie3', u'瘫': u'tan1', u'瘬': u'zhang4', u'瘭': u'biao1', u'瘮': u'shen4', u'瘯': u'cu4', u'瘰': u'luo3', u'瘱': u'yi4', u'瘲': u'zong4', u'瘳': u'chou1', u'瘴': u'zhang4', u'瘵': u'zhai4', u'瘶': u'sou4', u'瘷': u'se4', u'瘸': u'que2', u'瘹': u'diao4', u'瘺': u'lou4', u'瘻': u'lou4', u'瘼': u'mo4', u'瘽': u'qin2', u'瘾': u'yin3', u'瘿': u'ying3', u'癀': u'huang2', u'癁': u'fu2', u'療': u'liao2', u'癃': u'long2', u'癄': u'qiao2', u'癅': u'liu2', u'癆': u'lao2', u'癇': u'xian2', u'癈': u'fei4', u'癉': u'dan1', u'癊': u'yin4', u'癋': u'he4', u'癌': u'ai2', u'癍': u'ban1', u'癎': u'xian2', u'癏': u'guan1', u'癐': u'gui4', u'癑': u'nong4', u'癒': u'yu4', u'癓': u'wei1', u'癔': u'yi4', u'癕': u'yong1', u'癖': u'pi3', u'癗': u'lei3', u'癘': u'li4', u'癙': u'shu3', u'癚': u'dan4', u'癛': u'lin3', u'癜': u'dian4', u'癝': u'lin3', u'癞': u'lai4', u'癟': u'bie3', u'癠': u'ji4', u'癡': u'chi1', u'癢': u'yang3', u'癣': u'xuan3', u'癤': u'jie1', u'癥': u'zheng4', u'癦': u'mo4', u'癧': u'li4', u'癨': u'huo4', u'癩': u'lai4', u'癪': u'ji1', u'癫': u'dian1', u'癬': u'xuan3', u'癭': u'ying3', u'癮': u'yin3', u'癯': u'qu2', u'癰': u'yong1', u'癱': u'tan1', u'癲': u'dian1', u'癳': u'luo3', u'癴': u'luan2', u'癵': u'luan2', u'癶': u'bo1', u'癷': u'wuwu', u'癸': u'gui3', u'癹': u'ba2', u'発': u'fa1', u'登': u'deng1', u'發': u'fa1', u'白': u'bai2', u'百': u'bai3', u'癿': u'qie2', u'皀': u'bi1', u'皁': u'zao4', u'皂': u'zao4', u'皃': u'mao4', u'的': u'de', u'皅': u'pa1', u'皆': u'jie1', u'皇': u'huang2', u'皈': u'gui1', u'皉': u'ci3', u'皊': u'ling2', u'皋': u'gao1', u'皌': u'mo4', u'皍': u'ji2', u'皎': u'jiao3', u'皏': u'peng3', u'皐': u'gao1', u'皑': u'ai2', u'皒': u'e2', u'皓': u'hao4', u'皔': u'han4', u'皕': u'bi4', u'皖': u'wan3', u'皗': u'chou2', u'皘': u'qian4', u'皙': u'xi1', u'皚': u'ai2', u'皛': u'xiao3', u'皜': u'hao4', u'皝': u'huang4', u'皞': u'hao4', u'皟': u'ze2', u'皠': u'cui3', u'皡': u'hao4', u'皢': u'xiao3', u'皣': u'ye4', u'皤': u'po2', u'皥': u'hao4', u'皦': u'jiao3', u'皧': u'ai4', u'皨': u'xing1', u'皩': u'huang4', u'皪': u'li4', u'皫': u'piao3', u'皬': u'he2', u'皭': u'jiao4', u'皮': u'pi2', u'皯': u'gan3', u'皰': u'pao4', u'皱': u'zhou4', u'皲': u'jun1', u'皳': u'qiu2', u'皴': u'cun1', u'皵': u'que4', u'皶': u'zha1', u'皷': u'gu3', u'皸': u'jun1', u'皹': u'jun1', u'皺': u'zhou4', u'皻': u'hui1', u'皼': u'gu3', u'皽': u'zhao1', u'皾': u'du2', u'皿': u'min3', u'盀': u'qi3', u'盁': u'ying2', u'盂': u'yu2', u'盃': u'bei1', u'盄': u'diao4', u'盅': u'zhong1', u'盆': u'pen2', u'盇': u'he2', u'盈': u'ying2', u'盉': u'he2', u'益': u'yi4', u'盋': u'bo1', u'盌': u'wan3', u'盍': u'he2', u'盎': u'ang4', u'盏': u'zhan3', u'盐': u'yan2', u'监': u'jian1', u'盒': u'he2', u'盓': u'yu1', u'盔': u'kui1', u'盕': u'fan4', u'盖': u'gai4', u'盗': u'dao4', u'盘': u'pan2', u'盙': u'fu3', u'盚': u'qiu2', u'盛': u'sheng4', u'盜': u'dao4', u'盝': u'lu4', u'盞': u'zhan3', u'盟': u'meng2', u'盠': u'li2', u'盡': u'jin4', u'盢': u'xu4', u'監': u'jian1', u'盤': u'pan2', u'盥': u'guan4', u'盦': u'an1', u'盧': u'lu2', u'盨': u'xu3', u'盩': u'zhou1', u'盪': u'dang4', u'盫': u'an1', u'盬': u'gu3', u'盭': u'li4', u'目': u'mu4', u'盯': u'ding1', u'盰': u'gan4', u'盱': u'xu1', u'盲': u'mang2', u'盳': u'mang2', u'直': u'zhi2', u'盵': u'qi4', u'盶': u'yuan3', u'盷': u'xian2', u'相': u'xiang4', u'盹': u'dun3', u'盺': u'xin1', u'盻': u'xi4', u'盼': u'pan4', u'盽': u'feng1', u'盾': u'dun4', u'盿': u'min2', u'眀': u'ming2', u'省': u'sheng3', u'眂': u'shi4', u'眃': u'yun2', u'眄': u'mian3', u'眅': u'pan1', u'眆': u'fang3', u'眇': u'miao3', u'眈': u'dan1', u'眉': u'mei2', u'眊': u'mao4', u'看': u'kan4', u'県': u'xian4', u'眍': u'kou1', u'眎': u'shi4', u'眏': u'yang1', u'眐': u'zheng1', u'眑': u'yao3', u'眒': u'shen1', u'眓': u'huo4', u'眔': u'da4', u'眕': u'zhen3', u'眖': u'kuang4', u'眗': u'ju1', u'眘': u'shen4', u'眙': u'yi2', u'眚': u'sheng3', u'眛': u'mei4', u'眜': u'mo4', u'眝': u'zhu4', u'眞': u'zhen1', u'真': u'zhen1', u'眠': u'mian2', u'眡': u'shi4', u'眢': u'yuan1', u'眣': u'die2', u'眤': u'ni4', u'眥': u'zi4', u'眦': u'zi4', u'眧': u'chao3', u'眨': u'zha3', u'眩': u'xuan4', u'眪': u'bing3', u'眫': u'pang4', u'眬': u'long2', u'眭': u'sui1', u'眮': u'tong2', u'眯': u'mi1', u'眰': u'die2', u'眱': u'di4', u'眲': u'ne4', u'眳': u'ming2', u'眴': u'xuan4', u'眵': u'chi1', u'眶': u'kuang4', u'眷': u'juan4', u'眸': u'mou2', u'眹': u'zhen4', u'眺': u'tiao4', u'眻': u'yang2', u'眼': u'yan3', u'眽': u'mo4', u'眾': u'zhong4', u'眿': u'mo4', u'着': u'zhe', u'睁': u'zheng1', u'睂': u'mei2', u'睃': u'suo1', u'睄': u'shao4', u'睅': u'han4', u'睆': u'huan3', u'睇': u'di4', u'睈': u'cheng3', u'睉': u'cuo2', u'睊': u'juan4', u'睋': u'e2', u'睌': u'mian3', u'睍': u'xian4', u'睎': u'xi1', u'睏': u'kun4', u'睐': u'lai4', u'睑': u'jian3', u'睒': u'shan3', u'睓': u'tian3', u'睔': u'gun4', u'睕': u'wan1', u'睖': u'leng4', u'睗': u'shi4', u'睘': u'qiong2', u'睙': u'li4', u'睚': u'ya2', u'睛': u'jing1', u'睜': u'zheng1', u'睝': u'li', u'睞': u'lai4', u'睟': u'sui4', u'睠': u'juan4', u'睡': u'shui4', u'睢': u'sui1', u'督': u'du1', u'睤': u'bi4', u'睥': u'pi4', u'睦': u'mu4', u'睧': u'hun1', u'睨': u'ni4', u'睩': u'lu4', u'睪': u'gao1', u'睫': u'jie2', u'睬': u'cai3', u'睭': u'zhou3', u'睮': u'yu2', u'睯': u'hun1', u'睰': u'ma4', u'睱': u'xia4', u'睲': u'xing3', u'睳': u'hui1', u'睴': u'hun4', u'睵': u'zai1', u'睶': u'chun3', u'睷': u'jian1', u'睸': u'mei4', u'睹': u'du3', u'睺': u'hou2', u'睻': u'xuan1', u'睼': u'ti2', u'睽': u'kui2', u'睾': u'gao1', u'睿': u'rui4', u'瞀': u'mao4', u'瞁': u'xu4', u'瞂': u'fa2', u'瞃': u'wo4', u'瞄': u'miao2', u'瞅': u'chou3', u'瞆': u'gui4', u'瞇': u'mi1', u'瞈': u'weng3', u'瞉': u'kou4', u'瞊': u'dang4', u'瞋': u'chen1', u'瞌': u'ke1', u'瞍': u'sou3', u'瞎': u'xia1', u'瞏': u'qiong2', u'瞐': u'mo4', u'瞑': u'ming2', u'瞒': u'man2', u'瞓': u'fen', u'瞔': u'ze2', u'瞕': u'zhang4', u'瞖': u'yi4', u'瞗': u'diao1', u'瞘': u'kou1', u'瞙': u'mo4', u'瞚': u'shun4', u'瞛': u'cong1', u'瞜': u'lou1', u'瞝': u'chi1', u'瞞': u'man2', u'瞟': u'piao3', u'瞠': u'cheng1', u'瞡': u'gui1', u'瞢': u'meng2', u'瞣': u'wan4', u'瞤': u'shun4', u'瞥': u'pie1', u'瞦': u'xi1', u'瞧': u'qiao2', u'瞨': u'pu2', u'瞩': u'zhu3', u'瞪': u'deng4', u'瞫': u'shen3', u'瞬': u'shun4', u'瞭': u'le', u'瞮': u'che4', u'瞯': u'xian2', u'瞰': u'kan4', u'瞱': u'ye4', u'瞲': u'xue4', u'瞳': u'tong2', u'瞴': u'wu3', u'瞵': u'lin2', u'瞶': u'gui4', u'瞷': u'jian4', u'瞸': u'ye4', u'瞹': u'ai4', u'瞺': u'hui4', u'瞻': u'zhan1', u'瞼': u'jian3', u'瞽': u'gu3', u'瞾': u'zhao4', u'瞿': u'qu2', u'矀': u'wei2', u'矁': u'chou3', u'矂': u'sao4', u'矃': u'ning3', u'矄': u'xun1', u'矅': u'yao4', u'矆': u'huo4', u'矇': u'meng2', u'矈': u'mian2', u'矉': u'pin2', u'矊': u'mian2', u'矋': u'lei', u'矌': u'kuang4', u'矍': u'jue2', u'矎': u'xuan1', u'矏': u'mian2', u'矐': u'huo4', u'矑': u'lu2', u'矒': u'meng2', u'矓': u'long2', u'矔': u'guan4', u'矕': u'man3', u'矖': u'xi3', u'矗': u'chu4', u'矘': u'tang3', u'矙': u'kan4', u'矚': u'zhu3', u'矛': u'mao2', u'矜': u'jin1', u'矝': u'jin1', u'矞': u'yu4', u'矟': u'shuo4', u'矠': u'ze2', u'矡': u'jue2', u'矢': u'shi3', u'矣': u'yi3', u'矤': u'shen3', u'知': u'zhi1', u'矦': u'hou2', u'矧': u'shen3', u'矨': u'ying3', u'矩': u'ju3', u'矪': u'zhou1', u'矫': u'jiao3', u'矬': u'cuo2', u'短': u'duan3', u'矮': u'ai3', u'矯': u'jiao3', u'矰': u'zeng1', u'矱': u'yue1', u'矲': u'ba4', u'石': u'shi2', u'矴': u'ding4', u'矵': u'qi4', u'矶': u'ji1', u'矷': u'zi3', u'矸': u'gan1', u'矹': u'wu4', u'矺': u'zhe2', u'矻': u'ku1', u'矼': u'gang1', u'矽': u'xi1', u'矾': u'fan2', u'矿': u'kuang4', u'砀': u'dang4', u'码': u'ma3', u'砂': u'sha1', u'砃': u'dan1', u'砄': u'jue2', u'砅': u'li4', u'砆': u'fu1', u'砇': u'min2', u'砈': u'e4', u'砉': u'hua1', u'砊': u'kang1', u'砋': u'zhi3', u'砌': u'qi4', u'砍': u'kan3', u'砎': u'jie4', u'砏': u'pin1', u'砐': u'e4', u'砑': u'ya4', u'砒': u'pi1', u'砓': u'zhe2', u'研': u'yan2', u'砕': u'sui4', u'砖': u'zhuan1', u'砗': u'che1', u'砘': u'dun4', u'砙': u'wa3', u'砚': u'yan4', u'砛': u'jin', u'砜': u'feng1', u'砝': u'fa3', u'砞': u'mo4', u'砟': u'zha3', u'砠': u'ju1', u'砡': u'yu4', u'砢': u'ke1', u'砣': u'tuo2', u'砤': u'tuo2', u'砥': u'di3', u'砦': u'zhai4', u'砧': u'zhen1', u'砨': u'e3', u'砩': u'fu2', u'砪': u'mu3', u'砫': u'zhu4', u'砬': u'la2', u'砭': u'bian1', u'砮': u'nu3', u'砯': u'ping1', u'砰': u'peng1', u'砱': u'ling2', u'砲': u'pao4', u'砳': u'le4', u'破': u'po4', u'砵': u'bo1', u'砶': u'po4', u'砷': u'shen1', u'砸': u'za2', u'砹': u'ai4', u'砺': u'li4', u'砻': u'long2', u'砼': u'tong2', u'砽': u'yong', u'砾': u'li4', u'砿': u'kuang4', u'础': u'chu3', u'硁': u'keng1', u'硂': u'quan2', u'硃': u'zhu1', u'硄': u'kuang1', u'硅': u'gui1', u'硆': u'e4', u'硇': u'nao2', u'硈': u'qia4', u'硉': u'lu4', u'硊': u'wei3', u'硋': u'ai4', u'硌': u'ge4', u'硍': u'ken4', u'硎': u'xing2', u'硏': u'yan2', u'硐': u'dong4', u'硑': u'peng1', u'硒': u'xi1', u'硓': u'lao', u'硔': u'hong2', u'硕': u'shuo4', u'硖': u'xia2', u'硗': u'qiao1', u'硘': u'qing', u'硙': u'wei4', u'硚': u'qiao2', u'硛': u'ji4', u'硜': u'keng1', u'硝': u'xiao1', u'硞': u'que4', u'硟': u'chan4', u'硠': u'lang2', u'硡': u'hong1', u'硢': u'yu4', u'硣': u'xiao1', u'硤': u'xia2', u'硥': u'mang3', u'硦': u'luo4', u'硧': u'yong3', u'硨': u'che1', u'硩': u'che4', u'硪': u'wo4', u'硫': u'liu2', u'硬': u'ying4', u'硭': u'mang2', u'确': u'que4', u'硯': u'yan4', u'硰': u'sha1', u'硱': u'kun3', u'硲': u'yu4', u'硳': u'xi', u'硴': u'hua', u'硵': u'lu3', u'硶': u'chen3', u'硷': u'jian3', u'硸': u'nue4', u'硹': u'song1', u'硺': u'zhuo2', u'硻': u'keng1', u'硼': u'peng2', u'硽': u'yan1', u'硾': u'zhui4', u'硿': u'kong1', u'碀': u'cheng1', u'碁': u'qi2', u'碂': u'zong4', u'碃': u'qing4', u'碄': u'lin2', u'碅': u'jun1', u'碆': u'bo1', u'碇': u'ding4', u'碈': u'min2', u'碉': u'diao1', u'碊': u'jian1', u'碋': u'he4', u'碌': u'lu4', u'碍': u'ai4', u'碎': u'sui4', u'碏': u'que4', u'碐': u'leng2', u'碑': u'bei1', u'碒': u'yin2', u'碓': u'dui4', u'碔': u'wu3', u'碕': u'qi2', u'碖': u'lun2', u'碗': u'wan3', u'碘': u'dian3', u'碙': u'nao2', u'碚': u'bei4', u'碛': u'qi4', u'碜': u'chen3', u'碝': u'ruan3', u'碞': u'yan2', u'碟': u'die2', u'碠': u'ding4', u'碡': u'zhou2', u'碢': u'tuo2', u'碣': u'jie2', u'碤': u'ying1', u'碥': u'bian3', u'碦': u'ke4', u'碧': u'bi4', u'碨': u'wei4', u'碩': u'shuo4', u'碪': u'zhen1', u'碫': u'duan4', u'碬': u'xia2', u'碭': u'dang4', u'碮': u'ti2', u'碯': u'nao3', u'碰': u'peng4', u'碱': u'jian3', u'碲': u'di4', u'碳': u'tan4', u'碴': u'cha2', u'碵': u'tian2', u'碶': u'qi4', u'碷': u'dun', u'碸': u'feng1', u'碹': u'xuan4', u'確': u'que4', u'碻': u'que4', u'碼': u'ma3', u'碽': u'gong1', u'碾': u'nian3', u'碿': u'su4', u'磀': u'e2', u'磁': u'ci2', u'磂': u'liu2', u'磃': u'si1', u'磄': u'tang2', u'磅': u'bang4', u'磆': u'hua2', u'磇': u'pi1', u'磈': u'kui3', u'磉': u'sang3', u'磊': u'lei3', u'磋': u'cuo1', u'磌': u'tian2', u'磍': u'xia2', u'磎': u'xi1', u'磏': u'lian2', u'磐': u'pan2', u'磑': u'wei4', u'磒': u'yun3', u'磓': u'dui1', u'磔': u'zhe2', u'磕': u'ke1', u'磖': u'la2', u'磗': u'zhuan1', u'磘': u'yao2', u'磙': u'gun3', u'磚': u'zhuan1', u'磛': u'chan2', u'磜': u'qi4', u'磝': u'ao2', u'磞': u'peng1', u'磟': u'liu4', u'磠': u'lu3', u'磡': u'kan4', u'磢': u'chuang3', u'磣': u'chen3', u'磤': u'yin1', u'磥': u'lei3', u'磦': u'biao1', u'磧': u'qi4', u'磨': u'mo2', u'磩': u'qi4', u'磪': u'cui1', u'磫': u'zong1', u'磬': u'qing4', u'磭': u'chuo4', u'磮': u'lun', u'磯': u'ji1', u'磰': u'shan4', u'磱': u'lao2', u'磲': u'qu2', u'磳': u'zeng1', u'磴': u'deng4', u'磵': u'jian4', u'磶': u'xi4', u'磷': u'lin2', u'磸': u'ding4', u'磹': u'dian4', u'磺': u'huang2', u'磻': u'pan2', u'磼': u'ji2', u'磽': u'qiao1', u'磾': u'di1', u'磿': u'li4', u'礀': u'jian4', u'礁': u'jiao1', u'礂': u'xi', u'礃': u'zhang3', u'礄': u'qiao2', u'礅': u'dun1', u'礆': u'jian3', u'礇': u'yu4', u'礈': u'zhui4', u'礉': u'he2', u'礊': u'ke4', u'礋': u'ze2', u'礌': u'lei2', u'礍': u'jie2', u'礎': u'chu3', u'礏': u'ye4', u'礐': u'que4', u'礑': u'dang4', u'礒': u'yi3', u'礓': u'jiang1', u'礔': u'pi1', u'礕': u'pi1', u'礖': u'yu', u'礗': u'pin1', u'礘': u'e4', u'礙': u'ai4', u'礚': u'ke1', u'礛': u'jian1', u'礜': u'yu4', u'礝': u'ruan3', u'礞': u'meng2', u'礟': u'pao4', u'礠': u'ci2', u'礡': u'bo1', u'礢': u'yang', u'礣': u'mie4', u'礤': u'ca3', u'礥': u'xian2', u'礦': u'kuang4', u'礧': u'lei2', u'礨': u'lei3', u'礩': u'zhi4', u'礪': u'li4', u'礫': u'li4', u'礬': u'fan2', u'礭': u'que4', u'礮': u'pao4', u'礯': u'ying1', u'礰': u'li4', u'礱': u'long2', u'礲': u'long2', u'礳': u'mo4', u'礴': u'bo2', u'礵': u'shuang1', u'礶': u'guan4', u'礷': u'jian1', u'礸': u'ca3', u'礹': u'yan2', u'示': u'shi4', u'礻': u'shi4', u'礼': u'li3', u'礽': u'reng2', u'社': u'she4', u'礿': u'yue4', u'祀': u'si4', u'祁': u'qi2', u'祂': u'ta1', u'祃': u'ma4', u'祄': u'xie4', u'祅': u'xian1', u'祆': u'xian1', u'祇': u'zhi1', u'祈': u'qi2', u'祉': u'zhi3', u'祊': u'beng1', u'祋': u'dui4', u'祌': u'zhong4', u'祍': u'ren4', u'祎': u'yi1', u'祏': u'shi2', u'祐': u'you4', u'祑': u'zhi4', u'祒': u'tiao2', u'祓': u'fu2', u'祔': u'fu4', u'祕': u'mi4', u'祖': u'zu3', u'祗': u'zhi1', u'祘': u'suan4', u'祙': u'mei4', u'祚': u'zuo4', u'祛': u'qu1', u'祜': u'hu4', u'祝': u'zhu4', u'神': u'shen2', u'祟': u'sui4', u'祠': u'ci2', u'祡': u'chai2', u'祢': u'mi2', u'祣': u'lv3', u'祤': u'yu3', u'祥': u'xiang2', u'祦': u'wu2', u'祧': u'tiao1', u'票': u'piao4', u'祩': u'zhu4', u'祪': u'gui3', u'祫': u'xia2', u'祬': u'zhi1', u'祭': u'ji4', u'祮': u'gao4', u'祯': u'zhen1', u'祰': u'gao4', u'祱': u'shui4', u'祲': u'jin4', u'祳': u'shen4', u'祴': u'gai1', u'祵': u'kun3', u'祶': u'di4', u'祷': u'dao3', u'祸': u'huo4', u'祹': u'tao2', u'祺': u'qi2', u'祻': u'gu4', u'祼': u'guan4', u'祽': u'zui4', u'祾': u'ling2', u'祿': u'lu4', u'禀': u'bing3', u'禁': u'jin4', u'禂': u'dao3', u'禃': u'zhi2', u'禄': u'lu4', u'禅': u'chan2', u'禆': u'bi4', u'禇': u'chu3', u'禈': u'hui1', u'禉': u'you3', u'禊': u'xi4', u'禋': u'yin1', u'禌': u'zi1', u'禍': u'huo4', u'禎': u'zhen1', u'福': u'fu2', u'禐': u'yuan4', u'禑': u'xu2', u'禒': u'xian3', u'禓': u'shang1', u'禔': u'zhi1', u'禕': u'yi1', u'禖': u'mei2', u'禗': u'si1', u'禘': u'di4', u'禙': u'bei4', u'禚': u'zhuo2', u'禛': u'zhen1', u'禜': u'ying2', u'禝': u'ji4', u'禞': u'gao4', u'禟': u'tang2', u'禠': u'si1', u'禡': u'ma4', u'禢': u'ta1', u'禣': u'fu', u'禤': u'xuan1', u'禥': u'qi2', u'禦': u'yu4', u'禧': u'xi3', u'禨': u'ji1', u'禩': u'si4', u'禪': u'chan2', u'禫': u'dan4', u'禬': u'gui4', u'禭': u'sui4', u'禮': u'li3', u'禯': u'nong2', u'禰': u'mi2', u'禱': u'dao3', u'禲': u'li4', u'禳': u'rang2', u'禴': u'yue4', u'禵': u'ti2', u'禶': u'zan4', u'禷': u'lei4', u'禸': u'rou2', u'禹': u'yu3', u'禺': u'yu2', u'离': u'li2', u'禼': u'xie4', u'禽': u'qin2', u'禾': u'he2', u'禿': u'tu1', u'秀': u'xiu4', u'私': u'si1', u'秂': u'ren2', u'秃': u'tu1', u'秄': u'zi3', u'秅': u'cha2', u'秆': u'gan3', u'秇': u'yi4', u'秈': u'xian1', u'秉': u'bing3', u'秊': u'nian2', u'秋': u'qiu1', u'秌': u'qiu1', u'种': u'zhong4', u'秎': u'fen4', u'秏': u'hao4', u'秐': u'yun2', u'科': u'ke1', u'秒': u'miao3', u'秓': u'zhi1', u'秔': u'jing1', u'秕': u'bi3', u'秖': u'zhi1', u'秗': u'yu4', u'秘': u'mi4', u'秙': u'ku4', u'秚': u'ban4', u'秛': u'pi1', u'秜': u'ni2', u'秝': u'li4', u'秞': u'you2', u'租': u'zu1', u'秠': u'pi1', u'秡': u'bo2', u'秢': u'ling2', u'秣': u'mo4', u'秤': u'cheng4', u'秥': u'nian2', u'秦': u'qin2', u'秧': u'yang1', u'秨': u'zuo2', u'秩': u'zhi4', u'秪': u'di1', u'秫': u'shu2', u'秬': u'ju4', u'秭': u'zi3', u'秮': u'huo2', u'积': u'ji1', u'称': u'cheng1', u'秱': u'tong2', u'秲': u'shi4', u'秳': u'huo2', u'秴': u'huo1', u'秵': u'yin1', u'秶': u'zi1', u'秷': u'zhi4', u'秸': u'jie1', u'秹': u'ren3', u'秺': u'du4', u'移': u'yi2', u'秼': u'zhu1', u'秽': u'hui4', u'秾': u'nong2', u'秿': u'fu4', u'稀': u'xi1', u'稁': u'gao3', u'稂': u'lang2', u'稃': u'fu1', u'稄': u'xun4', u'稅': u'shui4', u'稆': u'lv3', u'稇': u'kun3', u'稈': u'gan3', u'稉': u'jing1', u'稊': u'ti2', u'程': u'cheng2', u'稌': u'tu2', u'稍': u'shao1', u'税': u'shui4', u'稏': u'ya4', u'稐': u'lun3', u'稑': u'lu4', u'稒': u'gu1', u'稓': u'zuo2', u'稔': u'ren3', u'稕': u'zhun4', u'稖': u'bang4', u'稗': u'bai4', u'稘': u'ji1', u'稙': u'zhi1', u'稚': u'zhi4', u'稛': u'kun3', u'稜': u'leng2', u'稝': u'peng2', u'稞': u'ke1', u'稟': u'bing3', u'稠': u'chou2', u'稡': u'zui4', u'稢': u'yu4', u'稣': u'su1', u'稤': u'lue4', u'稥': u'xiang1', u'稦': u'yi1', u'稧': u'xi4', u'稨': u'bian3', u'稩': u'ji4', u'稪': u'fu2', u'稫': u'pi4', u'稬': u'nuo4', u'稭': u'jie1', u'種': u'zhong4', u'稯': u'zong1', u'稰': u'xu3', u'稱': u'cheng1', u'稲': u'dao4', u'稳': u'wen3', u'稴': u'xian2', u'稵': u'zi1', u'稶': u'yu4', u'稷': u'ji4', u'稸': u'xu4', u'稹': u'zhen3', u'稺': u'zhi4', u'稻': u'dao4', u'稼': u'jia4', u'稽': u'ji1', u'稾': u'gao3', u'稿': u'gao3', u'穀': u'gu3', u'穁': u'rong2', u'穂': u'sui4', u'穃': u'rong', u'穄': u'ji4', u'穅': u'kang1', u'穆': u'mu4', u'穇': u'can3', u'穈': u'men2', u'穉': u'zhi4', u'穊': u'ji4', u'穋': u'lu4', u'穌': u'su1', u'積': u'ji1', u'穎': u'ying3', u'穏': u'wen3', u'穐': u'qiu1', u'穑': u'se4', u'穒': u'keweioke', u'穓': u'yi4', u'穔': u'huang2', u'穕': u'qie4', u'穖': u'ji3', u'穗': u'sui4', u'穘': u'xiao1', u'穙': u'pu2', u'穚': u'jiao1', u'穛': u'zhuo1', u'穜': u'tong2', u'穝': u'zuo1', u'穞': u'lu3', u'穟': u'sui4', u'穠': u'nong2', u'穡': u'se4', u'穢': u'hui4', u'穣': u'rang2', u'穤': u'nuo4', u'穥': u'yu3', u'穦': u'pin1', u'穧': u'ji4', u'穨': u'tui2', u'穩': u'wen3', u'穪': u'cheng1', u'穫': u'huo4', u'穬': u'kuang4', u'穭': u'lv3', u'穮': u'biao1', u'穯': u'se4', u'穰': u'rang2', u'穱': u'zhuo1', u'穲': u'li2', u'穳': u'cuan2', u'穴': u'xue2', u'穵': u'wa1', u'究': u'jiu1', u'穷': u'qiong2', u'穸': u'xi1', u'穹': u'qiong2', u'空': u'kong1', u'穻': u'yu1', u'穼': u'shen1', u'穽': u'jing3', u'穾': u'yao4', u'穿': u'chuan1', u'窀': u'zhun1', u'突': u'tu1', u'窂': u'lao2', u'窃': u'qie4', u'窄': u'zhai3', u'窅': u'yao3', u'窆': u'bian3', u'窇': u'bao2', u'窈': u'yao3', u'窉': u'bing4', u'窊': u'wa1', u'窋': u'zhu2', u'窌': u'jiao4', u'窍': u'qiao4', u'窎': u'diao4', u'窏': u'wu1', u'窐': u'wa1', u'窑': u'yao2', u'窒': u'zhi4', u'窓': u'chuang1', u'窔': u'yao4', u'窕': u'tiao3', u'窖': u'jiao4', u'窗': u'chuang1', u'窘': u'jiong3', u'窙': u'xiao1', u'窚': u'cheng2', u'窛': u'kou4', u'窜': u'cuan4', u'窝': u'wo1', u'窞': u'dan4', u'窟': u'ku1', u'窠': u'ke1', u'窡': u'zhuo2', u'窢': u'huo4', u'窣': u'su1', u'窤': u'guan1', u'窥': u'kui1', u'窦': u'dou4', u'窧': u'zhuo', u'窨': u'xun1', u'窩': u'wo1', u'窪': u'wa1', u'窫': u'ya4', u'窬': u'yu2', u'窭': u'ju4', u'窮': u'qiong2', u'窯': u'yao2', u'窰': u'yao2', u'窱': u'tiao3', u'窲': u'chao2', u'窳': u'yu3', u'窴': u'tian2', u'窵': u'diao4', u'窶': u'ju4', u'窷': u'liao4', u'窸': u'xi1', u'窹': u'wu4', u'窺': u'kui1', u'窻': u'chuang1', u'窼': u'chao1', u'窽': u'kuan3', u'窾': u'kuan3', u'窿': u'long2', u'竀': u'cheng1', u'竁': u'cui4', u'竂': u'liao2', u'竃': u'zao4', u'竄': u'cuan4', u'竅': u'qiao4', u'竆': u'qiong2', u'竇': u'dou4', u'竈': u'zao4', u'竉': u'long3', u'竊': u'qie4', u'立': u'li4', u'竌': u'chu4', u'竍': u'shi', u'竎': u'fu4', u'竏': u'qian', u'竐': u'chu4', u'竑': u'hong2', u'竒': u'qi2', u'竓': u'hao', u'竔': u'sheng', u'竕': u'fen', u'竖': u'shu4', u'竗': u'miao4', u'竘': u'qu3', u'站': u'zhan4', u'竚': u'zhu4', u'竛': u'ling2', u'竜': u'long2', u'竝': u'bing4', u'竞': u'jing4', u'竟': u'jing4', u'章': u'zhang1', u'竡': u'bai', u'竢': u'si4', u'竣': u'jun4', u'竤': u'hong2', u'童': u'tong2', u'竦': u'song3', u'竧': u'jing4', u'竨': u'diao4', u'竩': u'yi4', u'竪': u'shu4', u'竫': u'jing4', u'竬': u'qu3', u'竭': u'jie2', u'竮': u'ping2', u'端': u'duan1', u'竰': u'li', u'竱': u'zhuan3', u'竲': u'ceng2', u'竳': u'deng1', u'竴': u'cun1', u'竵': u'wai1', u'競': u'jing4', u'竷': u'kan3', u'竸': u'jing4', u'竹': u'zhu2', u'竺': u'zhu2', u'竻': u'le4', u'竼': u'peng2', u'竽': u'yu2', u'竾': u'chi2', u'竿': u'gan1', u'笀': u'mang2', u'笁': u'zhu2', u'笂': u'wan', u'笃': u'du3', u'笄': u'ji1', u'笅': u'jiao3', u'笆': u'ba1', u'笇': u'suan4', u'笈': u'ji2', u'笉': u'qin3', u'笊': u'zhao4', u'笋': u'sun3', u'笌': u'ya2', u'笍': u'zhui4', u'笎': u'yuan2', u'笏': u'hu4', u'笐': u'hang2', u'笑': u'xiao4', u'笒': u'cen2', u'笓': u'bi4', u'笔': u'bi3', u'笕': u'jian3', u'笖': u'yi3', u'笗': u'dong1', u'笘': u'shan1', u'笙': u'sheng1', u'笚': u'da1', u'笛': u'di2', u'笜': u'zhu2', u'笝': u'na4', u'笞': u'chi1', u'笟': u'gu1', u'笠': u'li4', u'笡': u'qie4', u'笢': u'min3', u'笣': u'bao1', u'笤': u'tiao2', u'笥': u'si4', u'符': u'fu2', u'笧': u'ce4', u'笨': u'ben4', u'笩': u'fa2', u'笪': u'da2', u'笫': u'zi3', u'第': u'di4', u'笭': u'ling2', u'笮': u'ze2', u'笯': u'nu2', u'笰': u'fu2', u'笱': u'gou3', u'笲': u'fan2', u'笳': u'jia1', u'笴': u'gan3', u'笵': u'fan4', u'笶': u'shi3', u'笷': u'mao3', u'笸': u'po3', u'笹': u'ti4', u'笺': u'jian1', u'笻': u'qiong2', u'笼': u'long2', u'笽': u'min', u'笾': u'bian1', u'笿': u'luo4', u'筀': u'gui4', u'筁': u'qu1', u'筂': u'chi2', u'筃': u'yin1', u'筄': u'yao4', u'筅': u'xian3', u'筆': u'bi3', u'筇': u'qiong2', u'筈': u'kuo4', u'等': u'deng3', u'筊': u'jiao3', u'筋': u'jin1', u'筌': u'quan2', u'筍': u'sun3', u'筎': u'ru2', u'筏': u'fa2', u'筐': u'kuang1', u'筑': u'zhu4', u'筒': u'tong3', u'筓': u'ji1', u'答': u'da2', u'筕': u'hang2', u'策': u'ce4', u'筗': u'zhong4', u'筘': u'kou4', u'筙': u'lai2', u'筚': u'bi4', u'筛': u'shai1', u'筜': u'dang1', u'筝': u'zheng1', u'筞': u'ce4', u'筟': u'fu1', u'筠': u'jun1', u'筡': u'tu2', u'筢': u'pa2', u'筣': u'li2', u'筤': u'lang2', u'筥': u'ju3', u'筦': u'guan3', u'筧': u'jian3', u'筨': u'han2', u'筩': u'tong3', u'筪': u'xia2', u'筫': u'zhi4', u'筬': u'cheng2', u'筭': u'suan4', u'筮': u'shi4', u'筯': u'zhu4', u'筰': u'zuo2', u'筱': u'xiao3', u'筲': u'shao1', u'筳': u'ting2', u'筴': u'ce4', u'筵': u'yan2', u'筶': u'gao4', u'筷': u'kuai4', u'筸': u'gan1', u'筹': u'chou2', u'筺': u'kuang1', u'筻': u'gang4', u'筼': u'yun2', u'筽': u'o', u'签': u'qian1', u'筿': u'xiao3', u'简': u'jian3', u'箁': u'pou2', u'箂': u'lai2', u'箃': u'zou1', u'箄': u'bi4', u'箅': u'bi4', u'箆': u'bi4', u'箇': u'ge', u'箈': u'tai2', u'箉': u'guai3', u'箊': u'yu1', u'箋': u'jian1', u'箌': u'zhao4', u'箍': u'gu1', u'箎': u'chi2', u'箏': u'zheng1', u'箐': u'qing4', u'箑': u'sha4', u'箒': u'zhou3', u'箓': u'lu4', u'箔': u'bo2', u'箕': u'ji1', u'箖': u'lin2', u'算': u'suan4', u'箘': u'jun4', u'箙': u'fu2', u'箚': u'zha2', u'箛': u'gu1', u'箜': u'kong1', u'箝': u'qian2', u'箞': u'quan1', u'箟': u'jun4', u'箠': u'chui2', u'管': u'guan3', u'箢': u'yuan1', u'箣': u'ce4', u'箤': u'zu2', u'箥': u'po3', u'箦': u'ze2', u'箧': u'qie4', u'箨': u'tuo4', u'箩': u'luo2', u'箪': u'dan1', u'箫': u'xiao1', u'箬': u'ruo4', u'箭': u'jian4', u'箮': u'xuan1', u'箯': u'bian1', u'箰': u'sun3', u'箱': u'xiang1', u'箲': u'xian3', u'箳': u'ping2', u'箴': u'zhen1', u'箵': u'xing1', u'箶': u'hu2', u'箷': u'yi2', u'箸': u'zhu4', u'箹': u'yue1', u'箺': u'chun1', u'箻': u'lv4', u'箼': u'wu1', u'箽': u'dong3', u'箾': u'shuo4', u'箿': u'ji2', u'節': u'jie2', u'篁': u'huang2', u'篂': u'xing1', u'篃': u'mei4', u'範': u'fan4', u'篅': u'chuan2', u'篆': u'zhuan4', u'篇': u'pian1', u'篈': u'feng1', u'築': u'zhu4', u'篊': u'hong2', u'篋': u'qie4', u'篌': u'hou2', u'篍': u'qiu1', u'篎': u'miao3', u'篏': u'qian4', u'篐': u'gu1', u'篑': u'kui4', u'篒': u'yi4', u'篓': u'lou3', u'篔': u'yun2', u'篕': u'he2', u'篖': u'tang2', u'篗': u'yue4', u'篘': u'chou1', u'篙': u'gao1', u'篚': u'fei3', u'篛': u'ruo4', u'篜': u'zheng1', u'篝': u'gou1', u'篞': u'nie4', u'篟': u'qian4', u'篠': u'xiao3', u'篡': u'cuan4', u'篢': u'long3', u'篣': u'peng2', u'篤': u'du3', u'篥': u'li4', u'篦': u'bi4', u'篧': u'zhuo2', u'篨': u'chu2', u'篩': u'shai1', u'篪': u'chi2', u'篫': u'zhu4', u'篬': u'qiang1', u'篭': u'long2', u'篮': u'lan2', u'篯': u'jian3', u'篰': u'bu4', u'篱': u'li2', u'篲': u'hui4', u'篳': u'bi4', u'篴': u'zhu2', u'篵': u'cong1', u'篶': u'yan1', u'篷': u'peng2', u'篸': u'can3', u'篹': u'zhuan4', u'篺': u'pi2', u'篻': u'piao3', u'篼': u'dou1', u'篽': u'yu4', u'篾': u'mie4', u'篿': u'tuan2', u'簀': u'ze2', u'簁': u'shai1', u'簂': u'guo2', u'簃': u'yi2', u'簄': u'hu4', u'簅': u'chan3', u'簆': u'kou4', u'簇': u'cu4', u'簈': u'ping2', u'簉': u'zao4', u'簊': u'ji1', u'簋': u'gui3', u'簌': u'su4', u'簍': u'lou3', u'簎': u'ce4', u'簏': u'lu4', u'簐': u'nian3', u'簑': u'suo1', u'簒': u'cuan4', u'簓': u'sa1sa1la1', u'簔': u'suo1', u'簕': u'le4', u'簖': u'duan4', u'簗': u'zhu4', u'簘': u'xiao1', u'簙': u'bo2', u'簚': u'mi4', u'簛': u'shai1', u'簜': u'dang4', u'簝': u'liao2', u'簞': u'dan1', u'簟': u'dian4', u'簠': u'fu3', u'簡': u'jian3', u'簢': u'min3', u'簣': u'kui4', u'簤': u'dai4', u'簥': u'jiao1', u'簦': u'deng1', u'簧': u'huang2', u'簨': u'sun3', u'簩': u'lao2', u'簪': u'zan1', u'簫': u'xiao1', u'簬': u'lu4', u'簭': u'shi4', u'簮': u'zan1', u'簯': u'qi', u'簰': u'pai2', u'簱': u'qi', u'簲': u'pai2', u'簳': u'gan3', u'簴': u'ju4', u'簵': u'lu4', u'簶': u'lu4', u'簷': u'yan2', u'簸': u'bo3', u'簹': u'dang1', u'簺': u'sai4', u'簻': u'zhua1', u'簼': u'gou1', u'簽': u'qian1', u'簾': u'lian2', u'簿': u'bu4', u'籀': u'zhou4', u'籁': u'lai4', u'籂': u'shi', u'籃': u'lan2', u'籄': u'kui4', u'籅': u'yu2', u'籆': u'yue4', u'籇': u'hao2', u'籈': u'zhen1', u'籉': u'tai2', u'籊': u'ti4', u'籋': u'nie4', u'籌': u'chou2', u'籍': u'ji2', u'籎': u'yi2', u'籏': u'qi', u'籐': u'teng2', u'籑': u'zhuan4', u'籒': u'zhou4', u'籓': u'fan1', u'籔': u'sou3', u'籕': u'zhou4', u'籖': u'qian1', u'籗': u'zhuo2', u'籘': u'teng2', u'籙': u'lu4', u'籚': u'lu2', u'籛': u'jian3', u'籜': u'tuo4', u'籝': u'ying2', u'籞': u'yu4', u'籟': u'lai4', u'籠': u'long2', u'籡': u'shenshi', u'籢': u'lian2', u'籣': u'lan2', u'籤': u'qian1', u'籥': u'yue4', u'籦': u'zhong1', u'籧': u'ju3', u'籨': u'lian2', u'籩': u'bian1', u'籪': u'duan4', u'籫': u'zuan3', u'籬': u'li2', u'籭': u'shai1', u'籮': u'luo2', u'籯': u'ying2', u'籰': u'yue4', u'籱': u'zhuo2', u'籲': u'xu1', u'米': u'mi3', u'籴': u'di2', u'籵': u'fan2', u'籶': u'shen1', u'籷': u'zhe2', u'籸': u'shen1', u'籹': u'nv3', u'籺': u'he2', u'类': u'lei4', u'籼': u'xian1', u'籽': u'zi3', u'籾': u'ni2', u'籿': u'cun', u'粀': u'zhang', u'粁': u'qian', u'粂': u'zhai', u'粃': u'bi3', u'粄': u'ban3', u'粅': u'wu4', u'粆': u'sha1', u'粇': u'jing1', u'粈': u'rou2', u'粉': u'fen3', u'粊': u'bi4', u'粋': u'cui4', u'粌': u'yin', u'粍': u'zhe', u'粎': u'mi', u'粏': u'ta4', u'粐': u'hu', u'粑': u'ba1', u'粒': u'li4', u'粓': u'gan1', u'粔': u'ju4', u'粕': u'po4', u'粖': u'yu4', u'粗': u'cu1', u'粘': u'nian2', u'粙': u'zhou4', u'粚': u'chi1', u'粛': u'su4', u'粜': u'tiao4', u'粝': u'li4', u'粞': u'xi1', u'粟': u'su4', u'粠': u'hong2', u'粡': u'tong2', u'粢': u'zi1', u'粣': u'ce4', u'粤': u'yue4', u'粥': u'zhou1', u'粦': u'lin2', u'粧': u'zhuang1', u'粨': u'bai', u'粩': u'lao', u'粪': u'fen4', u'粫': u'er', u'粬': u'qu1', u'粭': u'he', u'粮': u'liang2', u'粯': u'xian4', u'粰': u'fu1', u'粱': u'liang2', u'粲': u'can4', u'粳': u'jing1', u'粴': u'li', u'粵': u'yue4', u'粶': u'lu4', u'粷': u'ju2', u'粸': u'qi2', u'粹': u'cui4', u'粺': u'bai4', u'粻': u'zhang1', u'粼': u'lin2', u'粽': u'zong4', u'精': u'jing1', u'粿': u'guo3', u'糀': u'hua', u'糁': u'shen1', u'糂': u'san3', u'糃': u'tang2', u'糄': u'bian1', u'糅': u'rou2', u'糆': u'mian4', u'糇': u'hou2', u'糈': u'xu3', u'糉': u'zong4', u'糊': u'hu2', u'糋': u'jian4', u'糌': u'zan1', u'糍': u'ci2', u'糎': u'li', u'糏': u'xie4', u'糐': u'fu1', u'糑': u'nuo4', u'糒': u'bei4', u'糓': u'gu3', u'糔': u'xiu3', u'糕': u'gao1', u'糖': u'tang2', u'糗': u'qiu3', u'糘': u'jia', u'糙': u'cao1', u'糚': u'zhuang1', u'糛': u'tang2', u'糜': u'mi2', u'糝': u'shen1', u'糞': u'fen4', u'糟': u'zao1', u'糠': u'kang1', u'糡': u'jiang4', u'糢': u'mo2', u'糣': u'san3', u'糤': u'san3', u'糥': u'nuo4', u'糦': u'xi1', u'糧': u'liang2', u'糨': u'jiang4', u'糩': u'kuai4', u'糪': u'bo2', u'糫': u'huan2', u'糬': u'shu', u'糭': u'zong4', u'糮': u'xian4', u'糯': u'nuo4', u'糰': u'tuan2', u'糱': u'nie4', u'糲': u'li4', u'糳': u'zuo4', u'糴': u'di2', u'糵': u'nie4', u'糶': u'tiao4', u'糷': u'lan4', u'糸': u'mi4', u'糹': u'si1', u'糺': u'jiu1', u'系': u'xi4', u'糼': u'gong1', u'糽': u'zheng1', u'糾': u'jiu1', u'糿': u'gong1', u'紀': u'ji4', u'紁': u'cha4', u'紂': u'zhou4', u'紃': u'xun2', u'約': u'yue1', u'紅': u'hong2', u'紆': u'yu1', u'紇': u'ge1', u'紈': u'wan2', u'紉': u'ren4', u'紊': u'wen3', u'紋': u'wen2', u'紌': u'qiu2', u'納': u'na4', u'紎': u'zi1', u'紏': u'tou3', u'紐': u'niu3', u'紑': u'fou2', u'紒': u'ji4', u'紓': u'shu1', u'純': u'chun2', u'紕': u'pi1', u'紖': u'zhen4', u'紗': u'sha1', u'紘': u'hong2', u'紙': u'zhi3', u'級': u'ji2', u'紛': u'fen1', u'紜': u'yun2', u'紝': u'ren4', u'紞': u'dan3', u'紟': u'jin1', u'素': u'su4', u'紡': u'fang3', u'索': u'suo3', u'紣': u'cui4', u'紤': u'jiu3', u'紥': u'za1', u'紦': u'ha1', u'紧': u'jin3', u'紨': u'fu1', u'紩': u'zhi4', u'紪': u'qi1', u'紫': u'zi3', u'紬': u'chou1', u'紭': u'hong2', u'紮': u'za1', u'累': u'lei4', u'細': u'xi4', u'紱': u'fu2', u'紲': u'xie4', u'紳': u'shen1', u'紴': u'bo1', u'紵': u'zhu4', u'紶': u'qu1', u'紷': u'ling2', u'紸': u'zhu4', u'紹': u'shao4', u'紺': u'gan4', u'紻': u'yang3', u'紼': u'fu2', u'紽': u'tuo2', u'紾': u'zhen3', u'紿': u'dai4', u'絀': u'chu4', u'絁': u'shi1', u'終': u'zhong1', u'絃': u'xian2', u'組': u'zu3', u'絅': u'jiong3', u'絆': u'ban4', u'絇': u'qu2', u'絈': u'mo4', u'絉': u'shu4', u'絊': u'zui4', u'絋': u'kuang4', u'経': u'jing1', u'絍': u'ren4', u'絎': u'hang2', u'絏': u'xie4', u'結': u'jie2', u'絑': u'zhu1', u'絒': u'chou2', u'絓': u'gua4', u'絔': u'bai3', u'絕': u'jue2', u'絖': u'kuang4', u'絗': u'hu2', u'絘': u'ci4', u'絙': u'huan2', u'絚': u'geng1', u'絛': u'tao1', u'絜': u'jie2', u'絝': u'ku4', u'絞': u'jiao3', u'絟': u'quan2', u'絠': u'gai3', u'絡': u'luo4', u'絢': u'xuan4', u'絣': u'beng1', u'絤': u'xian4', u'絥': u'fu2', u'給': u'gei3', u'絧': u'tong1', u'絨': u'rong2', u'絩': u'tiao4', u'絪': u'yin1', u'絫': u'lei3', u'絬': u'xie4', u'絭': u'juan4', u'絮': u'xu4', u'絯': u'gai1', u'絰': u'die2', u'統': u'tong3', u'絲': u'si1', u'絳': u'tao1', u'絴': u'xiang2', u'絵': u'hui4', u'絶': u'jue2', u'絷': u'zhi2', u'絸': u'jian3', u'絹': u'juan4', u'絺': u'chi1', u'絻': u'wen4', u'絼': u'zhen4', u'絽': u'lv3', u'絾': u'cheng2', u'絿': u'qiu2', u'綀': u'shu1', u'綁': u'bang3', u'綂': u'tong3', u'綃': u'xiao1', u'綄': u'huan2', u'綅': u'qin1', u'綆': u'geng3', u'綇': u'xu1', u'綈': u'ti4', u'綉': u'xiu4', u'綊': u'xie2', u'綋': u'hong2', u'綌': u'xi4', u'綍': u'fu2', u'綎': u'ting1', u'綏': u'sui2', u'綐': u'dui4', u'綑': u'kun3', u'綒': u'fu1', u'經': u'jing1', u'綔': u'hu4', u'綕': u'zhi1', u'綖': u'yan2', u'綗': u'jiong3', u'綘': u'feng2', u'継': u'ji4', u'続': u'xu4', u'綛': u'sui', u'綜': u'zong1', u'綝': u'chen1', u'綞': u'duo3', u'綟': u'li4', u'綠': u'lv4', u'綡': u'jing1', u'綢': u'chou2', u'綣': u'quan3', u'綤': u'shao4', u'綥': u'qi2', u'綦': u'qi2', u'綧': u'zhun3', u'綨': u'ji1', u'綩': u'wan3', u'綪': u'qian4', u'綫': u'xian4', u'綬': u'shou4', u'維': u'wei2', u'綮': u'qing4', u'綯': u'tao2', u'綰': u'wan3', u'綱': u'gang1', u'網': u'wang3', u'綳': u'beng1', u'綴': u'zhui4', u'綵': u'cai3', u'綶': u'guo3', u'綷': u'cui4', u'綸': u'lun2', u'綹': u'liu3', u'綺': u'qi3', u'綻': u'zhan4', u'綼': u'bi4', u'綽': u'chuo4', u'綾': u'ling2', u'綿': u'mian2', u'緀': u'qi1', u'緁': u'ji1', u'緂': u'tian2', u'緃': u'zong1', u'緄': u'gun3', u'緅': u'zou1', u'緆': u'xi1', u'緇': u'zi1', u'緈': u'xing4', u'緉': u'liang3', u'緊': u'jin3', u'緋': u'fei1', u'緌': u'rui2', u'緍': u'min2', u'緎': u'yu4', u'総': u'zong3', u'緐': u'fan2', u'緑': u'lu4', u'緒': u'xu4', u'緓': u'ying1', u'緔': u'shang4', u'緕': u'zi1', u'緖': u'xu4', u'緗': u'xiang1', u'緘': u'jian1', u'緙': u'ke4', u'線': u'xian4', u'緛': u'ruan3', u'緜': u'mian2', u'緝': u'ji1', u'緞': u'duan4', u'緟': u'chong2', u'締': u'di4', u'緡': u'min2', u'緢': u'miao2', u'緣': u'yuan2', u'緤': u'xie4', u'緥': u'bao3', u'緦': u'si1', u'緧': u'qiu1', u'編': u'bian1', u'緩': u'huan3', u'緪': u'geng1', u'緫': u'zong3', u'緬': u'mian3', u'緭': u'wei4', u'緮': u'fu4', u'緯': u'wei3', u'緰': u'xu1', u'緱': u'gou1', u'緲': u'miao3', u'緳': u'xie2', u'練': u'lian4', u'緵': u'zong1', u'緶': u'bian4', u'緷': u'gun3', u'緸': u'yin1', u'緹': u'ti2', u'緺': u'gua1', u'緻': u'zhi4', u'緼': u'yun1', u'緽': u'cheng1', u'緾': u'chan2', u'緿': u'dai4', u'縀': u'xie2', u'縁': u'yuan2', u'縂': u'zong3', u'縃': u'xu1', u'縄': u'sheng2', u'縅': u'ou3duo1xi1', u'縆': u'geng1', u'縇': u'seone', u'縈': u'ying2', u'縉': u'jin4', u'縊': u'yi4', u'縋': u'zhui4', u'縌': u'ni4', u'縍': u'bang1', u'縎': u'gu3', u'縏': u'pan2', u'縐': u'zhou4', u'縑': u'jian1', u'縒': u'ci1', u'縓': u'quan4', u'縔': u'shuang3', u'縕': u'yun4', u'縖': u'xia2', u'縗': u'cui1', u'縘': u'xi4', u'縙': u'rong2', u'縚': u'tao1', u'縛': u'fu4', u'縜': u'yun2', u'縝': u'zhen3', u'縞': u'gao3', u'縟': u'ru4', u'縠': u'hu2', u'縡': u'zai4', u'縢': u'teng2', u'縣': u'xian4', u'縤': u'su4', u'縥': u'zhen3', u'縦': u'zong4', u'縧': u'tao1', u'縨': u'huanghuo', u'縩': u'cai4', u'縪': u'bi4', u'縫': u'feng2', u'縬': u'cu4', u'縭': u'li2', u'縮': u'suo1', u'縯': u'yan3', u'縰': u'xi3', u'縱': u'zong4', u'縲': u'lei2', u'縳': u'fu4', u'縴': u'xian1', u'縵': u'man4', u'縶': u'zhi2', u'縷': u'lv3', u'縸': u'mu4', u'縹': u'piao1', u'縺': u'lian2', u'縻': u'mi2', u'縼': u'xuan4', u'總': u'zong3', u'績': u'ji1', u'縿': u'shan1', u'繀': u'sui4', u'繁': u'fan2', u'繂': u'lv4', u'繃': u'beng1', u'繄': u'yi1', u'繅': u'sao1', u'繆': u'miu4', u'繇': u'yao2', u'繈': u'qiang3', u'繉': u'sheng2', u'繊': u'xian1', u'繋': u'ji4', u'繌': u'zong1', u'繍': u'xiu4', u'繎': u'ran2', u'繏': u'xuan4', u'繐': u'sui4', u'繑': u'qiao1', u'繒': u'zeng1', u'繓': u'zuo3', u'織': u'zhi1', u'繕': u'shan4', u'繖': u'san3', u'繗': u'lin2', u'繘': u'ju2', u'繙': u'fan1', u'繚': u'liao2', u'繛': u'chuo1', u'繜': u'zun1', u'繝': u'jian4', u'繞': u'rao4', u'繟': u'chan3', u'繠': u'rui3', u'繡': u'xiu4', u'繢': u'hui4', u'繣': u'hua4', u'繤': u'zuan3', u'繥': u'xi1', u'繦': u'qiang3', u'繧': u'wen2', u'繨': u'da', u'繩': u'sheng2', u'繪': u'hui4', u'繫': u'xi4', u'繬': u'se4', u'繭': u'jian3', u'繮': u'jiang1', u'繯': u'huan2', u'繰': u'zao3', u'繱': u'cong1', u'繲': u'xie4', u'繳': u'jiao3', u'繴': u'bi4', u'繵': u'dan4', u'繶': u'yi4', u'繷': u'nong3', u'繸': u'sui4', u'繹': u'yi4', u'繺': u'sha1', u'繻': u'xu1', u'繼': u'ji4', u'繽': u'bin1', u'繾': u'qian3', u'繿': u'lan2', u'纀': u'pu2', u'纁': u'xun1', u'纂': u'zuan3', u'纃': u'zi1', u'纄': u'peng2', u'纅': u'yao4', u'纆': u'mo4', u'纇': u'lei4', u'纈': u'xie2', u'纉': u'zuan3', u'纊': u'kuang4', u'纋': u'you1', u'續': u'xu4', u'纍': u'lei4', u'纎': u'xian1', u'纏': u'chan2', u'纐': u'o', u'纑': u'lu2', u'纒': u'chan2', u'纓': u'ying1', u'纔': u'cai2', u'纕': u'xiang1', u'纖': u'xian1', u'纗': u'zui1', u'纘': u'zuan3', u'纙': u'luo4', u'纚': u'li2', u'纛': u'dao4', u'纜': u'lan3', u'纝': u'lei2', u'纞': u'lian4', u'纟': u'si1', u'纠': u'jiu1', u'纡': u'yu1', u'红': u'hong2', u'纣': u'zhou4', u'纤': u'xian1', u'纥': u'ge1', u'约': u'yue1', u'级': u'ji2', u'纨': u'wan2', u'纩': u'kuang4', u'纪': u'ji4', u'纫': u'ren4', u'纬': u'wei3', u'纭': u'yun2', u'纮': u'hong2', u'纯': u'chun2', u'纰': u'pi1', u'纱': u'sha1', u'纲': u'gang1', u'纳': u'na4', u'纴': u'ren4', u'纵': u'zong4', u'纶': u'lun2', u'纷': u'fen1', u'纸': u'zhi3', u'纹': u'wen2', u'纺': u'fang3', u'纻': u'zhu4', u'纼': u'zhen4', u'纽': u'niu3', u'纾': u'shu1', u'线': u'xian4', u'绀': u'gan4', u'绁': u'xie4', u'绂': u'fu2', u'练': u'lian4', u'组': u'zu3', u'绅': u'shen1', u'细': u'xi4', u'织': u'zhi1', u'终': u'zhong1', u'绉': u'zhou4', u'绊': u'ban4', u'绋': u'fu2', u'绌': u'chu4', u'绍': u'shao4', u'绎': u'yi4', u'经': u'jing1', u'绐': u'dai4', u'绑': u'bang3', u'绒': u'rong2', u'结': u'jie2', u'绔': u'ku4', u'绕': u'rao4', u'绖': u'die2', u'绗': u'hang2', u'绘': u'hui4', u'给': u'gei3', u'绚': u'xuan4', u'绛': u'jiang4', u'络': u'luo4', u'绝': u'jue2', u'绞': u'jiao3', u'统': u'tong3', u'绠': u'geng3', u'绡': u'xiao1', u'绢': u'juan4', u'绣': u'xiu4', u'绤': u'xi4', u'绥': u'sui2', u'绦': u'tao1', u'继': u'ji4', u'绨': u'ti4', u'绩': u'ji1', u'绪': u'xu4', u'绫': u'ling2', u'绬': u'ying1', u'续': u'xu4', u'绮': u'qi3', u'绯': u'fei1', u'绰': u'chuo4', u'绱': u'shang4', u'绲': u'gun3', u'绳': u'sheng2', u'维': u'wei2', u'绵': u'mian2', u'绶': u'shou4', u'绷': u'beng1', u'绸': u'chou2', u'绹': u'tao2', u'绺': u'liu3', u'绻': u'quan3', u'综': u'zong1', u'绽': u'zhan4', u'绾': u'wan3', u'绿': u'lv4', u'缀': u'zhui4', u'缁': u'zi1', u'缂': u'ke4', u'缃': u'xiang1', u'缄': u'jian1', u'缅': u'mian3', u'缆': u'lan3', u'缇': u'ti2', u'缈': u'miao3', u'缉': u'ji1', u'缊': u'yun1', u'缋': u'hui4', u'缌': u'si1', u'缍': u'duo3', u'缎': u'duan4', u'缏': u'bian4', u'缐': u'xian4', u'缑': u'gou1', u'缒': u'zhui4', u'缓': u'huan3', u'缔': u'di4', u'缕': u'lv3', u'编': u'bian1', u'缗': u'min2', u'缘': u'yuan2', u'缙': u'jin4', u'缚': u'fu4', u'缛': u'ru4', u'缜': u'zhen3', u'缝': u'feng2', u'缞': u'cui1', u'缟': u'gao3', u'缠': u'chan2', u'缡': u'li2', u'缢': u'yi4', u'缣': u'jian1', u'缤': u'bin1', u'缥': u'piao1', u'缦': u'man4', u'缧': u'lei2', u'缨': u'ying1', u'缩': u'suo1', u'缪': u'miu4', u'缫': u'sao1', u'缬': u'xie2', u'缭': u'liao2', u'缮': u'shan4', u'缯': u'zeng1', u'缰': u'jiang1', u'缱': u'qian3', u'缲': u'zao3', u'缳': u'huan2', u'缴': u'jiao3', u'缵': u'zuan3', u'缶': u'fou3', u'缷': u'xie4', u'缸': u'gang1', u'缹': u'fou3', u'缺': u'que1', u'缻': u'fou3', u'缼': u'que1', u'缽': u'bo1', u'缾': u'ping2', u'缿': u'xiang4', u'罀': u'diao4', u'罁': u'gang1', u'罂': u'ying1', u'罃': u'ying1', u'罄': u'qing4', u'罅': u'xia4', u'罆': u'guan4', u'罇': u'zun1', u'罈': u'tan2', u'罉': u'cheng1', u'罊': u'qi4', u'罋': u'weng4', u'罌': u'ying1', u'罍': u'lei2', u'罎': u'tan2', u'罏': u'lu2', u'罐': u'guan4', u'网': u'wang3', u'罒': u'wang3', u'罓': u'wang3', u'罔': u'wang3', u'罕': u'han3', u'罖': u'rua', u'罗': u'luo2', u'罘': u'fu2', u'罙': u'shen1', u'罚': u'fa2', u'罛': u'gu1', u'罜': u'zhu3', u'罝': u'ju1', u'罞': u'mao2', u'罟': u'gu3', u'罠': u'min2', u'罡': u'gang1', u'罢': u'ba4', u'罣': u'gua4', u'罤': u'ti2', u'罥': u'juan4', u'罦': u'fu2', u'罧': u'shen1', u'罨': u'yan3', u'罩': u'zhao4', u'罪': u'zui4', u'罫': u'guai3', u'罬': u'zhuo2', u'罭': u'yu4', u'置': u'zhi4', u'罯': u'an3', u'罰': u'fa2', u'罱': u'lan3', u'署': u'shu3', u'罳': u'si1', u'罴': u'pi2', u'罵': u'ma4', u'罶': u'liu3', u'罷': u'ba4', u'罸': u'fa2', u'罹': u'li2', u'罺': u'chao2', u'罻': u'wei4', u'罼': u'bi4', u'罽': u'ji4', u'罾': u'zeng1', u'罿': u'chong1', u'羀': u'liu3', u'羁': u'ji1', u'羂': u'juan4', u'羃': u'mi4', u'羄': u'zhao4', u'羅': u'luo2', u'羆': u'pi2', u'羇': u'ji1', u'羈': u'ji1', u'羉': u'luan2', u'羊': u'yang2', u'羋': u'mi3', u'羌': u'qiang1', u'羍': u'da2', u'美': u'mei3', u'羏': u'yang2', u'羐': u'ling2', u'羑': u'you3', u'羒': u'fen2', u'羓': u'ba1', u'羔': u'gao1', u'羕': u'yang4', u'羖': u'gu3', u'羗': u'qiang1', u'羘': u'zang1', u'羙': u'mei3', u'羚': u'ling2', u'羛': u'yi4', u'羜': u'zhu4', u'羝': u'di1', u'羞': u'xiu1', u'羟': u'qiang3', u'羠': u'yi2', u'羡': u'xian4', u'羢': u'rong2', u'羣': u'qun2', u'群': u'qun2', u'羥': u'qiang3', u'羦': u'huan2', u'羧': u'suo1', u'羨': u'xian4', u'義': u'yi4', u'羪': u'you1', u'羫': u'qiang1', u'羬': u'qian2', u'羭': u'yu2', u'羮': u'geng1', u'羯': u'jie2', u'羰': u'tang1', u'羱': u'yuan2', u'羲': u'xi1', u'羳': u'fan2', u'羴': u'shan1', u'羵': u'fen2', u'羶': u'shan1', u'羷': u'lian3', u'羸': u'lei2', u'羹': u'geng1', u'羺': u'nou2', u'羻': u'qiang4', u'羼': u'chan4', u'羽': u'yu3', u'羾': u'hong2', u'羿': u'yi4', u'翀': u'chong1', u'翁': u'weng1', u'翂': u'fen1', u'翃': u'hong2', u'翄': u'chi4', u'翅': u'chi4', u'翆': u'cui4', u'翇': u'fu2', u'翈': u'xia2', u'翉': u'ben3', u'翊': u'yi4', u'翋': u'la4', u'翌': u'yi4', u'翍': u'pi1', u'翎': u'ling2', u'翏': u'liu4', u'翐': u'zhi4', u'翑': u'qu2', u'習': u'xi2', u'翓': u'xie2', u'翔': u'xiang2', u'翕': u'xi1', u'翖': u'xi1', u'翗': u'ke2', u'翘': u'qiao4', u'翙': u'hui4', u'翚': u'hui1', u'翛': u'xiao1', u'翜': u'sha4', u'翝': u'hong2', u'翞': u'jiang1', u'翟': u'zhai2', u'翠': u'cui4', u'翡': u'fei3', u'翢': u'dao4', u'翣': u'sha4', u'翤': u'chi4', u'翥': u'zhu4', u'翦': u'jian3', u'翧': u'xuan1', u'翨': u'chi4', u'翩': u'pian1', u'翪': u'zong1', u'翫': u'wan2', u'翬': u'hui1', u'翭': u'hou2', u'翮': u'he2', u'翯': u'he4', u'翰': u'han4', u'翱': u'ao2', u'翲': u'piao1', u'翳': u'yi4', u'翴': u'lian2', u'翵': u'hou2', u'翶': u'ao2', u'翷': u'lin2', u'翸': u'pen3', u'翹': u'qiao4', u'翺': u'ao2', u'翻': u'fan1', u'翼': u'yi4', u'翽': u'hui4', u'翾': u'xuan1', u'翿': u'dao4', u'耀': u'yao4', u'老': u'lao3', u'耂': u'lao3', u'考': u'kao3', u'耄': u'mao4', u'者': u'zhe3', u'耆': u'qi2', u'耇': u'gou3', u'耈': u'gou3', u'耉': u'gou3', u'耊': u'die2', u'耋': u'die2', u'而': u'er2', u'耍': u'shua3', u'耎': u'ruan3', u'耏': u'er2', u'耐': u'nai4', u'耑': u'duan1', u'耒': u'lei3', u'耓': u'ting1', u'耔': u'zi3', u'耕': u'geng1', u'耖': u'chao4', u'耗': u'hao4', u'耘': u'yun2', u'耙': u'ba4', u'耚': u'pi1', u'耛': u'si4', u'耜': u'si4', u'耝': u'qu4', u'耞': u'jia1', u'耟': u'ju4', u'耠': u'huo1', u'耡': u'chu2', u'耢': u'lao4', u'耣': u'lun2', u'耤': u'ji2', u'耥': u'tang1', u'耦': u'ou3', u'耧': u'lou2', u'耨': u'nou4', u'耩': u'jiang3', u'耪': u'pang3', u'耫': u'zha2', u'耬': u'lou2', u'耭': u'ji1', u'耮': u'lao4', u'耯': u'huo4', u'耰': u'you1', u'耱': u'mo4', u'耲': u'huai2', u'耳': u'er3', u'耴': u'yi4', u'耵': u'ding1', u'耶': u'ye1', u'耷': u'da1', u'耸': u'song3', u'耹': u'qin2', u'耺': u'yun2', u'耻': u'chi3', u'耼': u'dan1', u'耽': u'dan1', u'耾': u'hong2', u'耿': u'geng3', u'聀': u'zhi2', u'聁': u'pan4', u'聂': u'nie4', u'聃': u'dan1', u'聄': u'zhen3', u'聅': u'che4', u'聆': u'ling2', u'聇': u'zheng1', u'聈': u'you3', u'聉': u'wa4', u'聊': u'liao2', u'聋': u'long2', u'职': u'zhi2', u'聍': u'ning2', u'聎': u'tiao1', u'聏': u'er2', u'聐': u'ya4', u'聑': u'tie1', u'聒': u'guo1', u'聓': u'xu4', u'联': u'lian2', u'聕': u'hao4', u'聖': u'sheng4', u'聗': u'lie4', u'聘': u'pin4', u'聙': u'jing1', u'聚': u'ju4', u'聛': u'bi3', u'聜': u'di3', u'聝': u'guo2', u'聞': u'wen2', u'聟': u'xu4', u'聠': u'ping1', u'聡': u'cong1', u'聢': u'xi1ka1li1', u'聣': u'ni2', u'聤': u'ting2', u'聥': u'ju3', u'聦': u'cong1', u'聧': u'kui1', u'聨': u'lian2', u'聩': u'kui4', u'聪': u'cong1', u'聫': u'lian2', u'聬': u'weng1', u'聭': u'kui4', u'聮': u'lian2', u'聯': u'lian2', u'聰': u'cong1', u'聱': u'ao2', u'聲': u'sheng1', u'聳': u'song3', u'聴': u'ting1', u'聵': u'kui4', u'聶': u'nie4', u'職': u'zhi2', u'聸': u'dan1', u'聹': u'ning2', u'聺': u'qie2', u'聻': u'ni3', u'聼': u'ting1', u'聽': u'ting1', u'聾': u'long2', u'聿': u'yu4', u'肀': u'yu4', u'肁': u'zhao4', u'肂': u'si4', u'肃': u'su4', u'肄': u'yi4', u'肅': u'su4', u'肆': u'si4', u'肇': u'zhao4', u'肈': u'zhao4', u'肉': u'rou4', u'肊': u'yi4', u'肋': u'lei4', u'肌': u'ji1', u'肍': u'qiu2', u'肎': u'ken3', u'肏': u'cao4', u'肐': u'ge1', u'肑': u'bo2', u'肒': u'huan4', u'肓': u'huang1', u'肔': u'chi3', u'肕': u'ren4', u'肖': u'xiao1', u'肗': u'ru3', u'肘': u'zhou3', u'肙': u'yuan1', u'肚': u'du4', u'肛': u'gang1', u'肜': u'rong2', u'肝': u'gan1', u'肞': u'chai1', u'肟': u'wo4', u'肠': u'chang2', u'股': u'gu3', u'肢': u'zhi1', u'肣': u'qin2', u'肤': u'fu1', u'肥': u'fei2', u'肦': u'ban1', u'肧': u'pei1', u'肨': u'pang4', u'肩': u'jian1', u'肪': u'fang2', u'肫': u'zhun1', u'肬': u'you2', u'肭': u'na4', u'肮': u'ang1', u'肯': u'ken3', u'肰': u'ran2', u'肱': u'gong1', u'育': u'yu4', u'肳': u'wen3', u'肴': u'yao2', u'肵': u'qi2', u'肶': u'pi2', u'肷': u'qian3', u'肸': u'xi1', u'肹': u'xi1', u'肺': u'fei4', u'肻': u'ken3', u'肼': u'jing3', u'肽': u'tai4', u'肾': u'shen4', u'肿': u'zhong3', u'胀': u'zhang4', u'胁': u'xie2', u'胂': u'shen4', u'胃': u'wei4', u'胄': u'zhou4', u'胅': u'die2', u'胆': u'dan3', u'胇': u'fei4', u'胈': u'ba2', u'胉': u'bo2', u'胊': u'qu2', u'胋': u'tian2', u'背': u'bei4', u'胍': u'gua1', u'胎': u'tai1', u'胏': u'zi3', u'胐': u'fei3', u'胑': u'zhi1', u'胒': u'ni4', u'胓': u'ping2', u'胔': u'zi4', u'胕': u'fu1', u'胖': u'pang4', u'胗': u'zhen1', u'胘': u'xian2', u'胙': u'zuo4', u'胚': u'pei1', u'胛': u'jia3', u'胜': u'sheng4', u'胝': u'zhi1', u'胞': u'bao1', u'胟': u'mu3', u'胠': u'qu1', u'胡': u'hu2', u'胢': u'qia4', u'胣': u'chi3', u'胤': u'yin4', u'胥': u'xu1', u'胦': u'yang1', u'胧': u'long2', u'胨': u'dong4', u'胩': u'ka3', u'胪': u'lu2', u'胫': u'jing4', u'胬': u'nu3', u'胭': u'yan1', u'胮': u'pang1', u'胯': u'kua4', u'胰': u'yi2', u'胱': u'guang1', u'胲': u'hai3', u'胳': u'ge1', u'胴': u'dong4', u'胵': u'chi1', u'胶': u'jiao1', u'胷': u'xiong1', u'胸': u'xiong1', u'胹': u'er2', u'胺': u'an4', u'胻': u'heng2', u'胼': u'pian2', u'能': u'neng2', u'胾': u'zi4', u'胿': u'gui1', u'脀': u'zheng1', u'脁': u'tiao3', u'脂': u'zhi1', u'脃': u'cui4', u'脄': u'mei2', u'脅': u'xie2', u'脆': u'cui4', u'脇': u'xie2', u'脈': u'mai4', u'脉': u'mai4', u'脊': u'ji3', u'脋': u'xie2', u'脌': u'nin', u'脍': u'kuai4', u'脎': u'sa4', u'脏': u'zang1', u'脐': u'qi2', u'脑': u'nao3', u'脒': u'mi3', u'脓': u'nong2', u'脔': u'luan2', u'脕': u'wan4', u'脖': u'bo2', u'脗': u'wen3', u'脘': u'wan3', u'脙': u'xiu1', u'脚': u'jiao3', u'脛': u'jing4', u'脜': u'rou2', u'脝': u'heng1', u'脞': u'cuo3', u'脟': u'luan2', u'脠': u'shan1', u'脡': u'ting3', u'脢': u'mei2', u'脣': u'chun2', u'脤': u'shen4', u'脥': u'jia2', u'脦': u'te', u'脧': u'suo1', u'脨': u'cu4', u'脩': u'xiu1', u'脪': u'xin4', u'脫': u'tuo1', u'脬': u'pao1', u'脭': u'cheng2', u'脮': u'nei3', u'脯': u'pu2', u'脰': u'dou4', u'脱': u'tuo1', u'脲': u'niao4', u'脳': u'nao3', u'脴': u'pi3', u'脵': u'gu', u'脶': u'luo2', u'脷': u'li4', u'脸': u'lian3', u'脹': u'zhang4', u'脺': u'cui1', u'脻': u'jie1', u'脼': u'liang3', u'脽': u'shui2', u'脾': u'pi2', u'脿': u'biao1', u'腀': u'lun2', u'腁': u'pian2', u'腂': u'guo4', u'腃': u'juan4', u'腄': u'chui2', u'腅': u'dan4', u'腆': u'tian3', u'腇': u'nei3', u'腈': u'jing1', u'腉': u'nai2', u'腊': u'la4', u'腋': u'ye4', u'腌': u'yan1', u'腍': u'ren4', u'腎': u'shen4', u'腏': u'zhui4', u'腐': u'fu3', u'腑': u'fu3', u'腒': u'ju1', u'腓': u'fei2', u'腔': u'qiang1', u'腕': u'wan4', u'腖': u'dong4', u'腗': u'pi2', u'腘': u'guo2', u'腙': u'zong1', u'腚': u'ding4', u'腛': u'wo4', u'腜': u'mei2', u'腝': u'ruan3', u'腞': u'zhuan4', u'腟': u'chi4', u'腠': u'cou4', u'腡': u'luo2', u'腢': u'ou3', u'腣': u'di4', u'腤': u'an1', u'腥': u'xing1', u'腦': u'nao3', u'腧': u'shu4', u'腨': u'shuan4', u'腩': u'nan3', u'腪': u'yun4', u'腫': u'zhong3', u'腬': u'rou2', u'腭': u'e4', u'腮': u'sai1', u'腯': u'tu2', u'腰': u'yao1', u'腱': u'jian4', u'腲': u'wei3', u'腳': u'jiao3', u'腴': u'yu2', u'腵': u'jia1', u'腶': u'duan4', u'腷': u'bi4', u'腸': u'chang2', u'腹': u'fu4', u'腺': u'xian4', u'腻': u'ni4', u'腼': u'mian3', u'腽': u'wa4', u'腾': u'teng2', u'腿': u'tui3', u'膀': u'bang3', u'膁': u'qian3', u'膂': u'lv3', u'膃': u'wa4', u'膄': u'shou4', u'膅': u'tang2', u'膆': u'su4', u'膇': u'zhui4', u'膈': u'ge2', u'膉': u'yi4', u'膊': u'bo2', u'膋': u'liao2', u'膌': u'ji2', u'膍': u'pi2', u'膎': u'xie2', u'膏': u'gao1', u'膐': u'lv3', u'膑': u'bin4', u'膒': u'ou1', u'膓': u'chang2', u'膔': u'lu4', u'膕': u'guo2', u'膖': u'pang1', u'膗': u'chuai2', u'膘': u'biao1', u'膙': u'jiang3', u'膚': u'fu1', u'膛': u'tang2', u'膜': u'mo2', u'膝': u'xi1', u'膞': u'zhuan1', u'膟': u'lv4', u'膠': u'jiao1', u'膡': u'ying4', u'膢': u'lv2', u'膣': u'zhi4', u'膤': u'xue', u'膥': u'cun1', u'膦': u'lin4', u'膧': u'tong2', u'膨': u'peng2', u'膩': u'ni4', u'膪': u'chuai4', u'膫': u'liao2', u'膬': u'cui4', u'膭': u'kui4', u'膮': u'xiao1', u'膯': u'teng1', u'膰': u'fan2', u'膱': u'zhi2', u'膲': u'jiao1', u'膳': u'shan4', u'膴': u'hu1', u'膵': u'cui4', u'膶': u'run4', u'膷': u'xiang1', u'膸': u'sui3', u'膹': u'fen4', u'膺': u'ying1', u'膻': u'shan1', u'膼': u'zhua1', u'膽': u'dan3', u'膾': u'kuai4', u'膿': u'nong2', u'臀': u'tun2', u'臁': u'lian2', u'臂': u'bi4', u'臃': u'yong1', u'臄': u'jue2', u'臅': u'chu4', u'臆': u'yi4', u'臇': u'juan3', u'臈': u'la4', u'臉': u'lian3', u'臊': u'sao1', u'臋': u'tun2', u'臌': u'gu3', u'臍': u'qi2', u'臎': u'cui4', u'臏': u'bin4', u'臐': u'xun1', u'臑': u'er2', u'臒': u'wo4', u'臓': u'zang4', u'臔': u'xian4', u'臕': u'biao1', u'臖': u'xing4', u'臗': u'kuan1', u'臘': u'la4', u'臙': u'yan1', u'臚': u'lu2', u'臛': u'huo4', u'臜': u'za1', u'臝': u'luo3', u'臞': u'qu2', u'臟': u'zang1', u'臠': u'luan2', u'臡': u'ni2', u'臢': u'za1', u'臣': u'chen2', u'臤': u'qian1', u'臥': u'wo4', u'臦': u'guang4', u'臧': u'zang1', u'臨': u'lin2', u'臩': u'guang3', u'自': u'zi4', u'臫': u'jiao3', u'臬': u'nie4', u'臭': u'chou4', u'臮': u'ji4', u'臯': u'gao1', u'臰': u'chou4', u'臱': u'mian2', u'臲': u'nie4', u'至': u'zhi4', u'致': u'zhi4', u'臵': u'ge2', u'臶': u'jian4', u'臷': u'die2', u'臸': u'zhi1', u'臹': u'xiu1', u'臺': u'tai2', u'臻': u'zhen1', u'臼': u'jiu4', u'臽': u'xian4', u'臾': u'yu2', u'臿': u'cha1', u'舀': u'yao3', u'舁': u'yu2', u'舂': u'chong1', u'舃': u'xi4', u'舄': u'xi4', u'舅': u'jiu4', u'舆': u'yu2', u'與': u'yu3', u'興': u'xing1', u'舉': u'ju3', u'舊': u'jiu4', u'舋': u'xin4', u'舌': u'she2', u'舍': u'she3', u'舎': u'she4', u'舏': u'jiu3', u'舐': u'shi4', u'舑': u'tan1', u'舒': u'shu1', u'舓': u'shi4', u'舔': u'tian3', u'舕': u'tan4', u'舖': u'pu1', u'舗': u'pu4', u'舘': u'guan3', u'舙': u'hua4', u'舚': u'tian4', u'舛': u'chuan3', u'舜': u'shun4', u'舝': u'xia2', u'舞': u'wu3', u'舟': u'zhou1', u'舠': u'dao1', u'舡': u'chuan2', u'舢': u'shan1', u'舣': u'yi3', u'舤': u'fan2', u'舥': u'pa1', u'舦': u'tai4', u'舧': u'fan2', u'舨': u'ban3', u'舩': u'chuan2', u'航': u'hang2', u'舫': u'fang3', u'般': u'ban1', u'舭': u'bi3', u'舮': u'lu2', u'舯': u'zhong1', u'舰': u'jian4', u'舱': u'cang1', u'舲': u'ling2', u'舳': u'zhu2', u'舴': u'ze2', u'舵': u'duo4', u'舶': u'bo2', u'舷': u'xian2', u'舸': u'ge3', u'船': u'chuan2', u'舺': u'xia2', u'舻': u'lu2', u'舼': u'qiong2', u'舽': u'pang2', u'舾': u'xi1', u'舿': u'kua', u'艀': u'fu2', u'艁': u'zao4', u'艂': u'feng2', u'艃': u'li2', u'艄': u'shao1', u'艅': u'yu2', u'艆': u'lang2', u'艇': u'ting3', u'艈': u'yu4', u'艉': u'wei3', u'艊': u'bo2', u'艋': u'meng3', u'艌': u'nian4', u'艍': u'ju1', u'艎': u'huang2', u'艏': u'shou3', u'艐': u'ke4', u'艑': u'bian4', u'艒': u'mu4', u'艓': u'die2', u'艔': u'dao4', u'艕': u'bang4', u'艖': u'cha1', u'艗': u'yi4', u'艘': u'sou1', u'艙': u'cang1', u'艚': u'cao2', u'艛': u'lou2', u'艜': u'dai4', u'艝': u'suo1', u'艞': u'yao4', u'艟': u'chong1', u'艠': u'deng', u'艡': u'dang1', u'艢': u'qiang2', u'艣': u'lu3', u'艤': u'yi3', u'艥': u'ji2', u'艦': u'jian4', u'艧': u'huo4', u'艨': u'meng2', u'艩': u'qi2', u'艪': u'lu3', u'艫': u'lu2', u'艬': u'chan2', u'艭': u'shuang1', u'艮': u'gen4', u'良': u'liang2', u'艰': u'jian1', u'艱': u'jian1', u'色': u'se4', u'艳': u'yan4', u'艴': u'fu2', u'艵': u'ping1', u'艶': u'yan4', u'艷': u'yan4', u'艸': u'ao3', u'艹': u'ao3', u'艺': u'yi4', u'艻': u'le4', u'艼': u'ding3', u'艽': u'jiao1', u'艾': u'ai4', u'艿': u'nai3', u'芀': u'tiao2', u'芁': u'qiu2', u'节': u'jie2', u'芃': u'peng2', u'芄': u'wan2', u'芅': u'yi4', u'芆': u'chai1', u'芇': u'mian2', u'芈': u'mi3', u'芉': u'gan3', u'芊': u'qian1', u'芋': u'yu4', u'芌': u'yu4', u'芍': u'shao2', u'芎': u'xiong1', u'芏': u'du4', u'芐': u'bian4', u'芑': u'qi3', u'芒': u'mang2', u'芓': u'zi4', u'芔': u'hui4', u'芕': u'sui1', u'芖': u'zhi4', u'芗': u'xiang1', u'芘': u'bi4', u'芙': u'fu2', u'芚': u'chun1', u'芛': u'wei3', u'芜': u'wu2', u'芝': u'zhi1', u'芞': u'qi4', u'芟': u'shan1', u'芠': u'wen2', u'芡': u'qian4', u'芢': u'ren2', u'芣': u'fu2', u'芤': u'kou1', u'芥': u'jie4', u'芦': u'lu2', u'芧': u'xu4', u'芨': u'ji1', u'芩': u'qin2', u'芪': u'qi2', u'芫': u'yan2', u'芬': u'fen1', u'芭': u'ba1', u'芮': u'rui4', u'芯': u'xin1', u'芰': u'ji4', u'花': u'hua1', u'芲': u'lun2', u'芳': u'fang1', u'芴': u'wu4', u'芵': u'jue2', u'芶': u'gou3', u'芷': u'zhi3', u'芸': u'yun2', u'芹': u'qin2', u'芺': u'ao3', u'芻': u'chu2', u'芼': u'mao4', u'芽': u'ya2', u'芾': u'fu2', u'芿': u'reng4', u'苀': u'hang2', u'苁': u'cong1', u'苂': u'chan2', u'苃': u'you3', u'苄': u'bian4', u'苅': u'yi4', u'苆': u'qie', u'苇': u'wei3', u'苈': u'li4', u'苉': u'pi3', u'苊': u'e4', u'苋': u'xian4', u'苌': u'chang2', u'苍': u'cang1', u'苎': u'zhu4', u'苏': u'su1', u'苐': u'di4', u'苑': u'yuan4', u'苒': u'ran3', u'苓': u'ling2', u'苔': u'tai2', u'苕': u'shao2', u'苖': u'di2', u'苗': u'miao2', u'苘': u'qing3', u'苙': u'li4', u'苚': u'yong4', u'苛': u'ke1', u'苜': u'mu4', u'苝': u'bei4', u'苞': u'bao1', u'苟': u'gou3', u'苠': u'min2', u'苡': u'yi3', u'苢': u'yi3', u'苣': u'ju4', u'苤': u'pie3', u'若': u'ruo4', u'苦': u'ku3', u'苧': u'zhu4', u'苨': u'ni3', u'苩': u'pa1', u'苪': u'bing3', u'苫': u'shan4', u'苬': u'xiu2', u'苭': u'yao3', u'苮': u'xian1', u'苯': u'ben3', u'苰': u'hong2', u'英': u'ying1', u'苲': u'zha3', u'苳': u'dong1', u'苴': u'ju1', u'苵': u'die2', u'苶': u'nie2', u'苷': u'gan1', u'苸': u'hu1', u'苹': u'ping2', u'苺': u'mei2', u'苻': u'fu2', u'苼': u'sheng1', u'苽': u'gu1', u'苾': u'bi4', u'苿': u'wei4', u'茀': u'fu2', u'茁': u'zhuo2', u'茂': u'mao4', u'范': u'fan4', u'茄': u'qie2', u'茅': u'mao2', u'茆': u'mao2', u'茇': u'ba2', u'茈': u'ci2', u'茉': u'mo4', u'茊': u'zi1', u'茋': u'zhi3', u'茌': u'chi2', u'茍': u'gou3', u'茎': u'jing4', u'茏': u'long2', u'茐': u'cong1', u'茑': u'niao3', u'茒': u'yuan2', u'茓': u'xue2', u'茔': u'ying2', u'茕': u'qiong2', u'茖': u'ge2', u'茗': u'ming2', u'茘': u'li4', u'茙': u'rong2', u'茚': u'yin4', u'茛': u'gen4', u'茜': u'qian4', u'茝': u'chai3', u'茞': u'chen2', u'茟': u'yu4', u'茠': u'hao1', u'茡': u'zi4', u'茢': u'lie4', u'茣': u'wu2', u'茤': u'ji4', u'茥': u'gui1', u'茦': u'ci4', u'茧': u'jian3', u'茨': u'ci2', u'茩': u'hou4', u'茪': u'guang1', u'茫': u'mang2', u'茬': u'cha2', u'茭': u'jiao1', u'茮': u'jiao1', u'茯': u'fu2', u'茰': u'yu2', u'茱': u'zhu1', u'茲': u'zi1', u'茳': u'jiang1', u'茴': u'hui2', u'茵': u'yin1', u'茶': u'cha2', u'茷': u'fa2', u'茸': u'rong2', u'茹': u'ru2', u'茺': u'chong1', u'茻': u'mang3', u'茼': u'tong2', u'茽': u'zhong4', u'茾': u'qian1', u'茿': u'zhu2', u'荀': u'xun2', u'荁': u'huan2', u'荂': u'fu1', u'荃': u'quan2', u'荄': u'gai1', u'荅': u'da2', u'荆': u'jing1', u'荇': u'xing4', u'荈': u'chuan3', u'草': u'cao3', u'荊': u'jing1', u'荋': u'er2', u'荌': u'an4', u'荍': u'qiao2', u'荎': u'chi2', u'荏': u'ren3', u'荐': u'jian4', u'荑': u'yi2', u'荒': u'huang1', u'荓': u'ping2', u'荔': u'li4', u'荕': u'jin1', u'荖': u'lao3', u'荗': u'shu4', u'荘': u'zhuang1', u'荙': u'da2', u'荚': u'jia2', u'荛': u'rao2', u'荜': u'bi4', u'荝': u'ce4', u'荞': u'qiao2', u'荟': u'hui4', u'荠': u'ji4', u'荡': u'dang4', u'荢': u'zi4', u'荣': u'rong2', u'荤': u'hun1', u'荥': u'ying2', u'荦': u'luo4', u'荧': u'ying2', u'荨': u'qian2', u'荩': u'jin4', u'荪': u'sun1', u'荫': u'yin1', u'荬': u'mai3', u'荭': u'hong2', u'荮': u'zhou4', u'药': u'yao4', u'荰': u'du4', u'荱': u'wei3', u'荲': u'li2', u'荳': u'dou4', u'荴': u'fu1', u'荵': u'ren3', u'荶': u'yin2', u'荷': u'he2', u'荸': u'bi2', u'荹': u'bu4', u'荺': u'yun3', u'荻': u'di2', u'荼': u'tu2', u'荽': u'sui1', u'荾': u'sui1', u'荿': u'cheng2', u'莀': u'chen2', u'莁': u'wu2', u'莂': u'bie2', u'莃': u'xi1', u'莄': u'geng3', u'莅': u'li4', u'莆': u'pu2', u'莇': u'zhu4', u'莈': u'mo4', u'莉': u'li4', u'莊': u'zhuang1', u'莋': u'zuo2', u'莌': u'tuo1', u'莍': u'qiu2', u'莎': u'sha1', u'莏': u'suo1', u'莐': u'chen2', u'莑': u'peng2', u'莒': u'ju3', u'莓': u'mei2', u'莔': u'meng2', u'莕': u'xing4', u'莖': u'jing4', u'莗': u'che1', u'莘': u'shen1', u'莙': u'jun1', u'莚': u'yan2', u'莛': u'ting2', u'莜': u'you2', u'莝': u'cuo4', u'莞': u'wan3', u'莟': u'han4', u'莠': u'you3', u'莡': u'cuo4', u'莢': u'jia2', u'莣': u'wang2', u'莤': u'su4', u'莥': u'niu3', u'莦': u'shao1', u'莧': u'xian4', u'莨': u'liang2', u'莩': u'fu2', u'莪': u'e2', u'莫': u'mo4', u'莬': u'wen4', u'莭': u'jie2', u'莮': u'nan2', u'莯': u'mu4', u'莰': u'kan3', u'莱': u'lai2', u'莲': u'lian2', u'莳': u'shi2', u'莴': u'wo1', u'莵': u'tu4', u'莶': u'xian1', u'获': u'huo4', u'莸': u'you2', u'莹': u'ying2', u'莺': u'ying1', u'莻': u'wan3', u'莼': u'chun2', u'莽': u'mang3', u'莾': u'mang3', u'莿': u'ci4', u'菀': u'wan3', u'菁': u'jing1', u'菂': u'di4', u'菃': u'qu2', u'菄': u'dong1', u'菅': u'jian1', u'菆': u'cuan2', u'菇': u'gu1', u'菈': u'la1', u'菉': u'lu4', u'菊': u'ju2', u'菋': u'wei4', u'菌': u'jun1', u'菍': u'nie4', u'菎': u'kun1', u'菏': u'he2', u'菐': u'pu2', u'菑': u'zai1', u'菒': u'gao3', u'菓': u'guo3', u'菔': u'fu2', u'菕': u'lun2', u'菖': u'chang1', u'菗': u'chou2', u'菘': u'song1', u'菙': u'chui2', u'菚': u'zhan4', u'菛': u'men2', u'菜': u'cai4', u'菝': u'ba2', u'菞': u'li2', u'菟': u'tu4', u'菠': u'bo1', u'菡': u'han4', u'菢': u'bao4', u'菣': u'qin4', u'菤': u'juan3', u'菥': u'xi1', u'菦': u'qin2', u'菧': u'di3', u'菨': u'jie2', u'菩': u'pu2', u'菪': u'dang4', u'菫': u'jin3', u'菬': u'qiao2', u'菭': u'tai2', u'菮': u'geng1', u'華': u'hua2', u'菰': u'gu1', u'菱': u'ling2', u'菲': u'fei1', u'菳': u'qin2', u'菴': u'an1', u'菵': u'wang3', u'菶': u'beng3', u'菷': u'zhou3', u'菸': u'yan1', u'菹': u'zu1', u'菺': u'jian1', u'菻': u'lin3', u'菼': u'tan3', u'菽': u'shu1', u'菾': u'tian2', u'菿': u'dao4', u'萀': u'hu3', u'萁': u'qi2', u'萂': u'he2', u'萃': u'cui4', u'萄': u'tao2', u'萅': u'chun1', u'萆': u'bi4', u'萇': u'chang2', u'萈': u'huan2', u'萉': u'fei4', u'萊': u'lai2', u'萋': u'qi1', u'萌': u'meng2', u'萍': u'ping2', u'萎': u'wei3', u'萏': u'dan4', u'萐': u'sha4', u'萑': u'huan2', u'萒': u'yan3', u'萓': u'yi2', u'萔': u'tiao2', u'萕': u'qi2', u'萖': u'wan3', u'萗': u'ce4', u'萘': u'nai4', u'萙': u'ku3ta1bi1', u'萚': u'tuo4', u'萛': u'jiu1', u'萜': u'tie1', u'萝': u'luo2', u'萞': u'bi4', u'萟': u'yi4', u'萠': u'pan1', u'萡': u'bo2', u'萢': u'pao1', u'萣': u'ding4', u'萤': u'ying2', u'营': u'ying2', u'萦': u'ying2', u'萧': u'xiao1', u'萨': u'sa4', u'萩': u'qiu1', u'萪': u'ke1', u'萫': u'xiang1', u'萬': u'wan4', u'萭': u'yu3', u'萮': u'yu2', u'萯': u'fu4', u'萰': u'lian4', u'萱': u'xuan1', u'萲': u'xuan1', u'萳': u'nan3', u'萴': u'ce4', u'萵': u'wo1', u'萶': u'chun3', u'萷': u'shao1', u'萸': u'yu2', u'萹': u'bian1', u'萺': u'mao4', u'萻': u'an1', u'萼': u'e4', u'落': u'luo4', u'萾': u'ying2', u'萿': u'kuo4', u'葀': u'kuo4', u'葁': u'jiang1', u'葂': u'mian3', u'葃': u'zuo4', u'葄': u'zuo4', u'葅': u'zu1', u'葆': u'bao3', u'葇': u'rou2', u'葈': u'xi3', u'葉': u'ye4', u'葊': u'an1', u'葋': u'qu2', u'葌': u'jian1', u'葍': u'fu2', u'葎': u'lv4', u'葏': u'jing1', u'葐': u'pen2', u'葑': u'feng1', u'葒': u'hong2', u'葓': u'hong2', u'葔': u'hou2', u'葕': u'xing4', u'葖': u'tu1', u'著': u'zhu4', u'葘': u'zi1', u'葙': u'xiang1', u'葚': u'shen4', u'葛': u'ge3', u'葜': u'qia1', u'葝': u'qing2', u'葞': u'mi3', u'葟': u'huang2', u'葠': u'shen1', u'葡': u'pu2', u'葢': u'gai4', u'董': u'dong3', u'葤': u'zhou4', u'葥': u'qian2', u'葦': u'wei3', u'葧': u'bo2', u'葨': u'wei1', u'葩': u'pa1', u'葪': u'ji4', u'葫': u'hu2', u'葬': u'zang4', u'葭': u'jia1', u'葮': u'duan4', u'葯': u'yao4', u'葰': u'jun4', u'葱': u'cong1', u'葲': u'quan2', u'葳': u'wei1', u'葴': u'zhen1', u'葵': u'kui2', u'葶': u'ting2', u'葷': u'hun1', u'葸': u'xi3', u'葹': u'shi1', u'葺': u'qi4', u'葻': u'lan2', u'葼': u'zong1', u'葽': u'yao1', u'葾': u'yuan1', u'葿': u'mei2', u'蒀': u'yun1', u'蒁': u'shu4', u'蒂': u'di4', u'蒃': u'zhuan4', u'蒄': u'guan1', u'蒅': u'ran', u'蒆': u'xue1', u'蒇': u'chan3', u'蒈': u'kai3', u'蒉': u'kui4', u'蒊': u'wuwu', u'蒋': u'jiang3', u'蒌': u'lou2', u'蒍': u'wei3', u'蒎': u'pai4', u'蒏': u'yong4', u'蒐': u'sou1', u'蒑': u'yin1', u'蒒': u'shi1', u'蒓': u'chun2', u'蒔': u'shi2', u'蒕': u'yun1', u'蒖': u'zhen1', u'蒗': u'lang4', u'蒘': u'ru2', u'蒙': u'meng2', u'蒚': u'li4', u'蒛': u'que1', u'蒜': u'suan4', u'蒝': u'yuan2', u'蒞': u'li4', u'蒟': u'ju3', u'蒠': u'xi1', u'蒡': u'bang4', u'蒢': u'chu2', u'蒣': u'xu2', u'蒤': u'tu2', u'蒥': u'liu2', u'蒦': u'huo4', u'蒧': u'dian3', u'蒨': u'qian4', u'蒩': u'zu1', u'蒪': u'po4', u'蒫': u'cuo2', u'蒬': u'yuan1', u'蒭': u'chu2', u'蒮': u'yu4', u'蒯': u'kuai3', u'蒰': u'pan2', u'蒱': u'pu2', u'蒲': u'pu2', u'蒳': u'na4', u'蒴': u'shuo4', u'蒵': u'xi2', u'蒶': u'fen2', u'蒷': u'yun2', u'蒸': u'zheng1', u'蒹': u'jian1', u'蒺': u'ji2', u'蒻': u'ruo4', u'蒼': u'cang1', u'蒽': u'en1', u'蒾': u'mi2', u'蒿': u'hao1', u'蓀': u'sun1', u'蓁': u'zhen1', u'蓂': u'mi4', u'蓃': u'sou1', u'蓄': u'xu4', u'蓅': u'liu2', u'蓆': u'xi2', u'蓇': u'gu1', u'蓈': u'lang2', u'蓉': u'rong2', u'蓊': u'weng3', u'蓋': u'gai4', u'蓌': u'cuo4', u'蓍': u'shi1', u'蓎': u'tang2', u'蓏': u'luo3', u'蓐': u'ru4', u'蓑': u'suo1', u'蓒': u'xuan1', u'蓓': u'bei4', u'蓔': u'yao3', u'蓕': u'gui4', u'蓖': u'bi4', u'蓗': u'zong3', u'蓘': u'gun3', u'蓙': u'guo1zha1', u'蓚': u'tiao2', u'蓛': u'ce4', u'蓜': u'pei', u'蓝': u'lan2', u'蓞': u'dan4', u'蓟': u'ji4', u'蓠': u'li2', u'蓡': u'shen1', u'蓢': u'lang3', u'蓣': u'yu4', u'蓤': u'ling2', u'蓥': u'ying2', u'蓦': u'mo4', u'蓧': u'diao4', u'蓨': u'tiao2', u'蓩': u'mao3', u'蓪': u'tong1', u'蓫': u'zhu2', u'蓬': u'peng2', u'蓭': u'an1', u'蓮': u'lian2', u'蓯': u'cong1', u'蓰': u'xi3', u'蓱': u'ping2', u'蓲': u'qiu1', u'蓳': u'jin3', u'蓴': u'chun2', u'蓵': u'jie2', u'蓶': u'wei2', u'蓷': u'tui1', u'蓸': u'cao2', u'蓹': u'yu4', u'蓺': u'yi4', u'蓻': u'zi2', u'蓼': u'liao3', u'蓽': u'bi4', u'蓾': u'lu3', u'蓿': u'xu', u'蔀': u'bu4', u'蔁': u'zhang1', u'蔂': u'lei2', u'蔃': u'qiang2', u'蔄': u'man4', u'蔅': u'yan2', u'蔆': u'ling2', u'蔇': u'ji4', u'蔈': u'biao1', u'蔉': u'gun3', u'蔊': u'han3', u'蔋': u'di2', u'蔌': u'su4', u'蔍': u'lu4', u'蔎': u'she4', u'蔏': u'shang1', u'蔐': u'di2', u'蔑': u'mie4', u'蔒': u'hun1', u'蔓': u'man4', u'蔔': u'bu3', u'蔕': u'di4', u'蔖': u'cuo2', u'蔗': u'zhe4', u'蔘': u'shen1', u'蔙': u'xuan4', u'蔚': u'wei4', u'蔛': u'hu2', u'蔜': u'ao2', u'蔝': u'mi3', u'蔞': u'lou2', u'蔟': u'cu4', u'蔠': u'zhong1', u'蔡': u'cai4', u'蔢': u'po2', u'蔣': u'jiang3', u'蔤': u'mi4', u'蔥': u'cong1', u'蔦': u'niao3', u'蔧': u'hui4', u'蔨': u'juan4', u'蔩': u'yin2', u'蔪': u'jian1', u'蔫': u'nian1', u'蔬': u'shu1', u'蔭': u'yin1', u'蔮': u'guo2', u'蔯': u'chen2', u'蔰': u'hu4', u'蔱': u'sha1', u'蔲': u'kou4', u'蔳': u'qian4', u'蔴': u'ma2', u'蔵': u'zang4', u'蔶': u'ze2', u'蔷': u'qiang2', u'蔸': u'dou1', u'蔹': u'lian3', u'蔺': u'lin4', u'蔻': u'kou4', u'蔼': u'ai3', u'蔽': u'bi4', u'蔾': u'li2', u'蔿': u'wei3', u'蕀': u'ji2', u'蕁': u'qian2', u'蕂': u'sheng4', u'蕃': u'fan1', u'蕄': u'meng2', u'蕅': u'ou3', u'蕆': u'chan3', u'蕇': u'dian3', u'蕈': u'xun4', u'蕉': u'jiao1', u'蕊': u'rui3', u'蕋': u'rui3', u'蕌': u'lei3', u'蕍': u'yu2', u'蕎': u'qiao2', u'蕏': u'zhu1', u'蕐': u'hua2', u'蕑': u'jian1', u'蕒': u'mai3', u'蕓': u'yun2', u'蕔': u'bao1', u'蕕': u'you2', u'蕖': u'qu2', u'蕗': u'lu4', u'蕘': u'rao2', u'蕙': u'hui4', u'蕚': u'e4', u'蕛': u'ti2', u'蕜': u'fei3', u'蕝': u'jue2', u'蕞': u'zui4', u'蕟': u'fa4', u'蕠': u'ru2', u'蕡': u'fen2', u'蕢': u'kui4', u'蕣': u'shun4', u'蕤': u'rui2', u'蕥': u'ya3', u'蕦': u'xu1', u'蕧': u'fu4', u'蕨': u'jue2', u'蕩': u'dang4', u'蕪': u'wu2', u'蕫': u'dong3', u'蕬': u'si1', u'蕭': u'xiao1', u'蕮': u'xi4', u'蕯': u'sa4', u'蕰': u'wen1', u'蕱': u'shao1', u'蕲': u'qi2', u'蕳': u'jian1', u'蕴': u'yun4', u'蕵': u'sun1', u'蕶': u'ling2', u'蕷': u'yu4', u'蕸': u'xia2', u'蕹': u'weng4', u'蕺': u'ji2', u'蕻': u'hong2', u'蕼': u'si4', u'蕽': u'nong2', u'蕾': u'lei3', u'蕿': u'xuan1', u'薀': u'yun4', u'薁': u'yu4', u'薂': u'xi2', u'薃': u'hao4', u'薄': u'bao2', u'薅': u'hao1', u'薆': u'ai4', u'薇': u'wei1', u'薈': u'hui4', u'薉': u'hui4', u'薊': u'ji4', u'薋': u'ci2', u'薌': u'xiang1', u'薍': u'wan4', u'薎': u'mie4', u'薏': u'yi4', u'薐': u'leng2', u'薑': u'jiang1', u'薒': u'can4', u'薓': u'shen1', u'薔': u'qiang2', u'薕': u'lian2', u'薖': u'ke1', u'薗': u'yuan2', u'薘': u'da2', u'薙': u'ti4', u'薚': u'tang1', u'薛': u'xue1', u'薜': u'bi4', u'薝': u'zhan1', u'薞': u'sun1', u'薟': u'xian1', u'薠': u'fan2', u'薡': u'ding3', u'薢': u'xie4', u'薣': u'gu3', u'薤': u'xie4', u'薥': u'shu3', u'薦': u'jian4', u'薧': u'gao3', u'薨': u'hong1', u'薩': u'sa4', u'薪': u'xin1', u'薫': u'xun1', u'薬': u'yao4', u'薭': u'bai4', u'薮': u'sou3', u'薯': u'shu3', u'薰': u'xun1', u'薱': u'dui4', u'薲': u'pin2', u'薳': u'wei3', u'薴': u'ning2', u'薵': u'chou2', u'薶': u'mai2', u'薷': u'ru2', u'薸': u'piao2', u'薹': u'tai2', u'薺': u'ji4', u'薻': u'zao3', u'薼': u'chen2', u'薽': u'zhen1', u'薾': u'er3', u'薿': u'ni3', u'藀': u'ying2', u'藁': u'gao3', u'藂': u'cong2', u'藃': u'xiao1', u'藄': u'qi2', u'藅': u'fa2', u'藆': u'jian3', u'藇': u'xu4', u'藈': u'kui2', u'藉': u'ji2', u'藊': u'bian3', u'藋': u'diao4', u'藌': u'mi2', u'藍': u'lan2', u'藎': u'jin4', u'藏': u'cang2', u'藐': u'miao3', u'藑': u'qiong2', u'藒': u'qi4', u'藓': u'xian3', u'藔': u'liao2', u'藕': u'ou3', u'藖': u'xian2', u'藗': u'su4', u'藘': u'lv2', u'藙': u'yi4', u'藚': u'xu4', u'藛': u'xie3', u'藜': u'li2', u'藝': u'yi4', u'藞': u'la3', u'藟': u'lei3', u'藠': u'jiao4', u'藡': u'di2', u'藢': u'zhi3', u'藣': u'bei1', u'藤': u'teng2', u'藥': u'yao4', u'藦': u'mo4', u'藧': u'huan4', u'藨': u'biao1', u'藩': u'fan1', u'藪': u'sou3', u'藫': u'tan2', u'藬': u'tui1', u'藭': u'qiong2', u'藮': u'qiao2', u'藯': u'wei4', u'藰': u'liu2', u'藱': u'hui4', u'藲': u'ou1', u'藳': u'gao3', u'藴': u'yun4', u'藵': u'bao', u'藶': u'li4', u'藷': u'shu3', u'藸': u'zhu1', u'藹': u'ai3', u'藺': u'lin4', u'藻': u'zao3', u'藼': u'xuan1', u'藽': u'qin4', u'藾': u'lai4', u'藿': u'huo4', u'蘀': u'tuo4', u'蘁': u'wu4', u'蘂': u'rui3', u'蘃': u'rui3', u'蘄': u'qi2', u'蘅': u'heng2', u'蘆': u'lu2', u'蘇': u'su1', u'蘈': u'tui2', u'蘉': u'mang2', u'蘊': u'yun4', u'蘋': u'ping2', u'蘌': u'yu4', u'蘍': u'xun1', u'蘎': u'ji4', u'蘏': u'jiong1', u'蘐': u'xuan1', u'蘑': u'mo2', u'蘒': u'qiu', u'蘓': u'su1', u'蘔': u'jiong1', u'蘕': u'peng2', u'蘖': u'nie4', u'蘗': u'nie4', u'蘘': u'rang2', u'蘙': u'yi4', u'蘚': u'xian3', u'蘛': u'yu2', u'蘜': u'ju2', u'蘝': u'lian3', u'蘞': u'lian3', u'蘟': u'yin3', u'蘠': u'qiang2', u'蘡': u'ying1', u'蘢': u'long2', u'蘣': u'tou3', u'蘤': u'hua1', u'蘥': u'yue4', u'蘦': u'ling4', u'蘧': u'qu2', u'蘨': u'yao2', u'蘩': u'fan2', u'蘪': u'mei2', u'蘫': u'lan2', u'蘬': u'gui1', u'蘭': u'lan2', u'蘮': u'ji4', u'蘯': u'dang4', u'蘰': u'man', u'蘱': u'lei4', u'蘲': u'lei2', u'蘳': u'hui1', u'蘴': u'feng1', u'蘵': u'zhi1', u'蘶': u'wei4', u'蘷': u'kui2', u'蘸': u'zhan4', u'蘹': u'huai2', u'蘺': u'li2', u'蘻': u'ji4', u'蘼': u'mi2', u'蘽': u'lei3', u'蘾': u'huai4', u'蘿': u'luo2', u'虀': u'ji1', u'虁': u'kui2', u'虂': u'lu4', u'虃': u'jian1', u'虄': u'sa3ri', u'虅': u'teng2', u'虆': u'lei3', u'虇': u'quan3', u'虈': u'xiao1', u'虉': u'yi4', u'虊': u'luan2', u'虋': u'men2', u'虌': u'bie1', u'虍': u'hu1', u'虎': u'hu3', u'虏': u'lu3', u'虐': u'nue4', u'虑': u'lv4', u'虒': u'si1', u'虓': u'xiao1', u'虔': u'qian2', u'處': u'chu4', u'虖': u'hu1', u'虗': u'xu1', u'虘': u'cuo2', u'虙': u'fu2', u'虚': u'xu1', u'虛': u'xu1', u'虜': u'lu3', u'虝': u'hu3', u'虞': u'yu2', u'號': u'hao4', u'虠': u'jiao1', u'虡': u'ju4', u'虢': u'guo2', u'虣': u'bao4', u'虤': u'yan2', u'虥': u'zhan4', u'虦': u'zhan4', u'虧': u'kui1', u'虨': u'bin1', u'虩': u'xi4', u'虪': u'shu4', u'虫': u'chong2', u'虬': u'qiu2', u'虭': u'diao1', u'虮': u'ji3', u'虯': u'qiu2', u'虰': u'ding1', u'虱': u'shi1', u'虲': u'wuwu', u'虳': u'jue2', u'虴': u'zhe2', u'虵': u'she2', u'虶': u'yu2', u'虷': u'han2', u'虸': u'zi3', u'虹': u'hong2', u'虺': u'hui1', u'虻': u'meng2', u'虼': u'ge4', u'虽': u'sui1', u'虾': u'xia1', u'虿': u'chai4', u'蚀': u'shi2', u'蚁': u'yi3', u'蚂': u'ma3', u'蚃': u'xiang3', u'蚄': u'fang1', u'蚅': u'e4', u'蚆': u'ba1', u'蚇': u'chi3', u'蚈': u'qian1', u'蚉': u'wen2', u'蚊': u'wen2', u'蚋': u'rui4', u'蚌': u'bang4', u'蚍': u'pi2', u'蚎': u'yue4', u'蚏': u'yue4', u'蚐': u'jun1', u'蚑': u'qi2', u'蚒': u'tong2', u'蚓': u'yin3', u'蚔': u'qi2', u'蚕': u'can2', u'蚖': u'yuan2', u'蚗': u'jue2', u'蚘': u'hui2', u'蚙': u'qin2', u'蚚': u'qi2', u'蚛': u'zhong4', u'蚜': u'ya2', u'蚝': u'hao2', u'蚞': u'mu4', u'蚟': u'wang2', u'蚠': u'fen2', u'蚡': u'fen2', u'蚢': u'hang2', u'蚣': u'gong1', u'蚤': u'zao3', u'蚥': u'fu4', u'蚦': u'ran2', u'蚧': u'jie4', u'蚨': u'fu2', u'蚩': u'chi1', u'蚪': u'dou3', u'蚫': u'bao4', u'蚬': u'xian3', u'蚭': u'ni2', u'蚮': u'dai4', u'蚯': u'qiu1', u'蚰': u'you2', u'蚱': u'zha4', u'蚲': u'ping2', u'蚳': u'di4', u'蚴': u'you4', u'蚵': u'ke1', u'蚶': u'han1', u'蚷': u'ju4', u'蚸': u'li4', u'蚹': u'fu4', u'蚺': u'ran2', u'蚻': u'zha2', u'蚼': u'gou3', u'蚽': u'pi2', u'蚾': u'pi2', u'蚿': u'xian2', u'蛀': u'zhu4', u'蛁': u'diao1', u'蛂': u'bie2', u'蛃': u'bing3', u'蛄': u'gu1', u'蛅': u'zhan1', u'蛆': u'qu1', u'蛇': u'she2', u'蛈': u'tie3', u'蛉': u'ling2', u'蛊': u'gu3', u'蛋': u'dan4', u'蛌': u'tun2', u'蛍': u'ying2', u'蛎': u'li4', u'蛏': u'cheng1', u'蛐': u'qu1', u'蛑': u'mou2', u'蛒': u'ge2', u'蛓': u'ci4', u'蛔': u'hui2', u'蛕': u'hui2', u'蛖': u'mang2', u'蛗': u'fu4', u'蛘': u'yang2', u'蛙': u'wa1', u'蛚': u'lie4', u'蛛': u'zhu1', u'蛜': u'yi1', u'蛝': u'xian2', u'蛞': u'kuo4', u'蛟': u'jiao1', u'蛠': u'li4', u'蛡': u'yi4', u'蛢': u'ping2', u'蛣': u'jie2', u'蛤': u'ha2', u'蛥': u'she2', u'蛦': u'yi2', u'蛧': u'wang3', u'蛨': u'mo4', u'蛩': u'qiong2', u'蛪': u'qie4', u'蛫': u'gui3', u'蛬': u'qiong2', u'蛭': u'zhi4', u'蛮': u'man2', u'蛯': u'lao', u'蛰': u'zhe2', u'蛱': u'jia2', u'蛲': u'nao2', u'蛳': u'si1', u'蛴': u'qi2', u'蛵': u'xing2', u'蛶': u'jie4', u'蛷': u'qiu2', u'蛸': u'shao1', u'蛹': u'yong3', u'蛺': u'jia2', u'蛻': u'tui4', u'蛼': u'che1', u'蛽': u'bei4', u'蛾': u'e2', u'蛿': u'han4', u'蜀': u'shu3', u'蜁': u'xuan2', u'蜂': u'feng1', u'蜃': u'shen4', u'蜄': u'shen4', u'蜅': u'fu3', u'蜆': u'xian3', u'蜇': u'zhe1', u'蜈': u'wu2', u'蜉': u'fu2', u'蜊': u'li2', u'蜋': u'lang2', u'蜌': u'bi4', u'蜍': u'chu2', u'蜎': u'yuan1', u'蜏': u'you3', u'蜐': u'jie2', u'蜑': u'dan4', u'蜒': u'yan2', u'蜓': u'ting2', u'蜔': u'dian4', u'蜕': u'tui4', u'蜖': u'hui2', u'蜗': u'wo1', u'蜘': u'zhi1', u'蜙': u'zhong1', u'蜚': u'fei1', u'蜛': u'ju1', u'蜜': u'mi4', u'蜝': u'qi2', u'蜞': u'qi2', u'蜟': u'yu4', u'蜠': u'jun4', u'蜡': u'la4', u'蜢': u'meng3', u'蜣': u'qiang1', u'蜤': u'si1', u'蜥': u'xi1', u'蜦': u'lun2', u'蜧': u'li4', u'蜨': u'die2', u'蜩': u'tiao2', u'蜪': u'tao2', u'蜫': u'kun1', u'蜬': u'han2', u'蜭': u'han4', u'蜮': u'yu4', u'蜯': u'bang4', u'蜰': u'fei2', u'蜱': u'pi2', u'蜲': u'wei1', u'蜳': u'dun1', u'蜴': u'yi4', u'蜵': u'yuan1', u'蜶': u'suo4', u'蜷': u'quan2', u'蜸': u'qian3', u'蜹': u'rui4', u'蜺': u'ni2', u'蜻': u'qing1', u'蜼': u'wei4', u'蜽': u'liang3', u'蜾': u'guo3', u'蜿': u'wan1', u'蝀': u'dong1', u'蝁': u'e4', u'蝂': u'ban3', u'蝃': u'di4', u'蝄': u'wang3', u'蝅': u'can2', u'蝆': u'yang3', u'蝇': u'ying2', u'蝈': u'guo1', u'蝉': u'chan2', u'蝊': u'wuwu', u'蝋': u'la4', u'蝌': u'ke1', u'蝍': u'ji2', u'蝎': u'xie1', u'蝏': u'ting2', u'蝐': u'mao4', u'蝑': u'xu1', u'蝒': u'mian2', u'蝓': u'yu2', u'蝔': u'jie1', u'蝕': u'shi2', u'蝖': u'xuan1', u'蝗': u'huang2', u'蝘': u'yan3', u'蝙': u'bian1', u'蝚': u'rou2', u'蝛': u'wei1', u'蝜': u'fu4', u'蝝': u'yuan2', u'蝞': u'mei4', u'蝟': u'wei4', u'蝠': u'fu2', u'蝡': u'ru2', u'蝢': u'xie2', u'蝣': u'you2', u'蝤': u'qiu2', u'蝥': u'mou2', u'蝦': u'xia1', u'蝧': u'ying1', u'蝨': u'shi1', u'蝩': u'chong2', u'蝪': u'tang1', u'蝫': u'zhu1', u'蝬': u'zong1', u'蝭': u'di4', u'蝮': u'fu4', u'蝯': u'yuan2', u'蝰': u'kui2', u'蝱': u'meng2', u'蝲': u'la4', u'蝳': u'dai4', u'蝴': u'hu2', u'蝵': u'qiu1', u'蝶': u'die2', u'蝷': u'li4', u'蝸': u'wo1', u'蝹': u'yun1', u'蝺': u'qu3', u'蝻': u'nan3', u'蝼': u'lou2', u'蝽': u'chun1', u'蝾': u'rong2', u'蝿': u'ying2', u'螀': u'jiang1', u'螁': u'ban', u'螂': u'lang2', u'螃': u'pang2', u'螄': u'si1', u'螅': u'xi1', u'螆': u'ci4', u'螇': u'xi1', u'螈': u'yuan2', u'螉': u'weng1', u'螊': u'lian2', u'螋': u'sou1', u'螌': u'ban1', u'融': u'rong2', u'螎': u'rong2', u'螏': u'ji2', u'螐': u'wu1', u'螑': u'xiu4', u'螒': u'han4', u'螓': u'qin2', u'螔': u'yi2', u'螕': u'bi1', u'螖': u'hua2', u'螗': u'tang2', u'螘': u'yi3', u'螙': u'du4', u'螚': u'nai4', u'螛': u'he2', u'螜': u'hu2', u'螝': u'gui4', u'螞': u'ma3', u'螟': u'ming2', u'螠': u'yi4', u'螡': u'wen2', u'螢': u'ying2', u'螣': u'teng2', u'螤': u'zhong1', u'螥': u'cang1', u'螦': u'sao1', u'螧': u'qi', u'螨': u'man3', u'螩': u'dao1', u'螪': u'shang1', u'螫': u'shi4', u'螬': u'cao2', u'螭': u'chi1', u'螮': u'di4', u'螯': u'ao2', u'螰': u'lu4', u'螱': u'wei4', u'螲': u'die2', u'螳': u'tang2', u'螴': u'chen2', u'螵': u'piao1', u'螶': u'qu2', u'螷': u'pi2', u'螸': u'yu2', u'螹': u'chan2', u'螺': u'luo2', u'螻': u'lou2', u'螼': u'qin3', u'螽': u'zhong1', u'螾': u'yin3', u'螿': u'jiang1', u'蟀': u'shuai4', u'蟁': u'wen2', u'蟂': u'xiao1', u'蟃': u'wan4', u'蟄': u'zhe2', u'蟅': u'zhe4', u'蟆': u'ma2', u'蟇': u'ma2', u'蟈': u'guo1', u'蟉': u'liu2', u'蟊': u'mao2', u'蟋': u'xi1', u'蟌': u'cong1', u'蟍': u'li2', u'蟎': u'man3', u'蟏': u'xiao1', u'蟐': u'chang', u'蟑': u'zhang1', u'蟒': u'mang3', u'蟓': u'xiang4', u'蟔': u'mo4', u'蟕': u'zui1', u'蟖': u'si1', u'蟗': u'qiu1', u'蟘': u'te4', u'蟙': u'zhi2', u'蟚': u'peng2', u'蟛': u'peng2', u'蟜': u'jiao3', u'蟝': u'qu2', u'蟞': u'bie1', u'蟟': u'liao2', u'蟠': u'pan2', u'蟡': u'gui3', u'蟢': u'xi3', u'蟣': u'ji3', u'蟤': u'zhuan1', u'蟥': u'huang2', u'蟦': u'fei4', u'蟧': u'lao2', u'蟨': u'jue2', u'蟩': u'jue2', u'蟪': u'hui4', u'蟫': u'yin2', u'蟬': u'chan2', u'蟭': u'jiao1', u'蟮': u'shan4', u'蟯': u'nao2', u'蟰': u'xiao1', u'蟱': u'wu2', u'蟲': u'chong2', u'蟳': u'xun2', u'蟴': u'si1', u'蟵': u'chu', u'蟶': u'cheng1', u'蟷': u'dang1', u'蟸': u'li2', u'蟹': u'xie4', u'蟺': u'shan4', u'蟻': u'yi3', u'蟼': u'jing3', u'蟽': u'da2', u'蟾': u'chan2', u'蟿': u'qi4', u'蠀': u'ci1', u'蠁': u'xiang3', u'蠂': u'she4', u'蠃': u'luo3', u'蠄': u'qin2', u'蠅': u'ying2', u'蠆': u'chai4', u'蠇': u'li4', u'蠈': u'zei2', u'蠉': u'xuan1', u'蠊': u'lian2', u'蠋': u'zhu2', u'蠌': u'ze2', u'蠍': u'xie1', u'蠎': u'mang3', u'蠏': u'xie4', u'蠐': u'qi2', u'蠑': u'rong2', u'蠒': u'jian3', u'蠓': u'meng3', u'蠔': u'hao2', u'蠕': u'ru2', u'蠖': u'huo4', u'蠗': u'zhuo2', u'蠘': u'jie2', u'蠙': u'bin1', u'蠚': u'he1', u'蠛': u'mie4', u'蠜': u'fan2', u'蠝': u'lei3', u'蠞': u'jie2', u'蠟': u'la4', u'蠠': u'min3', u'蠡': u'li2', u'蠢': u'chun3', u'蠣': u'li4', u'蠤': u'qiu1', u'蠥': u'nie4', u'蠦': u'lu2', u'蠧': u'du4', u'蠨': u'xiao1', u'蠩': u'zhu1', u'蠪': u'long2', u'蠫': u'li2', u'蠬': u'long2', u'蠭': u'feng1', u'蠮': u'ye1', u'蠯': u'pi2', u'蠰': u'nang2', u'蠱': u'gu3', u'蠲': u'juan1', u'蠳': u'ying1', u'蠴': u'shu', u'蠵': u'xi1', u'蠶': u'can2', u'蠷': u'qu2', u'蠸': u'quan2', u'蠹': u'du4', u'蠺': u'can2', u'蠻': u'man2', u'蠼': u'qu2', u'蠽': u'jie2', u'蠾': u'zhu2', u'蠿': u'zhuo2', u'血': u'xue3', u'衁': u'huang1', u'衂': u'nv4', u'衃': u'pei1', u'衄': u'nv4', u'衅': u'xin4', u'衆': u'zhong4', u'衇': u'mai4', u'衈': u'er4', u'衉': u'ke4', u'衊': u'mie4', u'衋': u'xi4', u'行': u'xing2', u'衍': u'yan3', u'衎': u'kan4', u'衏': u'yuan4', u'衐': u'qu', u'衑': u'ling2', u'衒': u'xuan4', u'術': u'shu4', u'衔': u'xian2', u'衕': u'tong4', u'衖': u'long4', u'街': u'jie1', u'衘': u'xian', u'衙': u'ya2', u'衚': u'hu2', u'衛': u'wei4', u'衜': u'dao4', u'衝': u'chong1', u'衞': u'wei4', u'衟': u'dao4', u'衠': u'zhun1', u'衡': u'heng2', u'衢': u'qu2', u'衣': u'yi1', u'衤': u'yi1', u'补': u'bu3', u'衦': u'gan3', u'衧': u'yu2', u'表': u'biao3', u'衩': u'cha3', u'衪': u'yi4', u'衫': u'shan1', u'衬': u'chen4', u'衭': u'fu1', u'衮': u'gun3', u'衯': u'fen1', u'衰': u'shuai1', u'衱': u'jie2', u'衲': u'na4', u'衳': u'zhong1', u'衴': u'dan3', u'衵': u'ri4', u'衶': u'zhong4', u'衷': u'zhong1', u'衸': u'jie4', u'衹': u'zhi1', u'衺': u'xie2', u'衻': u'ran2', u'衼': u'zhi1', u'衽': u'ren4', u'衾': u'qin1', u'衿': u'jin1', u'袀': u'jun1', u'袁': u'yuan2', u'袂': u'mei4', u'袃': u'chai4', u'袄': u'ao3', u'袅': u'niao3', u'袆': u'hui1', u'袇': u'ran2', u'袈': u'jia1', u'袉': u'tuo2', u'袊': u'ling3', u'袋': u'dai4', u'袌': u'bao4', u'袍': u'pao2', u'袎': u'yao4', u'袏': u'zuo4', u'袐': u'bi4', u'袑': u'shao4', u'袒': u'tan3', u'袓': u'ju4', u'袔': u'he4', u'袕': u'xue2', u'袖': u'xiu4', u'袗': u'zhen3', u'袘': u'yi2', u'袙': u'pa4', u'袚': u'fu2', u'袛': u'di1', u'袜': u'wa4', u'袝': u'fu4', u'袞': u'gun3', u'袟': u'zhi4', u'袠': u'zhi4', u'袡': u'ran2', u'袢': u'pan4', u'袣': u'yi4', u'袤': u'mao4', u'袥': u'tuo1', u'袦': u'na4', u'袧': u'gou1', u'袨': u'xuan4', u'袩': u'zhe2', u'袪': u'qu1', u'被': u'bei4', u'袬': u'yu4', u'袭': u'xi2', u'袮': u'mi', u'袯': u'bo2', u'袰': u'wuwu', u'袱': u'fu2', u'袲': u'chi3', u'袳': u'chi3', u'袴': u'ku4', u'袵': u'ren4', u'袶': u'peng2', u'袷': u'jia2', u'袸': u'jian4', u'袹': u'bo2', u'袺': u'jie2', u'袻': u'er2', u'袼': u'ge1', u'袽': u'ru2', u'袾': u'zhu1', u'袿': u'gui1', u'裀': u'yin1', u'裁': u'cai2', u'裂': u'lie4', u'裃': u'ka1mi1xi1mo1', u'裄': u'hang2', u'装': u'zhuang1', u'裆': u'dang1', u'裇': u'xu1', u'裈': u'kun1', u'裉': u'ken4', u'裊': u'niao3', u'裋': u'shu4', u'裌': u'jia2', u'裍': u'kun3', u'裎': u'cheng2', u'裏': u'li3', u'裐': u'juan1', u'裑': u'shen1', u'裒': u'pou2', u'裓': u'ge2', u'裔': u'yi4', u'裕': u'yu4', u'裖': u'zhen3', u'裗': u'liu2', u'裘': u'qiu2', u'裙': u'qun2', u'裚': u'ji4', u'裛': u'yi4', u'補': u'bu3', u'裝': u'zhuang1', u'裞': u'shui4', u'裟': u'sha1', u'裠': u'qun2', u'裡': u'li3', u'裢': u'lian2', u'裣': u'lian3', u'裤': u'ku4', u'裥': u'jian3', u'裦': u'bao1', u'裧': u'chan1', u'裨': u'bi4', u'裩': u'kun1', u'裪': u'tao2', u'裫': u'yuan4', u'裬': u'ling2', u'裭': u'chi3', u'裮': u'chang1', u'裯': u'chou2', u'裰': u'duo1', u'裱': u'biao3', u'裲': u'liang3', u'裳': u'shang', u'裴': u'pei2', u'裵': u'pei2', u'裶': u'pei2', u'裷': u'yuan1', u'裸': u'luo3', u'裹': u'guo3', u'裺': u'yan3', u'裻': u'du2', u'裼': u'ti4', u'製': u'zhi4', u'裾': u'ju1', u'裿': u'yi3', u'褀': u'qi2', u'褁': u'guo3', u'褂': u'gua4', u'褃': u'ken4', u'褄': u'qi', u'褅': u'ti4', u'褆': u'ti2', u'複': u'fu4', u'褈': u'chong2', u'褉': u'xie4', u'褊': u'bian3', u'褋': u'die2', u'褌': u'kun1', u'褍': u'duan1', u'褎': u'xiu4', u'褏': u'xiu4', u'褐': u'he4', u'褑': u'yuan4', u'褒': u'bao1', u'褓': u'bao3', u'褔': u'fu4', u'褕': u'yu2', u'褖': u'tuan4', u'褗': u'yan3', u'褘': u'hui1', u'褙': u'bei4', u'褚': u'chu3', u'褛': u'lv3', u'褜': u'pao', u'褝': u'dan1', u'褞': u'yun4', u'褟': u'ta1', u'褠': u'gou1', u'褡': u'da1', u'褢': u'huai2', u'褣': u'rong2', u'褤': u'yuan2', u'褥': u'ru4', u'褦': u'nai4', u'褧': u'jiong3', u'褨': u'suo3', u'褩': u'ban1', u'褪': u'tui4', u'褫': u'chi3', u'褬': u'sang3', u'褭': u'niao3', u'褮': u'ying1', u'褯': u'jie4', u'褰': u'qian1', u'褱': u'huai2', u'褲': u'ku4', u'褳': u'lian2', u'褴': u'lan2', u'褵': u'li2', u'褶': u'zhe3', u'褷': u'shi1', u'褸': u'lv3', u'褹': u'yi4', u'褺': u'die1', u'褻': u'xie4', u'褼': u'xian1', u'褽': u'wei4', u'褾': u'biao3', u'褿': u'cao2', u'襀': u'ji1', u'襁': u'qiang3', u'襂': u'sen1', u'襃': u'bao1', u'襄': u'xiang1', u'襅': u'qi3ha1ya1', u'襆': u'fu2', u'襇': u'jian3', u'襈': u'zhuan4', u'襉': u'jian3', u'襊': u'cui4', u'襋': u'ji2', u'襌': u'dan1', u'襍': u'za2', u'襎': u'fan2', u'襏': u'bo2', u'襐': u'xiang4', u'襑': u'xin2', u'襒': u'bie2', u'襓': u'rao2', u'襔': u'man', u'襕': u'lan2', u'襖': u'ao3', u'襗': u'ze2', u'襘': u'gui4', u'襙': u'cao4', u'襚': u'sui4', u'襛': u'nong2', u'襜': u'chan1', u'襝': u'lian3', u'襞': u'bi4', u'襟': u'jin1', u'襠': u'dang1', u'襡': u'shu3', u'襢': u'tan3', u'襣': u'bi4', u'襤': u'lan2', u'襥': u'fu2', u'襦': u'ru2', u'襧': u'zhi3', u'襨': u'ta', u'襩': u'shu3', u'襪': u'wa4', u'襫': u'shi4', u'襬': u'bai3', u'襭': u'xie2', u'襮': u'bo2', u'襯': u'chen4', u'襰': u'lai3', u'襱': u'long2', u'襲': u'xi2', u'襳': u'xian1', u'襴': u'lan2', u'襵': u'zhe3', u'襶': u'dai4', u'襷': u'ta1si1', u'襸': u'zan4', u'襹': u'shi1', u'襺': u'jian3', u'襻': u'pan4', u'襼': u'yi4', u'襽': u'lan2', u'襾': u'ya4', u'西': u'xi1', u'覀': u'ya4', u'要': u'yao4', u'覂': u'feng3', u'覃': u'tan2', u'覄': u'fu4', u'覅': u'fu2yao4', u'覆': u'fu4', u'覇': u'ba4', u'覈': u'he2', u'覉': u'ji1', u'覊': u'ji1', u'見': u'jian4', u'覌': u'guan1', u'覍': u'bian4', u'覎': u'yan4', u'規': u'gui1', u'覐': u'jue2', u'覑': u'pian3', u'覒': u'mao4', u'覓': u'mi4', u'覔': u'mi4', u'覕': u'pie1', u'視': u'shi4', u'覗': u'si4', u'覘': u'chan1', u'覙': u'zhen3', u'覚': u'jue2', u'覛': u'mi4', u'覜': u'tiao4', u'覝': u'lian2', u'覞': u'yao4', u'覟': u'zhi4', u'覠': u'jun1', u'覡': u'xi2', u'覢': u'shan3', u'覣': u'wei1', u'覤': u'xi4', u'覥': u'tian3', u'覦': u'yu2', u'覧': u'lan3', u'覨': u'e4', u'覩': u'du3', u'親': u'qin1', u'覫': u'pang3', u'覬': u'ji4', u'覭': u'ming2', u'覮': u'ying2', u'覯': u'gou4', u'覰': u'qu1', u'覱': u'zhan4', u'覲': u'jin4', u'観': u'guan1', u'覴': u'deng4', u'覵': u'jian4', u'覶': u'luo2', u'覷': u'qu4', u'覸': u'jian4', u'覹': u'wei2', u'覺': u'jue2', u'覻': u'qu4', u'覼': u'luo2', u'覽': u'lan3', u'覾': u'shen3', u'覿': u'di2', u'觀': u'guan1', u'见': u'jian4', u'观': u'guan1', u'觃': u'yan4', u'规': u'gui1', u'觅': u'mi4', u'视': u'shi4', u'觇': u'chan1', u'览': u'lan3', u'觉': u'jue2', u'觊': u'ji4', u'觋': u'xi2', u'觌': u'di2', u'觍': u'tian3', u'觎': u'yu2', u'觏': u'gou4', u'觐': u'jin4', u'觑': u'qu4', u'角': u'jiao3', u'觓': u'qiu2', u'觔': u'jin1', u'觕': u'cu1', u'觖': u'jue2', u'觗': u'zhi4', u'觘': u'chao4', u'觙': u'ji2', u'觚': u'gu1', u'觛': u'dan4', u'觜': u'zi1', u'觝': u'di3', u'觞': u'shang1', u'觟': u'hua4', u'觠': u'quan2', u'觡': u'ge2', u'觢': u'shi4', u'解': u'jie3', u'觤': u'gui3', u'觥': u'gong1', u'触': u'chu4', u'觧': u'jie3', u'觨': u'hun4', u'觩': u'qiu2', u'觪': u'xing1', u'觫': u'su4', u'觬': u'ni2', u'觭': u'ji1', u'觮': u'jue2', u'觯': u'zhi4', u'觰': u'zha1', u'觱': u'bi4', u'觲': u'xing1', u'觳': u'hu2', u'觴': u'shang1', u'觵': u'xing1', u'觶': u'zhi4', u'觷': u'xue2', u'觸': u'chu4', u'觹': u'xi1', u'觺': u'yi2', u'觻': u'li4', u'觼': u'jue2', u'觽': u'xi1', u'觾': u'yan4', u'觿': u'xi1', u'言': u'yan2', u'訁': u'yan2', u'訂': u'ding4', u'訃': u'fu4', u'訄': u'qiu2', u'訅': u'qiu2', u'訆': u'jiao4', u'訇': u'hong1', u'計': u'ji4', u'訉': u'fan4', u'訊': u'xun4', u'訋': u'diao4', u'訌': u'hong4', u'訍': u'chai4', u'討': u'tao3', u'訏': u'xu1', u'訐': u'jie2', u'訑': u'yi2', u'訒': u'ren4', u'訓': u'xun4', u'訔': u'yin2', u'訕': u'shan4', u'訖': u'qi4', u'託': u'tuo1', u'記': u'ji4', u'訙': u'xun4', u'訚': u'yin2', u'訛': u'e2', u'訜': u'fen1', u'訝': u'ya4', u'訞': u'yao1', u'訟': u'song4', u'訠': u'shen3', u'訡': u'yin2', u'訢': u'xin1', u'訣': u'jue2', u'訤': u'xiao2', u'訥': u'ne4', u'訦': u'chen2', u'訧': u'chen2', u'訨': u'zhi3', u'訩': u'xiong1', u'訪': u'fang3', u'訫': u'xin4', u'訬': u'chao1', u'設': u'she4', u'訮': u'yan2', u'訯': u'sa3', u'訰': u'zhun4', u'許': u'xu3', u'訲': u'yi4', u'訳': u'yi4', u'訴': u'su4', u'訵': u'chi1', u'訶': u'he1', u'訷': u'shen1', u'訸': u'he2', u'訹': u'xu4', u'診': u'zhen3', u'註': u'zhu4', u'証': u'zheng4', u'訽': u'gou4', u'訾': u'zi1', u'訿': u'zi3', u'詀': u'zhan1', u'詁': u'gu3', u'詂': u'fu4', u'詃': u'jian3', u'詄': u'die2', u'詅': u'ling2', u'詆': u'di3', u'詇': u'yang4', u'詈': u'li4', u'詉': u'nao2', u'詊': u'pan4', u'詋': u'zhou4', u'詌': u'gan4', u'詍': u'yi4', u'詎': u'ju4', u'詏': u'yao4', u'詐': u'zha4', u'詑': u'yi2', u'詒': u'yi2', u'詓': u'qu3', u'詔': u'zhao4', u'評': u'ping2', u'詖': u'bi4', u'詗': u'xiong4', u'詘': u'qu1', u'詙': u'ba2', u'詚': u'da2', u'詛': u'zu3', u'詜': u'tao1', u'詝': u'zhu3', u'詞': u'ci2', u'詟': u'zhe2', u'詠': u'yong3', u'詡': u'xu3', u'詢': u'xun2', u'詣': u'yi4', u'詤': u'huang3', u'詥': u'he2', u'試': u'shi4', u'詧': u'cha2', u'詨': u'xiao4', u'詩': u'shi1', u'詪': u'hen3', u'詫': u'cha4', u'詬': u'gou4', u'詭': u'gui3', u'詮': u'quan2', u'詯': u'hui4', u'詰': u'jie2', u'話': u'hua4', u'該': u'gai1', u'詳': u'xiang2', u'詴': u'wei1', u'詵': u'shen1', u'詶': u'chou2', u'詷': u'tong2', u'詸': u'mi2', u'詹': u'zhan1', u'詺': u'ming2', u'詻': u'luo4', u'詼': u'hui1', u'詽': u'yan2', u'詾': u'xiong1', u'詿': u'gua4', u'誀': u'er4', u'誁': u'bing4', u'誂': u'tiao3', u'誃': u'yi2', u'誄': u'lei3', u'誅': u'zhu1', u'誆': u'kuang1', u'誇': u'kua1', u'誈': u'wu1', u'誉': u'yu4', u'誊': u'teng2', u'誋': u'ji4', u'誌': u'zhi4', u'認': u'ren4', u'誎': u'cu4', u'誏': u'lang3', u'誐': u'e2', u'誑': u'kuang2', u'誒': u'ei1', u'誓': u'shi4', u'誔': u'ting3', u'誕': u'dan4', u'誖': u'bei4', u'誗': u'chan2', u'誘': u'you4', u'誙': u'keng1', u'誚': u'qiao4', u'誛': u'qin1', u'誜': u'shua4', u'誝': u'an1', u'語': u'yu3', u'誟': u'xiao4', u'誠': u'cheng2', u'誡': u'jie4', u'誢': u'xian4', u'誣': u'wu1', u'誤': u'wu4', u'誥': u'gao4', u'誦': u'song4', u'誧': u'bu1', u'誨': u'hui4', u'誩': u'jing4', u'說': u'shuo1', u'誫': u'zhen4', u'説': u'shui4', u'読': u'du2', u'誮': u'hua', u'誯': u'chang4', u'誰': u'shui2', u'誱': u'jie2', u'課': u'ke4', u'誳': u'qu1', u'誴': u'cong2', u'誵': u'xiao2', u'誶': u'sui4', u'誷': u'wang3', u'誸': u'xian2', u'誹': u'fei3', u'誺': u'chi1', u'誻': u'ta4', u'誼': u'yi4', u'誽': u'ni4', u'誾': u'yin2', u'調': u'diao4', u'諀': u'pi3', u'諁': u'zhuo2', u'諂': u'chan3', u'諃': u'chen1', u'諄': u'zhun1', u'諅': u'ji4', u'諆': u'ji1', u'談': u'tan2', u'諈': u'zhui4', u'諉': u'wei3', u'諊': u'ju1', u'請': u'qing3', u'諌': u'dong3', u'諍': u'zheng4', u'諎': u'ze2', u'諏': u'zou1', u'諐': u'qian1', u'諑': u'zhuo2', u'諒': u'liang4', u'諓': u'jian4', u'諔': u'chu4', u'諕': u'xia4', u'論': u'lun4', u'諗': u'shen3', u'諘': u'biao3', u'諙': u'hua4', u'諚': u'bian4', u'諛': u'yu2', u'諜': u'die2', u'諝': u'xu1', u'諞': u'pian3', u'諟': u'shi4', u'諠': u'xuan1', u'諡': u'shi4', u'諢': u'hun4', u'諣': u'hua4', u'諤': u'e4', u'諥': u'zhong4', u'諦': u'di4', u'諧': u'xie2', u'諨': u'fu2', u'諩': u'pu3', u'諪': u'ting2', u'諫': u'jian4', u'諬': u'qi3', u'諭': u'yu4', u'諮': u'zi1', u'諯': u'zhuan1', u'諰': u'xi3', u'諱': u'hui4', u'諲': u'yin1', u'諳': u'an1', u'諴': u'xian2', u'諵': u'nan2', u'諶': u'chen2', u'諷': u'feng3', u'諸': u'zhu1', u'諹': u'yang2', u'諺': u'yan4', u'諻': u'huang2', u'諼': u'xuan1', u'諽': u'ge2', u'諾': u'nuo4', u'諿': u'xu3', u'謀': u'mou2', u'謁': u'ye4', u'謂': u'wei4', u'謃': u'xing', u'謄': u'teng2', u'謅': u'zhou1', u'謆': u'shan4', u'謇': u'jian3', u'謈': u'bo2', u'謉': u'kui4', u'謊': u'huang3', u'謋': u'huo4', u'謌': u'ge1', u'謍': u'ying2', u'謎': u'mi2', u'謏': u'xiao3', u'謐': u'mi4', u'謑': u'xi3', u'謒': u'qiang1', u'謓': u'chen1', u'謔': u'xue4', u'謕': u'ti2', u'謖': u'su4', u'謗': u'bang4', u'謘': u'chi2', u'謙': u'qian1', u'謚': u'shi4', u'講': u'jiang3', u'謜': u'yuan2', u'謝': u'xie4', u'謞': u'he4', u'謟': u'tao1', u'謠': u'yao2', u'謡': u'yao2', u'謢': u'lu1', u'謣': u'yu2', u'謤': u'biao1', u'謥': u'cong4', u'謦': u'qing3', u'謧': u'li2', u'謨': u'mo2', u'謩': u'mo2', u'謪': u'shang1', u'謫': u'zhe2', u'謬': u'miu4', u'謭': u'jian3', u'謮': u'ze2', u'謯': u'jie1', u'謰': u'lian2', u'謱': u'lou2', u'謲': u'zao4', u'謳': u'ou1', u'謴': u'gun4', u'謵': u'xi2', u'謶': u'zhuo2', u'謷': u'ao2', u'謸': u'ao2', u'謹': u'jin3', u'謺': u'zhe2', u'謻': u'yi2', u'謼': u'hu1', u'謽': u'jiang4', u'謾': u'man4', u'謿': u'chao2', u'譀': u'han4', u'譁': u'hua1', u'譂': u'chan3', u'譃': u'xu1', u'譄': u'xu1', u'譅': u'se4', u'譆': u'xi1', u'譇': u'zha1', u'譈': u'dui4', u'證': u'zheng4', u'譊': u'nao2', u'譋': u'lan2', u'譌': u'e2', u'譍': u'e2', u'譎': u'jue2', u'譏': u'ji1', u'譐': u'zun3', u'譑': u'jiao3', u'譒': u'bo4', u'譓': u'hui4', u'譔': u'zhuan4', u'譕': u'wu2', u'譖': u'zen4', u'譗': u'zha2', u'識': u'shi2', u'譙': u'qiao2', u'譚': u'tan2', u'譛': u'jian4', u'譜': u'pu3', u'譝': u'sheng2', u'譞': u'xuan1', u'譟': u'zao4', u'譠': u'tan2', u'譡': u'dang3', u'譢': u'sui4', u'譣': u'xian3', u'譤': u'ji1', u'譥': u'ji1', u'警': u'jing3', u'譧': u'zhan4', u'譨': u'nong2', u'譩': u'yi1', u'譪': u'ai3', u'譫': u'zhan1', u'譬': u'pi4', u'譭': u'hui3', u'譮': u'hua4', u'譯': u'yi4', u'議': u'yi4', u'譱': u'shan4', u'譲': u'rang4', u'譳': u'rou4', u'譴': u'qian3', u'譵': u'dui4', u'譶': u'ta4', u'護': u'hu4', u'譸': u'zhou1', u'譹': u'hao2', u'譺': u'ai4', u'譻': u'ying1', u'譼': u'jian1', u'譽': u'yu4', u'譾': u'jian3', u'譿': u'hui4', u'讀': u'du2', u'讁': u'zhe2', u'讂': u'juan4', u'讃': u'zan4', u'讄': u'lei3', u'讅': u'shen3', u'讆': u'wei4', u'讇': u'chan3', u'讈': u'li4', u'讉': u'yi2', u'變': u'bian4', u'讋': u'zhe2', u'讌': u'yan4', u'讍': u'e4', u'讎': u'chou2', u'讏': u'wei4', u'讐': u'chou2', u'讑': u'yao4', u'讒': u'chan2', u'讓': u'rang4', u'讔': u'yin3', u'讕': u'lan2', u'讖': u'chen4', u'讗': u'xie2', u'讘': u'nie4', u'讙': u'huan1', u'讚': u'zan4', u'讛': u'yi4', u'讜': u'dang3', u'讝': u'zhan2', u'讞': u'yan4', u'讟': u'du2', u'讠': u'yan2', u'计': u'ji4', u'订': u'ding4', u'讣': u'fu4', u'认': u'ren4', u'讥': u'ji1', u'讦': u'jie2', u'讧': u'hong4', u'讨': u'tao3', u'让': u'rang4', u'讪': u'shan4', u'讫': u'qi4', u'讬': u'tuo1', u'训': u'xun4', u'议': u'yi4', u'讯': u'xun4', u'记': u'ji4', u'讱': u'ren4', u'讲': u'jiang3', u'讳': u'hui4', u'讴': u'ou1', u'讵': u'ju4', u'讶': u'ya4', u'讷': u'ne4', u'许': u'xu3', u'讹': u'e2', u'论': u'lun4', u'讻': u'xiong1', u'讼': u'song4', u'讽': u'feng3', u'设': u'she4', u'访': u'fang3', u'诀': u'jue2', u'证': u'zheng4', u'诂': u'gu3', u'诃': u'he1', u'评': u'ping2', u'诅': u'zu3', u'识': u'shi2', u'诇': u'xiong4', u'诈': u'zha4', u'诉': u'su4', u'诊': u'zhen3', u'诋': u'di3', u'诌': u'zhou1', u'词': u'ci2', u'诎': u'qu1', u'诏': u'zhao4', u'诐': u'bi4', u'译': u'yi4', u'诒': u'yi2', u'诓': u'kuang1', u'诔': u'lei3', u'试': u'shi4', u'诖': u'gua4', u'诗': u'shi1', u'诘': u'jie2', u'诙': u'hui1', u'诚': u'cheng2', u'诛': u'zhu1', u'诜': u'shen1', u'话': u'hua4', u'诞': u'dan4', u'诟': u'gou4', u'诠': u'quan2', u'诡': u'gui3', u'询': u'xun2', u'诣': u'yi4', u'诤': u'zheng4', u'该': u'gai1', u'详': u'xiang2', u'诧': u'cha4', u'诨': u'hun4', u'诩': u'xu3', u'诪': u'zhou1', u'诫': u'jie4', u'诬': u'wu1', u'语': u'yu3', u'诮': u'qiao4', u'误': u'wu4', u'诰': u'gao4', u'诱': u'you4', u'诲': u'hui4', u'诳': u'kuang2', u'说': u'shuo1', u'诵': u'song4', u'诶': u'ei1', u'请': u'qing3', u'诸': u'zhu1', u'诹': u'zou1', u'诺': u'nuo4', u'读': u'du2', u'诼': u'zhuo2', u'诽': u'fei3', u'课': u'ke4', u'诿': u'wei3', u'谀': u'yu2', u'谁': u'shui2', u'谂': u'shen3', u'调': u'diao4', u'谄': u'chan3', u'谅': u'liang4', u'谆': u'zhun1', u'谇': u'sui4', u'谈': u'tan2', u'谉': u'shen3', u'谊': u'yi4', u'谋': u'mou2', u'谌': u'chen2', u'谍': u'die2', u'谎': u'huang3', u'谏': u'jian4', u'谐': u'xie2', u'谑': u'xue4', u'谒': u'ye4', u'谓': u'wei4', u'谔': u'e4', u'谕': u'yu4', u'谖': u'xuan1', u'谗': u'chan2', u'谘': u'zi1', u'谙': u'an1', u'谚': u'yan4', u'谛': u'di4', u'谜': u'mi2', u'谝': u'pian3', u'谞': u'xu1', u'谟': u'mo2', u'谠': u'dang3', u'谡': u'su4', u'谢': u'xie4', u'谣': u'yao2', u'谤': u'bang4', u'谥': u'shi4', u'谦': u'qian1', u'谧': u'mi4', u'谨': u'jin3', u'谩': u'man4', u'谪': u'zhe2', u'谫': u'jian3', u'谬': u'miu4', u'谭': u'tan2', u'谮': u'zen4', u'谯': u'qiao2', u'谰': u'lan2', u'谱': u'pu3', u'谲': u'jue2', u'谳': u'yan4', u'谴': u'qian3', u'谵': u'zhan1', u'谶': u'chen4', u'谷': u'gu3', u'谸': u'qian1', u'谹': u'hong2', u'谺': u'xia1', u'谻': u'ji2', u'谼': u'hong2', u'谽': u'han1', u'谾': u'hong1', u'谿': u'xi1', u'豀': u'xi1', u'豁': u'huo1', u'豂': u'liao2', u'豃': u'han3', u'豄': u'du2', u'豅': u'long2', u'豆': u'dou4', u'豇': u'jiang1', u'豈': u'qi3', u'豉': u'chi3', u'豊': u'li3', u'豋': u'deng1', u'豌': u'wan1', u'豍': u'bi1', u'豎': u'shu4', u'豏': u'xian4', u'豐': u'feng1', u'豑': u'zhi4', u'豒': u'zhi4', u'豓': u'yan4', u'豔': u'yan4', u'豕': u'shi3', u'豖': u'chu4', u'豗': u'hui1', u'豘': u'tun2', u'豙': u'yi4', u'豚': u'tun2', u'豛': u'yi4', u'豜': u'jian1', u'豝': u'ba1', u'豞': u'hou4', u'豟': u'e4', u'豠': u'chu2', u'象': u'xiang4', u'豢': u'huan4', u'豣': u'jian', u'豤': u'ken3', u'豥': u'gai1', u'豦': u'ju4', u'豧': u'fu2', u'豨': u'xi1', u'豩': u'bin1', u'豪': u'hao2', u'豫': u'yu4', u'豬': u'zhu1', u'豭': u'jia1', u'豮': u'fen2', u'豯': u'xi1', u'豰': u'hu4', u'豱': u'wen1', u'豲': u'huan2', u'豳': u'bin1', u'豴': u'di2', u'豵': u'zong4', u'豶': u'fen2', u'豷': u'yi4', u'豸': u'zhi4', u'豹': u'bao4', u'豺': u'chai2', u'豻': u'an4', u'豼': u'pi2', u'豽': u'na4', u'豾': u'pi1', u'豿': u'gou3', u'貀': u'na4', u'貁': u'you4', u'貂': u'diao1', u'貃': u'mo4', u'貄': u'si4', u'貅': u'xiu1', u'貆': u'huan2', u'貇': u'ken3', u'貈': u'he2', u'貉': u'hao2', u'貊': u'mo4', u'貋': u'an4', u'貌': u'mao4', u'貍': u'li2', u'貎': u'ni2', u'貏': u'bi3', u'貐': u'yu3', u'貑': u'jia1', u'貒': u'tuan1', u'貓': u'mao1', u'貔': u'pi2', u'貕': u'xi1', u'貖': u'yi4', u'貗': u'ju4', u'貘': u'mo4', u'貙': u'chu1', u'貚': u'tan2', u'貛': u'huan1', u'貜': u'jue2', u'貝': u'bei4', u'貞': u'zhen1', u'貟': u'yuan2', u'負': u'fu4', u'財': u'cai2', u'貢': u'gong4', u'貣': u'dai4', u'貤': u'yi2', u'貥': u'hang2', u'貦': u'wan2', u'貧': u'pin2', u'貨': u'huo4', u'販': u'fan4', u'貪': u'tan1', u'貫': u'guan4', u'責': u'ze2', u'貭': u'zhi4', u'貮': u'er4', u'貯': u'zhu4', u'貰': u'shi4', u'貱': u'bi4', u'貲': u'zi1', u'貳': u'er4', u'貴': u'gui4', u'貵': u'pian3', u'貶': u'bian3', u'買': u'mai3', u'貸': u'dai4', u'貹': u'sheng4', u'貺': u'kuang4', u'費': u'fei4', u'貼': u'tie1', u'貽': u'yi2', u'貾': u'chi2', u'貿': u'mao4', u'賀': u'he4', u'賁': u'ben1', u'賂': u'lu4', u'賃': u'lin4', u'賄': u'hui4', u'賅': u'gai1', u'賆': u'pian2', u'資': u'zi1', u'賈': u'jia3', u'賉': u'xu4', u'賊': u'zei2', u'賋': u'jiao3', u'賌': u'gai1', u'賍': u'zang1', u'賎': u'jian4', u'賏': u'ying1', u'賐': u'jun4', u'賑': u'zhen4', u'賒': u'she1', u'賓': u'bin1', u'賔': u'bin1', u'賕': u'qiu2', u'賖': u'she1', u'賗': u'chuan4', u'賘': u'zang1', u'賙': u'zhou1', u'賚': u'lai4', u'賛': u'zan4', u'賜': u'ci4', u'賝': u'chen1', u'賞': u'shang3', u'賟': u'tian3', u'賠': u'pei2', u'賡': u'geng1', u'賢': u'xian2', u'賣': u'mai4', u'賤': u'jian4', u'賥': u'sui4', u'賦': u'fu4', u'賧': u'dan3', u'賨': u'cong2', u'賩': u'cong2', u'質': u'zhi4', u'賫': u'ji1', u'賬': u'zhang4', u'賭': u'du3', u'賮': u'jin4', u'賯': u'xiong1', u'賰': u'chun3', u'賱': u'yun3', u'賲': u'bao3', u'賳': u'zai1', u'賴': u'lai4', u'賵': u'feng4', u'賶': u'cang4', u'賷': u'ji1', u'賸': u'sheng4', u'賹': u'yi4', u'賺': u'zhuan4', u'賻': u'fu4', u'購': u'gou4', u'賽': u'sai4', u'賾': u'ze2', u'賿': u'liao2', u'贀': u'yi4', u'贁': u'bai4', u'贂': u'chen3', u'贃': u'wan4', u'贄': u'zhi4', u'贅': u'zhui4', u'贆': u'biao1', u'贇': u'yun1', u'贈': u'zeng4', u'贉': u'dan4', u'贊': u'zan4', u'贋': u'yan4', u'贌': u'pu2', u'贍': u'shan4', u'贎': u'wan4', u'贏': u'ying2', u'贐': u'jin4', u'贑': u'gan4', u'贒': u'xian2', u'贓': u'zang1', u'贔': u'bi4', u'贕': u'du2', u'贖': u'shu2', u'贗': u'yan4', u'贘': u'shang3', u'贙': u'xuan4', u'贚': u'long4', u'贛': u'gan4', u'贜': u'zang1', u'贝': u'bei4', u'贞': u'zhen1', u'负': u'fu4', u'贠': u'yuan2', u'贡': u'gong4', u'财': u'cai2', u'责': u'ze2', u'贤': u'xian2', u'败': u'bai4', u'账': u'zhang4', u'货': u'huo4', u'质': u'zhi4', u'贩': u'fan4', u'贪': u'tan1', u'贫': u'pin2', u'贬': u'bian3', u'购': u'gou4', u'贮': u'zhu4', u'贯': u'guan4', u'贰': u'er4', u'贱': u'jian4', u'贲': u'ben1', u'贳': u'shi4', u'贴': u'tie1', u'贵': u'gui4', u'贶': u'kuang4', u'贷': u'dai4', u'贸': u'mao4', u'费': u'fei4', u'贺': u'he4', u'贻': u'yi2', u'贼': u'zei2', u'贽': u'zhi4', u'贾': u'jia3', u'贿': u'hui4', u'赀': u'zi1', u'赁': u'lin4', u'赂': u'lu4', u'赃': u'zang1', u'资': u'zi1', u'赅': u'gai1', u'赆': u'jin4', u'赇': u'qiu2', u'赈': u'zhen4', u'赉': u'lai4', u'赊': u'she1', u'赋': u'fu4', u'赌': u'du3', u'赍': u'ji1', u'赎': u'shu2', u'赏': u'shang3', u'赐': u'ci4', u'赑': u'bi4', u'赒': u'zhou1', u'赓': u'geng1', u'赔': u'pei2', u'赕': u'dan3', u'赖': u'lai4', u'赗': u'feng4', u'赘': u'zhui4', u'赙': u'fu4', u'赚': u'zhuan4', u'赛': u'sai4', u'赜': u'ze2', u'赝': u'yan4', u'赞': u'zan4', u'赟': u'yun1', u'赠': u'zeng4', u'赡': u'shan4', u'赢': u'ying2', u'赣': u'gan4', u'赤': u'chi4', u'赥': u'xi1', u'赦': u'she4', u'赧': u'nan3', u'赨': u'tong2', u'赩': u'xi4', u'赪': u'cheng1', u'赫': u'he4', u'赬': u'cheng1', u'赭': u'zhe3', u'赮': u'xia2', u'赯': u'tang2', u'走': u'zou3', u'赱': u'zou3', u'赲': u'li4', u'赳': u'jiu1', u'赴': u'fu4', u'赵': u'zhao4', u'赶': u'gan3', u'起': u'qi3', u'赸': u'shan4', u'赹': u'qiong2', u'赺': u'yin3', u'赻': u'xian3', u'赼': u'zi1', u'赽': u'jue2', u'赾': u'qin3', u'赿': u'chi2', u'趀': u'ci1', u'趁': u'chen4', u'趂': u'chen4', u'趃': u'die2', u'趄': u'ju1', u'超': u'chao1', u'趆': u'di1', u'趇': u'xi4', u'趈': u'zhan1', u'趉': u'jue2', u'越': u'yue4', u'趋': u'qu1', u'趌': u'ji2', u'趍': u'qu1', u'趎': u'chu2', u'趏': u'gua1', u'趐': u'xue4', u'趑': u'zi1', u'趒': u'tiao4', u'趓': u'duo3', u'趔': u'lie4', u'趕': u'gan3', u'趖': u'suo1', u'趗': u'cu4', u'趘': u'xi2', u'趙': u'zhao4', u'趚': u'su4', u'趛': u'yin3', u'趜': u'ju2', u'趝': u'jian4', u'趞': u'que4', u'趟': u'tang4', u'趠': u'chuo1', u'趡': u'cui3', u'趢': u'lu4', u'趣': u'qu4', u'趤': u'dang4', u'趥': u'qiu1', u'趦': u'zi1', u'趧': u'ti2', u'趨': u'qu1', u'趩': u'chi4', u'趪': u'huang2', u'趫': u'qiao2', u'趬': u'qiao1', u'趭': u'jiao4', u'趮': u'zao4', u'趯': u'ti4', u'趰': u'er', u'趱': u'zan3', u'趲': u'zan3', u'足': u'zu2', u'趴': u'pa1', u'趵': u'bao4', u'趶': u'kua4', u'趷': u'ke1', u'趸': u'dun3', u'趹': u'jue2', u'趺': u'fu1', u'趻': u'chen3', u'趼': u'jian3', u'趽': u'fang1', u'趾': u'zhi3', u'趿': u'ta1', u'跀': u'yue4', u'跁': u'ba4', u'跂': u'qi2', u'跃': u'yue4', u'跄': u'qiang4', u'跅': u'tuo4', u'跆': u'tai2', u'跇': u'yi4', u'跈': u'jian4', u'跉': u'ling2', u'跊': u'mei4', u'跋': u'ba2', u'跌': u'die1', u'跍': u'ku1', u'跎': u'tuo2', u'跏': u'jia1', u'跐': u'ci1', u'跑': u'pao3', u'跒': u'qia3', u'跓': u'zhu4', u'跔': u'ju1', u'跕': u'die2', u'跖': u'zhi2', u'跗': u'fu1', u'跘': u'pan2', u'跙': u'ju1', u'跚': u'shan1', u'跛': u'bo3', u'跜': u'ni2', u'距': u'ju4', u'跞': u'li4', u'跟': u'gen1', u'跠': u'yi2', u'跡': u'ji4', u'跢': u'dai4', u'跣': u'xian3', u'跤': u'jiao1', u'跥': u'duo4', u'跦': u'zhu1', u'跧': u'quan2', u'跨': u'kua4', u'跩': u'zhuai1', u'跪': u'gui4', u'跫': u'qiong2', u'跬': u'kui3', u'跭': u'xiang2', u'跮': u'die2', u'路': u'lu4', u'跰': u'pian2', u'跱': u'zhi4', u'跲': u'jia2', u'跳': u'tiao4', u'跴': u'cai3', u'践': u'jian4', u'跶': u'da2', u'跷': u'qiao1', u'跸': u'bi4', u'跹': u'xian1', u'跺': u'duo4', u'跻': u'ji1', u'跼': u'ju2', u'跽': u'ji4', u'跾': u'shu1', u'跿': u'tu2', u'踀': u'chuo4', u'踁': u'jing4', u'踂': u'nie4', u'踃': u'xiao1', u'踄': u'bu4', u'踅': u'xue2', u'踆': u'cun1', u'踇': u'mu3', u'踈': u'shu1', u'踉': u'liang4', u'踊': u'yong3', u'踋': u'jiao3', u'踌': u'chou2', u'踍': u'qiao1', u'踎': u'mou2', u'踏': u'ta4', u'踐': u'jian4', u'踑': u'ji2', u'踒': u'wo1', u'踓': u'wei3', u'踔': u'chuo1', u'踕': u'jie2', u'踖': u'ji2', u'踗': u'nie4', u'踘': u'ju1', u'踙': u'nie4', u'踚': u'lun2', u'踛': u'lu4', u'踜': u'leng4', u'踝': u'huai2', u'踞': u'ju4', u'踟': u'chi2', u'踠': u'wan3', u'踡': u'quan2', u'踢': u'ti1', u'踣': u'bo2', u'踤': u'zu2', u'踥': u'qie4', u'踦': u'qi1', u'踧': u'cu4', u'踨': u'zong1', u'踩': u'cai3', u'踪': u'zong1', u'踫': u'peng4', u'踬': u'zhi4', u'踭': u'zheng1', u'踮': u'dian3', u'踯': u'zhi2', u'踰': u'yu2', u'踱': u'duo2', u'踲': u'dun4', u'踳': u'chuan3', u'踴': u'yong3', u'踵': u'zhong3', u'踶': u'di4', u'踷': u'zhe3', u'踸': u'chen3', u'踹': u'chuai4', u'踺': u'jian4', u'踻': u'gua1', u'踼': u'tang2', u'踽': u'ju3', u'踾': u'fu2', u'踿': u'cu4', u'蹀': u'die2', u'蹁': u'pian2', u'蹂': u'rou2', u'蹃': u'nuo4', u'蹄': u'ti2', u'蹅': u'cha3', u'蹆': u'tui3', u'蹇': u'jian3', u'蹈': u'dao3', u'蹉': u'cuo1', u'蹊': u'qi1', u'蹋': u'ta4', u'蹌': u'qiang4', u'蹍': u'nian3', u'蹎': u'dian1', u'蹏': u'ti2', u'蹐': u'ji2', u'蹑': u'nie4', u'蹒': u'pan2', u'蹓': u'liu1', u'蹔': u'zan4', u'蹕': u'bi4', u'蹖': u'chong1', u'蹗': u'lu4', u'蹘': u'liao2', u'蹙': u'cu4', u'蹚': u'tang1', u'蹛': u'die2', u'蹜': u'su4', u'蹝': u'xi3', u'蹞': u'kui3', u'蹟': u'ji4', u'蹠': u'zhi2', u'蹡': u'qiang4', u'蹢': u'di2', u'蹣': u'pan2', u'蹤': u'zong1', u'蹥': u'lian2', u'蹦': u'beng4', u'蹧': u'zao1', u'蹨': u'nian3', u'蹩': u'bie2', u'蹪': u'tui2', u'蹫': u'ju2', u'蹬': u'deng1', u'蹭': u'ceng4', u'蹮': u'xian1', u'蹯': u'fan2', u'蹰': u'chu2', u'蹱': u'zhong1', u'蹲': u'dun1', u'蹳': u'bo1', u'蹴': u'cu4', u'蹵': u'cu4', u'蹶': u'jue2', u'蹷': u'jue2', u'蹸': u'lin4', u'蹹': u'ta4', u'蹺': u'qiao1', u'蹻': u'qiao1', u'蹼': u'pu3', u'蹽': u'liao1', u'蹾': u'dun1', u'蹿': u'cuan1', u'躀': u'guan4', u'躁': u'zao4', u'躂': u'da', u'躃': u'bi4', u'躄': u'bi4', u'躅': u'zhu2', u'躆': u'ju4', u'躇': u'chu2', u'躈': u'qiao4', u'躉': u'dun3', u'躊': u'chou2', u'躋': u'ji1', u'躌': u'qiao4', u'躍': u'yue4', u'躎': u'nian3', u'躏': u'lin4', u'躐': u'lie4', u'躑': u'zhi2', u'躒': u'li4', u'躓': u'zhi4', u'躔': u'chan2', u'躕': u'chu2', u'躖': u'duan4', u'躗': u'wei4', u'躘': u'long2', u'躙': u'lin4', u'躚': u'xian1', u'躛': u'wei4', u'躜': u'zuan1', u'躝': u'lan2', u'躞': u'xie4', u'躟': u'rang2', u'躠': u'sa3', u'躡': u'nie4', u'躢': u'ta4', u'躣': u'qu2', u'躤': u'ji2', u'躥': u'cuan1', u'躦': u'zuan1', u'躧': u'xi3', u'躨': u'kui2', u'躩': u'jue2', u'躪': u'lin4', u'身': u'shen1', u'躬': u'gong1', u'躭': u'dan1', u'躮': u'ga1', u'躯': u'qu1', u'躰': u'ti3', u'躱': u'duo3', u'躲': u'duo3', u'躳': u'gong1', u'躴': u'lang2', u'躵': u'hai3la1wu3', u'躶': u'luo3', u'躷': u'ai3', u'躸': u'ji1', u'躹': u'ju1', u'躺': u'tang3', u'躻': u'kong', u'躼': u'lao4', u'躽': u'yan3', u'躾': u'xi3tui1kai1', u'躿': u'kang1', u'軀': u'qu1', u'軁': u'lou2', u'軂': u'lao4', u'軃': u'duo3', u'軄': u'zhi2', u'軅': u'yan', u'軆': u'ti1', u'軇': u'dao4', u'軈': u'ya1ga1tei1', u'軉': u'yu', u'車': u'che1', u'軋': u'ya4', u'軌': u'gui3', u'軍': u'jun1', u'軎': u'wei4', u'軏': u'yue4', u'軐': u'xin4', u'軑': u'dai4', u'軒': u'xuan1', u'軓': u'fan4', u'軔': u'ren4', u'軕': u'shan1', u'軖': u'kuang2', u'軗': u'shu1', u'軘': u'tun2', u'軙': u'chen2', u'軚': u'dai4', u'軛': u'e4', u'軜': u'na4', u'軝': u'qi2', u'軞': u'mao2', u'軟': u'ruan3', u'軠': u'kuang2', u'軡': u'qian2', u'転': u'zhuan4', u'軣': u'hong1', u'軤': u'hu1', u'軥': u'qu2', u'軦': u'kuang4', u'軧': u'di3', u'軨': u'ling2', u'軩': u'dai4', u'軪': u'ao1', u'軫': u'zhen3', u'軬': u'fan4', u'軭': u'kuang1', u'軮': u'yang3', u'軯': u'peng1', u'軰': u'bei4', u'軱': u'gu1', u'軲': u'gu1', u'軳': u'pao2', u'軴': u'zhu4', u'軵': u'rong3', u'軶': u'e4', u'軷': u'ba2', u'軸': u'zhou2', u'軹': u'zhi3', u'軺': u'yao2', u'軻': u'ke1', u'軼': u'yi4', u'軽': u'qing1', u'軾': u'shi4', u'軿': u'ping2', u'輀': u'er2', u'輁': u'gong3', u'輂': u'ju2', u'較': u'jiao4', u'輄': u'guang1', u'輅': u'lu4', u'輆': u'kai3', u'輇': u'quan2', u'輈': u'zhou1', u'載': u'zai4', u'輊': u'zhi4', u'輋': u'she1', u'輌': u'liang4', u'輍': u'yu4', u'輎': u'shao1', u'輏': u'you2', u'輐': u'wan4', u'輑': u'yin3', u'輒': u'zhe2', u'輓': u'wan3', u'輔': u'fu3', u'輕': u'qing1', u'輖': u'zhou1', u'輗': u'ni2', u'輘': u'ling2', u'輙': u'zhe2', u'輚': u'zhan4', u'輛': u'liang4', u'輜': u'zi1', u'輝': u'hui1', u'輞': u'wang3', u'輟': u'chuo4', u'輠': u'guo3', u'輡': u'kan3', u'輢': u'yi3', u'輣': u'peng2', u'輤': u'qian4', u'輥': u'gun3', u'輦': u'nian3', u'輧': u'peng', u'輨': u'guan3', u'輩': u'bei4', u'輪': u'lun2', u'輫': u'pai2', u'輬': u'liang2', u'輭': u'ruan3', u'輮': u'rou2', u'輯': u'ji2', u'輰': u'yang2', u'輱': u'xian2', u'輲': u'chuan2', u'輳': u'cou4', u'輴': u'chun1', u'輵': u'ge2', u'輶': u'you2', u'輷': u'hong1', u'輸': u'shu1', u'輹': u'fu4', u'輺': u'zi1', u'輻': u'fu2', u'輼': u'wen1', u'輽': u'fan4', u'輾': u'nian3', u'輿': u'yu2', u'轀': u'wen1', u'轁': u'tao1', u'轂': u'gu1', u'轃': u'zhen1', u'轄': u'xia2', u'轅': u'yuan2', u'轆': u'lu4', u'轇': u'jiao1', u'轈': u'chao2', u'轉': u'zhuan3', u'轊': u'wei4', u'轋': u'hun1', u'轌': u'xue', u'轍': u'zhe2', u'轎': u'jiao4', u'轏': u'zhan4', u'轐': u'bu2', u'轑': u'lao3', u'轒': u'fen2', u'轓': u'fan1', u'轔': u'lin2', u'轕': u'ge2', u'轖': u'se4', u'轗': u'kan3', u'轘': u'huan2', u'轙': u'yi3', u'轚': u'ji2', u'轛': u'dui4', u'轜': u'er2', u'轝': u'yu2', u'轞': u'jian4', u'轟': u'hong1', u'轠': u'lei2', u'轡': u'pei4', u'轢': u'li4', u'轣': u'li4', u'轤': u'lu2', u'轥': u'lin4', u'车': u'che1', u'轧': u'ya4', u'轨': u'gui3', u'轩': u'xuan1', u'轪': u'dai4', u'轫': u'ren4', u'转': u'zhuan3', u'轭': u'e4', u'轮': u'lun2', u'软': u'ruan3', u'轰': u'hong1', u'轱': u'gu1', u'轲': u'ke1', u'轳': u'lu2', u'轴': u'zhou2', u'轵': u'zhi3', u'轶': u'yi4', u'轷': u'hu1', u'轸': u'zhen3', u'轹': u'li4', u'轺': u'yao2', u'轻': u'qing1', u'轼': u'shi4', u'载': u'zai4', u'轾': u'zhi4', u'轿': u'jiao4', u'辀': u'zhou1', u'辁': u'quan2', u'辂': u'lu4', u'较': u'jiao4', u'辄': u'zhe2', u'辅': u'fu3', u'辆': u'liang4', u'辇': u'nian3', u'辈': u'bei4', u'辉': u'hui1', u'辊': u'gun3', u'辋': u'wang3', u'辌': u'liang2', u'辍': u'chuo4', u'辎': u'zi1', u'辏': u'cou4', u'辐': u'fu2', u'辑': u'ji2', u'辒': u'wen1', u'输': u'shu1', u'辔': u'pei4', u'辕': u'yuan2', u'辖': u'xia2', u'辗': u'nian3', u'辘': u'lu4', u'辙': u'zhe2', u'辚': u'lin2', u'辛': u'xin1', u'辜': u'gu1', u'辝': u'ci2', u'辞': u'ci2', u'辟': u'bi4', u'辠': u'zui4', u'辡': u'bian4', u'辢': u'la4', u'辣': u'la4', u'辤': u'ci2', u'辥': u'xue1', u'辦': u'ban4', u'辧': u'bian4', u'辨': u'bian4', u'辩': u'bian4', u'辪': u'xue1', u'辫': u'bian4', u'辬': u'ban1', u'辭': u'ci2', u'辮': u'bian4', u'辯': u'bian4', u'辰': u'chen2', u'辱': u'ru3', u'農': u'nong2', u'辳': u'nong2', u'辴': u'zhen3', u'辵': u'chuo4', u'辶': u'chuo4', u'辷': u'yi', u'辸': u'reng2', u'边': u'bian1', u'辺': u'dao4', u'辻': u'shi', u'込': u'yu1', u'辽': u'liao2', u'达': u'da2', u'辿': u'chan1', u'迀': u'gan1', u'迁': u'qian1', u'迂': u'yu1', u'迃': u'yu1', u'迄': u'qi4', u'迅': u'xun4', u'迆': u'yi3', u'过': u'guo4', u'迈': u'mai4', u'迉': u'qi1', u'迊': u'bi4', u'迋': u'wang4', u'迌': u'tu4', u'迍': u'zhun1', u'迎': u'ying2', u'迏': u'da2', u'运': u'yun4', u'近': u'jin4', u'迒': u'hang2', u'迓': u'ya4', u'返': u'fan3', u'迕': u'wu3', u'迖': u'da2', u'迗': u'e2', u'还': u'huan2', u'这': u'zhe4', u'迚': u'da2', u'进': u'jin4', u'远': u'yuan3', u'违': u'wei2', u'连': u'lian2', u'迟': u'chi2', u'迠': u'che4', u'迡': u'chi2', u'迢': u'tiao2', u'迣': u'zhi4', u'迤': u'yi3', u'迥': u'jiong3', u'迦': u'jia1', u'迧': u'chen2', u'迨': u'dai4', u'迩': u'er3', u'迪': u'di2', u'迫': u'po4', u'迬': u'zhu4', u'迭': u'die2', u'迮': u'ze2', u'迯': u'tao2', u'述': u'shu4', u'迱': u'yi3', u'迲': u'keopi', u'迳': u'jing4', u'迴': u'hui2', u'迵': u'dong4', u'迶': u'you4', u'迷': u'mi2', u'迸': u'beng4', u'迹': u'ji4', u'迺': u'nai3', u'迻': u'yi2', u'迼': u'jie2', u'追': u'zhui1', u'迾': u'lie4', u'迿': u'xun4', u'退': u'tui4', u'送': u'song4', u'适': u'shi4', u'逃': u'tao2', u'逄': u'pang2', u'逅': u'hou4', u'逆': u'ni4', u'逇': u'dun4', u'逈': u'jiong3', u'选': u'xuan3', u'逊': u'xun4', u'逋': u'bu1', u'逌': u'you1', u'逍': u'xiao1', u'逎': u'qiu2', u'透': u'tou4', u'逐': u'zhu2', u'逑': u'qiu2', u'递': u'di4', u'逓': u'di4', u'途': u'tu2', u'逕': u'jing4', u'逖': u'ti4', u'逗': u'dou4', u'逘': u'yi3', u'這': u'zhe4', u'通': u'tong1', u'逛': u'guang4', u'逜': u'wu3', u'逝': u'shi4', u'逞': u'cheng3', u'速': u'su4', u'造': u'zao4', u'逡': u'qun1', u'逢': u'feng2', u'連': u'lian2', u'逤': u'suo4', u'逥': u'hui2', u'逦': u'li3', u'逧': u'gu', u'逨': u'lai2', u'逩': u'ben4', u'逪': u'cuo4', u'逫': u'zhu2', u'逬': u'beng4', u'逭': u'huan4', u'逮': u'dai3', u'逯': u'lu4', u'逰': u'you2', u'週': u'zhou1', u'進': u'jin4', u'逳': u'yu4', u'逴': u'chuo1', u'逵': u'kui2', u'逶': u'wei1', u'逷': u'ti4', u'逸': u'yi4', u'逹': u'da2', u'逺': u'yuan3', u'逻': u'luo2', u'逼': u'bi1', u'逽': u'nuo4', u'逾': u'yu2', u'逿': u'dang4', u'遀': u'sui2', u'遁': u'dun4', u'遂': u'sui4', u'遃': u'yan3', u'遄': u'chuan2', u'遅': u'chi2', u'遆': u'ti2', u'遇': u'yu4', u'遈': u'shi2', u'遉': u'zhen1', u'遊': u'you2', u'運': u'yun4', u'遌': u'e4', u'遍': u'bian4', u'過': u'guo4', u'遏': u'e4', u'遐': u'xia2', u'遑': u'huang2', u'遒': u'qiu2', u'道': u'dao4', u'達': u'da2', u'違': u'wei2', u'遖': u'nan', u'遗': u'yi2', u'遘': u'gou4', u'遙': u'yao2', u'遚': u'chou4', u'遛': u'liu4', u'遜': u'xun4', u'遝': u'ta4', u'遞': u'di4', u'遟': u'chi2', u'遠': u'yuan3', u'遡': u'su4', u'遢': u'ta1', u'遣': u'qian3', u'遤': u'hewo', u'遥': u'yao2', u'遦': u'guan4', u'遧': u'zhang1', u'遨': u'ao2', u'適': u'shi4', u'遪': u'ca4', u'遫': u'chi4', u'遬': u'su4', u'遭': u'zao1', u'遮': u'zhe1', u'遯': u'dun4', u'遰': u'di4', u'遱': u'lou2', u'遲': u'chi2', u'遳': u'cuo1', u'遴': u'lin2', u'遵': u'zun1', u'遶': u'rao4', u'遷': u'qian1', u'選': u'xuan3', u'遹': u'yu4', u'遺': u'yi2', u'遻': u'e4', u'遼': u'liao2', u'遽': u'ju4', u'遾': u'shi4', u'避': u'bi4', u'邀': u'yao1', u'邁': u'mai4', u'邂': u'xie4', u'邃': u'sui4', u'還': u'huan2', u'邅': u'zhan1', u'邆': u'teng2', u'邇': u'er3', u'邈': u'miao3', u'邉': u'bian1', u'邊': u'bian1', u'邋': u'la1', u'邌': u'li2', u'邍': u'yuan2', u'邎': u'you2', u'邏': u'luo2', u'邐': u'li3', u'邑': u'yi4', u'邒': u'ting2', u'邓': u'deng4', u'邔': u'qi3', u'邕': u'yong1', u'邖': u'shan1', u'邗': u'han2', u'邘': u'yu2', u'邙': u'mang2', u'邚': u'ru2', u'邛': u'qiong2', u'邜': u'xi1', u'邝': u'kuang4', u'邞': u'fu1', u'邟': u'kang4', u'邠': u'bin1', u'邡': u'fang1', u'邢': u'xing2', u'那': u'na4', u'邤': u'xin1', u'邥': u'shen3', u'邦': u'bang1', u'邧': u'yuan2', u'邨': u'cun1', u'邩': u'huo3', u'邪': u'xie2', u'邫': u'bang1', u'邬': u'wu1', u'邭': u'ju4', u'邮': u'you2', u'邯': u'han2', u'邰': u'tai2', u'邱': u'qiu1', u'邲': u'bi4', u'邳': u'pi1', u'邴': u'bing3', u'邵': u'shao4', u'邶': u'bei4', u'邷': u'wa3', u'邸': u'di3', u'邹': u'zou1', u'邺': u'ye4', u'邻': u'lin2', u'邼': u'kuang1', u'邽': u'gui1', u'邾': u'zhu1', u'邿': u'shi1', u'郀': u'ku1', u'郁': u'yu4', u'郂': u'gai1', u'郃': u'he2', u'郄': u'qie4', u'郅': u'zhi4', u'郆': u'ji2', u'郇': u'xun2', u'郈': u'hou4', u'郉': u'xing2', u'郊': u'jiao1', u'郋': u'xi2', u'郌': u'gui1', u'郍': u'na4', u'郎': u'lang2', u'郏': u'jia2', u'郐': u'kuai4', u'郑': u'zheng4', u'郒': u'lang2', u'郓': u'yun4', u'郔': u'yan2', u'郕': u'cheng2', u'郖': u'dou4', u'郗': u'xi1', u'郘': u'lv3', u'郙': u'fu3', u'郚': u'wu2', u'郛': u'fu2', u'郜': u'gao4', u'郝': u'hao3', u'郞': u'lang2', u'郟': u'jia2', u'郠': u'geng3', u'郡': u'jun4', u'郢': u'ying3', u'郣': u'bo2', u'郤': u'xi4', u'郥': u'bei4', u'郦': u'li4', u'郧': u'yun2', u'部': u'bu4', u'郩': u'xiao2', u'郪': u'qi1', u'郫': u'pi2', u'郬': u'qing1', u'郭': u'guo1', u'郮': u'zhou1', u'郯': u'tan2', u'郰': u'zou1', u'郱': u'ping2', u'郲': u'lai2', u'郳': u'ni2', u'郴': u'chen1', u'郵': u'you2', u'郶': u'bu4', u'郷': u'xiang1', u'郸': u'dan1', u'郹': u'ju2', u'郺': u'yong1', u'郻': u'qiao1', u'郼': u'yi1', u'都': u'dou1', u'郾': u'yan3', u'郿': u'mei2', u'鄀': u'ruo4', u'鄁': u'bei4', u'鄂': u'e4', u'鄃': u'shu1', u'鄄': u'juan4', u'鄅': u'yu3', u'鄆': u'yun4', u'鄇': u'hou2', u'鄈': u'kui2', u'鄉': u'xiang1', u'鄊': u'xiang1', u'鄋': u'sou1', u'鄌': u'tang2', u'鄍': u'ming2', u'鄎': u'xi1', u'鄏': u'ru3', u'鄐': u'chu4', u'鄑': u'zi1', u'鄒': u'zou1', u'鄓': u'yi4', u'鄔': u'wu1', u'鄕': u'xiang1', u'鄖': u'yun2', u'鄗': u'hao4', u'鄘': u'yong1', u'鄙': u'bi3', u'鄚': u'mao4', u'鄛': u'chao2', u'鄜': u'fu1', u'鄝': u'liao3', u'鄞': u'yin2', u'鄟': u'zhuan1', u'鄠': u'hu4', u'鄡': u'qiao1', u'鄢': u'yan1', u'鄣': u'zhang1', u'鄤': u'man4', u'鄥': u'qiao1', u'鄦': u'xu3', u'鄧': u'deng4', u'鄨': u'bi4', u'鄩': u'xun2', u'鄪': u'bi4', u'鄫': u'zeng1', u'鄬': u'wei2', u'鄭': u'zheng4', u'鄮': u'mao4', u'鄯': u'shan4', u'鄰': u'lin2', u'鄱': u'po2', u'鄲': u'dan1', u'鄳': u'meng2', u'鄴': u'ye4', u'鄵': u'cao4', u'鄶': u'kuai4', u'鄷': u'feng1', u'鄸': u'meng2', u'鄹': u'zou1', u'鄺': u'kuang4', u'鄻': u'lian3', u'鄼': u'zan4', u'鄽': u'chan2', u'鄾': u'you1', u'鄿': u'qi2', u'酀': u'yan4', u'酁': u'chan2', u'酂': u'cuo2', u'酃': u'ling2', u'酄': u'huan1', u'酅': u'xi1', u'酆': u'feng1', u'酇': u'cuo2', u'酈': u'li4', u'酉': u'you3', u'酊': u'ding1', u'酋': u'qiu2', u'酌': u'zhuo2', u'配': u'pei4', u'酎': u'zhou4', u'酏': u'yi3', u'酐': u'gan1', u'酑': u'yu2', u'酒': u'jiu3', u'酓': u'yan3', u'酔': u'zui4', u'酕': u'mao2', u'酖': u'dan1', u'酗': u'xu4', u'酘': u'dou4', u'酙': u'zhen1', u'酚': u'fen1', u'酛': u'yuan', u'酜': u'fu', u'酝': u'yun4', u'酞': u'tai4', u'酟': u'tian1', u'酠': u'qia3', u'酡': u'tuo2', u'酢': u'zuo4', u'酣': u'han1', u'酤': u'gu1', u'酥': u'su1', u'酦': u'fa1', u'酧': u'chou2', u'酨': u'zai4', u'酩': u'ming3', u'酪': u'lao4', u'酫': u'chuo4', u'酬': u'chou2', u'酭': u'you4', u'酮': u'tong2', u'酯': u'zhi3', u'酰': u'xian1', u'酱': u'jiang4', u'酲': u'cheng2', u'酳': u'yin4', u'酴': u'tu2', u'酵': u'jiao4', u'酶': u'mei2', u'酷': u'ku4', u'酸': u'suan1', u'酹': u'lei4', u'酺': u'pu2', u'酻': u'zui4', u'酼': u'hai3', u'酽': u'yan4', u'酾': u'shai1', u'酿': u'niang4', u'醀': u'wei2', u'醁': u'lu4', u'醂': u'lan3', u'醃': u'yan1', u'醄': u'tao2', u'醅': u'pei1', u'醆': u'zhan3', u'醇': u'chun2', u'醈': u'tan2', u'醉': u'zui4', u'醊': u'zhui4', u'醋': u'cu4', u'醌': u'kun1', u'醍': u'ti2', u'醎': u'xian2', u'醏': u'du1', u'醐': u'hu2', u'醑': u'xu3', u'醒': u'xing3', u'醓': u'tan3', u'醔': u'qiu2', u'醕': u'chun2', u'醖': u'yun4', u'醗': u'po1', u'醘': u'ke1', u'醙': u'sou1', u'醚': u'mi2', u'醛': u'quan2', u'醜': u'chou3', u'醝': u'cuo1', u'醞': u'yun4', u'醟': u'yong4', u'醠': u'ang4', u'醡': u'zha4', u'醢': u'hai3', u'醣': u'tang2', u'醤': u'jiang4', u'醥': u'piao3', u'醦': u'chan3', u'醧': u'yu4', u'醨': u'li2', u'醩': u'zao1', u'醪': u'lao2', u'醫': u'yi1', u'醬': u'jiang4', u'醭': u'bu2', u'醮': u'jiao4', u'醯': u'xi1', u'醰': u'tan2', u'醱': u'fa1', u'醲': u'nong2', u'醳': u'yi4', u'醴': u'li3', u'醵': u'ju4', u'醶': u'yan4', u'醷': u'yi4', u'醸': u'niang4', u'醹': u'ru2', u'醺': u'xun1', u'醻': u'chou2', u'醼': u'yan4', u'醽': u'ling2', u'醾': u'mi2', u'醿': u'mi2', u'釀': u'niang4', u'釁': u'xin4', u'釂': u'jiao4', u'釃': u'shai1', u'釄': u'mi2', u'釅': u'yan4', u'釆': u'bian4', u'采': u'cai3', u'釈': u'shi4', u'釉': u'you4', u'释': u'shi4', u'釋': u'shi4', u'里': u'li3', u'重': u'zhong4', u'野': u'ye3', u'量': u'liang4', u'釐': u'li2', u'金': u'jin1', u'釒': u'jin1', u'釓': u'ga2', u'釔': u'yi3', u'釕': u'liao3', u'釖': u'dao1', u'釗': u'zhao1', u'釘': u'ding4', u'釙': u'po1', u'釚': u'dao1', u'釛': u'he2', u'釜': u'fu3', u'針': u'zhen1', u'釞': u'zhi2', u'釟': u'ba1', u'釠': u'luan4', u'釡': u'fu3', u'釢': u'nai3', u'釣': u'diao4', u'釤': u'shan1', u'釥': u'qiao3', u'釦': u'kou4', u'釧': u'chuan4', u'釨': u'zi3', u'釩': u'fan2', u'釪': u'hua2', u'釫': u'wu1', u'釬': u'qian1', u'釭': u'gang1', u'釮': u'qi2', u'釯': u'mang2', u'釰': u'ri4', u'釱': u'di4', u'釲': u'si4', u'釳': u'xi4', u'釴': u'yi4', u'釵': u'chai1', u'釶': u'shi1', u'釷': u'tu3', u'釸': u'xi1', u'釹': u'nv3', u'釺': u'qian1', u'釻': u'qiu2', u'釼': u'ri4', u'釽': u'pi1', u'釾': u'ya2', u'釿': u'jin1', u'鈀': u'ba3', u'鈁': u'fang1', u'鈂': u'chen2', u'鈃': u'xing2', u'鈄': u'tou3', u'鈅': u'yue4', u'鈆': u'qian1', u'鈇': u'fu1', u'鈈': u'bu4', u'鈉': u'na4', u'鈊': u'xin1', u'鈋': u'e2', u'鈌': u'jue2', u'鈍': u'dun4', u'鈎': u'gou1', u'鈏': u'yin3', u'鈐': u'qian2', u'鈑': u'ban3', u'鈒': u'sa4', u'鈓': u'ren4', u'鈔': u'chao1', u'鈕': u'niu3', u'鈖': u'fen1', u'鈗': u'yun3', u'鈘': u'yi3', u'鈙': u'qin2', u'鈚': u'pi1', u'鈛': u'guo1', u'鈜': u'hong2', u'鈝': u'yin2', u'鈞': u'jun1', u'鈟': u'diao4', u'鈠': u'yi4', u'鈡': u'zhong1', u'鈢': u'xi3', u'鈣': u'gai4', u'鈤': u'ri4', u'鈥': u'huo3', u'鈦': u'tai4', u'鈧': u'kang4', u'鈨': u'yuan', u'鈩': u'lu', u'鈪': u'e4', u'鈫': u'qin2', u'鈬': u'duo', u'鈭': u'zi1', u'鈮': u'ni2', u'鈯': u'tu2', u'鈰': u'shi4', u'鈱': u'min2', u'鈲': u'gu1', u'鈳': u'ke1', u'鈴': u'ling2', u'鈵': u'bing3', u'鈶': u'si4', u'鈷': u'gu3', u'鈸': u'bo2', u'鈹': u'pi2', u'鈺': u'yu4', u'鈻': u'si4', u'鈼': u'zuo2', u'鈽': u'bu1', u'鈾': u'you2', u'鈿': u'dian4', u'鉀': u'jia3', u'鉁': u'zhen1', u'鉂': u'shi3', u'鉃': u'shi4', u'鉄': u'tie3', u'鉅': u'ju4', u'鉆': u'zuan1', u'鉇': u'shi1', u'鉈': u'tuo2', u'鉉': u'xuan4', u'鉊': u'zhao1', u'鉋': u'pao2', u'鉌': u'he2', u'鉍': u'bi4', u'鉎': u'sheng1', u'鉏': u'sheng1', u'鉐': u'shi2', u'鉑': u'bo2', u'鉒': u'zhu4', u'鉓': u'chi4', u'鉔': u'za1', u'鉕': u'po3', u'鉖': u'tong2', u'鉗': u'qian2', u'鉘': u'fu2', u'鉙': u'zhai3', u'鉚': u'mao3', u'鉛': u'qian1', u'鉜': u'fu2', u'鉝': u'li4', u'鉞': u'yue4', u'鉟': u'pi1', u'鉠': u'yang1', u'鉡': u'ban4', u'鉢': u'bo1', u'鉣': u'jie2', u'鉤': u'gou1', u'鉥': u'shu4', u'鉦': u'zheng1', u'鉧': u'mu3', u'鉨': u'xi3', u'鉩': u'xi3', u'鉪': u'di4', u'鉫': u'jia1', u'鉬': u'mu4', u'鉭': u'tan3', u'鉮': u'shen2', u'鉯': u'yi3', u'鉰': u'si1', u'鉱': u'kuang4', u'鉲': u'ka3', u'鉳': u'bei3', u'鉴': u'jian4', u'鉵': u'tong2', u'鉶': u'xing2', u'鉷': u'hong2', u'鉸': u'jiao3', u'鉹': u'chi3', u'鉺': u'er3', u'鉻': u'ge4', u'鉼': u'bing3', u'鉽': u'shi4', u'鉾': u'mao2', u'鉿': u'ha1', u'銀': u'yin2', u'銁': u'jun1', u'銂': u'zhou1', u'銃': u'chong4', u'銄': u'xiang3', u'銅': u'tong2', u'銆': u'mo4', u'銇': u'lei4', u'銈': u'ji1', u'銉': u'yu4', u'銊': u'xu4', u'銋': u'ren2', u'銌': u'zun4', u'銍': u'zhi4', u'銎': u'qiong2', u'銏': u'shan4', u'銐': u'chi4', u'銑': u'xi3', u'銒': u'xing2', u'銓': u'quan2', u'銔': u'pi1', u'銕': u'tie3', u'銖': u'zhu1', u'銗': u'hou2', u'銘': u'ming2', u'銙': u'kua3', u'銚': u'diao4', u'銛': u'xian1', u'銜': u'xian2', u'銝': u'xiu1', u'銞': u'jun1', u'銟': u'cha1', u'銠': u'lao3', u'銡': u'ji2', u'銢': u'pi3', u'銣': u'ru2', u'銤': u'mi3', u'銥': u'yi1', u'銦': u'yin1', u'銧': u'guang1', u'銨': u'an3', u'銩': u'diu1', u'銪': u'you3', u'銫': u'se4', u'銬': u'kao4', u'銭': u'qian2', u'銮': u'luan2', u'銯': u'ka3si1ga1yi1', u'銰': u'ai', u'銱': u'diao4', u'銲': u'han4', u'銳': u'rui4', u'銴': u'shi4', u'銵': u'keng1', u'銶': u'qiu2', u'銷': u'xiao1', u'銸': u'zhe2', u'銹': u'xiu4', u'銺': u'zang4', u'銻': u'ti1', u'銼': u'cuo4', u'銽': u'xian1', u'銾': u'gong3', u'銿': u'zhong1', u'鋀': u'tou1', u'鋁': u'lv3', u'鋂': u'mei2', u'鋃': u'lang2', u'鋄': u'wan4', u'鋅': u'xin1', u'鋆': u'yun2', u'鋇': u'bei4', u'鋈': u'wu4', u'鋉': u'su4', u'鋊': u'yu4', u'鋋': u'chan2', u'鋌': u'ting3', u'鋍': u'bo2', u'鋎': u'han4', u'鋏': u'jia2', u'鋐': u'hong2', u'鋑': u'juan1', u'鋒': u'feng1', u'鋓': u'chan1', u'鋔': u'wan3', u'鋕': u'zhi4', u'鋖': u'si1', u'鋗': u'xuan1', u'鋘': u'hua2', u'鋙': u'wu2', u'鋚': u'tiao2', u'鋛': u'kuang4', u'鋜': u'zhuo2', u'鋝': u'lue4', u'鋞': u'xing2', u'鋟': u'qin3', u'鋠': u'shen4', u'鋡': u'han2', u'鋢': u'lue4', u'鋣': u'ye2', u'鋤': u'chu2', u'鋥': u'zeng4', u'鋦': u'ju2', u'鋧': u'xian4', u'鋨': u'e2', u'鋩': u'mang2', u'鋪': u'pu1', u'鋫': u'li2', u'鋬': u'pan4', u'鋭': u'rui4', u'鋮': u'cheng2', u'鋯': u'gao4', u'鋰': u'li3', u'鋱': u'te4', u'鋲': u'biao', u'鋳': u'zhu4', u'鋴': u'zhen', u'鋵': u'tu1', u'鋶': u'liu3', u'鋷': u'zui4', u'鋸': u'ju4', u'鋹': u'chang3', u'鋺': u'yuan3', u'鋻': u'jian1', u'鋼': u'gang1', u'鋽': u'diao4', u'鋾': u'tao2', u'鋿': u'shang3', u'錀': u'lun2', u'錁': u'ke4', u'錂': u'ling2', u'錃': u'pi1', u'錄': u'lu4', u'錅': u'li2', u'錆': u'qiang1', u'錇': u'pei2', u'錈': u'juan3', u'錉': u'min2', u'錊': u'zui4', u'錋': u'peng2', u'錌': u'an4', u'錍': u'pi1', u'錎': u'xian4', u'錏': u'ya1', u'錐': u'zhui1', u'錑': u'lei4', u'錒': u'a1', u'錓': u'kong1', u'錔': u'ta4', u'錕': u'kun1', u'錖': u'du2', u'錗': u'nei4', u'錘': u'chui2', u'錙': u'zi1', u'錚': u'zheng1', u'錛': u'ben1', u'錜': u'nie4', u'錝': u'cong2', u'錞': u'chun2', u'錟': u'tan2', u'錠': u'ding4', u'錡': u'qi2', u'錢': u'qian2', u'錣': u'zhui4', u'錤': u'ji1', u'錥': u'yu4', u'錦': u'jin3', u'錧': u'guan3', u'錨': u'mao2', u'錩': u'chang1', u'錪': u'tian3', u'錫': u'xi1', u'錬': u'lian4', u'錭': u'diao1', u'錮': u'gu4', u'錯': u'cuo4', u'錰': u'shu4', u'錱': u'zhen1', u'録': u'lu4', u'錳': u'meng3', u'錴': u'lu4', u'錵': u'hua1', u'錶': u'biao3', u'錷': u'ga2', u'錸': u'lai2', u'錹': u'ken3', u'錺': u'ka3za1li1', u'錻': u'bu1', u'錼': u'nai4', u'錽': u'wan4', u'錾': u'zan4', u'錿': u'hu3', u'鍀': u'de2', u'鍁': u'xian1', u'鍂': u'wuwu', u'鍃': u'huo1', u'鍄': u'liang4', u'鍅': u'fa', u'鍆': u'men2', u'鍇': u'kai3', u'鍈': u'yang1', u'鍉': u'chi2', u'鍊': u'lian4', u'鍋': u'guo1', u'鍌': u'xian3', u'鍍': u'du4', u'鍎': u'tu2', u'鍏': u'wei2', u'鍐': u'zong1', u'鍑': u'fu4', u'鍒': u'rou2', u'鍓': u'ji2', u'鍔': u'e4', u'鍕': u'jun1', u'鍖': u'chen3', u'鍗': u'ti2', u'鍘': u'zha2', u'鍙': u'hu4', u'鍚': u'yang2', u'鍛': u'duan4', u'鍜': u'xia2', u'鍝': u'yu2', u'鍞': u'keng1', u'鍟': u'sheng1', u'鍠': u'huang2', u'鍡': u'wei3', u'鍢': u'fu4', u'鍣': u'zhao1', u'鍤': u'cha1', u'鍥': u'qie4', u'鍦': u'shi1', u'鍧': u'hong1', u'鍨': u'kui2', u'鍩': u'nuo4', u'鍪': u'mou2', u'鍫': u'qiao1', u'鍬': u'qiao1', u'鍭': u'hou2', u'鍮': u'tou1', u'鍯': u'cong1', u'鍰': u'huan2', u'鍱': u'ye4', u'鍲': u'min2', u'鍳': u'jian4', u'鍴': u'duan1', u'鍵': u'jian4', u'鍶': u'si1', u'鍷': u'kui2', u'鍸': u'hu2', u'鍹': u'xuan1', u'鍺': u'zhe3', u'鍻': u'jie2', u'鍼': u'zhen1', u'鍽': u'bian1', u'鍾': u'zhong1', u'鍿': u'zi1', u'鎀': u'xiu1', u'鎁': u'ye2', u'鎂': u'mei3', u'鎃': u'pai4', u'鎄': u'ai1', u'鎅': u'jie4', u'鎆': u'qian', u'鎇': u'mei2', u'鎈': u'cuo1', u'鎉': u'da1', u'鎊': u'bang4', u'鎋': u'xia2', u'鎌': u'lian2', u'鎍': u'suo3', u'鎎': u'kai4', u'鎏': u'liu2', u'鎐': u'yao2', u'鎑': u'ye4', u'鎒': u'nou4', u'鎓': u'weng1', u'鎔': u'rong2', u'鎕': u'tang2', u'鎖': u'suo3', u'鎗': u'qiang1', u'鎘': u'ge2', u'鎙': u'shuo4', u'鎚': u'chui2', u'鎛': u'bo2', u'鎜': u'pan2', u'鎝': u'da1', u'鎞': u'bi1', u'鎟': u'sang3', u'鎠': u'gang1', u'鎡': u'zi1', u'鎢': u'wu1', u'鎣': u'ying2', u'鎤': u'huang4', u'鎥': u'tiao2', u'鎦': u'liu2', u'鎧': u'kai3', u'鎨': u'sun3', u'鎩': u'sha1', u'鎪': u'sou1', u'鎫': u'wan4', u'鎬': u'gao3', u'鎭': u'zhen4', u'鎮': u'zhen4', u'鎯': u'lang2', u'鎰': u'yi4', u'鎱': u'yuan2', u'鎲': u'tang3', u'鎳': u'nie4', u'鎴': u'xi2', u'鎵': u'jia1', u'鎶': u'ge1', u'鎷': u'ma3', u'鎸': u'juan1', u'鎹': u'song', u'鎺': u'zu', u'鎻': u'suo3', u'鎼': u'xia4', u'鎽': u'feng1', u'鎾': u'wen', u'鎿': u'na2', u'鏀': u'lu3', u'鏁': u'suo3', u'鏂': u'ou1', u'鏃': u'zu2', u'鏄': u'tuan2', u'鏅': u'xiu1', u'鏆': u'guan4', u'鏇': u'xuan4', u'鏈': u'lian4', u'鏉': u'shou4', u'鏊': u'ao4', u'鏋': u'man3', u'鏌': u'mo4', u'鏍': u'luo2', u'鏎': u'bi4', u'鏏': u'wei4', u'鏐': u'liu2', u'鏑': u'di1', u'鏒': u'san3', u'鏓': u'cong1', u'鏔': u'yi2', u'鏕': u'lu4', u'鏖': u'ao2', u'鏗': u'keng1', u'鏘': u'qiang1', u'鏙': u'cui1', u'鏚': u'qi1', u'鏛': u'shang3', u'鏜': u'tang1', u'鏝': u'man4', u'鏞': u'yong1', u'鏟': u'chan3', u'鏠': u'feng1', u'鏡': u'jing4', u'鏢': u'biao1', u'鏣': u'shu4', u'鏤': u'lou4', u'鏥': u'xiu4', u'鏦': u'cong1', u'鏧': u'long2', u'鏨': u'zan4', u'鏩': u'jian4', u'鏪': u'cao2', u'鏫': u'li2', u'鏬': u'xia4', u'鏭': u'xi1', u'鏮': u'kang1', u'鏯': u'shuang', u'鏰': u'beng4', u'鏱': u'zhang', u'鏲': u'qian', u'鏳': u'zheng1', u'鏴': u'lu4', u'鏵': u'hua2', u'鏶': u'ji2', u'鏷': u'pu2', u'鏸': u'hui4', u'鏹': u'qiang3', u'鏺': u'po1', u'鏻': u'lin2', u'鏼': u'se4', u'鏽': u'xiu4', u'鏾': u'san3', u'鏿': u'cheng1', u'鐀': u'gui4', u'鐁': u'si1', u'鐂': u'liu2', u'鐃': u'nao2', u'鐄': u'huang2', u'鐅': u'pie3', u'鐆': u'sui4', u'鐇': u'fan2', u'鐈': u'qiao2', u'鐉': u'xi3', u'鐊': u'xi1', u'鐋': u'tang1', u'鐌': u'xiang4', u'鐍': u'jue2', u'鐎': u'jiao1', u'鐏': u'zun1', u'鐐': u'liao4', u'鐑': u'qi4', u'鐒': u'lao2', u'鐓': u'dun1', u'鐔': u'tan2', u'鐕': u'zan1', u'鐖': u'ji1', u'鐗': u'jian3', u'鐘': u'zhong1', u'鐙': u'deng4', u'鐚': u'ya1', u'鐛': u'ying3', u'鐜': u'dui1', u'鐝': u'jue2', u'鐞': u'nou4', u'鐟': u'zan1', u'鐠': u'pu3', u'鐡': u'tie3', u'鐢': u'wuwu', u'鐣': u'cheng1', u'鐤': u'ding3', u'鐥': u'shan4', u'鐦': u'kai1', u'鐧': u'jian3', u'鐨': u'fei4', u'鐩': u'sui4', u'鐪': u'lu3', u'鐫': u'juan1', u'鐬': u'hui4', u'鐭': u'yu4', u'鐮': u'lian2', u'鐯': u'zhuo1', u'鐰': u'qiao1', u'鐱': u'jian4', u'鐲': u'zhuo2', u'鐳': u'lei2', u'鐴': u'bi4', u'鐵': u'tie3', u'鐶': u'huan2', u'鐷': u'ye4', u'鐸': u'duo2', u'鐹': u'guo4', u'鐺': u'cheng1', u'鐻': u'ju4', u'鐼': u'fen2', u'鐽': u'tan3', u'鐾': u'bei4', u'鐿': u'yi4', u'鑀': u'ai4', u'鑁': u'zong1', u'鑂': u'xun4', u'鑃': u'diao4', u'鑄': u'zhu4', u'鑅': u'heng2', u'鑆': u'zhui4', u'鑇': u'ji1', u'鑈': u'nie4', u'鑉': u'he2', u'鑊': u'huo4', u'鑋': u'qing1', u'鑌': u'bin1', u'鑍': u'ying1', u'鑎': u'gui4', u'鑏': u'ning2', u'鑐': u'xu1', u'鑑': u'jian1', u'鑒': u'jian4', u'鑓': u'qian', u'鑔': u'cha3', u'鑕': u'zhi4', u'鑖': u'mie4', u'鑗': u'li2', u'鑘': u'lei2', u'鑙': u'ji1', u'鑚': u'zuan1', u'鑛': u'kuang4', u'鑜': u'shang3', u'鑝': u'peng2', u'鑞': u'la4', u'鑟': u'du2', u'鑠': u'shuo4', u'鑡': u'chuo4', u'鑢': u'lv4', u'鑣': u'biao1', u'鑤': u'pao2', u'鑥': u'lu3', u'鑦': u'xian', u'鑧': u'kuan', u'鑨': u'long2', u'鑩': u'e4', u'鑪': u'lu2', u'鑫': u'xin1', u'鑬': u'jian4', u'鑭': u'lan2', u'鑮': u'bo2', u'鑯': u'jian1', u'鑰': u'yao4', u'鑱': u'chan2', u'鑲': u'xiang1', u'鑳': u'jian4', u'鑴': u'xi1', u'鑵': u'guan4', u'鑶': u'cang2', u'鑷': u'nie4', u'鑸': u'lei3', u'鑹': u'cuan1', u'鑺': u'qu2', u'鑻': u'pan4', u'鑼': u'luo2', u'鑽': u'zuan1', u'鑾': u'luan2', u'鑿': u'zao2', u'钀': u'nie4', u'钁': u'jue2', u'钂': u'tang3', u'钃': u'zhu2', u'钄': u'lan2', u'钅': u'jin1', u'钆': u'ga2', u'钇': u'yi3', u'针': u'zhen1', u'钉': u'ding4', u'钊': u'zhao1', u'钋': u'po1', u'钌': u'liao3', u'钍': u'tu3', u'钎': u'qian1', u'钏': u'chuan4', u'钐': u'shan1', u'钑': u'sa4', u'钒': u'fan2', u'钓': u'diao4', u'钔': u'men2', u'钕': u'nv3', u'钖': u'yang2', u'钗': u'chai1', u'钘': u'xing2', u'钙': u'gai4', u'钚': u'bu4', u'钛': u'tai4', u'钜': u'ju4', u'钝': u'dun4', u'钞': u'chao1', u'钟': u'zhong1', u'钠': u'na4', u'钡': u'bei4', u'钢': u'gang1', u'钣': u'ban3', u'钤': u'qian2', u'钥': u'yao4', u'钦': u'qin1', u'钧': u'jun1', u'钨': u'wu1', u'钩': u'gou1', u'钪': u'kang4', u'钫': u'fang1', u'钬': u'huo3', u'钭': u'tou3', u'钮': u'niu3', u'钯': u'ba3', u'钰': u'yu4', u'钱': u'qian2', u'钲': u'zheng1', u'钳': u'qian2', u'钴': u'gu3', u'钵': u'bo1', u'钶': u'ke1', u'钷': u'po3', u'钸': u'bu1', u'钹': u'bo2', u'钺': u'yue4', u'钻': u'zuan1', u'钼': u'mu4', u'钽': u'tan3', u'钾': u'jia3', u'钿': u'dian4', u'铀': u'you2', u'铁': u'tie3', u'铂': u'bo2', u'铃': u'ling2', u'铄': u'shuo4', u'铅': u'qian1', u'铆': u'mao3', u'铇': u'bao4', u'铈': u'shi4', u'铉': u'xuan4', u'铊': u'tuo2', u'铋': u'bi4', u'铌': u'ni2', u'铍': u'pi2', u'铎': u'duo2', u'铏': u'xing2', u'铐': u'kao4', u'铑': u'lao3', u'铒': u'er3', u'铓': u'mang2', u'铔': u'ya1', u'铕': u'you3', u'铖': u'cheng2', u'铗': u'jia2', u'铘': u'ye2', u'铙': u'nao2', u'铚': u'zhi4', u'铛': u'cheng1', u'铜': u'tong2', u'铝': u'lv3', u'铞': u'diao4', u'铟': u'yin1', u'铠': u'kai3', u'铡': u'zha2', u'铢': u'zhu1', u'铣': u'xi3', u'铤': u'ting3', u'铥': u'diu1', u'铦': u'xian1', u'铧': u'hua2', u'铨': u'quan2', u'铩': u'sha1', u'铪': u'ha1', u'铫': u'diao4', u'铬': u'ge4', u'铭': u'ming2', u'铮': u'zheng1', u'铯': u'se4', u'铰': u'jiao3', u'铱': u'yi1', u'铲': u'chan3', u'铳': u'chong4', u'铴': u'tang1', u'铵': u'an3', u'银': u'yin2', u'铷': u'ru2', u'铸': u'zhu4', u'铹': u'lao2', u'铺': u'pu1', u'铻': u'wu2', u'铼': u'lai2', u'铽': u'te4', u'链': u'lian4', u'铿': u'keng1', u'销': u'xiao1', u'锁': u'suo3', u'锂': u'li3', u'锃': u'zeng4', u'锄': u'chu2', u'锅': u'guo1', u'锆': u'gao4', u'锇': u'e2', u'锈': u'xiu4', u'锉': u'cuo4', u'锊': u'lue4', u'锋': u'feng1', u'锌': u'xin1', u'锍': u'liu3', u'锎': u'kai1', u'锏': u'jian3', u'锐': u'rui4', u'锑': u'ti1', u'锒': u'lang2', u'锓': u'qin3', u'锔': u'ju2', u'锕': u'a1', u'锖': u'qiang1', u'锗': u'zhe3', u'锘': u'nuo4', u'错': u'cuo4', u'锚': u'mao2', u'锛': u'ben1', u'锜': u'qi2', u'锝': u'de2', u'锞': u'ke4', u'锟': u'kun1', u'锠': u'chang1', u'锡': u'xi1', u'锢': u'gu4', u'锣': u'luo2', u'锤': u'chui2', u'锥': u'zhui1', u'锦': u'jin3', u'锧': u'zhi4', u'锨': u'xian1', u'锩': u'juan3', u'锪': u'huo1', u'锫': u'pei2', u'锬': u'tan2', u'锭': u'ding4', u'键': u'jian4', u'锯': u'ju4', u'锰': u'meng3', u'锱': u'zi1', u'锲': u'qie4', u'锳': u'ying1', u'锴': u'kai3', u'锵': u'qiang1', u'锶': u'si1', u'锷': u'e4', u'锸': u'cha1', u'锹': u'qiao1', u'锺': u'zhong1', u'锻': u'duan4', u'锼': u'sou1', u'锽': u'huang2', u'锾': u'huan2', u'锿': u'ai1', u'镀': u'du4', u'镁': u'mei3', u'镂': u'lou4', u'镃': u'zi1', u'镄': u'fei4', u'镅': u'mei2', u'镆': u'mo4', u'镇': u'zhen4', u'镈': u'bo2', u'镉': u'ge2', u'镊': u'nie4', u'镋': u'tang3', u'镌': u'juan1', u'镍': u'nie4', u'镎': u'na2', u'镏': u'liu2', u'镐': u'gao3', u'镑': u'bang4', u'镒': u'yi4', u'镓': u'jia1', u'镔': u'bin1', u'镕': u'rong2', u'镖': u'biao1', u'镗': u'tang1', u'镘': u'man4', u'镙': u'luo2', u'镚': u'beng4', u'镛': u'yong1', u'镜': u'jing4', u'镝': u'di1', u'镞': u'zu2', u'镟': u'xuan4', u'镠': u'liu2', u'镡': u'tan2', u'镢': u'jue2', u'镣': u'liao4', u'镤': u'pu2', u'镥': u'lu3', u'镦': u'dun1', u'镧': u'lan2', u'镨': u'pu3', u'镩': u'cuan1', u'镪': u'qiang3', u'镫': u'deng4', u'镬': u'huo4', u'镭': u'lei2', u'镮': u'huan2', u'镯': u'zhuo2', u'镰': u'lian2', u'镱': u'yi4', u'镲': u'cha3', u'镳': u'biao1', u'镴': u'la4', u'镵': u'chan2', u'镶': u'xiang1', u'長': u'chang2', u'镸': u'chang2', u'镹': u'jiu3', u'镺': u'ao3', u'镻': u'die2', u'镼': u'jie2', u'镽': u'liao3', u'镾': u'mi2', u'长': u'chang2', u'門': u'men2', u'閁': u'ma4', u'閂': u'shuan1', u'閃': u'shan3', u'閄': u'huo4', u'閅': u'men2', u'閆': u'yan2', u'閇': u'bi4', u'閈': u'han4', u'閉': u'bi4', u'閊': u'ci1ka1ai1lu1', u'開': u'kai1', u'閌': u'kang1', u'閍': u'beng1', u'閎': u'hong2', u'閏': u'run4', u'閐': u'san4', u'閑': u'xian2', u'閒': u'xian2', u'間': u'jian1', u'閔': u'min3', u'閕': u'xia1', u'閖': u'lao4', u'閗': u'dou4', u'閘': u'zha2', u'閙': u'nao4', u'閚': u'zhan1', u'閛': u'peng1', u'閜': u'xia3', u'閝': u'ling2', u'閞': u'bian4', u'閟': u'bi4', u'閠': u'run4', u'閡': u'he2', u'関': u'guan1', u'閣': u'ge2', u'閤': u'he2', u'閥': u'fa2', u'閦': u'chu4', u'閧': u'hong4', u'閨': u'gui1', u'閩': u'min3', u'閪': u'se1', u'閫': u'kun3', u'閬': u'lang2', u'閭': u'lv2', u'閮': u'ting2', u'閯': u'sha4', u'閰': u'ju2', u'閱': u'yue4', u'閲': u'yue4', u'閳': u'chan3', u'閴': u'qu4', u'閵': u'lin4', u'閶': u'chang1', u'閷': u'sha1', u'閸': u'kun3', u'閹': u'yan1', u'閺': u'wen2', u'閻': u'yan2', u'閼': u'e4', u'閽': u'hun1', u'閾': u'yu4', u'閿': u'wen2', u'闀': u'hong4', u'闁': u'bao1', u'闂': u'hong4', u'闃': u'qu4', u'闄': u'yao3', u'闅': u'wen2', u'闆': u'ban3', u'闇': u'an4', u'闈': u'wei2', u'闉': u'yin1', u'闊': u'kuo4', u'闋': u'que4', u'闌': u'lan2', u'闍': u'du1', u'闎': u'quan', u'闏': u'paiying4', u'闐': u'tian2', u'闑': u'nie4', u'闒': u'ta4', u'闓': u'ta4', u'闔': u'he2', u'闕': u'que4', u'闖': u'chuang3', u'闗': u'guan1', u'闘': u'dou4', u'闙': u'qi3', u'闚': u'kui1', u'闛': u'tang2', u'關': u'guan1', u'闝': u'piao2', u'闞': u'kan4', u'闟': u'xi4', u'闠': u'hui4', u'闡': u'chan3', u'闢': u'bi4', u'闣': u'hui4', u'闤': u'huan2', u'闥': u'ta4', u'闦': u'wen2', u'闧': u'wuwu', u'门': u'men2', u'闩': u'shuan1', u'闪': u'shan3', u'闫': u'yan2', u'闬': u'han4', u'闭': u'bi4', u'问': u'wen4', u'闯': u'chuang3', u'闰': u'run4', u'闱': u'wei2', u'闲': u'xian2', u'闳': u'hong2', u'间': u'jian1', u'闵': u'min3', u'闶': u'kang1', u'闷': u'men1', u'闸': u'zha2', u'闹': u'nao4', u'闺': u'gui1', u'闻': u'wen2', u'闼': u'ta4', u'闽': u'min3', u'闾': u'lv2', u'闿': u'kai3', u'阀': u'fa2', u'阁': u'ge2', u'阂': u'he2', u'阃': u'kun3', u'阄': u'jiu1', u'阅': u'yue4', u'阆': u'lang2', u'阇': u'du1', u'阈': u'yu4', u'阉': u'yan1', u'阊': u'chang1', u'阋': u'xi4', u'阌': u'wen2', u'阍': u'hun1', u'阎': u'yan2', u'阏': u'e4', u'阐': u'chan3', u'阑': u'lan2', u'阒': u'qu4', u'阓': u'hui4', u'阔': u'kuo4', u'阕': u'que4', u'阖': u'he2', u'阗': u'tian2', u'阘': u'ta4', u'阙': u'que4', u'阚': u'kan4', u'阛': u'huan2', u'阜': u'fu4', u'阝': u'fu3', u'阞': u'le4', u'队': u'dui4', u'阠': u'xin4', u'阡': u'qian1', u'阢': u'wu4', u'阣': u'yi4', u'阤': u'tuo2', u'阥': u'yin1', u'阦': u'yang2', u'阧': u'dou3', u'阨': u'e4', u'阩': u'sheng1', u'阪': u'ban3', u'阫': u'pei2', u'阬': u'keng1', u'阭': u'yun3', u'阮': u'ruan3', u'阯': u'zhi3', u'阰': u'pi2', u'阱': u'jing3', u'防': u'fang2', u'阳': u'yang2', u'阴': u'yin1', u'阵': u'zhen4', u'阶': u'jie1', u'阷': u'cheng1', u'阸': u'e4', u'阹': u'qu1', u'阺': u'di3', u'阻': u'zu3', u'阼': u'zuo4', u'阽': u'dian4', u'阾': u'lin2', u'阿': u'a1', u'陀': u'tuo2', u'陁': u'tuo2', u'陂': u'bei1', u'陃': u'bing3', u'附': u'fu4', u'际': u'ji4', u'陆': u'lu4', u'陇': u'long3', u'陈': u'chen2', u'陉': u'xing2', u'陊': u'duo4', u'陋': u'lou4', u'陌': u'mo4', u'降': u'jiang4', u'陎': u'shu1', u'陏': u'duo4', u'限': u'xian4', u'陑': u'er2', u'陒': u'gui3', u'陓': u'yu1', u'陔': u'gai1', u'陕': u'shan3', u'陖': u'jun4', u'陗': u'qiao4', u'陘': u'xing2', u'陙': u'chun2', u'陚': u'wu3', u'陛': u'bi4', u'陜': u'shan3', u'陝': u'shan3', u'陞': u'sheng1', u'陟': u'zhi4', u'陠': u'pu1', u'陡': u'dou3', u'院': u'yuan4', u'陣': u'zhen4', u'除': u'chu2', u'陥': u'xian4', u'陦': u'dao3', u'陧': u'nie4', u'陨': u'yun3', u'险': u'xian3', u'陪': u'pei2', u'陫': u'fei4', u'陬': u'zou1', u'陭': u'qi2', u'陮': u'dui4', u'陯': u'lun2', u'陰': u'yin1', u'陱': u'ju1', u'陲': u'chui2', u'陳': u'chen2', u'陴': u'pi2', u'陵': u'ling2', u'陶': u'tao2', u'陷': u'xian4', u'陸': u'lu4', u'陹': u'sheng1', u'険': u'xian3', u'陻': u'yin1', u'陼': u'zhu3', u'陽': u'yang2', u'陾': u'reng2', u'陿': u'xia2', u'隀': u'chong2', u'隁': u'yan4', u'隂': u'yin1', u'隃': u'yu2', u'隄': u'di1', u'隅': u'yu2', u'隆': u'long2', u'隇': u'wei1', u'隈': u'wei1', u'隉': u'nie4', u'隊': u'dui4', u'隋': u'sui2', u'隌': u'an4', u'隍': u'huang2', u'階': u'jie1', u'随': u'sui2', u'隐': u'yin3', u'隑': u'gai1', u'隒': u'yan3', u'隓': u'duo4', u'隔': u'ge2', u'隕': u'yun3', u'隖': u'wu4', u'隗': u'kui2', u'隘': u'ai4', u'隙': u'xi4', u'隚': u'tang2', u'際': u'ji4', u'障': u'zhang4', u'隝': u'dao3', u'隞': u'ao2', u'隟': u'xi4', u'隠': u'yin3', u'隡': u'sa', u'隢': u'rao3', u'隣': u'lin2', u'隤': u'tui2', u'隥': u'deng4', u'隦': u'pi2', u'隧': u'sui4', u'隨': u'sui2', u'隩': u'yu4', u'險': u'xian3', u'隫': u'fen2', u'隬': u'ni3', u'隭': u'er2', u'隮': u'ji1', u'隯': u'dao3', u'隰': u'xi2', u'隱': u'yin3', u'隲': u'zhi4', u'隳': u'hui1', u'隴': u'long3', u'隵': u'xi1', u'隶': u'li4', u'隷': u'li4', u'隸': u'li4', u'隹': u'cui1', u'隺': u'hu2', u'隻': u'zhi1', u'隼': u'sun3', u'隽': u'juan4', u'难': u'nan2', u'隿': u'yi4', u'雀': u'que4', u'雁': u'yan4', u'雂': u'qin2', u'雃': u'jian1', u'雄': u'xiong2', u'雅': u'ya3', u'集': u'ji2', u'雇': u'gu4', u'雈': u'huan2', u'雉': u'zhi4', u'雊': u'gou4', u'雋': u'juan4', u'雌': u'ci2', u'雍': u'yong1', u'雎': u'ju1', u'雏': u'chu2', u'雐': u'hu1', u'雑': u'za2', u'雒': u'luo4', u'雓': u'yu2', u'雔': u'chou2', u'雕': u'diao1', u'雖': u'sui1', u'雗': u'han4', u'雘': u'huo4', u'雙': u'shuang1', u'雚': u'guan4', u'雛': u'chu2', u'雜': u'za2', u'雝': u'yong1', u'雞': u'ji1', u'雟': u'gui1', u'雠': u'chou2', u'雡': u'liu4', u'離': u'li2', u'難': u'nan2', u'雤': u'yu4', u'雥': u'za2', u'雦': u'chou2', u'雧': u'ji2', u'雨': u'yu3', u'雩': u'yu2', u'雪': u'xue3', u'雫': u'na3', u'雬': u'na3', u'雭': u'se4', u'雮': u'mu4', u'雯': u'wen2', u'雰': u'fen1', u'雱': u'pang1', u'雲': u'yun2', u'雳': u'li4', u'雴': u'chi4', u'雵': u'yang1', u'零': u'ling2', u'雷': u'lei2', u'雸': u'an2', u'雹': u'bao2', u'雺': u'wu4', u'電': u'dian4', u'雼': u'dang4', u'雽': u'hu1', u'雾': u'wu4', u'雿': u'diao4', u'需': u'xu1', u'霁': u'ji4', u'霂': u'mu4', u'霃': u'chen2', u'霄': u'xiao1', u'霅': u'zha4', u'霆': u'ting2', u'震': u'zhen4', u'霈': u'pei4', u'霉': u'mei2', u'霊': u'ling2', u'霋': u'qi1', u'霌': u'zhou1', u'霍': u'huo4', u'霎': u'sha4', u'霏': u'fei1', u'霐': u'hong2', u'霑': u'zhan1', u'霒': u'yin1', u'霓': u'ni2', u'霔': u'shu4', u'霕': u'tun2', u'霖': u'lin2', u'霗': u'ling2', u'霘': u'dong4', u'霙': u'ying1', u'霚': u'wu4', u'霛': u'ling2', u'霜': u'shuang1', u'霝': u'ling2', u'霞': u'xia2', u'霟': u'hong2', u'霠': u'yin1', u'霡': u'mai4', u'霢': u'mai4', u'霣': u'yun3', u'霤': u'liu1', u'霥': u'meng4', u'霦': u'bin1', u'霧': u'wu4', u'霨': u'wei4', u'霩': u'kuo4', u'霪': u'yin2', u'霫': u'xi2', u'霬': u'yi4', u'霭': u'ai3', u'霮': u'dan4', u'霯': u'teng4', u'霰': u'xian3', u'霱': u'yu4', u'露': u'lu4', u'霳': u'long2', u'霴': u'dai4', u'霵': u'ji2', u'霶': u'pang1', u'霷': u'yang2', u'霸': u'ba4', u'霹': u'pi1', u'霺': u'wei1', u'霻': u'wuwu', u'霼': u'xi4', u'霽': u'ji4', u'霾': u'mai2', u'霿': u'meng2', u'靀': u'meng2', u'靁': u'lei2', u'靂': u'li4', u'靃': u'huo4', u'靄': u'ai3', u'靅': u'fei4', u'靆': u'dai4', u'靇': u'long2', u'靈': u'ling2', u'靉': u'ai4', u'靊': u'feng1', u'靋': u'li4', u'靌': u'bao3', u'靍': u'he4', u'靎': u'he', u'靏': u'he', u'靐': u'bing4', u'靑': u'qing1', u'青': u'qing1', u'靓': u'jing4', u'靔': u'tian1', u'靕': u'zheng4', u'靖': u'jing4', u'靗': u'cheng1', u'靘': u'qing4', u'静': u'jing4', u'靚': u'jing4', u'靛': u'dian4', u'靜': u'jing4', u'靝': u'tian1', u'非': u'fei1', u'靟': u'fei1', u'靠': u'kao4', u'靡': u'mi2', u'面': u'mian4', u'靣': u'mian4', u'靤': u'pao4', u'靥': u'ye4', u'靦': u'mian3', u'靧': u'hui4', u'靨': u'ye4', u'革': u'ge2', u'靪': u'ding1', u'靫': u'cha2', u'靬': u'qian2', u'靭': u'ren4', u'靮': u'di2', u'靯': u'du4', u'靰': u'wu4', u'靱': u'ren4', u'靲': u'qin2', u'靳': u'jin4', u'靴': u'xue1', u'靵': u'niu3', u'靶': u'ba3', u'靷': u'yin3', u'靸': u'sa3', u'靹': u'na4', u'靺': u'mo4', u'靻': u'zu3', u'靼': u'da2', u'靽': u'ban4', u'靾': u'xie4', u'靿': u'yao4', u'鞀': u'tao2', u'鞁': u'bei4', u'鞂': u'jie1', u'鞃': u'hong2', u'鞄': u'pao2', u'鞅': u'yang1', u'鞆': u'bing', u'鞇': u'yin1', u'鞈': u'ge2', u'鞉': u'tao2', u'鞊': u'jie2', u'鞋': u'xie2', u'鞌': u'an1', u'鞍': u'an1', u'鞎': u'hen2', u'鞏': u'gong3', u'鞐': u'kuo1ha1', u'鞑': u'da2', u'鞒': u'qiao2', u'鞓': u'ting1', u'鞔': u'man2', u'鞕': u'bian1', u'鞖': u'sui1', u'鞗': u'tiao2', u'鞘': u'qiao4', u'鞙': u'xuan1', u'鞚': u'kong4', u'鞛': u'beng3', u'鞜': u'ta4', u'鞝': u'shang4', u'鞞': u'bing3', u'鞟': u'kuo4', u'鞠': u'ju1', u'鞡': u'la', u'鞢': u'xie4', u'鞣': u'rou2', u'鞤': u'bang1', u'鞥': u'eng1', u'鞦': u'qiu1', u'鞧': u'qiu1', u'鞨': u'he2', u'鞩': u'qiao4', u'鞪': u'mu4', u'鞫': u'ju1', u'鞬': u'jian1', u'鞭': u'bian1', u'鞮': u'di1', u'鞯': u'jian1', u'鞰': u'wen1', u'鞱': u'tao1', u'鞲': u'gou1', u'鞳': u'ta4', u'鞴': u'bei4', u'鞵': u'xie2', u'鞶': u'pan2', u'鞷': u'ge2', u'鞸': u'bi4', u'鞹': u'kuo4', u'鞺': u'tang1', u'鞻': u'lou2', u'鞼': u'gui4', u'鞽': u'qiao2', u'鞾': u'xue1', u'鞿': u'ji1', u'韀': u'jian1', u'韁': u'jiang1', u'韂': u'chan4', u'韃': u'da2', u'韄': u'huo4', u'韅': u'xian3', u'韆': u'qian1', u'韇': u'du2', u'韈': u'wa4', u'韉': u'jian1', u'韊': u'lan2', u'韋': u'wei2', u'韌': u'ren4', u'韍': u'fu2', u'韎': u'mei4', u'韏': u'quan4', u'韐': u'ge2', u'韑': u'wei3', u'韒': u'qiao4', u'韓': u'han2', u'韔': u'chang4', u'韕': u'kuo4', u'韖': u'rou3', u'韗': u'yun4', u'韘': u'she4', u'韙': u'wei3', u'韚': u'ge2', u'韛': u'bai4', u'韜': u'tao1', u'韝': u'gou1', u'韞': u'yun4', u'韟': u'gao1', u'韠': u'bi4', u'韡': u'wei3', u'韢': u'sui4', u'韣': u'du2', u'韤': u'wa4', u'韥': u'du2', u'韦': u'wei2', u'韧': u'ren4', u'韨': u'fu2', u'韩': u'han2', u'韪': u'wei3', u'韫': u'yun4', u'韬': u'tao1', u'韭': u'jiu3', u'韮': u'jiu3', u'韯': u'xian1', u'韰': u'xie4', u'韱': u'xian1', u'韲': u'ji1', u'音': u'yin1', u'韴': u'za2', u'韵': u'yun4', u'韶': u'shao2', u'韷': u'le4', u'韸': u'peng2', u'韹': u'huang2', u'韺': u'ying1', u'韻': u'yun4', u'韼': u'peng2', u'韽': u'an1', u'韾': u'yin1', u'響': u'xiang3', u'頀': u'hu4', u'頁': u'ye4', u'頂': u'ding3', u'頃': u'qing3', u'頄': u'qiu2', u'項': u'xiang4', u'順': u'shun4', u'頇': u'han1', u'須': u'xu1', u'頉': u'yi2', u'頊': u'xu1', u'頋': u'e3', u'頌': u'song4', u'頍': u'kui3', u'頎': u'qi2', u'頏': u'hang2', u'預': u'yu4', u'頑': u'wan2', u'頒': u'ban1', u'頓': u'dun4', u'頔': u'di2', u'頕': u'dan1', u'頖': u'pan4', u'頗': u'po1', u'領': u'ling3', u'頙': u'che4', u'頚': u'jing3', u'頛': u'lei4', u'頜': u'he2', u'頝': u'qiao1', u'頞': u'e4', u'頟': u'e2', u'頠': u'wei3', u'頡': u'jie2', u'頢': u'kuo4', u'頣': u'shen3', u'頤': u'yi2', u'頥': u'yi2', u'頦': u'ke1', u'頧': u'dui3', u'頨': u'yu3', u'頩': u'ping1', u'頪': u'lei4', u'頫': u'fu3', u'頬': u'jia2', u'頭': u'tou2', u'頮': u'hui4', u'頯': u'kui2', u'頰': u'jia2', u'頱': u'luo1', u'頲': u'ting3', u'頳': u'cheng1', u'頴': u'ying3', u'頵': u'jun1', u'頶': u'hu2', u'頷': u'han4', u'頸': u'jing3', u'頹': u'tui2', u'頺': u'tui2', u'頻': u'pin2', u'頼': u'lai4', u'頽': u'tui2', u'頾': u'zi1', u'頿': u'zi1', u'顀': u'chui2', u'顁': u'ding4', u'顂': u'lai4', u'顃': u'tan2', u'顄': u'han4', u'顅': u'qian1', u'顆': u'ke1', u'顇': u'cui4', u'顈': u'jiong3', u'顉': u'qin1', u'顊': u'yi2', u'顋': u'sai1', u'題': u'ti2', u'額': u'e2', u'顎': u'e4', u'顏': u'yan2', u'顐': u'wen4', u'顑': u'kan3', u'顒': u'yong2', u'顓': u'zhuan1', u'顔': u'yan2', u'顕': u'xian3', u'顖': u'xin4', u'顗': u'yi3', u'願': u'yuan4', u'顙': u'sang3', u'顚': u'dian1', u'顛': u'dian1', u'顜': u'jiang3', u'顝': u'kui1', u'類': u'lei4', u'顟': u'lao2', u'顠': u'piao3', u'顡': u'wai4', u'顢': u'man1', u'顣': u'cu4', u'顤': u'yao2', u'顥': u'hao4', u'顦': u'qiao2', u'顧': u'gu4', u'顨': u'xun4', u'顩': u'yan3', u'顪': u'hui4', u'顫': u'chan4', u'顬': u'ru2', u'顭': u'meng2', u'顮': u'bin1', u'顯': u'xian3', u'顰': u'pin2', u'顱': u'lu2', u'顲': u'lan3', u'顳': u'nie4', u'顴': u'quan2', u'页': u'ye4', u'顶': u'ding3', u'顷': u'qing3', u'顸': u'han1', u'项': u'xiang4', u'顺': u'shun4', u'须': u'xu1', u'顼': u'xu1', u'顽': u'wan2', u'顾': u'gu4', u'顿': u'dun4', u'颀': u'qi2', u'颁': u'ban1', u'颂': u'song4', u'颃': u'hang2', u'预': u'yu4', u'颅': u'lu2', u'领': u'ling3', u'颇': u'po1', u'颈': u'jing3', u'颉': u'jie2', u'颊': u'jia2', u'颋': u'ting3', u'颌': u'he2', u'颍': u'ying3', u'颎': u'jiong3', u'颏': u'ke1', u'颐': u'yi2', u'频': u'pin2', u'颒': u'hui4', u'颓': u'tui2', u'颔': u'han4', u'颕': u'ying3', u'颖': u'ying3', u'颗': u'ke1', u'题': u'ti2', u'颙': u'yong2', u'颚': u'e4', u'颛': u'zhuan1', u'颜': u'yan2', u'额': u'e2', u'颞': u'nie4', u'颟': u'man1', u'颠': u'dian1', u'颡': u'sang3', u'颢': u'hao4', u'颣': u'lei4', u'颤': u'chan4', u'颥': u'ru2', u'颦': u'pin2', u'颧': u'quan2', u'風': u'feng1', u'颩': u'diu1', u'颪': u'gua', u'颫': u'fu2', u'颬': u'xia1', u'颭': u'zhan3', u'颮': u'biao1', u'颯': u'sa4', u'颰': u'ba2', u'颱': u'tai2', u'颲': u'lie4', u'颳': u'gua1', u'颴': u'xuan4', u'颵': u'xiao1', u'颶': u'ju4', u'颷': u'biao1', u'颸': u'si1', u'颹': u'wei3', u'颺': u'yang2', u'颻': u'yao2', u'颼': u'sou1', u'颽': u'kai3', u'颾': u'sao1', u'颿': u'fan1', u'飀': u'liu2', u'飁': u'xi2', u'飂': u'liao2', u'飃': u'piao1', u'飄': u'piao1', u'飅': u'liu2', u'飆': u'biao1', u'飇': u'biao1', u'飈': u'biao1', u'飉': u'liao2', u'飊': u'biao1', u'飋': u'se4', u'飌': u'feng1', u'飍': u'xiu1', u'风': u'feng1', u'飏': u'yang2', u'飐': u'zhan3', u'飑': u'biao1', u'飒': u'sa4', u'飓': u'ju4', u'飔': u'si1', u'飕': u'sou1', u'飖': u'yao2', u'飗': u'liu2', u'飘': u'piao1', u'飙': u'biao1', u'飚': u'biao1', u'飛': u'fei1', u'飜': u'fan1', u'飝': u'fei1', u'飞': u'fei1', u'食': u'shi2', u'飠': u'shi2', u'飡': u'can1', u'飢': u'ji1', u'飣': u'ding4', u'飤': u'si4', u'飥': u'tuo1', u'飦': u'zhan1', u'飧': u'sun1', u'飨': u'xiang3', u'飩': u'tun2', u'飪': u'ren4', u'飫': u'yu4', u'飬': u'yang3', u'飭': u'chi4', u'飮': u'yin3', u'飯': u'fan4', u'飰': u'fan4', u'飱': u'can1', u'飲': u'yin3', u'飳': u'zhu4', u'飴': u'yi2', u'飵': u'zuo4', u'飶': u'bi4', u'飷': u'jie3', u'飸': u'tao1', u'飹': u'bao3', u'飺': u'ci2', u'飻': u'tie4', u'飼': u'si4', u'飽': u'bao3', u'飾': u'shi4', u'飿': u'duo4', u'餀': u'hai4', u'餁': u'ren4', u'餂': u'tian3', u'餃': u'jiao3', u'餄': u'he2', u'餅': u'bing3', u'餆': u'yao2', u'餇': u'tong2', u'餈': u'ci2', u'餉': u'xiang3', u'養': u'yang3', u'餋': u'juan4', u'餌': u'er3', u'餍': u'yan4', u'餎': u'ge1', u'餏': u'xi1', u'餐': u'can1', u'餑': u'bo1', u'餒': u'nei3', u'餓': u'e4', u'餔': u'bu1', u'餕': u'jun4', u'餖': u'dou4', u'餗': u'su4', u'餘': u'yu2', u'餙': u'shi4', u'餚': u'yao2', u'餛': u'hun2', u'餜': u'guo3', u'餝': u'shi4', u'餞': u'jian4', u'餟': u'chuo4', u'餠': u'bing3', u'餡': u'xian4', u'餢': u'bu4', u'餣': u'ye4', u'餤': u'dan4', u'餥': u'fei1', u'餦': u'zhang1', u'餧': u'nei3', u'館': u'guan3', u'餩': u'e4', u'餪': u'nuan3', u'餫': u'hun2', u'餬': u'hu2', u'餭': u'huang2', u'餮': u'tie4', u'餯': u'hui4', u'餰': u'jian1', u'餱': u'hou2', u'餲': u'ai4', u'餳': u'tang2', u'餴': u'fen1', u'餵': u'wei4', u'餶': u'gu3', u'餷': u'cha1', u'餸': u'song4', u'餹': u'tang2', u'餺': u'bo2', u'餻': u'gao1', u'餼': u'xi4', u'餽': u'kui4', u'餾': u'liu2', u'餿': u'sou1', u'饀': u'tao2', u'饁': u'ye4', u'饂': u'wen', u'饃': u'mo2', u'饄': u'tang2', u'饅': u'man2', u'饆': u'bi4', u'饇': u'yu4', u'饈': u'xiu1', u'饉': u'jin3', u'饊': u'san3', u'饋': u'kui4', u'饌': u'zhuan4', u'饍': u'shan4', u'饎': u'xi1', u'饏': u'dan4', u'饐': u'yi4', u'饑': u'ji1', u'饒': u'rao2', u'饓': u'cheng1', u'饔': u'yong1', u'饕': u'tao1', u'饖': u'wei4', u'饗': u'xiang3', u'饘': u'zhan1', u'饙': u'fen1', u'饚': u'hai4', u'饛': u'meng2', u'饜': u'yan4', u'饝': u'mo2', u'饞': u'chan2', u'饟': u'xiang3', u'饠': u'luo2', u'饡': u'zan4', u'饢': u'nang2', u'饣': u'shi2', u'饤': u'ding4', u'饥': u'ji1', u'饦': u'tuo1', u'饧': u'tang2', u'饨': u'tun2', u'饩': u'xi4', u'饪': u'ren4', u'饫': u'yu4', u'饬': u'chi4', u'饭': u'fan4', u'饮': u'yin3', u'饯': u'jian4', u'饰': u'shi4', u'饱': u'bao3', u'饲': u'si4', u'饳': u'duo4', u'饴': u'yi2', u'饵': u'er3', u'饶': u'rao2', u'饷': u'xiang3', u'饸': u'he2', u'饹': u'ge1', u'饺': u'jiao3', u'饻': u'xi1', u'饼': u'bing3', u'饽': u'bo1', u'饾': u'dou4', u'饿': u'e4', u'馀': u'yu2', u'馁': u'nei3', u'馂': u'jun4', u'馃': u'guo3', u'馄': u'hun2', u'馅': u'xian4', u'馆': u'guan3', u'馇': u'cha1', u'馈': u'kui4', u'馉': u'gu3', u'馊': u'sou1', u'馋': u'chan2', u'馌': u'ye4', u'馍': u'mo2', u'馎': u'bo2', u'馏': u'liu2', u'馐': u'xiu1', u'馑': u'jin3', u'馒': u'man2', u'馓': u'san3', u'馔': u'zhuan4', u'馕': u'nang2', u'首': u'shou3', u'馗': u'kui2', u'馘': u'guo2', u'香': u'xiang1', u'馚': u'fen1', u'馛': u'bo2', u'馜': u'ni2', u'馝': u'bi4', u'馞': u'bo2', u'馟': u'tu2', u'馠': u'han1', u'馡': u'fei1', u'馢': u'jian1', u'馣': u'an1', u'馤': u'ai4', u'馥': u'fu4', u'馦': u'xian1', u'馧': u'yun1', u'馨': u'xin1', u'馩': u'fen2', u'馪': u'pin1', u'馫': u'xin1', u'馬': u'ma3', u'馭': u'yu4', u'馮': u'feng2', u'馯': u'han4', u'馰': u'di2', u'馱': u'tuo2', u'馲': u'tuo1', u'馳': u'chi2', u'馴': u'xun4', u'馵': u'zhu4', u'馶': u'zhi1', u'馷': u'pei4', u'馸': u'xin4', u'馹': u'ri4', u'馺': u'sa4', u'馻': u'yun3', u'馼': u'wen2', u'馽': u'zhi2', u'馾': u'dan3', u'馿': u'lu2', u'駀': u'you2', u'駁': u'bo2', u'駂': u'bao3', u'駃': u'jue2', u'駄': u'tuo2', u'駅': u'yi4', u'駆': u'qu1', u'駇': u'wen2', u'駈': u'qu1', u'駉': u'jiong1', u'駊': u'po3', u'駋': u'zhao1', u'駌': u'yuan1', u'駍': u'peng1', u'駎': u'zhou4', u'駏': u'ju4', u'駐': u'zhu4', u'駑': u'nu2', u'駒': u'ju1', u'駓': u'pi1', u'駔': u'zang3', u'駕': u'jia4', u'駖': u'ling2', u'駗': u'zhen3', u'駘': u'dai4', u'駙': u'fu4', u'駚': u'yang3', u'駛': u'shi3', u'駜': u'bi4', u'駝': u'tuo2', u'駞': u'tuo2', u'駟': u'si4', u'駠': u'liu2', u'駡': u'ma4', u'駢': u'pian2', u'駣': u'tao2', u'駤': u'zhi4', u'駥': u'rong2', u'駦': u'teng2', u'駧': u'dong4', u'駨': u'xun2', u'駩': u'quan2', u'駪': u'shen1', u'駫': u'jiong1', u'駬': u'er3', u'駭': u'hai4', u'駮': u'bo2', u'駯': u'zhu1', u'駰': u'yin1', u'駱': u'luo4', u'駲': u'zhou', u'駳': u'dan4', u'駴': u'hai4', u'駵': u'liu2', u'駶': u'ju2', u'駷': u'song3', u'駸': u'qin1', u'駹': u'mang2', u'駺': u'liang2', u'駻': u'han4', u'駼': u'tu2', u'駽': u'xuan1', u'駾': u'tui4', u'駿': u'jun4', u'騀': u'e3', u'騁': u'cheng3', u'騂': u'xing1', u'騃': u'ai2', u'騄': u'lu4', u'騅': u'zhui1', u'騆': u'zhou1', u'騇': u'she4', u'騈': u'pian2', u'騉': u'kun1', u'騊': u'tao2', u'騋': u'lai2', u'騌': u'zong1', u'騍': u'ke4', u'騎': u'qi2', u'騏': u'qi2', u'騐': u'yan4', u'騑': u'fei1', u'騒': u'sao1', u'験': u'yan4', u'騔': u'ge2', u'騕': u'yao3', u'騖': u'wu4', u'騗': u'pian4', u'騘': u'cong1', u'騙': u'pian4', u'騚': u'qian2', u'騛': u'fei1', u'騜': u'huang2', u'騝': u'qian2', u'騞': u'huo1', u'騟': u'yu2', u'騠': u'ti2', u'騡': u'quan2', u'騢': u'xia2', u'騣': u'zong1', u'騤': u'kui2', u'騥': u'rou2', u'騦': u'si1', u'騧': u'gua1', u'騨': u'tuo2', u'騩': u'gui1', u'騪': u'sou1', u'騫': u'qian1', u'騬': u'cheng2', u'騭': u'zhi4', u'騮': u'liu2', u'騯': u'peng2', u'騰': u'teng2', u'騱': u'xi2', u'騲': u'cao3', u'騳': u'du2', u'騴': u'yan4', u'騵': u'yuan2', u'騶': u'zou1', u'騷': u'sao1', u'騸': u'shan4', u'騹': u'qi2', u'騺': u'zhi4', u'騻': u'shuang1', u'騼': u'lu4', u'騽': u'xi2', u'騾': u'luo2', u'騿': u'zhang1', u'驀': u'mo4', u'驁': u'ao4', u'驂': u'can1', u'驃': u'piao4', u'驄': u'cong1', u'驅': u'qu1', u'驆': u'bi4', u'驇': u'zhi4', u'驈': u'yu4', u'驉': u'xu1', u'驊': u'hua2', u'驋': u'bo1', u'驌': u'su4', u'驍': u'xiao1', u'驎': u'lin2', u'驏': u'chan3', u'驐': u'dun1', u'驑': u'liu2', u'驒': u'tuo2', u'驓': u'ceng2', u'驔': u'dian4', u'驕': u'jiao1', u'驖': u'tie3', u'驗': u'yan4', u'驘': u'luo2', u'驙': u'zhan1', u'驚': u'jing1', u'驛': u'yi4', u'驜': u'ye4', u'驝': u'tuo2', u'驞': u'pin1', u'驟': u'zhou4', u'驠': u'yan4', u'驡': u'long2', u'驢': u'lv2', u'驣': u'teng2', u'驤': u'xiang1', u'驥': u'ji4', u'驦': u'shuang1', u'驧': u'ju2', u'驨': u'xi2', u'驩': u'huan1', u'驪': u'li2', u'驫': u'biao1', u'马': u'ma3', u'驭': u'yu4', u'驮': u'tuo2', u'驯': u'xun4', u'驰': u'chi2', u'驱': u'qu1', u'驲': u'ri4', u'驳': u'bo2', u'驴': u'lv2', u'驵': u'zang3', u'驶': u'shi3', u'驷': u'si4', u'驸': u'fu4', u'驹': u'ju1', u'驺': u'zou1', u'驻': u'zhu4', u'驼': u'tuo2', u'驽': u'nu2', u'驾': u'jia4', u'驿': u'yi4', u'骀': u'dai4', u'骁': u'xiao1', u'骂': u'ma4', u'骃': u'yin1', u'骄': u'jiao1', u'骅': u'hua2', u'骆': u'luo4', u'骇': u'hai4', u'骈': u'pian2', u'骉': u'biao1', u'骊': u'li2', u'骋': u'cheng3', u'验': u'yan4', u'骍': u'xing1', u'骎': u'qin1', u'骏': u'jun4', u'骐': u'qi2', u'骑': u'qi2', u'骒': u'ke4', u'骓': u'zhui1', u'骔': u'zong1', u'骕': u'su4', u'骖': u'can1', u'骗': u'pian4', u'骘': u'zhi4', u'骙': u'kui2', u'骚': u'sao1', u'骛': u'wu4', u'骜': u'ao4', u'骝': u'liu2', u'骞': u'qian1', u'骟': u'shan4', u'骠': u'piao4', u'骡': u'luo2', u'骢': u'cong1', u'骣': u'chan3', u'骤': u'zhou4', u'骥': u'ji4', u'骦': u'shuang1', u'骧': u'xiang1', u'骨': u'gu3', u'骩': u'wei3', u'骪': u'wei3', u'骫': u'wei3', u'骬': u'yu2', u'骭': u'gan4', u'骮': u'yi4', u'骯': u'ang1', u'骰': u'tou2', u'骱': u'jie4', u'骲': u'bao4', u'骳': u'bei4', u'骴': u'ci1', u'骵': u'ti3', u'骶': u'di3', u'骷': u'ku1', u'骸': u'hai2', u'骹': u'qiao1', u'骺': u'hou2', u'骻': u'da4', u'骼': u'ge2', u'骽': u'tui3', u'骾': u'geng3', u'骿': u'pian2', u'髀': u'bi4', u'髁': u'ke1', u'髂': u'qia4', u'髃': u'yu2', u'髄': u'sui2', u'髅': u'lou2', u'髆': u'bo2', u'髇': u'xiao1', u'髈': u'bang3', u'髉': u'bo2', u'髊': u'ci1', u'髋': u'kuan1', u'髌': u'bin4', u'髍': u'mo2', u'髎': u'liao2', u'髏': u'lou2', u'髐': u'xiao1', u'髑': u'du2', u'髒': u'zang1', u'髓': u'sui3', u'體': u'ti3', u'髕': u'bin4', u'髖': u'kuan1', u'髗': u'lu2', u'高': u'gao1', u'髙': u'gao1', u'髚': u'qiao4', u'髛': u'kao1', u'髜': u'qiao3', u'髝': u'lao2', u'髞': u'sao4', u'髟': u'biao1', u'髠': u'kun1', u'髡': u'kun1', u'髢': u'di2', u'髣': u'fang3', u'髤': u'xiu1', u'髥': u'ran2', u'髦': u'mao2', u'髧': u'dan4', u'髨': u'kun1', u'髩': u'bin4', u'髪': u'fa4', u'髫': u'tiao2', u'髬': u'pi1', u'髭': u'zi1', u'髮': u'fa1', u'髯': u'ran2', u'髰': u'ti4', u'髱': u'bao4', u'髲': u'bi4', u'髳': u'mao2', u'髴': u'fu2', u'髵': u'er2', u'髶': u'er4', u'髷': u'qu1', u'髸': u'gong1', u'髹': u'xiu1', u'髺': u'kuo4', u'髻': u'ji4', u'髼': u'peng2', u'髽': u'zhua1', u'髾': u'shao1', u'髿': u'sha1', u'鬀': u'ti4', u'鬁': u'li4', u'鬂': u'bin4', u'鬃': u'zong1', u'鬄': u'ti4', u'鬅': u'peng2', u'鬆': u'song1', u'鬇': u'zheng1', u'鬈': u'quan2', u'鬉': u'zong1', u'鬊': u'shun4', u'鬋': u'jian3', u'鬌': u'duo3', u'鬍': u'hu2', u'鬎': u'la4', u'鬏': u'jiu1', u'鬐': u'qi2', u'鬑': u'lian2', u'鬒': u'zhen3', u'鬓': u'bin4', u'鬔': u'peng2', u'鬕': u'ma4', u'鬖': u'san1', u'鬗': u'man2', u'鬘': u'man2', u'鬙': u'seng1', u'鬚': u'xu1', u'鬛': u'lie4', u'鬜': u'qian1', u'鬝': u'qian1', u'鬞': u'nong2', u'鬟': u'huan2', u'鬠': u'kuo4', u'鬡': u'ning2', u'鬢': u'bin4', u'鬣': u'lie4', u'鬤': u'rang2', u'鬥': u'dou4', u'鬦': u'dou4', u'鬧': u'nao4', u'鬨': u'hong3', u'鬩': u'xi4', u'鬪': u'dou4', u'鬫': u'kan4', u'鬬': u'dou4', u'鬭': u'dou4', u'鬮': u'jiu1', u'鬯': u'chang4', u'鬰': u'yu4', u'鬱': u'yu4', u'鬲': u'ge2', u'鬳': u'yan4', u'鬴': u'fu3', u'鬵': u'zeng4', u'鬶': u'gui1', u'鬷': u'zong1', u'鬸': u'liu4', u'鬹': u'gui1', u'鬺': u'shang1', u'鬻': u'yu4', u'鬼': u'gui3', u'鬽': u'mei4', u'鬾': u'ji4', u'鬿': u'qi2', u'魀': u'ga4', u'魁': u'kui2', u'魂': u'hun2', u'魃': u'ba2', u'魄': u'po4', u'魅': u'mei4', u'魆': u'yu4', u'魇': u'yan3', u'魈': u'xiao1', u'魉': u'liang3', u'魊': u'yu4', u'魋': u'tui2', u'魌': u'qi1', u'魍': u'wang3', u'魎': u'liang3', u'魏': u'wei4', u'魐': u'gan1', u'魑': u'chi1', u'魒': u'piao1', u'魓': u'bi4', u'魔': u'mo2', u'魕': u'ji1', u'魖': u'xu1', u'魗': u'chou3', u'魘': u'yan3', u'魙': u'zhan1', u'魚': u'yu2', u'魛': u'dao1', u'魜': u'ren2', u'魝': u'ji4', u'魞': u'ai4li4', u'魟': u'hong2', u'魠': u'tuo1', u'魡': u'diao4', u'魢': u'ji3', u'魣': u'xu4', u'魤': u'e2', u'魥': u'ji4', u'魦': u'sha1', u'魧': u'hang2', u'魨': u'tun2', u'魩': u'mo4', u'魪': u'jie4', u'魫': u'shen3', u'魬': u'ban3', u'魭': u'yuan2', u'魮': u'pi2', u'魯': u'lu3', u'魰': u'wen2', u'魱': u'hu2', u'魲': u'lu2', u'魳': u'za1', u'魴': u'fang2', u'魵': u'fen2', u'魶': u'na4', u'魷': u'you2', u'魸': u'na3ma1zi1', u'魹': u'mo', u'魺': u'he2', u'魻': u'xia2', u'魼': u'qu1', u'魽': u'han1', u'魾': u'pi1', u'魿': u'ling2', u'鮀': u'tuo2', u'鮁': u'ba4', u'鮂': u'qiu2', u'鮃': u'ping2', u'鮄': u'fu2', u'鮅': u'bi4', u'鮆': u'ci3', u'鮇': u'wei4', u'鮈': u'ju1', u'鮉': u'diao1', u'鮊': u'bo2', u'鮋': u'you2', u'鮌': u'gun3', u'鮍': u'pi2', u'鮎': u'nian2', u'鮏': u'xing1', u'鮐': u'tai2', u'鮑': u'bao4', u'鮒': u'fu4', u'鮓': u'zha3', u'鮔': u'ju4', u'鮕': u'gu1', u'鮖': u'shi', u'鮗': u'dong1', u'鮘': u'chou', u'鮙': u'ta3', u'鮚': u'jie2', u'鮛': u'shu1', u'鮜': u'hou4', u'鮝': u'xiang3', u'鮞': u'er2', u'鮟': u'an1', u'鮠': u'wei2', u'鮡': u'zhao4', u'鮢': u'zhu1', u'鮣': u'yin4', u'鮤': u'lie4', u'鮥': u'luo4', u'鮦': u'tong2', u'鮧': u'yi2', u'鮨': u'yi4', u'鮩': u'bing4', u'鮪': u'wei3', u'鮫': u'jiao1', u'鮬': u'ku1', u'鮭': u'gui1', u'鮮': u'xian1', u'鮯': u'ge2', u'鮰': u'hui2', u'鮱': u'luo3la1', u'鮲': u'ma1tai4', u'鮳': u'kao4', u'鮴': u'xiu', u'鮵': u'tuo1', u'鮶': u'jun1', u'鮷': u'ti2', u'鮸': u'mian3', u'鮹': u'shao1', u'鮺': u'zha3', u'鮻': u'suo1', u'鮼': u'qin1', u'鮽': u'yu2', u'鮾': u'nei3', u'鮿': u'zhe2', u'鯀': u'gun3', u'鯁': u'geng3', u'鯂': u'su1', u'鯃': u'wu2', u'鯄': u'qiu2', u'鯅': u'shan1', u'鯆': u'pu1', u'鯇': u'huan4', u'鯈': u'tiao2', u'鯉': u'li3', u'鯊': u'sha1', u'鯋': u'sha1', u'鯌': u'kao4', u'鯍': u'meng2', u'鯎': u'cheng', u'鯏': u'li', u'鯐': u'si3ba1xi1li1', u'鯑': u'ka3zi1nou4ke', u'鯒': u'yong3', u'鯓': u'shen1', u'鯔': u'zi1', u'鯕': u'qi2', u'鯖': u'qing1', u'鯗': u'xiang3', u'鯘': u'nei3', u'鯙': u'chun2', u'鯚': u'ji4', u'鯛': u'diao1', u'鯜': u'qie4', u'鯝': u'gu4', u'鯞': u'zhou3', u'鯟': u'dong1', u'鯠': u'lai2', u'鯡': u'fei1', u'鯢': u'ni2', u'鯣': u'yi4', u'鯤': u'kun1', u'鯥': u'lu4', u'鯦': u'jiu4', u'鯧': u'chang1', u'鯨': u'jing1', u'鯩': u'lun2', u'鯪': u'ling2', u'鯫': u'zou1', u'鯬': u'li2', u'鯭': u'meng3', u'鯮': u'zong1', u'鯯': u'zhi4', u'鯰': u'nian2', u'鯱': u'xia4qi1huo1kuo1', u'鯲': u'duo3ji1ya1wu3', u'鯳': u'shu1ke1duo1da1', u'鯴': u'shi1', u'鯵': u'shen1', u'鯶': u'huan4', u'鯷': u'ti2', u'鯸': u'hou2', u'鯹': u'xing1', u'鯺': u'zhu1', u'鯻': u'la4', u'鯼': u'zong1', u'鯽': u'ji4', u'鯾': u'bian1', u'鯿': u'bian1', u'鰀': u'huan4', u'鰁': u'quan2', u'鰂': u'zei2', u'鰃': u'wei1', u'鰄': u'wei1', u'鰅': u'yu2', u'鰆': u'chun1', u'鰇': u'rou2', u'鰈': u'die2', u'鰉': u'huang2', u'鰊': u'lian4', u'鰋': u'yan3', u'鰌': u'qiu1', u'鰍': u'qiu1', u'鰎': u'jian3', u'鰏': u'bi1', u'鰐': u'e4', u'鰑': u'yang2', u'鰒': u'fu4', u'鰓': u'sai1', u'鰔': u'jian1', u'鰕': u'xia1', u'鰖': u'tuo3', u'鰗': u'hu2', u'鰘': u'shi', u'鰙': u'ruo4', u'鰚': u'ha3la1', u'鰛': u'wen1', u'鰜': u'jian1', u'鰝': u'hao4', u'鰞': u'wu1', u'鰟': u'pang2', u'鰠': u'sao1', u'鰡': u'liu2', u'鰢': u'ma3', u'鰣': u'shi2', u'鰤': u'shi1', u'鰥': u'guan1', u'鰦': u'zi1', u'鰧': u'teng2', u'鰨': u'ta3', u'鰩': u'yao2', u'鰪': u'e4', u'鰫': u'yong2', u'鰬': u'qian2', u'鰭': u'qi2', u'鰮': u'wen1', u'鰯': u'ruo4', u'鰰': u'ha1ta1ha1ta1', u'鰱': u'lian2', u'鰲': u'ao2', u'鰳': u'le4', u'鰴': u'hui1', u'鰵': u'min3', u'鰶': u'ji4', u'鰷': u'tiao2', u'鰸': u'qu1', u'鰹': u'jian1', u'鰺': u'shen1', u'鰻': u'man2', u'鰼': u'xi2', u'鰽': u'qiu2', u'鰾': u'biao4', u'鰿': u'ji4', u'鱀': u'ji4', u'鱁': u'zhu2', u'鱂': u'jiang1', u'鱃': u'xiu1', u'鱄': u'zhuan1', u'鱅': u'yong1', u'鱆': u'zhang1', u'鱇': u'kang1', u'鱈': u'xue3', u'鱉': u'bie1', u'鱊': u'yu4', u'鱋': u'qu1', u'鱌': u'xiang4', u'鱍': u'bo1', u'鱎': u'jiao3', u'鱏': u'xun2', u'鱐': u'su4', u'鱑': u'huang2', u'鱒': u'zun1', u'鱓': u'shan4', u'鱔': u'shan4', u'鱕': u'fan1', u'鱖': u'gui4', u'鱗': u'lin2', u'鱘': u'xun2', u'鱙': u'yao2', u'鱚': u'xi3', u'鱛': u'ai1suo3', u'鱜': u'ao4', u'鱝': u'fen4', u'鱞': u'guan1', u'鱟': u'hou4', u'鱠': u'kuai4', u'鱡': u'zei2', u'鱢': u'sao1', u'鱣': u'zhan1', u'鱤': u'gan3', u'鱥': u'gui4', u'鱦': u'ying4', u'鱧': u'li3', u'鱨': u'chang2', u'鱩': u'ha3ta1ha1ta1', u'鱪': u'se', u'鱫': u'ai', u'鱬': u'ru2', u'鱭': u'ji4', u'鱮': u'xu4', u'鱯': u'hu4', u'鱰': u'shu', u'鱱': u'li3', u'鱲': u'lie4', u'鱳': u'le4', u'鱴': u'mie4', u'鱵': u'zhen1', u'鱶': u'xiang3', u'鱷': u'e4', u'鱸': u'lu2', u'鱹': u'guan4', u'鱺': u'li2', u'鱻': u'xian1', u'鱼': u'yu2', u'鱽': u'dao1', u'鱾': u'ji3', u'鱿': u'you2', u'鲀': u'tun2', u'鲁': u'lu3', u'鲂': u'fang2', u'鲃': u'ba1', u'鲄': u'he2', u'鲅': u'ba4', u'鲆': u'ping2', u'鲇': u'nian2', u'鲈': u'lu2', u'鲉': u'you2', u'鲊': u'zha3', u'鲋': u'fu4', u'鲌': u'bo2', u'鲍': u'bao4', u'鲎': u'hou4', u'鲏': u'pi2', u'鲐': u'tai2', u'鲑': u'gui1', u'鲒': u'jie2', u'鲓': u'kao4', u'鲔': u'wei3', u'鲕': u'er2', u'鲖': u'tong2', u'鲗': u'zei2', u'鲘': u'hou4', u'鲙': u'kuai4', u'鲚': u'ji4', u'鲛': u'jiao1', u'鲜': u'xian1', u'鲝': u'zha3', u'鲞': u'xiang3', u'鲟': u'xun2', u'鲠': u'geng3', u'鲡': u'li2', u'鲢': u'lian2', u'鲣': u'jian1', u'鲤': u'li3', u'鲥': u'shi2', u'鲦': u'tiao2', u'鲧': u'gun3', u'鲨': u'sha1', u'鲩': u'huan4', u'鲪': u'jun1', u'鲫': u'ji4', u'鲬': u'yong3', u'鲭': u'qing1', u'鲮': u'ling2', u'鲯': u'qi2', u'鲰': u'zou1', u'鲱': u'fei1', u'鲲': u'kun1', u'鲳': u'chang1', u'鲴': u'gu4', u'鲵': u'ni2', u'鲶': u'nian2', u'鲷': u'diao1', u'鲸': u'jing1', u'鲹': u'shen1', u'鲺': u'shi1', u'鲻': u'zi1', u'鲼': u'fen4', u'鲽': u'die2', u'鲾': u'bi1', u'鲿': u'chang2', u'鳀': u'ti2', u'鳁': u'wen1', u'鳂': u'wei1', u'鳃': u'sai1', u'鳄': u'e4', u'鳅': u'qiu1', u'鳆': u'fu4', u'鳇': u'huang2', u'鳈': u'quan2', u'鳉': u'jiang1', u'鳊': u'bian1', u'鳋': u'sao1', u'鳌': u'ao2', u'鳍': u'qi2', u'鳎': u'ta3', u'鳏': u'guan1', u'鳐': u'yao2', u'鳑': u'pang2', u'鳒': u'jian1', u'鳓': u'le4', u'鳔': u'biao4', u'鳕': u'xue3', u'鳖': u'bie1', u'鳗': u'man2', u'鳘': u'min3', u'鳙': u'yong1', u'鳚': u'wei4', u'鳛': u'xi2', u'鳜': u'gui4', u'鳝': u'shan4', u'鳞': u'lin2', u'鳟': u'zun1', u'鳠': u'hu4', u'鳡': u'gan3', u'鳢': u'li3', u'鳣': u'zhan1', u'鳤': u'guan3', u'鳥': u'niao3', u'鳦': u'yi3', u'鳧': u'fu2', u'鳨': u'li4', u'鳩': u'jiu1', u'鳪': u'bu2', u'鳫': u'yan4', u'鳬': u'fu2', u'鳭': u'diao1', u'鳮': u'ji1', u'鳯': u'feng4', u'鳰': u'ru', u'鳱': u'gan1', u'鳲': u'shi1', u'鳳': u'feng4', u'鳴': u'ming2', u'鳵': u'bao3', u'鳶': u'yuan1', u'鳷': u'zhi1', u'鳸': u'hu4', u'鳹': u'qin2', u'鳺': u'fu1', u'鳻': u'ban1', u'鳼': u'wen2', u'鳽': u'jian1', u'鳾': u'shi1', u'鳿': u'yu4', u'鴀': u'fou3', u'鴁': u'yao1', u'鴂': u'jue2', u'鴃': u'jue2', u'鴄': u'pi3', u'鴅': u'huan1', u'鴆': u'zhen4', u'鴇': u'bao3', u'鴈': u'yan4', u'鴉': u'ya1', u'鴊': u'zheng4', u'鴋': u'fang1', u'鴌': u'feng4', u'鴍': u'wen2', u'鴎': u'ou1', u'鴏': u'dai4', u'鴐': u'jia1', u'鴑': u'ru2', u'鴒': u'ling2', u'鴓': u'mie4', u'鴔': u'fu2', u'鴕': u'tuo2', u'鴖': u'min2', u'鴗': u'li4', u'鴘': u'bian3', u'鴙': u'zhi4', u'鴚': u'ge1', u'鴛': u'yuan1', u'鴜': u'ci2', u'鴝': u'qu2', u'鴞': u'xiao1', u'鴟': u'chi1', u'鴠': u'dan4', u'鴡': u'ju1', u'鴢': u'yao1', u'鴣': u'gu1', u'鴤': u'zhong1', u'鴥': u'yu4', u'鴦': u'yang1', u'鴧': u'yu4', u'鴨': u'ya1', u'鴩': u'die2', u'鴪': u'yu4', u'鴫': u'tian', u'鴬': u'ying1', u'鴭': u'dui1', u'鴮': u'wu1', u'鴯': u'er2', u'鴰': u'gua1', u'鴱': u'ai4', u'鴲': u'zhi1', u'鴳': u'yan4', u'鴴': u'heng2', u'鴵': u'xiao1', u'鴶': u'jia2', u'鴷': u'lie4', u'鴸': u'zhu1', u'鴹': u'yang2', u'鴺': u'yi2', u'鴻': u'hong2', u'鴼': u'lu4', u'鴽': u'ru2', u'鴾': u'mou2', u'鴿': u'ge1', u'鵀': u'ren2', u'鵁': u'jiao1', u'鵂': u'xiu1', u'鵃': u'zhou1', u'鵄': u'chi1', u'鵅': u'luo4', u'鵆': u'qi3duo1li1', u'鵇': u'tuo3', u'鵈': u'e', u'鵉': u'luan2', u'鵊': u'jia2', u'鵋': u'ji4', u'鵌': u'tu2', u'鵍': u'huan1', u'鵎': u'tuo2', u'鵏': u'bu3', u'鵐': u'wu2', u'鵑': u'juan1', u'鵒': u'yu4', u'鵓': u'bo2', u'鵔': u'jun4', u'鵕': u'jun4', u'鵖': u'bi1', u'鵗': u'xi1', u'鵘': u'jun4', u'鵙': u'ju2', u'鵚': u'tu1', u'鵛': u'jing4', u'鵜': u'ti2', u'鵝': u'e2', u'鵞': u'e2', u'鵟': u'kuang2', u'鵠': u'hu2', u'鵡': u'wu3', u'鵢': u'shen1', u'鵣': u'lai4', u'鵤': u'zan1', u'鵥': u'ka3kai1si1', u'鵦': u'lu4', u'鵧': u'pi2', u'鵨': u'shu1', u'鵩': u'fu2', u'鵪': u'an1', u'鵫': u'zhuo2', u'鵬': u'peng2', u'鵭': u'qin2', u'鵮': u'qian1', u'鵯': u'bei1', u'鵰': u'diao1', u'鵱': u'lu4', u'鵲': u'que4', u'鵳': u'jian1', u'鵴': u'ju2', u'鵵': u'tu4', u'鵶': u'ya1', u'鵷': u'yuan1', u'鵸': u'qi2', u'鵹': u'li2', u'鵺': u'ye4', u'鵻': u'zhui1', u'鵼': u'kong1', u'鵽': u'duo4', u'鵾': u'kun1', u'鵿': u'sheng1', u'鶀': u'qi2', u'鶁': u'jing1', u'鶂': u'yi4', u'鶃': u'yi4', u'鶄': u'jing1', u'鶅': u'zi1', u'鶆': u'lai2', u'鶇': u'dong1', u'鶈': u'qi1', u'鶉': u'chun2', u'鶊': u'geng1', u'鶋': u'ju1', u'鶌': u'qu1', u'鶍': u'yi4si4ka1', u'鶎': u'ku1yi4ta3da1', u'鶏': u'ji1', u'鶐': u'shu4', u'鶑': u'ying1', u'鶒': u'chi4', u'鶓': u'miao2', u'鶔': u'rou2', u'鶕': u'an1', u'鶖': u'qiu1', u'鶗': u'ti2', u'鶘': u'hu2', u'鶙': u'ti2', u'鶚': u'e4', u'鶛': u'jie1', u'鶜': u'mao2', u'鶝': u'fu2', u'鶞': u'chun1', u'鶟': u'tu2', u'鶠': u'yan4', u'鶡': u'he2', u'鶢': u'yuan2', u'鶣': u'pian1', u'鶤': u'kun1', u'鶥': u'mei2', u'鶦': u'hu2', u'鶧': u'ying1', u'鶨': u'chuan4', u'鶩': u'wu4', u'鶪': u'ju2', u'鶫': u'dong', u'鶬': u'cang1', u'鶭': u'fang3', u'鶮': u'he4', u'鶯': u'ying1', u'鶰': u'yuan2', u'鶱': u'qian1', u'鶲': u'weng1', u'鶳': u'shi1', u'鶴': u'he4', u'鶵': u'chu2', u'鶶': u'tang2', u'鶷': u'xia2', u'鶸': u'ruo4', u'鶹': u'liu2', u'鶺': u'ji2', u'鶻': u'hu2', u'鶼': u'jian1', u'鶽': u'sun3', u'鶾': u'han4', u'鶿': u'ci2', u'鷀': u'ci2', u'鷁': u'yi2', u'鷂': u'yao4', u'鷃': u'yan4', u'鷄': u'ji1', u'鷅': u'li4', u'鷆': u'tian2', u'鷇': u'kou4', u'鷈': u'ti1', u'鷉': u'ti1', u'鷊': u'yi4', u'鷋': u'tu2', u'鷌': u'ma3', u'鷍': u'xiao1', u'鷎': u'gao1', u'鷏': u'tian2', u'鷐': u'chen2', u'鷑': u'ji4', u'鷒': u'tuan2', u'鷓': u'zhe4', u'鷔': u'ao2', u'鷕': u'yao3', u'鷖': u'yi1', u'鷗': u'ou1', u'鷘': u'chi4', u'鷙': u'zhi4', u'鷚': u'liu4', u'鷛': u'yong1', u'鷜': u'lou2', u'鷝': u'bi4', u'鷞': u'shuang1', u'鷟': u'zhuo2', u'鷠': u'yu2', u'鷡': u'wu2', u'鷢': u'jue2', u'鷣': u'yin2', u'鷤': u'ti2', u'鷥': u'si1', u'鷦': u'jiao1', u'鷧': u'yi4', u'鷨': u'hua2', u'鷩': u'bi4', u'鷪': u'ying1', u'鷫': u'su4', u'鷬': u'huang2', u'鷭': u'fan2', u'鷮': u'jiao1', u'鷯': u'liao2', u'鷰': u'yan4', u'鷱': u'gao1', u'鷲': u'jiu4', u'鷳': u'xian2', u'鷴': u'xian2', u'鷵': u'tu2', u'鷶': u'mai3', u'鷷': u'zun1', u'鷸': u'yu4', u'鷹': u'ying1', u'鷺': u'lu4', u'鷻': u'tuan2', u'鷼': u'xian2', u'鷽': u'xue2', u'鷾': u'yi4', u'鷿': u'pi4', u'鸀': u'zhu3', u'鸁': u'luo2', u'鸂': u'xi1', u'鸃': u'yi4', u'鸄': u'ji1', u'鸅': u'ze2', u'鸆': u'yu2', u'鸇': u'zhan1', u'鸈': u'ye4', u'鸉': u'yang2', u'鸊': u'pi4', u'鸋': u'ning2', u'鸌': u'hu4', u'鸍': u'mi2', u'鸎': u'ying1', u'鸏': u'meng2', u'鸐': u'di2', u'鸑': u'yue4', u'鸒': u'yu4', u'鸓': u'lei3', u'鸔': u'bu3', u'鸕': u'lu2', u'鸖': u'he4', u'鸗': u'long2', u'鸘': u'shuang1', u'鸙': u'yue4', u'鸚': u'ying1', u'鸛': u'guan4', u'鸜': u'qu2', u'鸝': u'li2', u'鸞': u'luan2', u'鸟': u'niao3', u'鸠': u'jiu1', u'鸡': u'ji1', u'鸢': u'yuan1', u'鸣': u'ming2', u'鸤': u'shi1', u'鸥': u'ou1', u'鸦': u'ya1', u'鸧': u'cang1', u'鸨': u'bao3', u'鸩': u'zhen4', u'鸪': u'gu1', u'鸫': u'dong1', u'鸬': u'lu2', u'鸭': u'ya1', u'鸮': u'xiao1', u'鸯': u'yang1', u'鸰': u'ling2', u'鸱': u'chi1', u'鸲': u'qu2', u'鸳': u'yuan1', u'鸴': u'xue2', u'鸵': u'tuo2', u'鸶': u'si1', u'鸷': u'zhi4', u'鸸': u'er2', u'鸹': u'gua1', u'鸺': u'xiu1', u'鸻': u'heng2', u'鸼': u'zhou1', u'鸽': u'ge1', u'鸾': u'luan2', u'鸿': u'hong2', u'鹀': u'wu2', u'鹁': u'bo2', u'鹂': u'li2', u'鹃': u'juan1', u'鹄': u'hu2', u'鹅': u'e2', u'鹆': u'yu4', u'鹇': u'xian2', u'鹈': u'ti2', u'鹉': u'wu3', u'鹊': u'que4', u'鹋': u'miao2', u'鹌': u'an1', u'鹍': u'kun1', u'鹎': u'bei1', u'鹏': u'peng2', u'鹐': u'qian1', u'鹑': u'chun2', u'鹒': u'geng1', u'鹓': u'yuan1', u'鹔': u'su4', u'鹕': u'hu2', u'鹖': u'he2', u'鹗': u'e4', u'鹘': u'hu2', u'鹙': u'qiu1', u'鹚': u'ci2', u'鹛': u'mei2', u'鹜': u'wu4', u'鹝': u'yi4', u'鹞': u'yao4', u'鹟': u'weng1', u'鹠': u'liu2', u'鹡': u'ji2', u'鹢': u'yi4', u'鹣': u'jian1', u'鹤': u'he4', u'鹥': u'yi1', u'鹦': u'ying1', u'鹧': u'zhe4', u'鹨': u'liu4', u'鹩': u'liao2', u'鹪': u'jiao1', u'鹫': u'jiu4', u'鹬': u'yu4', u'鹭': u'lu4', u'鹮': u'huan2', u'鹯': u'zhan1', u'鹰': u'ying1', u'鹱': u'hu4', u'鹲': u'meng2', u'鹳': u'guan4', u'鹴': u'shuang1', u'鹵': u'lu3', u'鹶': u'jin1', u'鹷': u'ling2', u'鹸': u'jian3', u'鹹': u'xian2', u'鹺': u'cuo2', u'鹻': u'jian3', u'鹼': u'jian3', u'鹽': u'yan2', u'鹾': u'cuo2', u'鹿': u'lu4', u'麀': u'you1', u'麁': u'cu1', u'麂': u'ji3', u'麃': u'biao1', u'麄': u'cu1', u'麅': u'pao2', u'麆': u'zhu4', u'麇': u'qun2', u'麈': u'chen2', u'麉': u'jian', u'麊': u'mi2', u'麋': u'mi2', u'麌': u'yu3', u'麍': u'liu2', u'麎': u'chen2', u'麏': u'jun1', u'麐': u'lin2', u'麑': u'ni2', u'麒': u'qi2', u'麓': u'lu4', u'麔': u'jiu4', u'麕': u'jun1', u'麖': u'jing1', u'麗': u'li4', u'麘': u'xiang1', u'麙': u'xian2', u'麚': u'jia1', u'麛': u'mi2', u'麜': u'li4', u'麝': u'she4', u'麞': u'zhang1', u'麟': u'lin2', u'麠': u'jing1', u'麡': u'qi2', u'麢': u'ling2', u'麣': u'yan2', u'麤': u'cu1', u'麥': u'mai4', u'麦': u'mai4', u'麧': u'he2', u'麨': u'chao3', u'麩': u'fu1', u'麪': u'mian4', u'麫': u'mian4', u'麬': u'fu1', u'麭': u'pao4', u'麮': u'qu4', u'麯': u'qu1', u'麰': u'mou2', u'麱': u'fu1', u'麲': u'xian4', u'麳': u'lai2', u'麴': u'qu1', u'麵': u'mian4', u'麶': u'chi', u'麷': u'feng1', u'麸': u'fu1', u'麹': u'qu1', u'麺': u'mian4', u'麻': u'ma2', u'麼': u'mo2', u'麽': u'mo2', u'麾': u'hui1', u'麿': u'mi2', u'黀': u'zou1', u'黁': u'nen2', u'黂': u'fen2', u'黃': u'huang2', u'黄': u'huang2', u'黅': u'jin1', u'黆': u'guang1', u'黇': u'tian1', u'黈': u'tou3', u'黉': u'hong2', u'黊': u'hua4', u'黋': u'kuang4', u'黌': u'hong2', u'黍': u'shu3', u'黎': u'li2', u'黏': u'nian2', u'黐': u'chi1', u'黑': u'hei1', u'黒': u'hei1', u'黓': u'yi4', u'黔': u'qian2', u'黕': u'dan3', u'黖': u'xi4', u'黗': u'tun2', u'默': u'mo4', u'黙': u'mo4', u'黚': u'qian2', u'黛': u'dai4', u'黜': u'chu4', u'黝': u'you3', u'點': u'dian3', u'黟': u'yi1', u'黠': u'xia2', u'黡': u'yan3', u'黢': u'qu1', u'黣': u'mei3', u'黤': u'yan3', u'黥': u'qing2', u'黦': u'yue4', u'黧': u'li2', u'黨': u'dang3', u'黩': u'du2', u'黪': u'can3', u'黫': u'yan1', u'黬': u'yan3', u'黭': u'yan3', u'黮': u'dan3', u'黯': u'an4', u'黰': u'zhen3', u'黱': u'dai4', u'黲': u'can3', u'黳': u'yi1', u'黴': u'mei2', u'黵': u'dan3', u'黶': u'yan3', u'黷': u'du2', u'黸': u'lu2', u'黹': u'zhi3', u'黺': u'fen3', u'黻': u'fu2', u'黼': u'fu3', u'黽': u'mian3', u'黾': u'mian3', u'黿': u'yuan2', u'鼀': u'cu4', u'鼁': u'qu4', u'鼂': u'chao2', u'鼃': u'wa1', u'鼄': u'zhu1', u'鼅': u'zhi1', u'鼆': u'meng3', u'鼇': u'ao2', u'鼈': u'bie1', u'鼉': u'tuo2', u'鼊': u'bi4', u'鼋': u'yuan2', u'鼌': u'chao2', u'鼍': u'tuo2', u'鼎': u'ding3', u'鼏': u'mi4', u'鼐': u'nai4', u'鼑': u'ding3', u'鼒': u'zi1', u'鼓': u'gu3', u'鼔': u'gu3', u'鼕': u'dong1', u'鼖': u'fen2', u'鼗': u'tao2', u'鼘': u'yuan1', u'鼙': u'pi2', u'鼚': u'chang1', u'鼛': u'gao1', u'鼜': u'cao4', u'鼝': u'yuan1', u'鼞': u'tang1', u'鼟': u'teng1', u'鼠': u'shu3', u'鼡': u'zu1mi4', u'鼢': u'fen2', u'鼣': u'fei4', u'鼤': u'wen2', u'鼥': u'ba2', u'鼦': u'diao1', u'鼧': u'tuo2', u'鼨': u'zhong1', u'鼩': u'qu2', u'鼪': u'sheng1', u'鼫': u'shi2', u'鼬': u'you4', u'鼭': u'shi2', u'鼮': u'ting2', u'鼯': u'wu2', u'鼰': u'ju2', u'鼱': u'jing1', u'鼲': u'hun2', u'鼳': u'ju2', u'鼴': u'yan3', u'鼵': u'tu1', u'鼶': u'si1', u'鼷': u'xi1', u'鼸': u'xian4', u'鼹': u'yan3', u'鼺': u'lei2', u'鼻': u'bi2', u'鼼': u'yao4', u'鼽': u'qiu2', u'鼾': u'han1', u'鼿': u'wu4', u'齀': u'wu4', u'齁': u'hou1', u'齂': u'xie4', u'齃': u'e4', u'齄': u'zha1', u'齅': u'xiu4', u'齆': u'weng4', u'齇': u'zha1', u'齈': u'nong4', u'齉': u'nang4', u'齊': u'qi2', u'齋': u'zhai1', u'齌': u'ji4', u'齍': u'zi1', u'齎': u'ji2', u'齏': u'ji1', u'齐': u'qi2', u'齑': u'ji1', u'齒': u'chi3', u'齓': u'chen4', u'齔': u'chen4', u'齕': u'he2', u'齖': u'ya2', u'齗': u'yin2', u'齘': u'xie4', u'齙': u'bao1', u'齚': u'ze2', u'齛': u'xie4', u'齜': u'zi1', u'齝': u'chi1', u'齞': u'yan4', u'齟': u'ju3', u'齠': u'tiao2', u'齡': u'ling2', u'齢': u'ling2', u'齣': u'chu1', u'齤': u'quan2', u'齥': u'xie4', u'齦': u'yin2', u'齧': u'nie4', u'齨': u'jiu4', u'齩': u'yao3', u'齪': u'chuo4', u'齫': u'yun3', u'齬': u'yu3', u'齭': u'chu3', u'齮': u'yi3', u'齯': u'ni2', u'齰': u'ze2', u'齱': u'zou1', u'齲': u'qu3', u'齳': u'yun3', u'齴': u'yan3', u'齵': u'yu2', u'齶': u'e4', u'齷': u'wo4', u'齸': u'yi4', u'齹': u'cuo2', u'齺': u'zou1', u'齻': u'dian1', u'齼': u'chu3', u'齽': u'jin4', u'齾': u'ya4', u'齿': u'chi3', u'龀': u'chen4', u'龁': u'he2', u'龂': u'yin2', u'龃': u'ju3', u'龄': u'ling2', u'龅': u'bao1', u'龆': u'tiao2', u'龇': u'zi1', u'龈': u'yin2', u'龉': u'yu3', u'龊': u'chuo4', u'龋': u'qu3', u'龌': u'wo4', u'龍': u'long2', u'龎': u'pang2', u'龏': u'gong1', u'龐': u'pang2', u'龑': u'yan3', u'龒': u'long2', u'龓': u'long2', u'龔': u'gong1', u'龕': u'kan1', u'龖': u'da2', u'龗': u'ling2', u'龘': u'da2', u'龙': u'long2', u'龚': u'gong1', u'龛': u'kan1', u'龜': u'gui1', u'龝': u'qiu1', u'龞': u'bie1', u'龟': u'gui1', u'龠': u'yue4', u'龡': u'chui1', u'龢': u'he2', u'龣': u'jiao3', u'龤': u'xie2', u'龥': u'xu1', # the followings are user defined }
ajibawa-2023/Python-Code-Large/train/row_99157
12
20,935
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_99157:Import_L4_C0", "label": "codecs import codecs", "type": "import", "loc": [4, 4], "level": 0, "parent": null, "vector": [1, 0, 0.0002, 0.0, 0, 0.66, 0.0, 220, 0, 1, 0, 0, 220, 0, 0], "semantic": {"name": "codecs", "arg_names": [], "import_names": ["codecs"], "rhs_call_name": "", "annotation": ""}, "snippet": "import codecs"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99157:ClassDef_L6_C0", "label": "PinyinConverter", "type": "class", "loc": [6, 25], "level": 0, "parent": null, "vector": [3, 0, 0.0007, 0.001, 0, 0.66, 0.5, 429, 0, 3, 0, 0, 0, 0, 4], "semantic": {"name": "PinyinConverter", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class PinyinConverter:\n\tdef __init__(self):\n\t\tself._pinyinTable = PINYIN_TABLE\n\n\tdef char2pinyin(self, c):\n\t\t## convert Chinese character to pinyin\n\t\t## @exception: AssertionError, KeyError\n\t\tassert isinstance(c, unicode)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99157:FunctionDef_L7_C1", "label": "__init__", "type": "function", "loc": [7, 8], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99157:ClassDef_L6_C0", "vector": [2, 1, 0.0004, 0.0001, 1, 0.32, 0.0, 555, 0, 1, 0, 0, 0, 0, 0], "semantic": {"name": "__init__", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tdef __init__(self):\n\t\tself._pinyinTable = PINYIN_TABLE"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99157:Assign_L8_C2", "label": "self._pinyinTable =", "type": "assigned_variable", "loc": [8, 8], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99157:FunctionDef_L7_C1", "vector": [14, 2, 0.0004, 0.0, 2, 0.85, 0.0, 16, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self._pinyinTable", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tself._pinyinTable = PINYIN_TABLE"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99157:FunctionDef_L10_C1", "label": "char2pinyin", "type": "function", "loc": [10, 15], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99157:ClassDef_L6_C0", "vector": [2, 1, 0.0006, 0.0003, 1, 0.32, 0.5, 59, 0, 2, 1, 0, 0, 0, 2], "semantic": {"name": "char2pinyin", "arg_names": ["self", "c"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tdef char2pinyin(self, c):\n\t\t## convert Chinese character to pinyin\n\t\t## @exception: AssertionError, KeyError\n\t\tassert isinstance(c, unicode)\n\t\tassert len(c) == 1\n\t\treturn self._pinyinTable[c]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99157:Return_L15_C2", "label": "return", "type": "return", "loc": [15, 15], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99157:FunctionDef_L10_C1", "vector": [13, 2, 0.0007, 0.0, 2, 0.7, 0.0, 0, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\treturn self._pinyinTable[c]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99157:FunctionDef_L17_C1", "label": "str2pinyin", "type": "function", "loc": [17, 25], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99157:ClassDef_L6_C0", "vector": [2, 1, 0.001, 0.0004, 1, 0.32, 1.0, 483, 0, 2, 1, 0, 0, 0, 2], "semantic": {"name": "str2pinyin", "arg_names": ["self", "s"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tdef str2pinyin(self, s):\n\t\t## convert string to pinyin\n\t\tret = u''\n\t\tfor c in s:\n\t\t\tif self._pinyinTable.has_key(c):\n\t\t\t\tret += self._pinyinTable[c].capitalize()\n\t\t\telse:\n\t\t\t\tret += c"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99157:Assign_L19_C2", "label": "ret =", "type": "assigned_variable", "loc": [19, 19], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99157:FunctionDef_L17_C1", "vector": [14, 2, 0.0009, 0.0, 2, 0.64, 0.0, 501, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "ret", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tret = u''"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99157:For_L20_C2", "label": "for c", "type": "for", "loc": [20, 24], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99157:FunctionDef_L17_C1", "vector": [6, 2, 0.0011, 0.0002, 2, 0.64, 0.5, 411, 2, 0, 0, 0, 0, 0, 2], "semantic": {"name": "c", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tfor c in s:\n\t\t\tif self._pinyinTable.has_key(c):\n\t\t\t\tret += self._pinyinTable[c].capitalize()\n\t\t\telse:\n\t\t\t\tret += c"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99157:If_L21_C3", "label": "if", "type": "if", "loc": [21, 24], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99157:For_L20_C2", "vector": [4, 3, 0.0011, 0.0002, 3, 0.44, 0.0, 0, 3, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\tif self._pinyinTable.has_key(c):\n\t\t\t\tret += self._pinyinTable[c].capitalize()\n\t\t\telse:\n\t\t\t\tret += c"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99157:Return_L25_C2", "label": "return", "type": "return", "loc": [25, 25], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99157:FunctionDef_L17_C1", "vector": [13, 2, 0.0012, 0.0, 2, 0.64, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\treturn ret"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99157:Assign_L29_C0", "label": "PINYIN_TABLE =", "type": "assigned_variable", "loc": [29, 20934], "level": 0, "parent": null, "vector": [14, 0, 0.5007, 0.9986, 0, 0.66, 1.0, 484, 0, 0, 0, 0, 0, 6, 0], "semantic": {"name": "PINYIN_TABLE", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "PINYIN_TABLE = {\n\tu'\u4e00':\tu'yi1',\n\tu'\u4e01':\tu'ding1',\n\tu'\u4e02':\tu'kao3',\n\tu'\u4e03':\tu'qi1',\n\tu'\u4e04':\tu'shang4',\n\tu'\u4e05':\tu'xia4',\n\tu'\u4e06':\tu'han1',"}]
[{"f": "ajibawa-2023/Python-Code-Large/train/row_99157:ClassDef_L6_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99157:FunctionDef_L7_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99157:FunctionDef_L7_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99157:Assign_L8_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99157:ClassDef_L6_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99157:FunctionDef_L10_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99157:FunctionDef_L10_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99157:Return_L15_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99157:ClassDef_L6_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99157:FunctionDef_L17_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99157:FunctionDef_L17_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99157:Assign_L19_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99157:FunctionDef_L17_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99157:For_L20_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99157:For_L20_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99157:If_L21_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99157:FunctionDef_L17_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99157:Return_L25_C2"}]
#!/usr/bin/python # # Copyright (C) 2012 Google Inc. # # 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. __author__ = 'afshar@google.com (Ali Afshar)' # Add the library location to the path import sys sys.path.insert(0, 'lib') import os import httplib2 import sessions from google.appengine.ext import webapp from google.appengine.ext.webapp.util import run_wsgi_app from google.appengine.ext import db from google.appengine.ext.webapp import template from apiclient.discovery import build from apiclient.http import MediaUpload from oauth2client.client import flow_from_clientsecrets from oauth2client.client import FlowExchangeError from oauth2client.client import AccessTokenRefreshError from oauth2client.appengine import CredentialsProperty from oauth2client.appengine import StorageByKeyName from oauth2client.appengine import simplejson as json ALL_SCOPES = ('https://www.googleapis.com/auth/drive.file ' 'https://www.googleapis.com/auth/userinfo.email ' 'https://www.googleapis.com/auth/userinfo.profile') def SibPath(name): """Generate a path that is a sibling of this file. Args: name: Name of sibling file. Returns: Path to sibling file. """ return os.path.join(os.path.dirname(__file__), name) # Load the secret that is used for client side sessions # Create one of these for yourself with, for example: # python -c "import os; print os.urandom(64)" > session-secret SESSION_SECRET = open(SibPath('session.secret')).read() INDEX_HTML = open(SibPath('index.html')).read() class Credentials(db.Model): """Datastore entity for storing OAuth2.0 credentials. The CredentialsProperty is provided by the Google API Python Client, and is used by the Storage classes to store OAuth 2.0 credentials in the data store.""" credentials = CredentialsProperty() def CreateService(service, version, creds): """Create a Google API service. Load an API service from a discovery document and authorize it with the provided credentials. Args: service: Service name (e.g 'drive', 'oauth2'). version: Service version (e.g 'v1'). creds: Credentials used to authorize service. Returns: Authorized Google API service. """ # Instantiate an Http instance http = httplib2.Http() # Authorize the Http instance with the passed credentials creds.authorize(http) # Build a service from the passed discovery document path return build(service, version, http=http) class DriveState(object): """Store state provided by Drive.""" def __init__(self, state): """Create a new instance of drive state. Parse and load the JSON state parameter. Args: state: State query parameter as a string. """ if state: state_data = json.loads(state) self.action = state_data['action'] self.ids = map(str, state_data.get('ids', [])) else: self.action = 'create' self.ids = [] @classmethod def FromRequest(cls, request): """Create a Drive State instance from an HTTP request. Args: cls: Type this class method is called against. request: HTTP request. """ return DriveState(request.get('state')) class BaseDriveHandler(webapp.RequestHandler): """Base request handler for drive applications. Adds Authorization support for Drive. """ def CreateOAuthFlow(self): """Create OAuth2.0 flow controller This controller can be used to perform all parts of the OAuth 2.0 dance including exchanging an Authorization code. Args: request: HTTP request to create OAuth2.0 flow for Returns: OAuth2.0 Flow instance suitable for performing OAuth2.0. """ flow = flow_from_clientsecrets('client_secrets.json', scope='') # Dynamically set the redirect_uri based on the request URL. This is extremely # convenient for debugging to an alternative host without manually setting the # redirect URI. flow.redirect_uri = self.request.url.split('?', 1)[0].rsplit('/', 1)[0] return flow def GetCodeCredentials(self): """Create OAuth 2.0 credentials by extracting a code and performing OAuth2.0. The authorization code is extracted form the URI parameters. If it is absent, None is returned immediately. Otherwise, if it is present, it is used to perform step 2 of the OAuth 2.0 web server flow. Once a token is received, the user information is fetched from the userinfo service and stored in the session. The token is saved in the datastore against the user ID received from the userinfo service. Args: request: HTTP request used for extracting an authorization code and the session information. Returns: OAuth2.0 credentials suitable for authorizing clients or None if Authorization could not take place. """ # Other frameworks use different API to get a query parameter. code = self.request.get('code') if not code: # returns None to indicate that no code was passed from Google Drive. return None # Auth flow is a controller that is loaded with the client information, # including client_id, client_secret, redirect_uri etc oauth_flow = self.CreateOAuthFlow() # Perform the exchange of the code. If there is a failure with exchanging # the code, return None. try: creds = oauth_flow.step2_exchange(code) except FlowExchangeError: return None # Create an API service that can use the userinfo API. Authorize it with our # credentials that we gained from the code exchange. users_service = CreateService('oauth2', 'v2', creds) # Make a call against the userinfo service to retrieve the user's information. # In this case we are interested in the user's "id" field. userid = users_service.userinfo().get().execute().get('id') # Store the user id in the user's cookie-based session. session = sessions.LilCookies(self, SESSION_SECRET) session.set_secure_cookie(name='userid', value=userid) # Store the credentials in the data store using the userid as the key. StorageByKeyName(Credentials, userid, 'credentials').put(creds) return creds def GetSessionCredentials(self): """Get OAuth 2.0 credentials for an HTTP session. If the user has a user id stored in their cookie session, extract that value and use it to load that user's credentials from the data store. Args: request: HTTP request to use session from. Returns: OAuth2.0 credentials suitable for authorizing clients. """ # Try to load the user id from the session session = sessions.LilCookies(self, SESSION_SECRET) userid = session.get_secure_cookie(name='userid') if not userid: # return None to indicate that no credentials could be loaded from the # session. return None # Load the credentials from the data store, using the userid as a key. creds = StorageByKeyName(Credentials, userid, 'credentials').get() # if the credentials are invalid, return None to indicate that the credentials # cannot be used. if creds and creds.invalid: return None return creds def RedirectAuth(self): """Redirect a handler to an authorization page. Used when a handler fails to fetch credentials suitable for making Drive API requests. The request is redirected to an OAuth 2.0 authorization approval page and on approval, are returned to application. Args: handler: webapp.RequestHandler to redirect. """ flow = self.CreateOAuthFlow() # Manually add the required scopes. Since this redirect does not originate # from the Google Drive UI, which authomatically sets the scopes that are # listed in the API Console. flow.scope = ALL_SCOPES # Create the redirect URI by performing step 1 of the OAuth 2.0 web server # flow. uri = flow.step1_get_authorize_url(flow.redirect_uri) # Perform the redirect. self.redirect(uri) def RespondJSON(self, data): """Generate a JSON response and return it to the client. Args: data: The data that will be converted to JSON to return. """ self.response.headers['Content-Type'] = 'application/json' self.response.out.write(json.dumps(data)) def CreateAuthorizedService(self, service, version): """Create an authorize service instance. The service can only ever retrieve the credentials from the session. Args: service: Service name (e.g 'drive', 'oauth2'). version: Service version (e.g 'v1'). Returns: Authorized service or redirect to authorization flow if no credentials. """ # For the service, the session holds the credentials creds = self.GetSessionCredentials() if creds: # If the session contains credentials, use them to create a Drive service # instance. return CreateService(service, version, creds) else: # If no credentials could be loaded from the session, redirect the user to # the authorization page. self.RedirectAuth() def CreateDrive(self): """Create a drive client instance.""" return self.CreateAuthorizedService('drive', 'v2') def CreateUserInfo(self): """Create a user info client instance.""" return self.CreateAuthorizedService('oauth2', 'v2') class MainPage(BaseDriveHandler): """Web handler for the main page. Handles requests and returns the user interface for Open With and Create cases. Responsible for parsing the state provided from the Drive UI and acting appropriately. """ def get(self): """Handle GET for Create New and Open With. This creates an authorized client, and checks whether a resource id has been passed or not. If a resource ID has been passed, this is the Open With use-case, otherwise it is the Create New use-case. """ # Generate a state instance for the request, this includes the action, and # the file id(s) that have been sent from the Drive user interface. drive_state = DriveState.FromRequest(self.request) if drive_state.action == 'open' and len(drive_state.ids) > 0: code = self.request.get('code') if code: code = '?code=%s' % code self.redirect('/#edit/%s%s' % (drive_state.ids[0], code)) return # Fetch the credentials by extracting an OAuth 2.0 authorization code from # the request URL. If the code is not present, redirect to the OAuth 2.0 # authorization URL. creds = self.GetCodeCredentials() if not creds: return self.RedirectAuth() # Extract the numerical portion of the client_id from the stored value in # the OAuth flow. You could also store this value as a separate variable # somewhere. client_id = self.CreateOAuthFlow().client_id.split('.')[0].split('-')[0] self.RenderTemplate() def RenderTemplate(self): """Render a named template in a context.""" self.response.headers['Content-Type'] = 'text/html' self.response.out.write(INDEX_HTML) class ServiceHandler(BaseDriveHandler): """Web handler for the service to read and write to Drive.""" def post(self): """Called when HTTP POST requests are received by the web application. The POST body is JSON which is deserialized and used as values to create a new file in Drive. The authorization access token for this action is retreived from the data store. """ # Create a Drive service service = self.CreateDrive() if service is None: return # Load the data that has been posted as JSON data = self.RequestJSON() # Create a new file data structure. resource = { 'title': data['title'], 'description': data['description'], 'mimeType': data['mimeType'], } try: # Make an insert request to create a new file. A MediaInMemoryUpload # instance is used to upload the file body. resource = service.files().insert( body=resource, media_body=MediaInMemoryUpload( data.get('content', ''), data['mimeType'], resumable=True) ).execute() # Respond with the new file id as JSON. self.RespondJSON(resource['id']) except AccessTokenRefreshError: # In cases where the access token has expired and cannot be refreshed # (e.g. manual token revoking) redirect the user to the authorization page # to authorize. self.RedirectAuth() def get(self): """Called when HTTP GET requests are received by the web application. Use the query parameter file_id to fetch the required file's metadata then content and return it as a JSON object. Since DrEdit deals with text files, it is safe to dump the content directly into JSON, but this is not the case with binary files, where something like Base64 encoding is more appropriate. """ # Create a Drive service service = self.CreateDrive() if service is None: return try: # Requests are expected to pass the file_id query parameter. file_id = self.request.get('file_id') if file_id: # Fetch the file metadata by making the service.files().get method of # the Drive API. f = service.files().get(fileId=file_id).execute() downloadUrl = f.get('downloadUrl') # If a download URL is provided in the file metadata, use it to make an # authorized request to fetch the file ontent. Set this content in the # data to return as the 'content' field. If there is no downloadUrl, # just set empty content. if downloadUrl: resp, f['content'] = service._http.request(downloadUrl) else: f['content'] = '' else: f = None # Generate a JSON response with the file data and return to the client. self.RespondJSON(f) except AccessTokenRefreshError: # Catch AccessTokenRefreshError which occurs when the API client library # fails to refresh a token. This occurs, for example, when a refresh token # is revoked. When this happens the user is redirected to the # Authorization URL. self.RedirectAuth() def put(self): """Called when HTTP PUT requests are received by the web application. The PUT body is JSON which is deserialized and used as values to update a file in Drive. The authorization access token for this action is retreived from the data store. """ # Create a Drive service service = self.CreateDrive() if service is None: return # Load the data that has been posted as JSON data = self.RequestJSON() try: # Create a new file data structure. content = data.get('content') if 'content' in data: data.pop('content') if content is not None: # Make an update request to update the file. A MediaInMemoryUpload # instance is used to upload the file body. Because of a limitation, this # request must be made in two parts, the first to update the metadata, and # the second to update the body. resource = service.files().update( fileId=data['resource_id'], newRevision=self.request.get('newRevision', False), body=data, media_body=MediaInMemoryUpload( content, data['mimeType'], resumable=True) ).execute() else: # Only update the metadata, a patch request is prefered but not yet # supported on Google App Engine; see # http://code.google.com/p/googleappengine/issues/detail?id=6316. resource = service.files().update( fileId=data['resource_id'], newRevision=self.request.get('newRevision', False), body=data).execute() # Respond with the new file id as JSON. self.RespondJSON(resource['id']) except AccessTokenRefreshError: # In cases where the access token has expired and cannot be refreshed # (e.g. manual token revoking) redirect the user to the authorization page # to authorize. self.RedirectAuth() def RequestJSON(self): """Load the request body as JSON. Returns: Request body loaded as JSON or None if there is no request body. """ if self.request.body: return json.loads(self.request.body) class UserHandler(BaseDriveHandler): """Web handler for the service to read user information.""" def get(self): """Called when HTTP GET requests are received by the web application.""" # Create a Drive service service = self.CreateUserInfo() if service is None: return try: result = service.userinfo().get().execute() # Generate a JSON response with the file data and return to the client. self.RespondJSON(result) except AccessTokenRefreshError: # Catch AccessTokenRefreshError which occurs when the API client library # fails to refresh a token. This occurs, for example, when a refresh token # is revoked. When this happens the user is redirected to the # Authorization URL. self.RedirectAuth() class AboutHandler(BaseDriveHandler): """Web handler for the service to read user information.""" def get(self): """Called when HTTP GET requests are received by the web application.""" # Create a Drive service service = self.CreateDrive() if service is None: return try: result = service.about().get().execute() # Generate a JSON response with the file data and return to the client. self.RespondJSON(result) except AccessTokenRefreshError: # Catch AccessTokenRefreshError which occurs when the API client library # fails to refresh a token. This occurs, for example, when a refresh token # is revoked. When this happens the user is redirected to the # Authorization URL. self.RedirectAuth() class MediaInMemoryUpload(MediaUpload): """MediaUpload for a chunk of bytes. Construct a MediaFileUpload and pass as the media_body parameter of the method. For example, if we had a service that allowed plain text: """ def __init__(self, body, mimetype='application/octet-stream', chunksize=256*1024, resumable=False): """Create a new MediaBytesUpload. Args: body: string, Bytes of body content. mimetype: string, Mime-type of the file or default of 'application/octet-stream'. chunksize: int, File will be uploaded in chunks of this many bytes. Only used if resumable=True. resumable: bool, True if this is a resumable upload. False means upload in a single request. """ self._body = body self._mimetype = mimetype self._resumable = resumable self._chunksize = chunksize def chunksize(self): """Chunk size for resumable uploads. Returns: Chunk size in bytes. """ return self._chunksize def mimetype(self): """Mime type of the body. Returns: Mime type. """ return self._mimetype def size(self): """Size of upload. Returns: Size of the body. """ return len(self._body) def resumable(self): """Whether this upload is resumable. Returns: True if resumable upload or False. """ return self._resumable def getbytes(self, begin, length): """Get bytes from the media. Args: begin: int, offset from beginning of file. length: int, number of bytes to read, starting at begin. Returns: A string of bytes read. May be shorter than length if EOF was reached first. """ return self._body[begin:begin + length] # Create an WSGI application suitable for running on App Engine application = webapp.WSGIApplication( [('/', MainPage), ('/svc', ServiceHandler), ('/about', AboutHandler), ('/user', UserHandler)], # XXX Set to False in production. debug=True ) def main(): """Main entry point for executing a request with this handler.""" run_wsgi_app(application) if __name__ == "__main__": main()
ajibawa-2023/Python-Code-Large/train/row_99158
218
605
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_99158:Assign_L17_C0", "label": "__author__ =", "type": "assigned_variable", "loc": [17, 17], "level": 0, "parent": null, "vector": [14, 0, 0.0281, 0.0017, 0, 0.66, 0.0, 777, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "__author__", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "__author__ = 'afshar@google.com (Ali Afshar)'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99158:Import_L21_C0", "label": "sys import sys", "type": "import", "loc": [21, 21], "level": 0, "parent": null, "vector": [1, 0, 0.0347, 0.0017, 0, 0.66, 0.0303, 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_99158:Expr_L22_C0", "label": "insert()", "type": "expression", "loc": [22, 22], "level": 0, "parent": null, "vector": [8, 0, 0.0364, 0.0017, 0, 0.66, 0.0606, 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, 'lib')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99158:Import_L24_C0", "label": "os import os", "type": "import", "loc": [24, 24], "level": 0, "parent": null, "vector": [1, 0, 0.0397, 0.0017, 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_99158:Import_L25_C0", "label": "httplib2 import httplib2", "type": "import", "loc": [25, 25], "level": 0, "parent": null, "vector": [1, 0, 0.0413, 0.0017, 0, 0.66, 0.1212, 273, 0, 1, 0, 0, 273, 0, 0], "semantic": {"name": "httplib2", "arg_names": [], "import_names": ["httplib2"], "rhs_call_name": "", "annotation": ""}, "snippet": "import httplib2"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99158:Import_L26_C0", "label": "sessions import sessions", "type": "import", "loc": [26, 26], "level": 0, "parent": null, "vector": [1, 0, 0.043, 0.0017, 0, 0.66, 0.1515, 787, 0, 1, 0, 0, 787, 0, 0], "semantic": {"name": "sessions", "arg_names": [], "import_names": ["sessions"], "rhs_call_name": "", "annotation": ""}, "snippet": "import sessions"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99158:ImportFrom_L27_C0", "label": "from google.appengine.ext import webapp", "type": "import", "loc": [27, 27], "level": 0, "parent": null, "vector": [1, 0, 0.0446, 0.0017, 0, 0.66, 0.1818, 167, 0, 1, 0, 0, 167, 0, 0], "semantic": {"name": "google.appengine.ext", "arg_names": [], "import_names": ["webapp"], "rhs_call_name": "", "annotation": ""}, "snippet": "from google.appengine.ext import webapp"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99158:ImportFrom_L28_C0", "label": "from google.appengine.ext.webapp.util import run_wsgi_app", "type": "import", "loc": [28, 28], "level": 0, "parent": null, "vector": [1, 0, 0.0463, 0.0017, 0, 0.66, 0.2121, 327, 0, 1, 0, 0, 327, 0, 0], "semantic": {"name": "google.appengine.ext.webapp.util", "arg_names": [], "import_names": ["run_wsgi_app"], "rhs_call_name": "", "annotation": ""}, "snippet": "from google.appengine.ext.webapp.util import run_wsgi_app"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99158:ImportFrom_L29_C0", "label": "from google.appengine.ext import db", "type": "import", "loc": [29, 29], "level": 0, "parent": null, "vector": [1, 0, 0.0479, 0.0017, 0, 0.66, 0.2424, 167, 0, 1, 0, 0, 167, 0, 0], "semantic": {"name": "google.appengine.ext", "arg_names": [], "import_names": ["db"], "rhs_call_name": "", "annotation": ""}, "snippet": "from google.appengine.ext import db"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99158:ImportFrom_L30_C0", "label": "from google.appengine.ext.webapp import template", "type": "import", "loc": [30, 30], "level": 0, "parent": null, "vector": [1, 0, 0.0496, 0.0017, 0, 0.66, 0.2727, 8, 0, 1, 0, 0, 8, 0, 0], "semantic": {"name": "google.appengine.ext.webapp", "arg_names": [], "import_names": ["template"], "rhs_call_name": "", "annotation": ""}, "snippet": "from google.appengine.ext.webapp import template"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99158:ImportFrom_L31_C0", "label": "from apiclient.discovery import build", "type": "import", "loc": [31, 31], "level": 0, "parent": null, "vector": [1, 0, 0.0512, 0.0017, 0, 0.66, 0.303, 78, 0, 1, 0, 0, 78, 0, 0], "semantic": {"name": "apiclient.discovery", "arg_names": [], "import_names": ["build"], "rhs_call_name": "", "annotation": ""}, "snippet": "from apiclient.discovery import build"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99158:ImportFrom_L32_C0", "label": "from apiclient.http import MediaUpload", "type": "import", "loc": [32, 32], "level": 0, "parent": null, "vector": [1, 0, 0.0529, 0.0017, 0, 0.66, 0.3333, 670, 0, 1, 0, 0, 670, 0, 0], "semantic": {"name": "apiclient.http", "arg_names": [], "import_names": ["MediaUpload"], "rhs_call_name": "", "annotation": ""}, "snippet": "from apiclient.http import MediaUpload"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99158:ImportFrom_L33_C0", "label": "from oauth2client.client import flow_from_clientsecrets", "type": "import", "loc": [33, 33], "level": 0, "parent": null, "vector": [1, 0, 0.0545, 0.0017, 0, 0.66, 0.3636, 340, 0, 1, 0, 0, 340, 0, 0], "semantic": {"name": "oauth2client.client", "arg_names": [], "import_names": ["flow_from_clientsecrets"], "rhs_call_name": "", "annotation": ""}, "snippet": "from oauth2client.client import flow_from_clientsecrets"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99158:ImportFrom_L34_C0", "label": "from oauth2client.client import FlowExchangeError", "type": "import", "loc": [34, 34], "level": 0, "parent": null, "vector": [1, 0, 0.0562, 0.0017, 0, 0.66, 0.3939, 340, 0, 1, 0, 0, 340, 0, 0], "semantic": {"name": "oauth2client.client", "arg_names": [], "import_names": ["FlowExchangeError"], "rhs_call_name": "", "annotation": ""}, "snippet": "from oauth2client.client import FlowExchangeError"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99158:ImportFrom_L35_C0", "label": "from oauth2client.client import AccessTokenRefreshError", "type": "import", "loc": [35, 35], "level": 0, "parent": null, "vector": [1, 0, 0.0579, 0.0017, 0, 0.66, 0.4242, 340, 0, 1, 0, 0, 340, 0, 0], "semantic": {"name": "oauth2client.client", "arg_names": [], "import_names": ["AccessTokenRefreshError"], "rhs_call_name": "", "annotation": ""}, "snippet": "from oauth2client.client import AccessTokenRefreshError"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99158:ImportFrom_L36_C0", "label": "from oauth2client.appengine import CredentialsProperty", "type": "import", "loc": [36, 36], "level": 0, "parent": null, "vector": [1, 0, 0.0595, 0.0017, 0, 0.66, 0.4545, 953, 0, 1, 0, 0, 953, 0, 0], "semantic": {"name": "oauth2client.appengine", "arg_names": [], "import_names": ["CredentialsProperty"], "rhs_call_name": "", "annotation": ""}, "snippet": "from oauth2client.appengine import CredentialsProperty"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99158:ImportFrom_L37_C0", "label": "from oauth2client.appengine import StorageByKeyName", "type": "import", "loc": [37, 37], "level": 0, "parent": null, "vector": [1, 0, 0.0612, 0.0017, 0, 0.66, 0.4848, 953, 0, 1, 0, 0, 953, 0, 0], "semantic": {"name": "oauth2client.appengine", "arg_names": [], "import_names": ["StorageByKeyName"], "rhs_call_name": "", "annotation": ""}, "snippet": "from oauth2client.appengine import StorageByKeyName"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99158:ImportFrom_L38_C0", "label": "from oauth2client.appengine import json", "type": "import", "loc": [38, 38], "level": 0, "parent": null, "vector": [1, 0, 0.0628, 0.0017, 0, 0.66, 0.5152, 953, 0, 1, 0, 0, 953, 0, 0], "semantic": {"name": "oauth2client.appengine", "arg_names": [], "import_names": ["json"], "rhs_call_name": "", "annotation": ""}, "snippet": "from oauth2client.appengine import simplejson as json"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99158:Assign_L41_C0", "label": "ALL_SCOPES =", "type": "assigned_variable", "loc": [41, 43], "level": 0, "parent": null, "vector": [14, 0, 0.0694, 0.005, 0, 0.66, 0.5455, 422, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "ALL_SCOPES", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "ALL_SCOPES = ('https://www.googleapis.com/auth/drive.file '\n 'https://www.googleapis.com/auth/userinfo.email '\n 'https://www.googleapis.com/auth/userinfo.profile')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99158:FunctionDef_L46_C0", "label": "SibPath", "type": "function", "loc": [46, 54], "level": 0, "parent": null, "vector": [2, 0, 0.0826, 0.0149, 0, 0.66, 0.5758, 38, 0, 1, 1, 0, 0, 0, 2], "semantic": {"name": "SibPath", "arg_names": ["name"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def SibPath(name):\n \"\"\"Generate a path that is a sibling of this file.\n\n Args:\n name: Name of sibling file.\n Returns:\n Path to sibling file.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99158:Expr_L47_C2", "label": "expression", "type": "expression", "loc": [47, 53], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99158:FunctionDef_L46_C0", "vector": [8, 1, 0.0826, 0.0116, 1, 0.01, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Generate a path that is a sibling of this file.\n\n Args:\n name: Name of sibling file.\n Returns:\n Path to sibling file.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99158:Return_L54_C2", "label": "return", "type": "return", "loc": [54, 54], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99158:FunctionDef_L46_C0", "vector": [13, 1, 0.0893, 0.0017, 1, 0.01, 1.0, 0, 3, 0, 0, 0, 0, 10, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return os.path.join(os.path.dirname(__file__), name)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99158:Assign_L60_C0", "label": "SESSION_SECRET = read()", "type": "assigned_variable", "loc": [60, 60], "level": 0, "parent": null, "vector": [14, 0, 0.0992, 0.0017, 0, 0.66, 0.6061, 330, 3, 0, 0, 0, 453, 10, 3], "semantic": {"name": "SESSION_SECRET", "arg_names": [], "import_names": [], "rhs_call_name": "read", "annotation": ""}, "snippet": "SESSION_SECRET = open(SibPath('session.secret')).read()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99158:Assign_L61_C0", "label": "INDEX_HTML = read()", "type": "assigned_variable", "loc": [61, 61], "level": 0, "parent": null, "vector": [14, 0, 0.1008, 0.0017, 0, 0.66, 0.6364, 221, 3, 0, 0, 0, 453, 10, 3], "semantic": {"name": "INDEX_HTML", "arg_names": [], "import_names": [], "rhs_call_name": "read", "annotation": ""}, "snippet": "INDEX_HTML = open(SibPath('index.html')).read()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99158:ClassDef_L64_C0", "label": "Credentials", "type": "class", "loc": [64, 69], "level": 0, "parent": null, "vector": [3, 0, 0.1099, 0.0099, 0, 0.66, 0.6667, 309, 0, 0, 0, 0, 697, 0, 1], "semantic": {"name": "Credentials", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class Credentials(db.Model):\n \"\"\"Datastore entity for storing OAuth2.0 credentials.\n\n The CredentialsProperty is provided by the Google API Python Client, and is\n used by the Storage classes to store OAuth 2.0 credentials in the data store.\"\"\"\n credentials = CredentialsProperty()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99158:Expr_L65_C2", "label": "expression", "type": "expression", "loc": [65, 68], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99158:ClassDef_L64_C0", "vector": [8, 1, 0.1099, 0.0066, 1, 0.82, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Datastore entity for storing OAuth2.0 credentials.\n\n The CredentialsProperty is provided by the Google API Python Client, and is\n used by the Storage classes to store OAuth 2.0 credentials in the data store.\"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99158:Assign_L69_C2", "label": "credentials = CredentialsProperty()", "type": "assigned_variable", "loc": [69, 69], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99158:ClassDef_L64_C0", "vector": [14, 1, 0.114, 0.0017, 1, 0.82, 1.0, 198, 3, 0, 0, 0, 135, 10, 1], "semantic": {"name": "credentials", "arg_names": [], "import_names": [], "rhs_call_name": "CredentialsProperty", "annotation": ""}, "snippet": " credentials = CredentialsProperty()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99158:FunctionDef_L72_C0", "label": "CreateService", "type": "function", "loc": [72, 92], "level": 0, "parent": null, "vector": [2, 0, 0.1355, 0.0347, 0, 0.66, 0.697, 493, 0, 3, 1, 0, 0, 0, 3], "semantic": {"name": "CreateService", "arg_names": ["service", "version", "creds"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def CreateService(service, version, creds):\n \"\"\"Create a Google API service.\n\n Load an API service from a discovery document and authorize it with the\n provided credentials.\n\n Args:\n service: Service name (e.g 'drive', 'oauth2')."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99158:Expr_L73_C2", "label": "expression", "type": "expression", "loc": [73, 84], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99158:FunctionDef_L72_C0", "vector": [8, 1, 0.1298, 0.0198, 1, 0.55, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Create a Google API service.\n\n Load an API service from a discovery document and authorize it with the\n provided credentials.\n\n Args:\n service: Service name (e.g 'drive', 'oauth2').\n version: Service version (e.g 'v1')."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99158:Assign_L86_C2", "label": "http = Http()", "type": "assigned_variable", "loc": [86, 86], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99158:FunctionDef_L72_C0", "vector": [14, 1, 0.1421, 0.0017, 1, 0.55, 0.3333, 415, 3, 0, 0, 0, 967, 10, 1], "semantic": {"name": "http", "arg_names": [], "import_names": [], "rhs_call_name": "Http", "annotation": ""}, "snippet": " http = httplib2.Http()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99158:Expr_L89_C2", "label": "authorize()", "type": "expression", "loc": [89, 89], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99158:FunctionDef_L72_C0", "vector": [8, 1, 0.1471, 0.0017, 1, 0.55, 0.6667, 880, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "authorize", "arg_names": [], "import_names": [], "rhs_call_name": "authorize", "annotation": ""}, "snippet": " creds.authorize(http)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99158:Return_L92_C2", "label": "return", "type": "return", "loc": [92, 92], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99158:FunctionDef_L72_C0", "vector": [13, 1, 0.1521, 0.0017, 1, 0.55, 1.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return build(service, version, http=http)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99158:ClassDef_L95_C0", "label": "DriveState", "type": "class", "loc": [95, 122], "level": 0, "parent": null, "vector": [3, 0, 0.1793, 0.0463, 0, 0.66, 0.7273, 620, 0, 2, 0, 0, 186, 0, 5], "semantic": {"name": "DriveState", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class DriveState(object):\n \"\"\"Store state provided by Drive.\"\"\"\n\n def __init__(self, state):\n \"\"\"Create a new instance of drive state.\n\n Parse and load the JSON state parameter.\n"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99158:Expr_L96_C2", "label": "expression", "type": "expression", "loc": [96, 96], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99158:ClassDef_L95_C0", "vector": [8, 1, 0.1587, 0.0017, 1, 0.72, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Store state provided by Drive.\"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99158:FunctionDef_L98_C2", "label": "__init__", "type": "function", "loc": [98, 112], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99158:ClassDef_L95_C0", "vector": [2, 1, 0.1736, 0.0248, 1, 0.72, 0.5, 555, 0, 2, 0, 0, 0, 0, 3], "semantic": {"name": "__init__", "arg_names": ["self", "state"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, state):\n \"\"\"Create a new instance of drive state.\n\n Parse and load the JSON state parameter.\n\n Args:\n state: State query parameter as a string.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99158:Expr_L99_C4", "label": "expression", "type": "expression", "loc": [99, 105], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99158:FunctionDef_L98_C2", "vector": [8, 2, 0.1686, 0.0116, 2, 0.62, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Create a new instance of drive state.\n\n Parse and load the JSON state parameter.\n\n Args:\n state: State query parameter as a string.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99158:If_L106_C4", "label": "if", "type": "if", "loc": [106, 112], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99158:FunctionDef_L98_C2", "vector": [4, 2, 0.1802, 0.0116, 2, 0.62, 1.0, 0, 2, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if state:\n state_data = json.loads(state)\n self.action = state_data['action']\n self.ids = map(str, state_data.get('ids', []))\n else:\n self.action = 'create'\n self.ids = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99158:Assign_L107_C6", "label": "state_data = loads()", "type": "assigned_variable", "loc": [107, 107], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99158:If_L106_C4", "vector": [14, 3, 0.1769, 0.0017, 3, 0.59, 0.0, 203, 3, 1, 0, 0, 88, 10, 1], "semantic": {"name": "state_data", "arg_names": [], "import_names": [], "rhs_call_name": "loads", "annotation": ""}, "snippet": " state_data = json.loads(state)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99158:Assign_L108_C6", "label": "self.action =", "type": "assigned_variable", "loc": [108, 108], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99158:If_L106_C4", "vector": [14, 3, 0.1785, 0.0017, 3, 0.59, 0.25, 222, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.action", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.action = state_data['action']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99158:Assign_L109_C6", "label": "self.ids = map()", "type": "assigned_variable", "loc": [109, 109], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99158:If_L106_C4", "vector": [14, 3, 0.1802, 0.0017, 3, 0.59, 0.5, 806, 3, 2, 0, 0, 53, 10, 2], "semantic": {"name": "self.ids", "arg_names": [], "import_names": [], "rhs_call_name": "map", "annotation": ""}, "snippet": " self.ids = map(str, state_data.get('ids', []))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99158:Assign_L111_C6", "label": "self.action =", "type": "assigned_variable", "loc": [111, 111], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99158:If_L106_C4", "vector": [14, 3, 0.1835, 0.0017, 3, 0.59, 0.75, 222, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "self.action", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.action = 'create'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99158:Assign_L112_C6", "label": "self.ids =", "type": "assigned_variable", "loc": [112, 112], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99158:If_L106_C4", "vector": [14, 3, 0.1851, 0.0017, 3, 0.59, 1.0, 806, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "self.ids", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.ids = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99158:FunctionDef_L115_C2", "label": "FromRequest", "type": "function", "loc": [115, 122], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99158:ClassDef_L95_C0", "vector": [2, 1, 0.1959, 0.0132, 1, 0.72, 1.0, 504, 0, 2, 1, 0, 0, 0, 2], "semantic": {"name": "FromRequest", "arg_names": ["cls", "request"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def FromRequest(cls, request):\n \"\"\"Create a Drive State instance from an HTTP request.\n\n Args:\n cls: Type this class method is called against.\n request: HTTP request.\n \"\"\"\n return DriveState(request.get('state'))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99158:Expr_L116_C4", "label": "expression", "type": "expression", "loc": [116, 121], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99158:FunctionDef_L115_C2", "vector": [8, 2, 0.1959, 0.0099, 2, 0.88, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Create a Drive State instance from an HTTP request.\n\n Args:\n cls: Type this class method is called against.\n request: HTTP request.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99158:Return_L122_C4", "label": "return", "type": "return", "loc": [122, 122], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99158:FunctionDef_L115_C2", "vector": [13, 2, 0.2017, 0.0017, 2, 0.88, 1.0, 0, 3, 0, 0, 0, 0, 10, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return DriveState(request.get('state'))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99158:ClassDef_L126_C0", "label": "BaseDriveHandler", "type": "class", "loc": [126, 291], "level": 0, "parent": null, "vector": [3, 0, 0.3446, 0.2744, 0, 0.66, 0.7576, 266, 0, 8, 0, 0, 256, 0, 29], "semantic": {"name": "BaseDriveHandler", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class BaseDriveHandler(webapp.RequestHandler):\n \"\"\"Base request handler for drive applications.\n\n Adds Authorization support for Drive.\n \"\"\"\n\n def CreateOAuthFlow(self):\n \"\"\"Create OAuth2.0 flow controller"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99158:Expr_L127_C2", "label": "expression", "type": "expression", "loc": [127, 130], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99158:ClassDef_L126_C0", "vector": [8, 1, 0.2124, 0.0066, 1, 0.9, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Base request handler for drive applications.\n\n Adds Authorization support for Drive.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99158:FunctionDef_L132_C2", "label": "CreateOAuthFlow", "type": "function", "loc": [132, 148], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99158:ClassDef_L126_C0", "vector": [2, 1, 0.2314, 0.0281, 1, 0.9, 0.125, 672, 0, 1, 1, 0, 0, 0, 3], "semantic": {"name": "CreateOAuthFlow", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def CreateOAuthFlow(self):\n \"\"\"Create OAuth2.0 flow controller\n\n This controller can be used to perform all parts of the OAuth 2.0 dance\n including exchanging an Authorization code.\n\n Args:\n request: HTTP request to create OAuth2.0 flow for"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99158:Expr_L133_C4", "label": "expression", "type": "expression", "loc": [133, 142], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99158:FunctionDef_L132_C2", "vector": [8, 2, 0.2273, 0.0165, 2, 0.05, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Create OAuth2.0 flow controller\n\n This controller can be used to perform all parts of the OAuth 2.0 dance\n including exchanging an Authorization code.\n\n Args:\n request: HTTP request to create OAuth2.0 flow for\n Returns:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99158:Assign_L143_C4", "label": "flow = flow_from_clientsecrets()", "type": "assigned_variable", "loc": [143, 143], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99158:FunctionDef_L132_C2", "vector": [14, 2, 0.2364, 0.0017, 2, 0.05, 0.3333, 258, 3, 2, 0, 0, 355, 10, 1], "semantic": {"name": "flow", "arg_names": [], "import_names": [], "rhs_call_name": "flow_from_clientsecrets", "annotation": ""}, "snippet": " flow = flow_from_clientsecrets('client_secrets.json', scope='')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99158:Assign_L147_C4", "label": "flow.redirect_uri =", "type": "assigned_variable", "loc": [147, 147], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99158:FunctionDef_L132_C2", "vector": [14, 2, 0.243, 0.0017, 2, 0.05, 0.6667, 890, 6, 0, 0, 0, 0, 0, 2], "semantic": {"name": "flow.redirect_uri", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " flow.redirect_uri = self.request.url.split('?', 1)[0].rsplit('/', 1)[0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99158:Return_L148_C4", "label": "return", "type": "return", "loc": [148, 148], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99158:FunctionDef_L132_C2", "vector": [13, 2, 0.2446, 0.0017, 2, 0.05, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return flow"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99158:FunctionDef_L150_C2", "label": "GetCodeCredentials", "type": "function", "loc": [150, 199], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99158:ClassDef_L126_C0", "vector": [2, 1, 0.2884, 0.0826, 1, 0.9, 0.25, 113, 0, 1, 1, 0, 0, 0, 12], "semantic": {"name": "GetCodeCredentials", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def GetCodeCredentials(self):\n \"\"\"Create OAuth 2.0 credentials by extracting a code and performing OAuth2.0.\n\n The authorization code is extracted form the URI parameters. If it is absent,\n None is returned immediately. Otherwise, if it is present, it is used to\n perform step 2 of the OAuth 2.0 web server flow.\n\n Once a token is received, the user information is fetched from the userinfo"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99158:Expr_L151_C4", "label": "expression", "type": "expression", "loc": [151, 167], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99158:FunctionDef_L150_C2", "vector": [8, 2, 0.2628, 0.0281, 2, 0.35, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Create OAuth 2.0 credentials by extracting a code and performing OAuth2.0.\n\n The authorization code is extracted form the URI parameters. If it is absent,\n None is returned immediately. Otherwise, if it is present, it is used to\n perform step 2 of the OAuth 2.0 web server flow.\n\n Once a token is received, the user information is fetched from the userinfo\n service and stored in the session. The token is saved in the datastore against"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99158:Assign_L169_C4", "label": "code = get()", "type": "assigned_variable", "loc": [169, 169], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99158:FunctionDef_L150_C2", "vector": [14, 2, 0.2793, 0.0017, 2, 0.35, 0.1, 44, 3, 1, 0, 0, 607, 10, 1], "semantic": {"name": "code", "arg_names": [], "import_names": [], "rhs_call_name": "get", "annotation": ""}, "snippet": " code = self.request.get('code')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99158:If_L170_C4", "label": "if", "type": "if", "loc": [170, 172], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99158:FunctionDef_L150_C2", "vector": [4, 2, 0.2826, 0.005, 2, 0.35, 0.2, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not code:\n # returns None to indicate that no code was passed from Google Drive.\n return None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99158:Return_L172_C6", "label": "return", "type": "return", "loc": [172, 172], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99158:If_L170_C4", "vector": [13, 3, 0.2843, 0.0017, 3, 0.46, 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_99158:Assign_L176_C4", "label": "oauth_flow = CreateOAuthFlow()", "type": "assigned_variable", "loc": [176, 176], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99158:FunctionDef_L150_C2", "vector": [14, 2, 0.2909, 0.0017, 2, 0.35, 0.3, 725, 3, 0, 0, 0, 672, 10, 1], "semantic": {"name": "oauth_flow", "arg_names": [], "import_names": [], "rhs_call_name": "CreateOAuthFlow", "annotation": ""}, "snippet": " oauth_flow = self.CreateOAuthFlow()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99158:Try_L180_C4", "label": "try", "type": "try", "loc": [180, 183], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99158:FunctionDef_L150_C2", "vector": [7, 2, 0.3, 0.0066, 2, 0.35, 0.4, 0, 0, 1, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " try:\n creds = oauth_flow.step2_exchange(code)\n except FlowExchangeError:\n return None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99158:Assign_L181_C6", "label": "creds = step2_exchange()", "type": "assigned_variable", "loc": [181, 181], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99158:Try_L180_C4", "vector": [14, 3, 0.2992, 0.0017, 3, 0.25, 0.0, 394, 3, 1, 0, 0, 471, 10, 1], "semantic": {"name": "creds", "arg_names": [], "import_names": [], "rhs_call_name": "step2_exchange", "annotation": ""}, "snippet": " creds = oauth_flow.step2_exchange(code)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99158:Return_L183_C6", "label": "return", "type": "return", "loc": [183, 183], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99158:Try_L180_C4", "vector": [13, 3, 0.3025, 0.0017, 3, 0.25, 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_99158:Assign_L187_C4", "label": "users_service = CreateService()", "type": "assigned_variable", "loc": [187, 187], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99158:FunctionDef_L150_C2", "vector": [14, 2, 0.3091, 0.0017, 2, 0.35, 0.5, 630, 3, 3, 0, 0, 493, 10, 1], "semantic": {"name": "users_service", "arg_names": [], "import_names": [], "rhs_call_name": "CreateService", "annotation": ""}, "snippet": " users_service = CreateService('oauth2', 'v2', creds)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99158:Assign_L191_C4", "label": "userid = get()", "type": "assigned_variable", "loc": [191, 191], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99158:FunctionDef_L150_C2", "vector": [14, 2, 0.3157, 0.0017, 2, 0.35, 0.6, 403, 3, 1, 0, 0, 607, 10, 4], "semantic": {"name": "userid", "arg_names": [], "import_names": [], "rhs_call_name": "get", "annotation": ""}, "snippet": " userid = users_service.userinfo().get().execute().get('id')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99158:Assign_L194_C4", "label": "session = LilCookies()", "type": "assigned_variable", "loc": [194, 194], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99158:FunctionDef_L150_C2", "vector": [14, 2, 0.3207, 0.0017, 2, 0.35, 0.7, 83, 3, 2, 0, 0, 220, 10, 1], "semantic": {"name": "session", "arg_names": [], "import_names": [], "rhs_call_name": "LilCookies", "annotation": ""}, "snippet": " session = sessions.LilCookies(self, SESSION_SECRET)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99158:Expr_L195_C4", "label": "set_secure_cookie()", "type": "expression", "loc": [195, 195], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99158:FunctionDef_L150_C2", "vector": [8, 2, 0.3223, 0.0017, 2, 0.35, 0.8, 330, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "set_secure_cookie", "arg_names": [], "import_names": [], "rhs_call_name": "set_secure_cookie", "annotation": ""}, "snippet": " session.set_secure_cookie(name='userid', value=userid)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99158:Expr_L198_C4", "label": "put()", "type": "expression", "loc": [198, 198], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99158:FunctionDef_L150_C2", "vector": [8, 2, 0.3273, 0.0017, 2, 0.35, 0.9, 636, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "put", "arg_names": [], "import_names": [], "rhs_call_name": "put", "annotation": ""}, "snippet": " StorageByKeyName(Credentials, userid, 'credentials').put(creds)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99158:Return_L199_C4", "label": "return", "type": "return", "loc": [199, 199], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99158:FunctionDef_L150_C2", "vector": [13, 2, 0.3289, 0.0017, 2, 0.35, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return creds"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99158:FunctionDef_L201_C2", "label": "GetSessionCredentials", "type": "function", "loc": [201, 228], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99158:ClassDef_L126_C0", "vector": [2, 1, 0.3545, 0.0463, 1, 0.9, 0.375, 208, 0, 1, 1, 0, 0, 0, 4], "semantic": {"name": "GetSessionCredentials", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def GetSessionCredentials(self):\n \"\"\"Get OAuth 2.0 credentials for an HTTP session.\n\n If the user has a user id stored in their cookie session, extract that value\n and use it to load that user's credentials from the data store.\n\n Args:\n request: HTTP request to use session from."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99158:Expr_L202_C4", "label": "expression", "type": "expression", "loc": [202, 211], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99158:FunctionDef_L201_C2", "vector": [8, 2, 0.3413, 0.0165, 2, 0.82, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Get OAuth 2.0 credentials for an HTTP session.\n\n If the user has a user id stored in their cookie session, extract that value\n and use it to load that user's credentials from the data store.\n\n Args:\n request: HTTP request to use session from.\n Returns:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99158:Assign_L213_C4", "label": "session = LilCookies()", "type": "assigned_variable", "loc": [213, 213], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99158:FunctionDef_L201_C2", "vector": [14, 2, 0.3521, 0.0017, 2, 0.82, 0.1667, 83, 3, 2, 0, 0, 220, 10, 1], "semantic": {"name": "session", "arg_names": [], "import_names": [], "rhs_call_name": "LilCookies", "annotation": ""}, "snippet": " session = sessions.LilCookies(self, SESSION_SECRET)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99158:Assign_L214_C4", "label": "userid = get_secure_cookie()", "type": "assigned_variable", "loc": [214, 214], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99158:FunctionDef_L201_C2", "vector": [14, 2, 0.3537, 0.0017, 2, 0.82, 0.3333, 403, 3, 1, 0, 0, 71, 10, 1], "semantic": {"name": "userid", "arg_names": [], "import_names": [], "rhs_call_name": "get_secure_cookie", "annotation": ""}, "snippet": " userid = session.get_secure_cookie(name='userid')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99158:If_L215_C4", "label": "if", "type": "if", "loc": [215, 218], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99158:FunctionDef_L201_C2", "vector": [4, 2, 0.3579, 0.0066, 2, 0.82, 0.5, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not userid:\n # return None to indicate that no credentials could be loaded from the\n # session.\n return None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99158:Return_L218_C6", "label": "return", "type": "return", "loc": [218, 218], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99158:If_L215_C4", "vector": [13, 3, 0.3603, 0.0017, 3, 0.18, 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_99158:Assign_L221_C4", "label": "creds = get()", "type": "assigned_variable", "loc": [221, 221], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99158:FunctionDef_L201_C2", "vector": [14, 2, 0.3653, 0.0017, 2, 0.82, 0.6667, 394, 3, 0, 0, 0, 607, 10, 2], "semantic": {"name": "creds", "arg_names": [], "import_names": [], "rhs_call_name": "get", "annotation": ""}, "snippet": " creds = StorageByKeyName(Credentials, userid, 'credentials').get()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99158:If_L225_C4", "label": "if", "type": "if", "loc": [225, 226], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99158:FunctionDef_L201_C2", "vector": [4, 2, 0.3727, 0.0033, 2, 0.82, 0.8333, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if creds and creds.invalid:\n return None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99158:Return_L226_C6", "label": "return", "type": "return", "loc": [226, 226], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99158:If_L225_C4", "vector": [13, 3, 0.3736, 0.0017, 3, 0.94, 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_99158:Return_L228_C4", "label": "return", "type": "return", "loc": [228, 228], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99158:FunctionDef_L201_C2", "vector": [13, 2, 0.3769, 0.0017, 2, 0.82, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return creds"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99158:FunctionDef_L230_C2", "label": "RedirectAuth", "type": "function", "loc": [230, 252], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99158:ClassDef_L126_C0", "vector": [2, 1, 0.3983, 0.038, 1, 0.9, 0.5, 681, 0, 1, 0, 0, 0, 0, 3], "semantic": {"name": "RedirectAuth", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def RedirectAuth(self):\n \"\"\"Redirect a handler to an authorization page.\n\n Used when a handler fails to fetch credentials suitable for making Drive API\n requests. The request is redirected to an OAuth 2.0 authorization approval\n page and on approval, are returned to application.\n\n Args:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99158:Expr_L231_C4", "label": "expression", "type": "expression", "loc": [231, 239], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99158:FunctionDef_L230_C2", "vector": [8, 2, 0.3884, 0.0149, 2, 0.73, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Redirect a handler to an authorization page.\n\n Used when a handler fails to fetch credentials suitable for making Drive API\n requests. The request is redirected to an OAuth 2.0 authorization approval\n page and on approval, are returned to application.\n\n Args:\n handler: webapp.RequestHandler to redirect."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99158:Assign_L240_C4", "label": "flow = CreateOAuthFlow()", "type": "assigned_variable", "loc": [240, 240], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99158:FunctionDef_L230_C2", "vector": [14, 2, 0.3967, 0.0017, 2, 0.73, 0.25, 258, 3, 0, 0, 0, 672, 10, 1], "semantic": {"name": "flow", "arg_names": [], "import_names": [], "rhs_call_name": "CreateOAuthFlow", "annotation": ""}, "snippet": " flow = self.CreateOAuthFlow()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99158:Assign_L245_C4", "label": "flow.scope =", "type": "assigned_variable", "loc": [245, 245], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99158:FunctionDef_L230_C2", "vector": [14, 2, 0.405, 0.0017, 2, 0.73, 0.5, 584, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "flow.scope", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " flow.scope = ALL_SCOPES"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99158:Assign_L249_C4", "label": "uri = step1_get_authorize_url()", "type": "assigned_variable", "loc": [249, 249], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99158:FunctionDef_L230_C2", "vector": [14, 2, 0.4116, 0.0017, 2, 0.73, 0.75, 600, 3, 1, 0, 0, 752, 10, 1], "semantic": {"name": "uri", "arg_names": [], "import_names": [], "rhs_call_name": "step1_get_authorize_url", "annotation": ""}, "snippet": " uri = flow.step1_get_authorize_url(flow.redirect_uri)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99158:Expr_L252_C4", "label": "redirect()", "type": "expression", "loc": [252, 252], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99158:FunctionDef_L230_C2", "vector": [8, 2, 0.4165, 0.0017, 2, 0.73, 1.0, 206, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "redirect", "arg_names": [], "import_names": [], "rhs_call_name": "redirect", "annotation": ""}, "snippet": " self.redirect(uri)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99158:FunctionDef_L254_C2", "label": "RespondJSON", "type": "function", "loc": [254, 261], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99158:ClassDef_L126_C0", "vector": [2, 1, 0.4256, 0.0132, 1, 0.9, 0.625, 530, 0, 2, 0, 0, 0, 0, 2], "semantic": {"name": "RespondJSON", "arg_names": ["self", "data"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def RespondJSON(self, data):\n \"\"\"Generate a JSON response and return it to the client.\n\n Args:\n data: The data that will be converted to JSON to return.\n \"\"\"\n self.response.headers['Content-Type'] = 'application/json'\n self.response.out.write(json.dumps(data))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99158:Expr_L255_C4", "label": "expression", "type": "expression", "loc": [255, 259], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99158:FunctionDef_L254_C2", "vector": [8, 2, 0.4248, 0.0083, 2, 0.53, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Generate a JSON response and return it to the client.\n\n Args:\n data: The data that will be converted to JSON to return.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99158:Assign_L260_C4", "label": "assign", "type": "assigned_variable", "loc": [260, 260], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99158:FunctionDef_L254_C2", "vector": [14, 2, 0.4298, 0.0017, 2, 0.53, 0.5, 0, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.response.headers['Content-Type'] = 'application/json'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99158:Expr_L261_C4", "label": "write()", "type": "expression", "loc": [261, 261], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99158:FunctionDef_L254_C2", "vector": [8, 2, 0.4314, 0.0017, 2, 0.53, 1.0, 837, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "write", "arg_names": [], "import_names": [], "rhs_call_name": "write", "annotation": ""}, "snippet": " self.response.out.write(json.dumps(data))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99158:FunctionDef_L263_C2", "label": "CreateAuthorizedService", "type": "function", "loc": [263, 283], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99158:ClassDef_L126_C0", "vector": [2, 1, 0.4512, 0.0347, 1, 0.9, 0.75, 947, 0, 3, 1, 0, 0, 0, 3], "semantic": {"name": "CreateAuthorizedService", "arg_names": ["self", "service", "version"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def CreateAuthorizedService(self, service, version):\n \"\"\"Create an authorize service instance.\n\n The service can only ever retrieve the credentials from the session.\n\n Args:\n service: Service name (e.g 'drive', 'oauth2').\n version: Service version (e.g 'v1')."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99158:Expr_L264_C4", "label": "expression", "type": "expression", "loc": [264, 273], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99158:FunctionDef_L263_C2", "vector": [8, 2, 0.4438, 0.0165, 2, 0.87, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Create an authorize service instance.\n\n The service can only ever retrieve the credentials from the session.\n\n Args:\n service: Service name (e.g 'drive', 'oauth2').\n version: Service version (e.g 'v1').\n Returns:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99158:Assign_L275_C4", "label": "creds = GetSessionCredentials()", "type": "assigned_variable", "loc": [275, 275], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99158:FunctionDef_L263_C2", "vector": [14, 2, 0.4545, 0.0017, 2, 0.87, 0.5, 394, 3, 0, 0, 0, 208, 10, 1], "semantic": {"name": "creds", "arg_names": [], "import_names": [], "rhs_call_name": "GetSessionCredentials", "annotation": ""}, "snippet": " creds = self.GetSessionCredentials()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99158:If_L276_C4", "label": "if", "type": "if", "loc": [276, 283], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99158:FunctionDef_L263_C2", "vector": [4, 2, 0.462, 0.0132, 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 creds:\n # If the session contains credentials, use them to create a Drive service\n # instance.\n return CreateService(service, version, creds)\n else:\n # If no credentials could be loaded from the session, redirect the user to\n # the authorization page.\n self.RedirectAuth()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99158:Return_L279_C6", "label": "return", "type": "return", "loc": [279, 279], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99158:If_L276_C4", "vector": [13, 3, 0.4612, 0.0017, 3, 0.77, 0.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return CreateService(service, version, creds)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99158:Expr_L283_C6", "label": "RedirectAuth()", "type": "expression", "loc": [283, 283], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99158:If_L276_C4", "vector": [8, 3, 0.4678, 0.0017, 3, 0.77, 1.0, 681, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "RedirectAuth", "arg_names": [], "import_names": [], "rhs_call_name": "RedirectAuth", "annotation": ""}, "snippet": " self.RedirectAuth()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99158:FunctionDef_L285_C2", "label": "CreateDrive", "type": "function", "loc": [285, 287], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99158:ClassDef_L126_C0", "vector": [2, 1, 0.4727, 0.005, 1, 0.9, 0.875, 839, 0, 1, 1, 0, 0, 0, 1], "semantic": {"name": "CreateDrive", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def CreateDrive(self):\n \"\"\"Create a drive client instance.\"\"\"\n return self.CreateAuthorizedService('drive', 'v2')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99158:Expr_L286_C4", "label": "expression", "type": "expression", "loc": [286, 286], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99158:FunctionDef_L285_C2", "vector": [8, 2, 0.4727, 0.0017, 2, 0.14, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Create a drive client instance.\"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99158:Return_L287_C4", "label": "return", "type": "return", "loc": [287, 287], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99158:FunctionDef_L285_C2", "vector": [13, 2, 0.4744, 0.0017, 2, 0.14, 1.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self.CreateAuthorizedService('drive', 'v2')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99158:FunctionDef_L289_C2", "label": "CreateUserInfo", "type": "function", "loc": [289, 291], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99158:ClassDef_L126_C0", "vector": [2, 1, 0.4793, 0.005, 1, 0.9, 1.0, 15, 0, 1, 1, 0, 0, 0, 1], "semantic": {"name": "CreateUserInfo", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def CreateUserInfo(self):\n \"\"\"Create a user info client instance.\"\"\"\n return self.CreateAuthorizedService('oauth2', 'v2')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99158:Expr_L290_C4", "label": "expression", "type": "expression", "loc": [290, 290], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99158:FunctionDef_L289_C2", "vector": [8, 2, 0.4793, 0.0017, 2, 0.26, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Create a user info client instance.\"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99158:Return_L291_C4", "label": "return", "type": "return", "loc": [291, 291], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99158:FunctionDef_L289_C2", "vector": [13, 2, 0.481, 0.0017, 2, 0.26, 1.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self.CreateAuthorizedService('oauth2', 'v2')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99158:ClassDef_L294_C0", "label": "MainPage", "type": "class", "loc": [294, 334], "level": 0, "parent": null, "vector": [3, 0, 0.519, 0.0678, 0, 0.66, 0.7879, 516, 0, 2, 0, 0, 266, 0, 11], "semantic": {"name": "MainPage", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class MainPage(BaseDriveHandler):\n \"\"\"Web handler for the main page.\n\n Handles requests and returns the user interface for Open With and Create\n cases. Responsible for parsing the state provided from the Drive UI and acting\n appropriately.\n \"\"\"\n"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99158:Expr_L295_C2", "label": "expression", "type": "expression", "loc": [295, 300], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99158:ClassDef_L294_C0", "vector": [8, 1, 0.4917, 0.0099, 1, 0.1, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Web handler for the main page.\n\n Handles requests and returns the user interface for Open With and Create\n cases. Responsible for parsing the state provided from the Drive UI and acting\n appropriately.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99158:FunctionDef_L302_C2", "label": "get", "type": "function", "loc": [302, 329], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99158:ClassDef_L294_C0", "vector": [2, 1, 0.5215, 0.0463, 1, 0.1, 0.5, 607, 0, 1, 1, 0, 0, 0, 10], "semantic": {"name": "get", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def get(self):\n \"\"\"Handle GET for Create New and Open With.\n\n This creates an authorized client, and checks whether a resource id has\n been passed or not. If a resource ID has been passed, this is the Open\n With use-case, otherwise it is the Create New use-case.\n \"\"\"\n # Generate a state instance for the request, this includes the action, and"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99158:Expr_L303_C4", "label": "expression", "type": "expression", "loc": [303, 308], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99158:FunctionDef_L302_C2", "vector": [8, 2, 0.505, 0.0099, 2, 0.89, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Handle GET for Create New and Open With.\n\n This creates an authorized client, and checks whether a resource id has\n been passed or not. If a resource ID has been passed, this is the Open\n With use-case, otherwise it is the Create New use-case.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99158:Assign_L311_C4", "label": "drive_state = FromRequest()", "type": "assigned_variable", "loc": [311, 311], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99158:FunctionDef_L302_C2", "vector": [14, 2, 0.514, 0.0017, 2, 0.89, 0.1667, 359, 3, 1, 0, 0, 504, 10, 1], "semantic": {"name": "drive_state", "arg_names": [], "import_names": [], "rhs_call_name": "FromRequest", "annotation": ""}, "snippet": " drive_state = DriveState.FromRequest(self.request)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99158:If_L312_C4", "label": "if", "type": "if", "loc": [312, 317], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99158:FunctionDef_L302_C2", "vector": [4, 2, 0.5198, 0.0099, 2, 0.89, 0.3333, 0, 0, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if drive_state.action == 'open' and len(drive_state.ids) > 0:\n code = self.request.get('code')\n if code:\n code = '?code=%s' % code\n self.redirect('/#edit/%s%s' % (drive_state.ids[0], code))\n return"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99158:Assign_L313_C6", "label": "code = get()", "type": "assigned_variable", "loc": [313, 313], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99158:If_L312_C4", "vector": [14, 3, 0.5174, 0.0017, 3, 0.38, 0.0, 44, 3, 1, 0, 0, 607, 10, 1], "semantic": {"name": "code", "arg_names": [], "import_names": [], "rhs_call_name": "get", "annotation": ""}, "snippet": " code = self.request.get('code')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99158:If_L314_C6", "label": "if", "type": "if", "loc": [314, 315], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99158:If_L312_C4", "vector": [4, 3, 0.5198, 0.0033, 3, 0.38, 0.3333, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if code:\n code = '?code=%s' % code"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99158:Assign_L315_C8", "label": "code =", "type": "assigned_variable", "loc": [315, 315], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99158:If_L314_C6", "vector": [14, 4, 0.5207, 0.0017, 4, 0.94, 0.0, 44, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "code", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " code = '?code=%s' % code"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99158:Expr_L316_C6", "label": "redirect()", "type": "expression", "loc": [316, 316], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99158:If_L312_C4", "vector": [8, 3, 0.5223, 0.0017, 3, 0.38, 0.6667, 206, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "redirect", "arg_names": [], "import_names": [], "rhs_call_name": "redirect", "annotation": ""}, "snippet": " self.redirect('/#edit/%s%s' % (drive_state.ids[0], code))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99158:Return_L317_C6", "label": "return", "type": "return", "loc": [317, 317], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99158:If_L312_C4", "vector": [13, 3, 0.524, 0.0017, 3, 0.38, 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_99158:Assign_L321_C4", "label": "creds = GetCodeCredentials()", "type": "assigned_variable", "loc": [321, 321], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99158:FunctionDef_L302_C2", "vector": [14, 2, 0.5306, 0.0017, 2, 0.89, 0.5, 394, 3, 0, 0, 0, 113, 10, 1], "semantic": {"name": "creds", "arg_names": [], "import_names": [], "rhs_call_name": "GetCodeCredentials", "annotation": ""}, "snippet": " creds = self.GetCodeCredentials()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99158:If_L322_C4", "label": "if", "type": "if", "loc": [322, 323], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99158:FunctionDef_L302_C2", "vector": [4, 2, 0.5331, 0.0033, 2, 0.89, 0.6667, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not creds:\n return self.RedirectAuth()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99158:Return_L323_C6", "label": "return", "type": "return", "loc": [323, 323], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99158:If_L322_C4", "vector": [13, 3, 0.5339, 0.0017, 3, 0.54, 0.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self.RedirectAuth()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99158:Assign_L328_C4", "label": "client_id =", "type": "assigned_variable", "loc": [328, 328], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99158:FunctionDef_L302_C2", "vector": [14, 2, 0.5421, 0.0017, 2, 0.89, 0.8333, 542, 6, 0, 0, 0, 0, 0, 3], "semantic": {"name": "client_id", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " client_id = self.CreateOAuthFlow().client_id.split('.')[0].split('-')[0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99158:Expr_L329_C4", "label": "RenderTemplate()", "type": "expression", "loc": [329, 329], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99158:FunctionDef_L302_C2", "vector": [8, 2, 0.5438, 0.0017, 2, 0.89, 1.0, 734, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "RenderTemplate", "arg_names": [], "import_names": [], "rhs_call_name": "RenderTemplate", "annotation": ""}, "snippet": " self.RenderTemplate()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99158:FunctionDef_L331_C2", "label": "RenderTemplate", "type": "function", "loc": [331, 334], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99158:ClassDef_L294_C0", "vector": [2, 1, 0.5496, 0.0066, 1, 0.1, 1.0, 734, 0, 1, 0, 0, 0, 0, 1], "semantic": {"name": "RenderTemplate", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def RenderTemplate(self):\n \"\"\"Render a named template in a context.\"\"\"\n self.response.headers['Content-Type'] = 'text/html'\n self.response.out.write(INDEX_HTML)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99158:Expr_L332_C4", "label": "expression", "type": "expression", "loc": [332, 332], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99158:FunctionDef_L331_C2", "vector": [8, 2, 0.5488, 0.0017, 2, 0.54, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Render a named template in a context.\"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99158:Assign_L333_C4", "label": "assign", "type": "assigned_variable", "loc": [333, 333], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99158:FunctionDef_L331_C2", "vector": [14, 2, 0.5504, 0.0017, 2, 0.54, 0.5, 0, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.response.headers['Content-Type'] = 'text/html'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99158:Expr_L334_C4", "label": "write()", "type": "expression", "loc": [334, 334], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99158:FunctionDef_L331_C2", "vector": [8, 2, 0.5521, 0.0017, 2, 0.54, 1.0, 837, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "write", "arg_names": [], "import_names": [], "rhs_call_name": "write", "annotation": ""}, "snippet": " self.response.out.write(INDEX_HTML)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99158:ClassDef_L337_C0", "label": "ServiceHandler", "type": "class", "loc": [337, 473], "level": 0, "parent": null, "vector": [3, 0, 0.6694, 0.2264, 0, 0.66, 0.8182, 115, 0, 4, 0, 0, 266, 0, 34], "semantic": {"name": "ServiceHandler", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class ServiceHandler(BaseDriveHandler):\n \"\"\"Web handler for the service to read and write to Drive.\"\"\"\n\n def post(self):\n \"\"\"Called when HTTP POST requests are received by the web application.\n\n The POST body is JSON which is deserialized and used as values to create a\n new file in Drive. The authorization access token for this action is"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99158:Expr_L338_C2", "label": "expression", "type": "expression", "loc": [338, 338], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99158:ClassDef_L337_C0", "vector": [8, 1, 0.5587, 0.0017, 1, 0.97, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Web handler for the service to read and write to Drive.\"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99158:FunctionDef_L340_C2", "label": "post", "type": "function", "loc": [340, 377], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99158:ClassDef_L337_C0", "vector": [2, 1, 0.5926, 0.0628, 1, 0.97, 0.25, 304, 0, 1, 0, 0, 0, 0, 9], "semantic": {"name": "post", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def post(self):\n \"\"\"Called when HTTP POST requests are received by the web application.\n\n The POST body is JSON which is deserialized and used as values to create a\n new file in Drive. The authorization access token for this action is\n retreived from the data store.\n \"\"\"\n # Create a Drive service"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99158:Expr_L341_C4", "label": "expression", "type": "expression", "loc": [341, 346], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99158:FunctionDef_L340_C2", "vector": [8, 2, 0.5678, 0.0099, 2, 0.17, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Called when HTTP POST requests are received by the web application.\n\n The POST body is JSON which is deserialized and used as values to create a\n new file in Drive. The authorization access token for this action is\n retreived from the data store.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99158:Assign_L348_C4", "label": "service = CreateDrive()", "type": "assigned_variable", "loc": [348, 348], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99158:FunctionDef_L340_C2", "vector": [14, 2, 0.5752, 0.0017, 2, 0.17, 0.2, 314, 3, 0, 0, 0, 839, 10, 1], "semantic": {"name": "service", "arg_names": [], "import_names": [], "rhs_call_name": "CreateDrive", "annotation": ""}, "snippet": " service = self.CreateDrive()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99158:If_L349_C4", "label": "if", "type": "if", "loc": [349, 350], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99158:FunctionDef_L340_C2", "vector": [4, 2, 0.5777, 0.0033, 2, 0.17, 0.4, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if service is None:\n return"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99158:Return_L350_C6", "label": "return", "type": "return", "loc": [350, 350], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99158:If_L349_C4", "vector": [13, 3, 0.5785, 0.0017, 3, 0.78, 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_99158:Assign_L353_C4", "label": "data = RequestJSON()", "type": "assigned_variable", "loc": [353, 353], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99158:FunctionDef_L340_C2", "vector": [14, 2, 0.5835, 0.0017, 2, 0.17, 0.6, 929, 3, 0, 0, 0, 552, 10, 1], "semantic": {"name": "data", "arg_names": [], "import_names": [], "rhs_call_name": "RequestJSON", "annotation": ""}, "snippet": " data = self.RequestJSON()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99158:Assign_L356_C4", "label": "resource =", "type": "assigned_variable", "loc": [356, 360], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99158:FunctionDef_L340_C2", "vector": [14, 2, 0.5917, 0.0083, 2, 0.17, 0.8, 559, 0, 0, 0, 0, 0, 6, 0], "semantic": {"name": "resource", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " resource = {\n 'title': data['title'],\n 'description': data['description'],\n 'mimeType': data['mimeType'],\n }"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99158:Try_L361_C4", "label": "try", "type": "try", "loc": [361, 377], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99158:FunctionDef_L340_C2", "vector": [7, 2, 0.6099, 0.0281, 2, 0.17, 1.0, 0, 0, 1, 0, 0, 0, 0, 7], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " try:\n # Make an insert request to create a new file. A MediaInMemoryUpload\n # instance is used to upload the file body.\n resource = service.files().insert(\n body=resource,\n media_body=MediaInMemoryUpload(\n data.get('content', ''),\n data['mimeType'],"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99158:Assign_L364_C6", "label": "resource = execute()", "type": "assigned_variable", "loc": [364, 370], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99158:Try_L361_C4", "vector": [14, 3, 0.6066, 0.0116, 3, 0.71, 0.0, 559, 3, 0, 0, 0, 569, 10, 5], "semantic": {"name": "resource", "arg_names": [], "import_names": [], "rhs_call_name": "execute", "annotation": ""}, "snippet": " resource = service.files().insert(\n body=resource,\n media_body=MediaInMemoryUpload(\n data.get('content', ''),\n data['mimeType'],\n resumable=True)\n ).execute()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99158:Expr_L372_C6", "label": "RespondJSON()", "type": "expression", "loc": [372, 372], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99158:Try_L361_C4", "vector": [8, 3, 0.6149, 0.0017, 3, 0.71, 1.0, 530, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "RespondJSON", "arg_names": [], "import_names": [], "rhs_call_name": "RespondJSON", "annotation": ""}, "snippet": " self.RespondJSON(resource['id'])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99158:Expr_L377_C6", "label": "RedirectAuth()", "type": "expression", "loc": [377, 377], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99158:Try_L361_C4", "vector": [8, 3, 0.6231, 0.0017, 3, 0.71, 0.0, 681, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "RedirectAuth", "arg_names": [], "import_names": [], "rhs_call_name": "RedirectAuth", "annotation": ""}, "snippet": " self.RedirectAuth()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99158:FunctionDef_L379_C2", "label": "get", "type": "function", "loc": [379, 418], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99158:ClassDef_L337_C0", "vector": [2, 1, 0.6587, 0.0661, 1, 0.97, 0.5, 607, 0, 1, 0, 0, 0, 0, 9], "semantic": {"name": "get", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def get(self):\n \"\"\"Called when HTTP GET requests are received by the web application.\n\n Use the query parameter file_id to fetch the required file's metadata then\n content and return it as a JSON object.\n\n Since DrEdit deals with text files, it is safe to dump the content directly\n into JSON, but this is not the case with binary files, where something like"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99158:Expr_L380_C4", "label": "expression", "type": "expression", "loc": [380, 388], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99158:FunctionDef_L379_C2", "vector": [8, 2, 0.6347, 0.0149, 2, 0.99, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Called when HTTP GET requests are received by the web application.\n\n Use the query parameter file_id to fetch the required file's metadata then\n content and return it as a JSON object.\n\n Since DrEdit deals with text files, it is safe to dump the content directly\n into JSON, but this is not the case with binary files, where something like\n Base64 encoding is more appropriate."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99158:Assign_L390_C4", "label": "service = CreateDrive()", "type": "assigned_variable", "loc": [390, 390], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99158:FunctionDef_L379_C2", "vector": [14, 2, 0.6446, 0.0017, 2, 0.99, 0.3333, 314, 3, 0, 0, 0, 839, 10, 1], "semantic": {"name": "service", "arg_names": [], "import_names": [], "rhs_call_name": "CreateDrive", "annotation": ""}, "snippet": " service = self.CreateDrive()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99158:If_L391_C4", "label": "if", "type": "if", "loc": [391, 392], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99158:FunctionDef_L379_C2", "vector": [4, 2, 0.6471, 0.0033, 2, 0.99, 0.6667, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if service is None:\n return"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99158:Return_L392_C6", "label": "return", "type": "return", "loc": [392, 392], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99158:If_L391_C4", "vector": [13, 3, 0.6479, 0.0017, 3, 0.34, 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_99158:Try_L393_C4", "label": "try", "type": "try", "loc": [393, 418], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99158:FunctionDef_L379_C2", "vector": [7, 2, 0.6702, 0.043, 2, 0.99, 1.0, 0, 0, 1, 0, 0, 0, 0, 8], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " try:\n # Requests are expected to pass the file_id query parameter.\n file_id = self.request.get('file_id')\n if file_id:\n # Fetch the file metadata by making the service.files().get method of\n # the Drive API.\n f = service.files().get(fileId=file_id).execute()\n downloadUrl = f.get('downloadUrl')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99158:Assign_L395_C6", "label": "file_id = get()", "type": "assigned_variable", "loc": [395, 395], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99158:Try_L393_C4", "vector": [14, 3, 0.6529, 0.0017, 3, 0.44, 0.0, 375, 3, 1, 0, 0, 607, 10, 1], "semantic": {"name": "file_id", "arg_names": [], "import_names": [], "rhs_call_name": "get", "annotation": ""}, "snippet": " file_id = self.request.get('file_id')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99158:If_L396_C6", "label": "if", "type": "if", "loc": [396, 410], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99158:Try_L393_C4", "vector": [4, 3, 0.6661, 0.0248, 3, 0.44, 0.5, 0, 2, 0, 0, 0, 0, 0, 5], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if file_id:\n # Fetch the file metadata by making the service.files().get method of\n # the Drive API.\n f = service.files().get(fileId=file_id).execute()\n downloadUrl = f.get('downloadUrl')\n # If a download URL is provided in the file metadata, use it to make an\n # authorized request to fetch the file ontent. Set this content in the\n # data to return as the 'content' field. If there is no downloadUrl,"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99158:Assign_L399_C8", "label": "f = execute()", "type": "assigned_variable", "loc": [399, 399], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99158:If_L396_C6", "vector": [14, 4, 0.6595, 0.0017, 4, 0.84, 0.0, 899, 3, 0, 0, 0, 569, 10, 3], "semantic": {"name": "f", "arg_names": [], "import_names": [], "rhs_call_name": "execute", "annotation": ""}, "snippet": " f = service.files().get(fileId=file_id).execute()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99158:Assign_L400_C8", "label": "downloadUrl = get()", "type": "assigned_variable", "loc": [400, 400], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99158:If_L396_C6", "vector": [14, 4, 0.6612, 0.0017, 4, 0.84, 0.3333, 667, 3, 1, 0, 0, 607, 10, 1], "semantic": {"name": "downloadUrl", "arg_names": [], "import_names": [], "rhs_call_name": "get", "annotation": ""}, "snippet": " downloadUrl = f.get('downloadUrl')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99158:If_L405_C8", "label": "if", "type": "if", "loc": [405, 408], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99158:If_L396_C6", "vector": [4, 4, 0.6719, 0.0066, 4, 0.84, 0.6667, 0, 2, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if downloadUrl:\n resp, f['content'] = service._http.request(downloadUrl)\n else:\n f['content'] = ''"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99158:Assign_L406_C10", "label": "resp = request()", "type": "assigned_variable", "loc": [406, 406], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99158:If_L405_C8", "vector": [14, 5, 0.6711, 0.0017, 5, 0.45, 0.0, 48, 3, 1, 0, 0, 50, 10, 1], "semantic": {"name": "resp", "arg_names": [], "import_names": [], "rhs_call_name": "request", "annotation": ""}, "snippet": " resp, f['content'] = service._http.request(downloadUrl)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99158:Assign_L408_C10", "label": "assign", "type": "assigned_variable", "loc": [408, 408], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99158:If_L405_C8", "vector": [14, 5, 0.6744, 0.0017, 5, 0.45, 1.0, 0, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " f['content'] = ''"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99158:Assign_L410_C8", "label": "f =", "type": "assigned_variable", "loc": [410, 410], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99158:If_L396_C6", "vector": [14, 4, 0.6777, 0.0017, 4, 0.84, 1.0, 899, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "f", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " f = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99158:Expr_L412_C6", "label": "RespondJSON()", "type": "expression", "loc": [412, 412], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99158:Try_L393_C4", "vector": [8, 3, 0.681, 0.0017, 3, 0.44, 1.0, 530, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "RespondJSON", "arg_names": [], "import_names": [], "rhs_call_name": "RespondJSON", "annotation": ""}, "snippet": " self.RespondJSON(f)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99158:Expr_L418_C6", "label": "RedirectAuth()", "type": "expression", "loc": [418, 418], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99158:Try_L393_C4", "vector": [8, 3, 0.6909, 0.0017, 3, 0.44, 0.0, 681, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "RedirectAuth", "arg_names": [], "import_names": [], "rhs_call_name": "RedirectAuth", "annotation": ""}, "snippet": " self.RedirectAuth()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99158:FunctionDef_L420_C2", "label": "put", "type": "function", "loc": [420, 464], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99158:ClassDef_L337_C0", "vector": [2, 1, 0.7306, 0.0744, 1, 0.97, 0.75, 636, 0, 1, 0, 0, 0, 0, 15], "semantic": {"name": "put", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def put(self):\n \"\"\"Called when HTTP PUT requests are received by the web application.\n\n The PUT body is JSON which is deserialized and used as values to update\n a file in Drive. The authorization access token for this action is\n retreived from the data store.\n \"\"\"\n # Create a Drive service"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99158:Expr_L421_C4", "label": "expression", "type": "expression", "loc": [421, 426], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99158:FunctionDef_L420_C2", "vector": [8, 2, 0.7, 0.0099, 2, 0.94, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Called when HTTP PUT requests are received by the web application.\n\n The PUT body is JSON which is deserialized and used as values to update\n a file in Drive. The authorization access token for this action is\n retreived from the data store.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99158:Assign_L428_C4", "label": "service = CreateDrive()", "type": "assigned_variable", "loc": [428, 428], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99158:FunctionDef_L420_C2", "vector": [14, 2, 0.7074, 0.0017, 2, 0.94, 0.25, 314, 3, 0, 0, 0, 839, 10, 1], "semantic": {"name": "service", "arg_names": [], "import_names": [], "rhs_call_name": "CreateDrive", "annotation": ""}, "snippet": " service = self.CreateDrive()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99158:If_L429_C4", "label": "if", "type": "if", "loc": [429, 430], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99158:FunctionDef_L420_C2", "vector": [4, 2, 0.7099, 0.0033, 2, 0.94, 0.5, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if service is None:\n return"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99158:Return_L430_C6", "label": "return", "type": "return", "loc": [430, 430], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99158:If_L429_C4", "vector": [13, 3, 0.7107, 0.0017, 3, 0.81, 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_99158:Assign_L432_C4", "label": "data = RequestJSON()", "type": "assigned_variable", "loc": [432, 432], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99158:FunctionDef_L420_C2", "vector": [14, 2, 0.714, 0.0017, 2, 0.94, 0.75, 929, 3, 0, 0, 0, 552, 10, 1], "semantic": {"name": "data", "arg_names": [], "import_names": [], "rhs_call_name": "RequestJSON", "annotation": ""}, "snippet": " data = self.RequestJSON()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99158:Try_L433_C4", "label": "try", "type": "try", "loc": [433, 464], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99158:FunctionDef_L420_C2", "vector": [7, 2, 0.7413, 0.0529, 2, 0.94, 1.0, 0, 0, 1, 0, 0, 0, 0, 13], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " try:\n # Create a new file data structure.\n content = data.get('content')\n if 'content' in data:\n data.pop('content')\n if content is not None:\n # Make an update request to update the file. A MediaInMemoryUpload\n # instance is used to upload the file body. Because of a limitation, this"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99158:Assign_L435_C6", "label": "content = get()", "type": "assigned_variable", "loc": [435, 435], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99158:Try_L433_C4", "vector": [14, 3, 0.719, 0.0017, 3, 0.28, 0.0, 273, 3, 1, 0, 0, 607, 10, 1], "semantic": {"name": "content", "arg_names": [], "import_names": [], "rhs_call_name": "get", "annotation": ""}, "snippet": " content = data.get('content')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99158:If_L436_C6", "label": "if", "type": "if", "loc": [436, 437], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99158:Try_L433_C4", "vector": [4, 3, 0.7215, 0.0033, 3, 0.28, 0.3333, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if 'content' in data:\n data.pop('content')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99158:Expr_L437_C8", "label": "pop()", "type": "expression", "loc": [437, 437], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99158:If_L436_C6", "vector": [8, 4, 0.7223, 0.0017, 4, 0.45, 0.0, 969, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "pop", "arg_names": [], "import_names": [], "rhs_call_name": "pop", "annotation": ""}, "snippet": " data.pop('content')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99158:If_L438_C6", "label": "if", "type": "if", "loc": [438, 457], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99158:Try_L433_C4", "vector": [4, 3, 0.7397, 0.0331, 3, 0.28, 0.6667, 0, 0, 0, 0, 0, 0, 0, 9], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if content is not None:\n # Make an update request to update the file. A MediaInMemoryUpload\n # instance is used to upload the file body. Because of a limitation, this\n # request must be made in two parts, the first to update the metadata, and\n # the second to update the body.\n resource = service.files().update(\n fileId=data['resource_id'],\n newRevision=self.request.get('newRevision', False),"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99158:Assign_L443_C8", "label": "resource = execute()", "type": "assigned_variable", "loc": [443, 449], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99158:If_L438_C6", "vector": [14, 4, 0.7372, 0.0116, 4, 0.58, 0.0, 559, 3, 0, 0, 0, 569, 10, 5], "semantic": {"name": "resource", "arg_names": [], "import_names": [], "rhs_call_name": "execute", "annotation": ""}, "snippet": " resource = service.files().update(\n fileId=data['resource_id'],\n newRevision=self.request.get('newRevision', False),\n body=data,\n media_body=MediaInMemoryUpload(\n content, data['mimeType'], resumable=True)\n ).execute()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99158:Assign_L454_C8", "label": "resource = execute()", "type": "assigned_variable", "loc": [454, 457], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99158:If_L438_C6", "vector": [14, 4, 0.7529, 0.0066, 4, 0.58, 1.0, 559, 3, 0, 0, 0, 569, 10, 4], "semantic": {"name": "resource", "arg_names": [], "import_names": [], "rhs_call_name": "execute", "annotation": ""}, "snippet": " resource = service.files().update(\n fileId=data['resource_id'],\n newRevision=self.request.get('newRevision', False),\n body=data).execute()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99158:Expr_L459_C6", "label": "RespondJSON()", "type": "expression", "loc": [459, 459], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99158:Try_L433_C4", "vector": [8, 3, 0.7587, 0.0017, 3, 0.28, 1.0, 530, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "RespondJSON", "arg_names": [], "import_names": [], "rhs_call_name": "RespondJSON", "annotation": ""}, "snippet": " self.RespondJSON(resource['id'])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99158:Expr_L464_C6", "label": "RedirectAuth()", "type": "expression", "loc": [464, 464], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99158:Try_L433_C4", "vector": [8, 3, 0.7669, 0.0017, 3, 0.28, 0.0, 681, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "RedirectAuth", "arg_names": [], "import_names": [], "rhs_call_name": "RedirectAuth", "annotation": ""}, "snippet": " self.RedirectAuth()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99158:FunctionDef_L466_C2", "label": "RequestJSON", "type": "function", "loc": [466, 473], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99158:ClassDef_L337_C0", "vector": [2, 1, 0.776, 0.0132, 1, 0.97, 1.0, 552, 0, 1, 1, 0, 0, 0, 1], "semantic": {"name": "RequestJSON", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def RequestJSON(self):\n \"\"\"Load the request body as JSON.\n\n Returns:\n Request body loaded as JSON or None if there is no request body.\n \"\"\"\n if self.request.body:\n return json.loads(self.request.body)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99158:Expr_L467_C4", "label": "expression", "type": "expression", "loc": [467, 471], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99158:FunctionDef_L466_C2", "vector": [8, 2, 0.7752, 0.0083, 2, 0.28, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Load the request body as JSON.\n\n Returns:\n Request body loaded as JSON or None if there is no request body.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99158:If_L472_C4", "label": "if", "type": "if", "loc": [472, 473], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99158:FunctionDef_L466_C2", "vector": [4, 2, 0.781, 0.0033, 2, 0.28, 1.0, 0, 7, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self.request.body:\n return json.loads(self.request.body)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99158:Return_L473_C6", "label": "return", "type": "return", "loc": [473, 473], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99158:If_L472_C4", "vector": [13, 3, 0.7818, 0.0017, 3, 0.32, 0.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return json.loads(self.request.body)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99158:ClassDef_L476_C0", "label": "UserHandler", "type": "class", "loc": [476, 494], "level": 0, "parent": null, "vector": [3, 0, 0.8017, 0.0314, 0, 0.66, 0.8485, 299, 0, 1, 0, 0, 266, 0, 6], "semantic": {"name": "UserHandler", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class UserHandler(BaseDriveHandler):\n \"\"\"Web handler for the service to read user information.\"\"\"\n\n def get(self):\n \"\"\"Called when HTTP GET requests are received by the web application.\"\"\"\n # Create a Drive service\n service = self.CreateUserInfo()\n if service is None:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99158:Expr_L477_C2", "label": "expression", "type": "expression", "loc": [477, 477], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99158:ClassDef_L476_C0", "vector": [8, 1, 0.7884, 0.0017, 1, 0.56, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Web handler for the service to read user information.\"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99158:FunctionDef_L479_C2", "label": "get", "type": "function", "loc": [479, 494], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99158:ClassDef_L476_C0", "vector": [2, 1, 0.8041, 0.0264, 1, 0.56, 1.0, 607, 0, 1, 0, 0, 0, 0, 6], "semantic": {"name": "get", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def get(self):\n \"\"\"Called when HTTP GET requests are received by the web application.\"\"\"\n # Create a Drive service\n service = self.CreateUserInfo()\n if service is None:\n return\n try:\n result = service.userinfo().get().execute()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99158:Expr_L480_C4", "label": "expression", "type": "expression", "loc": [480, 480], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99158:FunctionDef_L479_C2", "vector": [8, 2, 0.7934, 0.0017, 2, 0.71, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Called when HTTP GET requests are received by the web application.\"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99158:Assign_L482_C4", "label": "service = CreateUserInfo()", "type": "assigned_variable", "loc": [482, 482], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99158:FunctionDef_L479_C2", "vector": [14, 2, 0.7967, 0.0017, 2, 0.71, 0.3333, 314, 3, 0, 0, 0, 15, 10, 1], "semantic": {"name": "service", "arg_names": [], "import_names": [], "rhs_call_name": "CreateUserInfo", "annotation": ""}, "snippet": " service = self.CreateUserInfo()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99158:If_L483_C4", "label": "if", "type": "if", "loc": [483, 484], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99158:FunctionDef_L479_C2", "vector": [4, 2, 0.7992, 0.0033, 2, 0.71, 0.6667, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if service is None:\n return"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99158:Return_L484_C6", "label": "return", "type": "return", "loc": [484, 484], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99158:If_L483_C4", "vector": [13, 3, 0.8, 0.0017, 3, 0.56, 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_99158:Try_L485_C4", "label": "try", "type": "try", "loc": [485, 494], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99158:FunctionDef_L479_C2", "vector": [7, 2, 0.8091, 0.0165, 2, 0.71, 1.0, 0, 0, 1, 0, 0, 0, 0, 5], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " try:\n result = service.userinfo().get().execute()\n # Generate a JSON response with the file data and return to the client.\n self.RespondJSON(result)\n except AccessTokenRefreshError:\n # Catch AccessTokenRefreshError which occurs when the API client library\n # fails to refresh a token. This occurs, for example, when a refresh token\n # is revoked. When this happens the user is redirected to the"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99158:Assign_L486_C6", "label": "result = execute()", "type": "assigned_variable", "loc": [486, 486], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99158:Try_L485_C4", "vector": [14, 3, 0.8033, 0.0017, 3, 0.19, 0.0, 51, 3, 0, 0, 0, 569, 10, 3], "semantic": {"name": "result", "arg_names": [], "import_names": [], "rhs_call_name": "execute", "annotation": ""}, "snippet": " result = service.userinfo().get().execute()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99158:Expr_L488_C6", "label": "RespondJSON()", "type": "expression", "loc": [488, 488], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99158:Try_L485_C4", "vector": [8, 3, 0.8066, 0.0017, 3, 0.19, 1.0, 530, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "RespondJSON", "arg_names": [], "import_names": [], "rhs_call_name": "RespondJSON", "annotation": ""}, "snippet": " self.RespondJSON(result)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99158:Expr_L494_C6", "label": "RedirectAuth()", "type": "expression", "loc": [494, 494], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99158:Try_L485_C4", "vector": [8, 3, 0.8165, 0.0017, 3, 0.19, 0.0, 681, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "RedirectAuth", "arg_names": [], "import_names": [], "rhs_call_name": "RedirectAuth", "annotation": ""}, "snippet": " self.RedirectAuth()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99158:ClassDef_L497_C0", "label": "AboutHandler", "type": "class", "loc": [497, 515], "level": 0, "parent": null, "vector": [3, 0, 0.8364, 0.0314, 0, 0.66, 0.8788, 925, 0, 1, 0, 0, 266, 0, 6], "semantic": {"name": "AboutHandler", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class AboutHandler(BaseDriveHandler):\n \"\"\"Web handler for the service to read user information.\"\"\"\n\n def get(self):\n \"\"\"Called when HTTP GET requests are received by the web application.\"\"\"\n # Create a Drive service\n service = self.CreateDrive()\n if service is None:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99158:Expr_L498_C2", "label": "expression", "type": "expression", "loc": [498, 498], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99158:ClassDef_L497_C0", "vector": [8, 1, 0.8231, 0.0017, 1, 0.9, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Web handler for the service to read user information.\"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99158:FunctionDef_L500_C2", "label": "get", "type": "function", "loc": [500, 515], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99158:ClassDef_L497_C0", "vector": [2, 1, 0.8388, 0.0264, 1, 0.9, 1.0, 607, 0, 1, 0, 0, 0, 0, 6], "semantic": {"name": "get", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def get(self):\n \"\"\"Called when HTTP GET requests are received by the web application.\"\"\"\n # Create a Drive service\n service = self.CreateDrive()\n if service is None:\n return\n try:\n result = service.about().get().execute()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99158:Expr_L501_C4", "label": "expression", "type": "expression", "loc": [501, 501], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99158:FunctionDef_L500_C2", "vector": [8, 2, 0.8281, 0.0017, 2, 0.75, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Called when HTTP GET requests are received by the web application.\"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99158:Assign_L503_C4", "label": "service = CreateDrive()", "type": "assigned_variable", "loc": [503, 503], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99158:FunctionDef_L500_C2", "vector": [14, 2, 0.8314, 0.0017, 2, 0.75, 0.3333, 314, 3, 0, 0, 0, 839, 10, 1], "semantic": {"name": "service", "arg_names": [], "import_names": [], "rhs_call_name": "CreateDrive", "annotation": ""}, "snippet": " service = self.CreateDrive()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99158:If_L504_C4", "label": "if", "type": "if", "loc": [504, 505], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99158:FunctionDef_L500_C2", "vector": [4, 2, 0.8339, 0.0033, 2, 0.75, 0.6667, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if service is None:\n return"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99158:Return_L505_C6", "label": "return", "type": "return", "loc": [505, 505], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99158:If_L504_C4", "vector": [13, 3, 0.8347, 0.0017, 3, 0.79, 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_99158:Try_L506_C4", "label": "try", "type": "try", "loc": [506, 515], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99158:FunctionDef_L500_C2", "vector": [7, 2, 0.8438, 0.0165, 2, 0.75, 1.0, 0, 0, 1, 0, 0, 0, 0, 5], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " try:\n result = service.about().get().execute()\n # Generate a JSON response with the file data and return to the client.\n self.RespondJSON(result)\n except AccessTokenRefreshError:\n # Catch AccessTokenRefreshError which occurs when the API client library\n # fails to refresh a token. This occurs, for example, when a refresh token\n # is revoked. When this happens the user is redirected to the"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99158:Assign_L507_C6", "label": "result = execute()", "type": "assigned_variable", "loc": [507, 507], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99158:Try_L506_C4", "vector": [14, 3, 0.838, 0.0017, 3, 0.66, 0.0, 51, 3, 0, 0, 0, 569, 10, 3], "semantic": {"name": "result", "arg_names": [], "import_names": [], "rhs_call_name": "execute", "annotation": ""}, "snippet": " result = service.about().get().execute()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99158:Expr_L509_C6", "label": "RespondJSON()", "type": "expression", "loc": [509, 509], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99158:Try_L506_C4", "vector": [8, 3, 0.8413, 0.0017, 3, 0.66, 1.0, 530, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "RespondJSON", "arg_names": [], "import_names": [], "rhs_call_name": "RespondJSON", "annotation": ""}, "snippet": " self.RespondJSON(result)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99158:Expr_L515_C6", "label": "RedirectAuth()", "type": "expression", "loc": [515, 515], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99158:Try_L506_C4", "vector": [8, 3, 0.8512, 0.0017, 3, 0.66, 0.0, 681, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "RedirectAuth", "arg_names": [], "import_names": [], "rhs_call_name": "RedirectAuth", "annotation": ""}, "snippet": " self.RedirectAuth()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99158:ClassDef_L518_C0", "label": "MediaInMemoryUpload", "type": "class", "loc": [518, 586], "level": 0, "parent": null, "vector": [3, 0, 0.9124, 0.114, 0, 0.66, 0.9091, 833, 0, 6, 0, 0, 102, 0, 1], "semantic": {"name": "MediaInMemoryUpload", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class MediaInMemoryUpload(MediaUpload):\n \"\"\"MediaUpload for a chunk of bytes.\n\n Construct a MediaFileUpload and pass as the media_body parameter of the\n method. For example, if we had a service that allowed plain text:\n \"\"\"\n\n def __init__(self, body, mimetype='application/octet-stream',"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99158:Expr_L519_C2", "label": "expression", "type": "expression", "loc": [519, 523], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99158:ClassDef_L518_C0", "vector": [8, 1, 0.8612, 0.0083, 1, 0.78, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"MediaUpload for a chunk of bytes.\n\n Construct a MediaFileUpload and pass as the media_body parameter of the\n method. For example, if we had a service that allowed plain text:\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99158:FunctionDef_L525_C2", "label": "__init__", "type": "function", "loc": [525, 541], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99158:ClassDef_L518_C0", "vector": [2, 1, 0.881, 0.0281, 1, 0.78, 0.1667, 555, 0, 5, 0, 0, 0, 0, 0], "semantic": {"name": "__init__", "arg_names": ["self", "body", "mimetype", "chunksize", "resumable"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, body, mimetype='application/octet-stream',\n chunksize=256*1024, resumable=False):\n \"\"\"Create a new MediaBytesUpload.\n\n Args:\n body: string, Bytes of body content.\n mimetype: string, Mime-type of the file or default of\n 'application/octet-stream'."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99158:Expr_L527_C4", "label": "expression", "type": "expression", "loc": [527, 537], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99158:FunctionDef_L525_C2", "vector": [8, 2, 0.8793, 0.0182, 2, 0.54, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Create a new MediaBytesUpload.\n\n Args:\n body: string, Bytes of body content.\n mimetype: string, Mime-type of the file or default of\n 'application/octet-stream'.\n chunksize: int, File will be uploaded in chunks of this many bytes. Only\n used if resumable=True."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99158:Assign_L538_C4", "label": "self._body =", "type": "assigned_variable", "loc": [538, 538], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99158:FunctionDef_L525_C2", "vector": [14, 2, 0.8893, 0.0017, 2, 0.54, 0.25, 36, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self._body", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self._body = body"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99158:Assign_L539_C4", "label": "self._mimetype =", "type": "assigned_variable", "loc": [539, 539], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99158:FunctionDef_L525_C2", "vector": [14, 2, 0.8909, 0.0017, 2, 0.54, 0.5, 699, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self._mimetype", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self._mimetype = mimetype"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99158:Assign_L540_C4", "label": "self._resumable =", "type": "assigned_variable", "loc": [540, 540], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99158:FunctionDef_L525_C2", "vector": [14, 2, 0.8926, 0.0017, 2, 0.54, 0.75, 847, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self._resumable", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self._resumable = resumable"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99158:Assign_L541_C4", "label": "self._chunksize =", "type": "assigned_variable", "loc": [541, 541], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99158:FunctionDef_L525_C2", "vector": [14, 2, 0.8942, 0.0017, 2, 0.54, 1.0, 383, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self._chunksize", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self._chunksize = chunksize"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99158:FunctionDef_L543_C2", "label": "chunksize", "type": "function", "loc": [543, 549], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99158:ClassDef_L518_C0", "vector": [2, 1, 0.9025, 0.0116, 1, 0.78, 0.3333, 120, 0, 1, 1, 0, 0, 0, 0], "semantic": {"name": "chunksize", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def chunksize(self):\n \"\"\"Chunk size for resumable uploads.\n\n Returns:\n Chunk size in bytes.\n \"\"\"\n return self._chunksize"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99158:Expr_L544_C4", "label": "expression", "type": "expression", "loc": [544, 548], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99158:FunctionDef_L543_C2", "vector": [8, 2, 0.9025, 0.0083, 2, 0.7, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Chunk size for resumable uploads.\n\n Returns:\n Chunk size in bytes.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99158:Return_L549_C4", "label": "return", "type": "return", "loc": [549, 549], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99158:FunctionDef_L543_C2", "vector": [13, 2, 0.9074, 0.0017, 2, 0.7, 1.0, 0, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self._chunksize"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99158:FunctionDef_L551_C2", "label": "mimetype", "type": "function", "loc": [551, 557], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99158:ClassDef_L518_C0", "vector": [2, 1, 0.9157, 0.0116, 1, 0.78, 0.5, 290, 0, 1, 1, 0, 0, 0, 0], "semantic": {"name": "mimetype", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def mimetype(self):\n \"\"\"Mime type of the body.\n\n Returns:\n Mime type.\n \"\"\"\n return self._mimetype"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99158:Expr_L552_C4", "label": "expression", "type": "expression", "loc": [552, 556], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99158:FunctionDef_L551_C2", "vector": [8, 2, 0.9157, 0.0083, 2, 0.83, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Mime type of the body.\n\n Returns:\n Mime type.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99158:Return_L557_C4", "label": "return", "type": "return", "loc": [557, 557], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99158:FunctionDef_L551_C2", "vector": [13, 2, 0.9207, 0.0017, 2, 0.83, 1.0, 0, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self._mimetype"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99158:FunctionDef_L559_C2", "label": "size", "type": "function", "loc": [559, 565], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99158:ClassDef_L518_C0", "vector": [2, 1, 0.9289, 0.0116, 1, 0.78, 0.6667, 714, 0, 1, 1, 0, 0, 0, 1], "semantic": {"name": "size", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def size(self):\n \"\"\"Size of upload.\n\n Returns:\n Size of the body.\n \"\"\"\n return len(self._body)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99158:Expr_L560_C4", "label": "expression", "type": "expression", "loc": [560, 564], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99158:FunctionDef_L559_C2", "vector": [8, 2, 0.9289, 0.0083, 2, 0.72, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Size of upload.\n\n Returns:\n Size of the body.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99158:Return_L565_C4", "label": "return", "type": "return", "loc": [565, 565], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99158:FunctionDef_L559_C2", "vector": [13, 2, 0.9339, 0.0017, 2, 0.72, 1.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return len(self._body)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99158:FunctionDef_L567_C2", "label": "resumable", "type": "function", "loc": [567, 573], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99158:ClassDef_L518_C0", "vector": [2, 1, 0.9421, 0.0116, 1, 0.78, 0.8333, 471, 0, 1, 1, 0, 0, 0, 0], "semantic": {"name": "resumable", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def resumable(self):\n \"\"\"Whether this upload is resumable.\n\n Returns:\n True if resumable upload or False.\n \"\"\"\n return self._resumable"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99158:Expr_L568_C4", "label": "expression", "type": "expression", "loc": [568, 572], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99158:FunctionDef_L567_C2", "vector": [8, 2, 0.9421, 0.0083, 2, 0.64, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Whether this upload is resumable.\n\n Returns:\n True if resumable upload or False.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99158:Return_L573_C4", "label": "return", "type": "return", "loc": [573, 573], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99158:FunctionDef_L567_C2", "vector": [13, 2, 0.9471, 0.0017, 2, 0.64, 1.0, 0, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self._resumable"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99158:FunctionDef_L575_C2", "label": "getbytes", "type": "function", "loc": [575, 586], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99158:ClassDef_L518_C0", "vector": [2, 1, 0.9595, 0.0198, 1, 0.78, 1.0, 626, 0, 3, 1, 0, 0, 0, 0], "semantic": {"name": "getbytes", "arg_names": ["self", "begin", "length"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def getbytes(self, begin, length):\n \"\"\"Get bytes from the media.\n\n Args:\n begin: int, offset from beginning of file.\n length: int, number of bytes to read, starting at begin.\n\n Returns:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99158:Expr_L576_C4", "label": "expression", "type": "expression", "loc": [576, 585], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99158:FunctionDef_L575_C2", "vector": [8, 2, 0.9595, 0.0165, 2, 0.11, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Get bytes from the media.\n\n Args:\n begin: int, offset from beginning of file.\n length: int, number of bytes to read, starting at begin.\n\n Returns:\n A string of bytes read. May be shorter than length if EOF was reached"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99158:Return_L586_C4", "label": "return", "type": "return", "loc": [586, 586], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99158:FunctionDef_L575_C2", "vector": [13, 2, 0.9686, 0.0017, 2, 0.11, 1.0, 0, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self._body[begin:begin + length]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99158:Assign_L591_C0", "label": "application = WSGIApplication()", "type": "assigned_variable", "loc": [591, 596], "level": 0, "parent": null, "vector": [14, 0, 0.981, 0.0099, 0, 0.66, 0.9394, 244, 3, 2, 0, 0, 623, 10, 1], "semantic": {"name": "application", "arg_names": [], "import_names": [], "rhs_call_name": "WSGIApplication", "annotation": ""}, "snippet": "application = webapp.WSGIApplication(\n [('/', MainPage), ('/svc', ServiceHandler), ('/about', AboutHandler),\n ('/user', UserHandler)],\n # XXX Set to False in production.\n debug=True\n)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99158:FunctionDef_L599_C0", "label": "main", "type": "function", "loc": [599, 601], "level": 0, "parent": null, "vector": [2, 0, 0.9917, 0.005, 0, 0.66, 0.9697, 624, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "main", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def main():\n \"\"\"Main entry point for executing a request with this handler.\"\"\"\n run_wsgi_app(application)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99158:Expr_L600_C2", "label": "expression", "type": "expression", "loc": [600, 600], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99158:FunctionDef_L599_C0", "vector": [8, 1, 0.9917, 0.0017, 1, 0.79, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Main entry point for executing a request with this handler.\"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99158:Expr_L601_C2", "label": "run_wsgi_app()", "type": "expression", "loc": [601, 601], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99158:FunctionDef_L599_C0", "vector": [8, 1, 0.9934, 0.0017, 1, 0.79, 1.0, 563, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "run_wsgi_app", "arg_names": [], "import_names": [], "rhs_call_name": "run_wsgi_app", "annotation": ""}, "snippet": " run_wsgi_app(application)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99158:If_L604_C0", "label": "if", "type": "if", "loc": [604, 605], "level": 0, "parent": null, "vector": [4, 0, 0.9992, 0.0033, 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_99158:Expr_L605_C4", "label": "main()", "type": "expression", "loc": [605, 605], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99158:If_L604_C0", "vector": [8, 1, 1.0, 0.0017, 1, 0.06, 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_99158:FunctionDef_L46_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99158:Expr_L47_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99158:FunctionDef_L46_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99158:Return_L54_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99158:ClassDef_L64_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99158:Expr_L65_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99158:ClassDef_L64_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99158:Assign_L69_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99158:FunctionDef_L72_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99158:Expr_L73_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99158:FunctionDef_L72_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99158:Assign_L86_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99158:FunctionDef_L72_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99158:Expr_L89_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99158:FunctionDef_L72_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99158:Return_L92_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99158:ClassDef_L95_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99158:Expr_L96_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99158:ClassDef_L95_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99158:FunctionDef_L98_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99158:FunctionDef_L98_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99158:Expr_L99_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99158:FunctionDef_L98_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99158:If_L106_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99158:If_L106_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99158:Assign_L107_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99158:If_L106_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99158:Assign_L108_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99158:If_L106_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99158:Assign_L109_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99158:If_L106_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99158:Assign_L111_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99158:If_L106_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99158:Assign_L112_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99158:ClassDef_L95_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99158:FunctionDef_L115_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99158:FunctionDef_L115_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99158:Expr_L116_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99158:FunctionDef_L115_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99158:Return_L122_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99158:ClassDef_L126_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99158:Expr_L127_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99158:ClassDef_L126_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99158:FunctionDef_L132_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99158:FunctionDef_L132_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99158:Expr_L133_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99158:FunctionDef_L132_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99158:Assign_L143_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99158:FunctionDef_L132_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99158:Assign_L147_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99158:FunctionDef_L132_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99158:Return_L148_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99158:ClassDef_L126_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99158:FunctionDef_L150_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99158:FunctionDef_L150_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99158:Expr_L151_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99158:FunctionDef_L150_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99158:Assign_L169_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99158:FunctionDef_L150_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99158:If_L170_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99158:If_L170_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99158:Return_L172_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99158:FunctionDef_L150_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99158:Assign_L176_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99158:FunctionDef_L150_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99158:Try_L180_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99158:Try_L180_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99158:Assign_L181_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99158:Try_L180_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99158:Return_L183_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99158:FunctionDef_L150_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99158:Assign_L187_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99158:FunctionDef_L150_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99158:Assign_L191_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99158:FunctionDef_L150_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99158:Assign_L194_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99158:FunctionDef_L150_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99158:Expr_L195_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99158:FunctionDef_L150_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99158:Expr_L198_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99158:FunctionDef_L150_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99158:Return_L199_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99158:ClassDef_L126_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99158:FunctionDef_L201_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99158:FunctionDef_L201_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99158:Expr_L202_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99158:FunctionDef_L201_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99158:Assign_L213_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99158:FunctionDef_L201_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99158:Assign_L214_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99158:FunctionDef_L201_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99158:If_L215_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99158:If_L215_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99158:Return_L218_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99158:FunctionDef_L201_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99158:Assign_L221_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99158:FunctionDef_L201_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99158:If_L225_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99158:If_L225_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99158:Return_L226_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99158:FunctionDef_L201_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99158:Return_L228_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99158:ClassDef_L126_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99158:FunctionDef_L230_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99158:FunctionDef_L230_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99158:Expr_L231_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99158:FunctionDef_L230_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99158:Assign_L240_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99158:FunctionDef_L230_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99158:Assign_L245_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99158:FunctionDef_L230_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99158:Assign_L249_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99158:FunctionDef_L230_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99158:Expr_L252_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99158:ClassDef_L126_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99158:FunctionDef_L254_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99158:FunctionDef_L254_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99158:Expr_L255_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99158:FunctionDef_L254_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99158:Assign_L260_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99158:FunctionDef_L254_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99158:Expr_L261_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99158:ClassDef_L126_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99158:FunctionDef_L263_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99158:FunctionDef_L263_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99158:Expr_L264_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99158:FunctionDef_L263_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99158:Assign_L275_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99158:FunctionDef_L263_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99158:If_L276_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99158:If_L276_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99158:Return_L279_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99158:If_L276_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99158:Expr_L283_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99158:ClassDef_L126_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99158:FunctionDef_L285_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99158:FunctionDef_L285_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99158:Expr_L286_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99158:FunctionDef_L285_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99158:Return_L287_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99158:ClassDef_L126_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99158:FunctionDef_L289_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99158:FunctionDef_L289_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99158:Expr_L290_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99158:FunctionDef_L289_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99158:Return_L291_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99158:ClassDef_L294_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99158:Expr_L295_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99158:ClassDef_L294_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99158:FunctionDef_L302_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99158:FunctionDef_L302_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99158:Expr_L303_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99158:FunctionDef_L302_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99158:Assign_L311_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99158:FunctionDef_L302_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99158:If_L312_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99158:If_L312_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99158:Assign_L313_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99158:If_L312_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99158:If_L314_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99158:If_L314_C6", "t": "ajibawa-2023/Python-Code-Large/train/row_99158:Assign_L315_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99158:If_L312_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99158:Expr_L316_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99158:If_L312_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99158:Return_L317_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99158:FunctionDef_L302_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99158:Assign_L321_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99158:FunctionDef_L302_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99158:If_L322_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99158:If_L322_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99158:Return_L323_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99158:FunctionDef_L302_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99158:Assign_L328_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99158:FunctionDef_L302_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99158:Expr_L329_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99158:ClassDef_L294_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99158:FunctionDef_L331_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99158:FunctionDef_L331_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99158:Expr_L332_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99158:FunctionDef_L331_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99158:Assign_L333_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99158:FunctionDef_L331_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99158:Expr_L334_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99158:ClassDef_L337_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99158:Expr_L338_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99158:ClassDef_L337_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99158:FunctionDef_L340_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99158:FunctionDef_L340_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99158:Expr_L341_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99158:FunctionDef_L340_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99158:Assign_L348_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99158:FunctionDef_L340_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99158:If_L349_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99158:If_L349_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99158:Return_L350_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99158:FunctionDef_L340_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99158:Assign_L353_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99158:FunctionDef_L340_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99158:Assign_L356_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99158:FunctionDef_L340_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99158:Try_L361_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99158:Try_L361_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99158:Assign_L364_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99158:Try_L361_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99158:Expr_L372_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99158:Try_L361_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99158:Expr_L377_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99158:ClassDef_L337_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99158:FunctionDef_L379_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99158:FunctionDef_L379_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99158:Expr_L380_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99158:FunctionDef_L379_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99158:Assign_L390_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99158:FunctionDef_L379_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99158:If_L391_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99158:If_L391_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99158:Return_L392_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99158:FunctionDef_L379_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99158:Try_L393_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99158:Try_L393_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99158:Assign_L395_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99158:Try_L393_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99158:If_L396_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99158:If_L396_C6", "t": "ajibawa-2023/Python-Code-Large/train/row_99158:Assign_L399_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99158:If_L396_C6", "t": "ajibawa-2023/Python-Code-Large/train/row_99158:Assign_L400_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99158:If_L396_C6", "t": "ajibawa-2023/Python-Code-Large/train/row_99158:If_L405_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99158:If_L405_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99158:Assign_L406_C10"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99158:If_L405_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99158:Assign_L408_C10"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99158:If_L396_C6", "t": "ajibawa-2023/Python-Code-Large/train/row_99158:Assign_L410_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99158:Try_L393_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99158:Expr_L412_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99158:Try_L393_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99158:Expr_L418_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99158:ClassDef_L337_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99158:FunctionDef_L420_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99158:FunctionDef_L420_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99158:Expr_L421_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99158:FunctionDef_L420_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99158:Assign_L428_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99158:FunctionDef_L420_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99158:If_L429_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99158:If_L429_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99158:Return_L430_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99158:FunctionDef_L420_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99158:Assign_L432_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99158:FunctionDef_L420_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99158:Try_L433_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99158:Try_L433_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99158:Assign_L435_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99158:Try_L433_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99158:If_L436_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99158:If_L436_C6", "t": "ajibawa-2023/Python-Code-Large/train/row_99158:Expr_L437_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99158:Try_L433_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99158:If_L438_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99158:If_L438_C6", "t": "ajibawa-2023/Python-Code-Large/train/row_99158:Assign_L443_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99158:If_L438_C6", "t": "ajibawa-2023/Python-Code-Large/train/row_99158:Assign_L454_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99158:Try_L433_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99158:Expr_L459_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99158:Try_L433_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99158:Expr_L464_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99158:ClassDef_L337_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99158:FunctionDef_L466_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99158:FunctionDef_L466_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99158:Expr_L467_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99158:FunctionDef_L466_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99158:If_L472_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99158:If_L472_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99158:Return_L473_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99158:ClassDef_L476_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99158:Expr_L477_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99158:ClassDef_L476_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99158:FunctionDef_L479_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99158:FunctionDef_L479_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99158:Expr_L480_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99158:FunctionDef_L479_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99158:Assign_L482_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99158:FunctionDef_L479_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99158:If_L483_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99158:If_L483_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99158:Return_L484_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99158:FunctionDef_L479_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99158:Try_L485_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99158:Try_L485_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99158:Assign_L486_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99158:Try_L485_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99158:Expr_L488_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99158:Try_L485_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99158:Expr_L494_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99158:ClassDef_L497_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99158:Expr_L498_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99158:ClassDef_L497_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99158:FunctionDef_L500_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99158:FunctionDef_L500_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99158:Expr_L501_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99158:FunctionDef_L500_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99158:Assign_L503_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99158:FunctionDef_L500_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99158:If_L504_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99158:If_L504_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99158:Return_L505_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99158:FunctionDef_L500_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99158:Try_L506_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99158:Try_L506_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99158:Assign_L507_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99158:Try_L506_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99158:Expr_L509_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99158:Try_L506_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99158:Expr_L515_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99158:ClassDef_L518_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99158:Expr_L519_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99158:ClassDef_L518_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99158:FunctionDef_L525_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99158:FunctionDef_L525_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99158:Expr_L527_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99158:FunctionDef_L525_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99158:Assign_L538_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99158:FunctionDef_L525_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99158:Assign_L539_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99158:FunctionDef_L525_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99158:Assign_L540_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99158:FunctionDef_L525_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99158:Assign_L541_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99158:ClassDef_L518_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99158:FunctionDef_L543_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99158:FunctionDef_L543_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99158:Expr_L544_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99158:FunctionDef_L543_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99158:Return_L549_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99158:ClassDef_L518_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99158:FunctionDef_L551_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99158:FunctionDef_L551_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99158:Expr_L552_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99158:FunctionDef_L551_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99158:Return_L557_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99158:ClassDef_L518_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99158:FunctionDef_L559_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99158:FunctionDef_L559_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99158:Expr_L560_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99158:FunctionDef_L559_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99158:Return_L565_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99158:ClassDef_L518_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99158:FunctionDef_L567_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99158:FunctionDef_L567_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99158:Expr_L568_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99158:FunctionDef_L567_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99158:Return_L573_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99158:ClassDef_L518_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99158:FunctionDef_L575_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99158:FunctionDef_L575_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99158:Expr_L576_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99158:FunctionDef_L575_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99158:Return_L586_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99158:FunctionDef_L599_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99158:Expr_L600_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99158:FunctionDef_L599_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99158:Expr_L601_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99158:If_L604_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99158:Expr_L605_C4"}]
#!/usr/bin/python # # Copyright (C) 2012 Google Inc. # # 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. __author__ = 'afshar@google.com (Ali Afshar)' import os import httplib2 import sessions from google.appengine.ext import db from google.appengine.ext.webapp import template from apiclient.discovery import build_from_document from apiclient.http import MediaUpload from oauth2client import client from oauth2client.appengine import CredentialsProperty from oauth2client.appengine import StorageByKeyName from oauth2client.appengine import simplejson as json APIS_BASE = 'https://www.googleapis.com' ALL_SCOPES = ('https://www.googleapis.com/auth/drive.file ' 'https://www.googleapis.com/auth/userinfo.email ' 'https://www.googleapis.com/auth/userinfo.profile') CODE_PARAMETER = 'code' STATE_PARAMETER = 'state' SESSION_SECRET = open('session.secret').read() DRIVE_DISCOVERY_DOC = open('drive.json').read() USERS_DISCOVERY_DOC = open('users.json').read() class Credentials(db.Model): """Datastore entity for storing OAuth2.0 credentials.""" credentials = CredentialsProperty() def CreateOAuthFlow(request): """Create OAuth2.0 flow controller Args: request: HTTP request to create OAuth2.0 flow for Returns: OAuth2.0 Flow instance suitable for performing OAuth2.0. """ flow = client.flow_from_clientsecrets('client-debug.json', scope='') flow.redirect_uri = request.url.split('?', 1)[0].rstrip('/') return flow def GetCodeCredentials(request): """Create OAuth2.0 credentials by extracting a code and performing OAuth2.0. Args: request: HTTP request used for extracting an authorization code. Returns: OAuth2.0 credentials suitable for authorizing clients. """ code = request.get(CODE_PARAMETER) if code: oauth_flow = CreateOAuthFlow(request) creds = oauth_flow.step2_exchange(code) users_service = CreateService(USERS_DISCOVERY_DOC, creds) userid = users_service.userinfo().get().execute().get('id') request.session.set_secure_cookie(name='userid', value=userid) StorageByKeyName(Credentials, userid, 'credentials').put(creds) return creds def GetSessionCredentials(request): """Get OAuth2.0 credentials for an HTTP session. Args: request: HTTP request to use session from. Returns: OAuth2.0 credentials suitable for authorizing clients. """ userid = request.session.get_secure_cookie(name='userid') if userid: creds = StorageByKeyName(Credentials, userid, 'credentials').get() if creds and not creds.invalid: return creds def CreateService(discovery_doc, creds): """Create a Google API service. Args: discovery_doc: Discovery doc used to configure service. creds: Credentials used to authorize service. Returns: Authorized Google API service. """ http = httplib2.Http() creds.authorize(http) return build_from_document(discovery_doc, APIS_BASE, http=http) def RedirectAuth(handler): """Redirect a handler to an authorization page. Args: handler: webapp.RequestHandler to redirect. """ flow = CreateOAuthFlow(handler.request) flow.scope = ALL_SCOPES uri = flow.step1_get_authorize_url(flow.redirect_uri) handler.redirect(uri) def CreateDrive(handler): """Create a fully authorized drive service for this handler. Args: handler: RequestHandler from which drive service is generated. Returns: Authorized drive service, generated from the handler request. """ request = handler.request request.session = sessions.LilCookies(handler, SESSION_SECRET) creds = GetCodeCredentials(request) or GetSessionCredentials(request) if creds: return CreateService(DRIVE_DISCOVERY_DOC, creds) else: RedirectAuth(handler) def ServiceEnabled(view): """Decorator to inject an authorized service into an HTTP handler. Args: view: HTTP request handler method. Returns: Decorated handler which accepts the service as a parameter. """ def ServiceDecoratedView(handler, view=view): service = CreateDrive(handler) response_data = view(handler, service) handler.response.headers['Content-Type'] = 'text/html' handler.response.out.write(response_data) return ServiceDecoratedView def ServiceEnabledJson(view): """Decorator to inject an authorized service into a JSON HTTP handler. Args: view: HTTP request handler method. Returns: Decorated handler which accepts the service as a parameter. """ def ServiceDecoratedView(handler, view=view): service = CreateDrive(handler) if handler.request.body: data = json.loads(handler.request.body) else: data = None response_data = json.dumps(view(handler, service, data)) handler.response.headers['Content-Type'] = 'application/json' handler.response.out.write(response_data) return ServiceDecoratedView class DriveState(object): """Store state provided by Drive.""" def __init__(self, state): self.ParseState(state) @classmethod def FromRequest(cls, request): """Create a Drive State instance from an HTTP request. Args: cls: Type this class method is called against. request: HTTP request. """ return DriveState(request.get(STATE_PARAMETER)) def ParseState(self, state): """Parse a state parameter and set internal values. Args: state: State parameter to parse. """ if state.startswith('{'): self.ParseJsonState(state) else: self.ParsePlainState(state) def ParseJsonState(self, state): """Parse a state parameter that is JSON. Args: state: State parameter to parse """ state_data = json.loads(state) self.action = state_data['action'] self.ids = map(str, state_data.get('ids', [])) def ParsePlainState(self, state): """Parse a state parameter that is a plain resource id or missing. Args: state: State parameter to parse """ if state: self.action = 'open' self.ids = [state] else: self.action = 'create' self.ids = [] class MediaInMemoryUpload(MediaUpload): """MediaUpload for a chunk of bytes. Construct a MediaFileUpload and pass as the media_body parameter of the method. For example, if we had a service that allowed plain text: """ def __init__(self, body, mimetype='application/octet-stream', chunksize=256*1024, resumable=False): """Create a new MediaBytesUpload. Args: body: string, Bytes of body content. mimetype: string, Mime-type of the file or default of 'application/octet-stream'. chunksize: int, File will be uploaded in chunks of this many bytes. Only used if resumable=True. resumable: bool, True if this is a resumable upload. False means upload in a single request. """ self._body = body self._mimetype = mimetype self._resumable = resumable self._chunksize = chunksize def chunksize(self): """Chunk size for resumable uploads. Returns: Chunk size in bytes. """ return self._chunksize def mimetype(self): """Mime type of the body. Returns: Mime type. """ return self._mimetype def size(self): """Size of upload. Returns: Size of the body. """ return len(self._body) def resumable(self): """Whether this upload is resumable. Returns: True if resumable upload or False. """ return self._resumable def getbytes(self, begin, length): """Get bytes from the media. Args: begin: int, offset from beginning of file. length: int, number of bytes to read, starting at begin. Returns: A string of bytes read. May be shorter than length if EOF was reached first. """ return self._body[begin:begin + length] def RenderTemplate(name, **context): """Render a named template in a context. Args: name: Template name. context: Keyword arguments to render as template variables. """ return template.render(name, context)
ajibawa-2023/Python-Code-Large/train/row_99159
133
305
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_99159:Assign_L17_C0", "label": "__author__ =", "type": "assigned_variable", "loc": [17, 17], "level": 0, "parent": null, "vector": [14, 0, 0.0557, 0.0033, 0, 0.66, 0.0, 777, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "__author__", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "__author__ = 'afshar@google.com (Ali Afshar)'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99159:Import_L21_C0", "label": "os import os", "type": "import", "loc": [21, 21], "level": 0, "parent": null, "vector": [1, 0, 0.0689, 0.0033, 0, 0.66, 0.0333, 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_99159:Import_L22_C0", "label": "httplib2 import httplib2", "type": "import", "loc": [22, 22], "level": 0, "parent": null, "vector": [1, 0, 0.0721, 0.0033, 0, 0.66, 0.0667, 273, 0, 1, 0, 0, 273, 0, 0], "semantic": {"name": "httplib2", "arg_names": [], "import_names": ["httplib2"], "rhs_call_name": "", "annotation": ""}, "snippet": "import httplib2"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99159:Import_L23_C0", "label": "sessions import sessions", "type": "import", "loc": [23, 23], "level": 0, "parent": null, "vector": [1, 0, 0.0754, 0.0033, 0, 0.66, 0.1, 787, 0, 1, 0, 0, 787, 0, 0], "semantic": {"name": "sessions", "arg_names": [], "import_names": ["sessions"], "rhs_call_name": "", "annotation": ""}, "snippet": "import sessions"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99159:ImportFrom_L24_C0", "label": "from google.appengine.ext import db", "type": "import", "loc": [24, 24], "level": 0, "parent": null, "vector": [1, 0, 0.0787, 0.0033, 0, 0.66, 0.1333, 167, 0, 1, 0, 0, 167, 0, 0], "semantic": {"name": "google.appengine.ext", "arg_names": [], "import_names": ["db"], "rhs_call_name": "", "annotation": ""}, "snippet": "from google.appengine.ext import db"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99159:ImportFrom_L25_C0", "label": "from google.appengine.ext.webapp import template", "type": "import", "loc": [25, 25], "level": 0, "parent": null, "vector": [1, 0, 0.082, 0.0033, 0, 0.66, 0.1667, 8, 0, 1, 0, 0, 8, 0, 0], "semantic": {"name": "google.appengine.ext.webapp", "arg_names": [], "import_names": ["template"], "rhs_call_name": "", "annotation": ""}, "snippet": "from google.appengine.ext.webapp import template"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99159:ImportFrom_L26_C0", "label": "from apiclient.discovery import build_from_document", "type": "import", "loc": [26, 26], "level": 0, "parent": null, "vector": [1, 0, 0.0852, 0.0033, 0, 0.66, 0.2, 78, 0, 1, 0, 0, 78, 0, 0], "semantic": {"name": "apiclient.discovery", "arg_names": [], "import_names": ["build_from_document"], "rhs_call_name": "", "annotation": ""}, "snippet": "from apiclient.discovery import build_from_document"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99159:ImportFrom_L27_C0", "label": "from apiclient.http import MediaUpload", "type": "import", "loc": [27, 27], "level": 0, "parent": null, "vector": [1, 0, 0.0885, 0.0033, 0, 0.66, 0.2333, 670, 0, 1, 0, 0, 670, 0, 0], "semantic": {"name": "apiclient.http", "arg_names": [], "import_names": ["MediaUpload"], "rhs_call_name": "", "annotation": ""}, "snippet": "from apiclient.http import MediaUpload"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99159:ImportFrom_L28_C0", "label": "from oauth2client import client", "type": "import", "loc": [28, 28], "level": 0, "parent": null, "vector": [1, 0, 0.0918, 0.0033, 0, 0.66, 0.2667, 90, 0, 1, 0, 0, 90, 0, 0], "semantic": {"name": "oauth2client", "arg_names": [], "import_names": ["client"], "rhs_call_name": "", "annotation": ""}, "snippet": "from oauth2client import client"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99159:ImportFrom_L29_C0", "label": "from oauth2client.appengine import CredentialsProperty", "type": "import", "loc": [29, 29], "level": 0, "parent": null, "vector": [1, 0, 0.0951, 0.0033, 0, 0.66, 0.3, 953, 0, 1, 0, 0, 953, 0, 0], "semantic": {"name": "oauth2client.appengine", "arg_names": [], "import_names": ["CredentialsProperty"], "rhs_call_name": "", "annotation": ""}, "snippet": "from oauth2client.appengine import CredentialsProperty"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99159:ImportFrom_L30_C0", "label": "from oauth2client.appengine import StorageByKeyName", "type": "import", "loc": [30, 30], "level": 0, "parent": null, "vector": [1, 0, 0.0984, 0.0033, 0, 0.66, 0.3333, 953, 0, 1, 0, 0, 953, 0, 0], "semantic": {"name": "oauth2client.appengine", "arg_names": [], "import_names": ["StorageByKeyName"], "rhs_call_name": "", "annotation": ""}, "snippet": "from oauth2client.appengine import StorageByKeyName"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99159:ImportFrom_L31_C0", "label": "from oauth2client.appengine import json", "type": "import", "loc": [31, 31], "level": 0, "parent": null, "vector": [1, 0, 0.1016, 0.0033, 0, 0.66, 0.3667, 953, 0, 1, 0, 0, 953, 0, 0], "semantic": {"name": "oauth2client.appengine", "arg_names": [], "import_names": ["json"], "rhs_call_name": "", "annotation": ""}, "snippet": "from oauth2client.appengine import simplejson as json"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99159:Assign_L34_C0", "label": "APIS_BASE =", "type": "assigned_variable", "loc": [34, 34], "level": 0, "parent": null, "vector": [14, 0, 0.1115, 0.0033, 0, 0.66, 0.4, 209, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "APIS_BASE", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "APIS_BASE = 'https://www.googleapis.com'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99159:Assign_L35_C0", "label": "ALL_SCOPES =", "type": "assigned_variable", "loc": [35, 37], "level": 0, "parent": null, "vector": [14, 0, 0.118, 0.0098, 0, 0.66, 0.4333, 422, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "ALL_SCOPES", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "ALL_SCOPES = ('https://www.googleapis.com/auth/drive.file '\n 'https://www.googleapis.com/auth/userinfo.email '\n 'https://www.googleapis.com/auth/userinfo.profile')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99159:Assign_L38_C0", "label": "CODE_PARAMETER =", "type": "assigned_variable", "loc": [38, 38], "level": 0, "parent": null, "vector": [14, 0, 0.1246, 0.0033, 0, 0.66, 0.4667, 689, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "CODE_PARAMETER", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "CODE_PARAMETER = 'code'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99159:Assign_L39_C0", "label": "STATE_PARAMETER =", "type": "assigned_variable", "loc": [39, 39], "level": 0, "parent": null, "vector": [14, 0, 0.1279, 0.0033, 0, 0.66, 0.5, 433, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "STATE_PARAMETER", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "STATE_PARAMETER = 'state'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99159:Assign_L40_C0", "label": "SESSION_SECRET = read()", "type": "assigned_variable", "loc": [40, 40], "level": 0, "parent": null, "vector": [14, 0, 0.1311, 0.0033, 0, 0.66, 0.5333, 330, 3, 0, 0, 0, 453, 10, 2], "semantic": {"name": "SESSION_SECRET", "arg_names": [], "import_names": [], "rhs_call_name": "read", "annotation": ""}, "snippet": "SESSION_SECRET = open('session.secret').read()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99159:Assign_L41_C0", "label": "DRIVE_DISCOVERY_DOC = read()", "type": "assigned_variable", "loc": [41, 41], "level": 0, "parent": null, "vector": [14, 0, 0.1344, 0.0033, 0, 0.66, 0.5667, 873, 3, 0, 0, 0, 453, 10, 2], "semantic": {"name": "DRIVE_DISCOVERY_DOC", "arg_names": [], "import_names": [], "rhs_call_name": "read", "annotation": ""}, "snippet": "DRIVE_DISCOVERY_DOC = open('drive.json').read()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99159:Assign_L42_C0", "label": "USERS_DISCOVERY_DOC = read()", "type": "assigned_variable", "loc": [42, 42], "level": 0, "parent": null, "vector": [14, 0, 0.1377, 0.0033, 0, 0.66, 0.6, 375, 3, 0, 0, 0, 453, 10, 2], "semantic": {"name": "USERS_DISCOVERY_DOC", "arg_names": [], "import_names": [], "rhs_call_name": "read", "annotation": ""}, "snippet": "USERS_DISCOVERY_DOC = open('users.json').read()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99159:ClassDef_L45_C0", "label": "Credentials", "type": "class", "loc": [45, 47], "level": 0, "parent": null, "vector": [3, 0, 0.1508, 0.0098, 0, 0.66, 0.6333, 309, 0, 0, 0, 0, 697, 0, 1], "semantic": {"name": "Credentials", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class Credentials(db.Model):\n \"\"\"Datastore entity for storing OAuth2.0 credentials.\"\"\"\n credentials = CredentialsProperty()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99159:Expr_L46_C2", "label": "expression", "type": "expression", "loc": [46, 46], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99159:ClassDef_L45_C0", "vector": [8, 1, 0.1508, 0.0033, 1, 0.66, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Datastore entity for storing OAuth2.0 credentials.\"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99159:Assign_L47_C2", "label": "credentials = CredentialsProperty()", "type": "assigned_variable", "loc": [47, 47], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99159:ClassDef_L45_C0", "vector": [14, 1, 0.1541, 0.0033, 1, 0.66, 1.0, 198, 3, 0, 0, 0, 135, 10, 1], "semantic": {"name": "credentials", "arg_names": [], "import_names": [], "rhs_call_name": "CredentialsProperty", "annotation": ""}, "snippet": " credentials = CredentialsProperty()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99159:FunctionDef_L50_C0", "label": "CreateOAuthFlow", "type": "function", "loc": [50, 60], "level": 0, "parent": null, "vector": [2, 0, 0.1803, 0.0361, 0, 0.66, 0.6667, 672, 0, 1, 1, 0, 0, 0, 3], "semantic": {"name": "CreateOAuthFlow", "arg_names": ["request"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def CreateOAuthFlow(request):\n \"\"\"Create OAuth2.0 flow controller\n\n Args:\n request: HTTP request to create OAuth2.0 flow for\n Returns:\n OAuth2.0 Flow instance suitable for performing OAuth2.0.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99159:Expr_L51_C2", "label": "expression", "type": "expression", "loc": [51, 57], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99159:FunctionDef_L50_C0", "vector": [8, 1, 0.177, 0.023, 1, 0.49, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Create OAuth2.0 flow controller\n\n Args:\n request: HTTP request to create OAuth2.0 flow for\n Returns:\n OAuth2.0 Flow instance suitable for performing OAuth2.0.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99159:Assign_L58_C2", "label": "flow = flow_from_clientsecrets()", "type": "assigned_variable", "loc": [58, 58], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99159:FunctionDef_L50_C0", "vector": [14, 1, 0.1902, 0.0033, 1, 0.49, 0.3333, 258, 3, 2, 0, 0, 355, 10, 1], "semantic": {"name": "flow", "arg_names": [], "import_names": [], "rhs_call_name": "flow_from_clientsecrets", "annotation": ""}, "snippet": " flow = client.flow_from_clientsecrets('client-debug.json', scope='')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99159:Assign_L59_C2", "label": "flow.redirect_uri = rstrip()", "type": "assigned_variable", "loc": [59, 59], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99159:FunctionDef_L50_C0", "vector": [14, 1, 0.1934, 0.0033, 1, 0.49, 0.6667, 890, 3, 1, 0, 0, 807, 10, 2], "semantic": {"name": "flow.redirect_uri", "arg_names": [], "import_names": [], "rhs_call_name": "rstrip", "annotation": ""}, "snippet": " flow.redirect_uri = request.url.split('?', 1)[0].rstrip('/')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99159:Return_L60_C2", "label": "return", "type": "return", "loc": [60, 60], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99159:FunctionDef_L50_C0", "vector": [13, 1, 0.1967, 0.0033, 1, 0.49, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return flow"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99159:FunctionDef_L63_C0", "label": "GetCodeCredentials", "type": "function", "loc": [63, 79], "level": 0, "parent": null, "vector": [2, 0, 0.2328, 0.0557, 0, 0.66, 0.7, 113, 0, 1, 1, 0, 0, 0, 11], "semantic": {"name": "GetCodeCredentials", "arg_names": ["request"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def GetCodeCredentials(request):\n \"\"\"Create OAuth2.0 credentials by extracting a code and performing OAuth2.0.\n\n Args:\n request: HTTP request used for extracting an authorization code.\n Returns:\n OAuth2.0 credentials suitable for authorizing clients.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99159:Expr_L64_C2", "label": "expression", "type": "expression", "loc": [64, 70], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99159:FunctionDef_L63_C0", "vector": [8, 1, 0.2197, 0.023, 1, 0.81, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Create OAuth2.0 credentials by extracting a code and performing OAuth2.0.\n\n Args:\n request: HTTP request used for extracting an authorization code.\n Returns:\n OAuth2.0 credentials suitable for authorizing clients.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99159:Assign_L71_C2", "label": "code = get()", "type": "assigned_variable", "loc": [71, 71], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99159:FunctionDef_L63_C0", "vector": [14, 1, 0.2328, 0.0033, 1, 0.81, 0.5, 44, 3, 1, 0, 0, 607, 10, 1], "semantic": {"name": "code", "arg_names": [], "import_names": [], "rhs_call_name": "get", "annotation": ""}, "snippet": " code = request.get(CODE_PARAMETER)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99159:If_L72_C2", "label": "if", "type": "if", "loc": [72, 79], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99159:FunctionDef_L63_C0", "vector": [4, 1, 0.2475, 0.0262, 1, 0.81, 1.0, 0, 2, 0, 0, 0, 0, 0, 10], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if code:\n oauth_flow = CreateOAuthFlow(request)\n creds = oauth_flow.step2_exchange(code)\n users_service = CreateService(USERS_DISCOVERY_DOC, creds)\n userid = users_service.userinfo().get().execute().get('id')\n request.session.set_secure_cookie(name='userid', value=userid)\n StorageByKeyName(Credentials, userid, 'credentials').put(creds)\n return creds"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99159:Assign_L73_C4", "label": "oauth_flow = CreateOAuthFlow()", "type": "assigned_variable", "loc": [73, 73], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99159:If_L72_C2", "vector": [14, 2, 0.2393, 0.0033, 2, 0.07, 0.0, 725, 3, 1, 0, 0, 672, 10, 1], "semantic": {"name": "oauth_flow", "arg_names": [], "import_names": [], "rhs_call_name": "CreateOAuthFlow", "annotation": ""}, "snippet": " oauth_flow = CreateOAuthFlow(request)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99159:Assign_L74_C4", "label": "creds = step2_exchange()", "type": "assigned_variable", "loc": [74, 74], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99159:If_L72_C2", "vector": [14, 2, 0.2426, 0.0033, 2, 0.07, 0.1667, 394, 3, 1, 0, 0, 471, 10, 1], "semantic": {"name": "creds", "arg_names": [], "import_names": [], "rhs_call_name": "step2_exchange", "annotation": ""}, "snippet": " creds = oauth_flow.step2_exchange(code)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99159:Assign_L75_C4", "label": "users_service = CreateService()", "type": "assigned_variable", "loc": [75, 75], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99159:If_L72_C2", "vector": [14, 2, 0.2459, 0.0033, 2, 0.07, 0.3333, 630, 3, 2, 0, 0, 493, 10, 1], "semantic": {"name": "users_service", "arg_names": [], "import_names": [], "rhs_call_name": "CreateService", "annotation": ""}, "snippet": " users_service = CreateService(USERS_DISCOVERY_DOC, creds)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99159:Assign_L76_C4", "label": "userid = get()", "type": "assigned_variable", "loc": [76, 76], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99159:If_L72_C2", "vector": [14, 2, 0.2492, 0.0033, 2, 0.07, 0.5, 403, 3, 1, 0, 0, 607, 10, 4], "semantic": {"name": "userid", "arg_names": [], "import_names": [], "rhs_call_name": "get", "annotation": ""}, "snippet": " userid = users_service.userinfo().get().execute().get('id')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99159:Expr_L77_C4", "label": "set_secure_cookie()", "type": "expression", "loc": [77, 77], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99159:If_L72_C2", "vector": [8, 2, 0.2525, 0.0033, 2, 0.07, 0.6667, 330, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "set_secure_cookie", "arg_names": [], "import_names": [], "rhs_call_name": "set_secure_cookie", "annotation": ""}, "snippet": " request.session.set_secure_cookie(name='userid', value=userid)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99159:Expr_L78_C4", "label": "put()", "type": "expression", "loc": [78, 78], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99159:If_L72_C2", "vector": [8, 2, 0.2557, 0.0033, 2, 0.07, 0.8333, 636, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "put", "arg_names": [], "import_names": [], "rhs_call_name": "put", "annotation": ""}, "snippet": " StorageByKeyName(Credentials, userid, 'credentials').put(creds)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99159:Return_L79_C4", "label": "return", "type": "return", "loc": [79, 79], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99159:If_L72_C2", "vector": [13, 2, 0.259, 0.0033, 2, 0.07, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return creds"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99159:FunctionDef_L82_C0", "label": "GetSessionCredentials", "type": "function", "loc": [82, 94], "level": 0, "parent": null, "vector": [2, 0, 0.2885, 0.0426, 0, 0.66, 0.7333, 208, 0, 1, 1, 0, 0, 0, 3], "semantic": {"name": "GetSessionCredentials", "arg_names": ["request"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def GetSessionCredentials(request):\n \"\"\"Get OAuth2.0 credentials for an HTTP session.\n\n Args:\n request: HTTP request to use session from.\n Returns:\n OAuth2.0 credentials suitable for authorizing clients.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99159:Expr_L83_C2", "label": "expression", "type": "expression", "loc": [83, 89], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99159:FunctionDef_L82_C0", "vector": [8, 1, 0.282, 0.023, 1, 0.85, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Get OAuth2.0 credentials for an HTTP session.\n\n Args:\n request: HTTP request to use session from.\n Returns:\n OAuth2.0 credentials suitable for authorizing clients.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99159:Assign_L90_C2", "label": "userid = get_secure_cookie()", "type": "assigned_variable", "loc": [90, 90], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99159:FunctionDef_L82_C0", "vector": [14, 1, 0.2951, 0.0033, 1, 0.85, 0.5, 403, 3, 1, 0, 0, 71, 10, 1], "semantic": {"name": "userid", "arg_names": [], "import_names": [], "rhs_call_name": "get_secure_cookie", "annotation": ""}, "snippet": " userid = request.session.get_secure_cookie(name='userid')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99159:If_L91_C2", "label": "if", "type": "if", "loc": [91, 94], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99159:FunctionDef_L82_C0", "vector": [4, 1, 0.3033, 0.0131, 1, 0.85, 1.0, 0, 2, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if userid:\n creds = StorageByKeyName(Credentials, userid, 'credentials').get()\n if creds and not creds.invalid:\n return creds"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99159:Assign_L92_C4", "label": "creds = get()", "type": "assigned_variable", "loc": [92, 92], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99159:If_L91_C2", "vector": [14, 2, 0.3016, 0.0033, 2, 0.4, 0.0, 394, 3, 0, 0, 0, 607, 10, 2], "semantic": {"name": "creds", "arg_names": [], "import_names": [], "rhs_call_name": "get", "annotation": ""}, "snippet": " creds = StorageByKeyName(Credentials, userid, 'credentials').get()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99159:If_L93_C4", "label": "if", "type": "if", "loc": [93, 94], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99159:If_L91_C2", "vector": [4, 2, 0.3066, 0.0066, 2, 0.4, 1.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if creds and not creds.invalid:\n return creds"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99159:Return_L94_C6", "label": "return", "type": "return", "loc": [94, 94], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99159:If_L93_C4", "vector": [13, 3, 0.3082, 0.0033, 3, 0.43, 0.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return creds"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99159:FunctionDef_L97_C0", "label": "CreateService", "type": "function", "loc": [97, 108], "level": 0, "parent": null, "vector": [2, 0, 0.3361, 0.0393, 0, 0.66, 0.7667, 493, 0, 2, 1, 0, 0, 0, 3], "semantic": {"name": "CreateService", "arg_names": ["discovery_doc", "creds"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def CreateService(discovery_doc, creds):\n \"\"\"Create a Google API service.\n\n Args:\n discovery_doc: Discovery doc used to configure service.\n creds: Credentials used to authorize service.\n Returns:\n Authorized Google API service."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99159:Expr_L98_C2", "label": "expression", "type": "expression", "loc": [98, 105], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99159:FunctionDef_L97_C0", "vector": [8, 1, 0.3328, 0.0262, 1, 0.37, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Create a Google API service.\n\n Args:\n discovery_doc: Discovery doc used to configure service.\n creds: Credentials used to authorize service.\n Returns:\n Authorized Google API service.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99159:Assign_L106_C2", "label": "http = Http()", "type": "assigned_variable", "loc": [106, 106], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99159:FunctionDef_L97_C0", "vector": [14, 1, 0.3475, 0.0033, 1, 0.37, 0.3333, 415, 3, 0, 0, 0, 967, 10, 1], "semantic": {"name": "http", "arg_names": [], "import_names": [], "rhs_call_name": "Http", "annotation": ""}, "snippet": " http = httplib2.Http()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99159:Expr_L107_C2", "label": "authorize()", "type": "expression", "loc": [107, 107], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99159:FunctionDef_L97_C0", "vector": [8, 1, 0.3508, 0.0033, 1, 0.37, 0.6667, 880, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "authorize", "arg_names": [], "import_names": [], "rhs_call_name": "authorize", "annotation": ""}, "snippet": " creds.authorize(http)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99159:Return_L108_C2", "label": "return", "type": "return", "loc": [108, 108], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99159:FunctionDef_L97_C0", "vector": [13, 1, 0.3541, 0.0033, 1, 0.37, 1.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return build_from_document(discovery_doc, APIS_BASE, http=http)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99159:FunctionDef_L111_C0", "label": "RedirectAuth", "type": "function", "loc": [111, 120], "level": 0, "parent": null, "vector": [2, 0, 0.3787, 0.0328, 0, 0.66, 0.8, 681, 0, 1, 0, 0, 0, 0, 3], "semantic": {"name": "RedirectAuth", "arg_names": ["handler"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def RedirectAuth(handler):\n \"\"\"Redirect a handler to an authorization page.\n\n Args:\n handler: webapp.RequestHandler to redirect.\n \"\"\"\n flow = CreateOAuthFlow(handler.request)\n flow.scope = ALL_SCOPES"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99159:Expr_L112_C2", "label": "expression", "type": "expression", "loc": [112, 116], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99159:FunctionDef_L111_C0", "vector": [8, 1, 0.3738, 0.0164, 1, 0.0, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Redirect a handler to an authorization page.\n\n Args:\n handler: webapp.RequestHandler to redirect.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99159:Assign_L117_C2", "label": "flow = CreateOAuthFlow()", "type": "assigned_variable", "loc": [117, 117], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99159:FunctionDef_L111_C0", "vector": [14, 1, 0.3836, 0.0033, 1, 0.0, 0.25, 258, 3, 1, 0, 0, 672, 10, 1], "semantic": {"name": "flow", "arg_names": [], "import_names": [], "rhs_call_name": "CreateOAuthFlow", "annotation": ""}, "snippet": " flow = CreateOAuthFlow(handler.request)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99159:Assign_L118_C2", "label": "flow.scope =", "type": "assigned_variable", "loc": [118, 118], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99159:FunctionDef_L111_C0", "vector": [14, 1, 0.3869, 0.0033, 1, 0.0, 0.5, 584, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "flow.scope", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " flow.scope = ALL_SCOPES"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99159:Assign_L119_C2", "label": "uri = step1_get_authorize_url()", "type": "assigned_variable", "loc": [119, 119], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99159:FunctionDef_L111_C0", "vector": [14, 1, 0.3902, 0.0033, 1, 0.0, 0.75, 600, 3, 1, 0, 0, 752, 10, 1], "semantic": {"name": "uri", "arg_names": [], "import_names": [], "rhs_call_name": "step1_get_authorize_url", "annotation": ""}, "snippet": " uri = flow.step1_get_authorize_url(flow.redirect_uri)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99159:Expr_L120_C2", "label": "redirect()", "type": "expression", "loc": [120, 120], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99159:FunctionDef_L111_C0", "vector": [8, 1, 0.3934, 0.0033, 1, 0.0, 1.0, 206, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "redirect", "arg_names": [], "import_names": [], "rhs_call_name": "redirect", "annotation": ""}, "snippet": " handler.redirect(uri)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99159:FunctionDef_L123_C0", "label": "CreateDrive", "type": "function", "loc": [123, 137], "level": 0, "parent": null, "vector": [2, 0, 0.4262, 0.0492, 0, 0.66, 0.8333, 839, 0, 1, 1, 0, 0, 0, 5], "semantic": {"name": "CreateDrive", "arg_names": ["handler"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def CreateDrive(handler):\n \"\"\"Create a fully authorized drive service for this handler.\n\n Args:\n handler: RequestHandler from which drive service is generated.\n Returns:\n Authorized drive service, generated from the handler request.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99159:Expr_L124_C2", "label": "expression", "type": "expression", "loc": [124, 130], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99159:FunctionDef_L123_C0", "vector": [8, 1, 0.4164, 0.023, 1, 0.2, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Create a fully authorized drive service for this handler.\n\n Args:\n handler: RequestHandler from which drive service is generated.\n Returns:\n Authorized drive service, generated from the handler request.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99159:Assign_L131_C2", "label": "request =", "type": "assigned_variable", "loc": [131, 131], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99159:FunctionDef_L123_C0", "vector": [14, 1, 0.4295, 0.0033, 1, 0.2, 0.25, 50, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "request", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " request = handler.request"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99159:Assign_L132_C2", "label": "request.session = LilCookies()", "type": "assigned_variable", "loc": [132, 132], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99159:FunctionDef_L123_C0", "vector": [14, 1, 0.4328, 0.0033, 1, 0.2, 0.5, 591, 3, 2, 0, 0, 220, 10, 1], "semantic": {"name": "request.session", "arg_names": [], "import_names": [], "rhs_call_name": "LilCookies", "annotation": ""}, "snippet": " request.session = sessions.LilCookies(handler, SESSION_SECRET)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99159:Assign_L133_C2", "label": "creds =", "type": "assigned_variable", "loc": [133, 133], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99159:FunctionDef_L123_C0", "vector": [14, 1, 0.4361, 0.0033, 1, 0.2, 0.75, 394, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "creds", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " creds = GetCodeCredentials(request) or GetSessionCredentials(request)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99159:If_L134_C2", "label": "if", "type": "if", "loc": [134, 137], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99159:FunctionDef_L123_C0", "vector": [4, 1, 0.4443, 0.0131, 1, 0.2, 1.0, 0, 2, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if creds:\n return CreateService(DRIVE_DISCOVERY_DOC, creds)\n else:\n RedirectAuth(handler)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99159:Return_L135_C4", "label": "return", "type": "return", "loc": [135, 135], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99159:If_L134_C2", "vector": [13, 2, 0.4426, 0.0033, 2, 0.58, 0.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return CreateService(DRIVE_DISCOVERY_DOC, creds)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99159:Expr_L137_C4", "label": "RedirectAuth()", "type": "expression", "loc": [137, 137], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99159:If_L134_C2", "vector": [8, 2, 0.4492, 0.0033, 2, 0.58, 1.0, 681, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "RedirectAuth", "arg_names": [], "import_names": [], "rhs_call_name": "RedirectAuth", "annotation": ""}, "snippet": " RedirectAuth(handler)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99159:FunctionDef_L140_C0", "label": "ServiceEnabled", "type": "function", "loc": [140, 153], "level": 0, "parent": null, "vector": [2, 0, 0.4803, 0.0459, 0, 0.66, 0.8667, 562, 0, 1, 1, 0, 0, 0, 3], "semantic": {"name": "ServiceEnabled", "arg_names": ["view"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def ServiceEnabled(view):\n \"\"\"Decorator to inject an authorized service into an HTTP handler.\n\n Args:\n view: HTTP request handler method.\n Returns:\n Decorated handler which accepts the service as a parameter.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99159:Expr_L141_C2", "label": "expression", "type": "expression", "loc": [141, 147], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99159:FunctionDef_L140_C0", "vector": [8, 1, 0.4721, 0.023, 1, 0.04, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Decorator to inject an authorized service into an HTTP handler.\n\n Args:\n view: HTTP request handler method.\n Returns:\n Decorated handler which accepts the service as a parameter.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99159:FunctionDef_L148_C2", "label": "ServiceDecoratedView", "type": "function", "loc": [148, 152], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99159:FunctionDef_L140_C0", "vector": [2, 1, 0.4918, 0.0164, 1, 0.04, 0.5, 667, 0, 2, 0, 0, 0, 0, 3], "semantic": {"name": "ServiceDecoratedView", "arg_names": ["handler", "view"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def ServiceDecoratedView(handler, view=view):\n service = CreateDrive(handler)\n response_data = view(handler, service)\n handler.response.headers['Content-Type'] = 'text/html'\n handler.response.out.write(response_data)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99159:Assign_L149_C4", "label": "service = CreateDrive()", "type": "assigned_variable", "loc": [149, 149], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99159:FunctionDef_L148_C2", "vector": [14, 2, 0.4885, 0.0033, 2, 0.68, 0.0, 314, 3, 1, 0, 0, 839, 10, 1], "semantic": {"name": "service", "arg_names": [], "import_names": [], "rhs_call_name": "CreateDrive", "annotation": ""}, "snippet": " service = CreateDrive(handler)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99159:Assign_L150_C4", "label": "response_data = view()", "type": "assigned_variable", "loc": [150, 150], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99159:FunctionDef_L148_C2", "vector": [14, 2, 0.4918, 0.0033, 2, 0.68, 0.3333, 701, 3, 2, 0, 0, 781, 10, 1], "semantic": {"name": "response_data", "arg_names": [], "import_names": [], "rhs_call_name": "view", "annotation": ""}, "snippet": " response_data = view(handler, service)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99159:Assign_L151_C4", "label": "assign", "type": "assigned_variable", "loc": [151, 151], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99159:FunctionDef_L148_C2", "vector": [14, 2, 0.4951, 0.0033, 2, 0.68, 0.6667, 0, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " handler.response.headers['Content-Type'] = 'text/html'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99159:Expr_L152_C4", "label": "write()", "type": "expression", "loc": [152, 152], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99159:FunctionDef_L148_C2", "vector": [8, 2, 0.4984, 0.0033, 2, 0.68, 1.0, 837, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "write", "arg_names": [], "import_names": [], "rhs_call_name": "write", "annotation": ""}, "snippet": " handler.response.out.write(response_data)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99159:Return_L153_C2", "label": "return", "type": "return", "loc": [153, 153], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99159:FunctionDef_L140_C0", "vector": [13, 1, 0.5016, 0.0033, 1, 0.04, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return ServiceDecoratedView"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99159:FunctionDef_L156_C0", "label": "ServiceEnabledJson", "type": "function", "loc": [156, 173], "level": 0, "parent": null, "vector": [2, 0, 0.5393, 0.059, 0, 0.66, 0.9, 499, 0, 1, 1, 0, 0, 0, 5], "semantic": {"name": "ServiceEnabledJson", "arg_names": ["view"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def ServiceEnabledJson(view):\n \"\"\"Decorator to inject an authorized service into a JSON HTTP handler.\n\n Args:\n view: HTTP request handler method.\n Returns:\n Decorated handler which accepts the service as a parameter.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99159:Expr_L157_C2", "label": "expression", "type": "expression", "loc": [157, 163], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99159:FunctionDef_L156_C0", "vector": [8, 1, 0.5246, 0.023, 1, 0.5, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Decorator to inject an authorized service into a JSON HTTP handler.\n\n Args:\n view: HTTP request handler method.\n Returns:\n Decorated handler which accepts the service as a parameter.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99159:FunctionDef_L164_C2", "label": "ServiceDecoratedView", "type": "function", "loc": [164, 172], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99159:FunctionDef_L156_C0", "vector": [2, 1, 0.5508, 0.0295, 1, 0.5, 0.5, 667, 0, 2, 0, 0, 0, 0, 5], "semantic": {"name": "ServiceDecoratedView", "arg_names": ["handler", "view"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def ServiceDecoratedView(handler, view=view):\n service = CreateDrive(handler)\n if handler.request.body:\n data = json.loads(handler.request.body)\n else:\n data = None\n response_data = json.dumps(view(handler, service, data))\n handler.response.headers['Content-Type'] = 'application/json'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99159:Assign_L165_C4", "label": "service = CreateDrive()", "type": "assigned_variable", "loc": [165, 165], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99159:FunctionDef_L164_C2", "vector": [14, 2, 0.541, 0.0033, 2, 0.15, 0.0, 314, 3, 1, 0, 0, 839, 10, 1], "semantic": {"name": "service", "arg_names": [], "import_names": [], "rhs_call_name": "CreateDrive", "annotation": ""}, "snippet": " service = CreateDrive(handler)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99159:If_L166_C4", "label": "if", "type": "if", "loc": [166, 169], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99159:FunctionDef_L164_C2", "vector": [4, 2, 0.5492, 0.0131, 2, 0.15, 0.25, 0, 7, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if handler.request.body:\n data = json.loads(handler.request.body)\n else:\n data = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99159:Assign_L167_C6", "label": "data = loads()", "type": "assigned_variable", "loc": [167, 167], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99159:If_L166_C4", "vector": [14, 3, 0.5475, 0.0033, 3, 0.37, 0.0, 929, 3, 1, 0, 0, 88, 10, 1], "semantic": {"name": "data", "arg_names": [], "import_names": [], "rhs_call_name": "loads", "annotation": ""}, "snippet": " data = json.loads(handler.request.body)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99159:Assign_L169_C6", "label": "data =", "type": "assigned_variable", "loc": [169, 169], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99159:If_L166_C4", "vector": [14, 3, 0.5541, 0.0033, 3, 0.37, 1.0, 929, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "data", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " data = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99159:Assign_L170_C4", "label": "response_data = dumps()", "type": "assigned_variable", "loc": [170, 170], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99159:FunctionDef_L164_C2", "vector": [14, 2, 0.5574, 0.0033, 2, 0.15, 0.5, 701, 3, 1, 0, 0, 160, 10, 2], "semantic": {"name": "response_data", "arg_names": [], "import_names": [], "rhs_call_name": "dumps", "annotation": ""}, "snippet": " response_data = json.dumps(view(handler, service, data))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99159:Assign_L171_C4", "label": "assign", "type": "assigned_variable", "loc": [171, 171], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99159:FunctionDef_L164_C2", "vector": [14, 2, 0.5607, 0.0033, 2, 0.15, 0.75, 0, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " handler.response.headers['Content-Type'] = 'application/json'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99159:Expr_L172_C4", "label": "write()", "type": "expression", "loc": [172, 172], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99159:FunctionDef_L164_C2", "vector": [8, 2, 0.5639, 0.0033, 2, 0.15, 1.0, 837, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "write", "arg_names": [], "import_names": [], "rhs_call_name": "write", "annotation": ""}, "snippet": " handler.response.out.write(response_data)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99159:Return_L173_C2", "label": "return", "type": "return", "loc": [173, 173], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99159:FunctionDef_L156_C0", "vector": [13, 1, 0.5672, 0.0033, 1, 0.5, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return ServiceDecoratedView"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99159:ClassDef_L176_C0", "label": "DriveState", "type": "class", "loc": [176, 224], "level": 0, "parent": null, "vector": [3, 0, 0.6557, 0.1607, 0, 0.66, 0.9333, 620, 0, 5, 0, 0, 186, 0, 9], "semantic": {"name": "DriveState", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class DriveState(object):\n \"\"\"Store state provided by Drive.\"\"\"\n\n def __init__(self, state):\n self.ParseState(state)\n\n @classmethod\n def FromRequest(cls, request):"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99159:Expr_L177_C2", "label": "expression", "type": "expression", "loc": [177, 177], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99159:ClassDef_L176_C0", "vector": [8, 1, 0.5803, 0.0033, 1, 0.65, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Store state provided by Drive.\"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99159:FunctionDef_L179_C2", "label": "__init__", "type": "function", "loc": [179, 180], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99159:ClassDef_L176_C0", "vector": [2, 1, 0.5885, 0.0066, 1, 0.65, 0.2, 555, 0, 2, 0, 0, 0, 0, 1], "semantic": {"name": "__init__", "arg_names": ["self", "state"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, state):\n self.ParseState(state)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99159:Expr_L180_C4", "label": "ParseState()", "type": "expression", "loc": [180, 180], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99159:FunctionDef_L179_C2", "vector": [8, 2, 0.5902, 0.0033, 2, 0.59, 0.0, 17, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "ParseState", "arg_names": [], "import_names": [], "rhs_call_name": "ParseState", "annotation": ""}, "snippet": " self.ParseState(state)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99159:FunctionDef_L183_C2", "label": "FromRequest", "type": "function", "loc": [183, 190], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99159:ClassDef_L176_C0", "vector": [2, 1, 0.6115, 0.0262, 1, 0.65, 0.4, 504, 0, 2, 1, 0, 0, 0, 2], "semantic": {"name": "FromRequest", "arg_names": ["cls", "request"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def FromRequest(cls, request):\n \"\"\"Create a Drive State instance from an HTTP request.\n\n Args:\n cls: Type this class method is called against.\n request: HTTP request.\n \"\"\"\n return DriveState(request.get(STATE_PARAMETER))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99159:Expr_L184_C4", "label": "expression", "type": "expression", "loc": [184, 189], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99159:FunctionDef_L183_C2", "vector": [8, 2, 0.6115, 0.0197, 2, 0.3, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Create a Drive State instance from an HTTP request.\n\n Args:\n cls: Type this class method is called against.\n request: HTTP request.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99159:Return_L190_C4", "label": "return", "type": "return", "loc": [190, 190], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99159:FunctionDef_L183_C2", "vector": [13, 2, 0.623, 0.0033, 2, 0.3, 1.0, 0, 3, 0, 0, 0, 0, 10, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return DriveState(request.get(STATE_PARAMETER))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99159:FunctionDef_L192_C2", "label": "ParseState", "type": "function", "loc": [192, 201], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99159:ClassDef_L176_C0", "vector": [2, 1, 0.6443, 0.0328, 1, 0.65, 0.6, 17, 0, 2, 0, 0, 0, 0, 3], "semantic": {"name": "ParseState", "arg_names": ["self", "state"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def ParseState(self, state):\n \"\"\"Parse a state parameter and set internal values.\n\n Args:\n state: State parameter to parse.\n \"\"\"\n if state.startswith('{'):\n self.ParseJsonState(state)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99159:Expr_L193_C4", "label": "expression", "type": "expression", "loc": [193, 197], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99159:FunctionDef_L192_C2", "vector": [8, 2, 0.6393, 0.0164, 2, 0.57, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Parse a state parameter and set internal values.\n\n Args:\n state: State parameter to parse.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99159:If_L198_C4", "label": "if", "type": "if", "loc": [198, 201], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99159:FunctionDef_L192_C2", "vector": [4, 2, 0.6541, 0.0131, 2, 0.57, 1.0, 0, 3, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if state.startswith('{'):\n self.ParseJsonState(state)\n else:\n self.ParsePlainState(state)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99159:Expr_L199_C6", "label": "ParseJsonState()", "type": "expression", "loc": [199, 199], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99159:If_L198_C4", "vector": [8, 3, 0.6525, 0.0033, 3, 0.8, 0.0, 406, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "ParseJsonState", "arg_names": [], "import_names": [], "rhs_call_name": "ParseJsonState", "annotation": ""}, "snippet": " self.ParseJsonState(state)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99159:Expr_L201_C6", "label": "ParsePlainState()", "type": "expression", "loc": [201, 201], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99159:If_L198_C4", "vector": [8, 3, 0.659, 0.0033, 3, 0.8, 1.0, 786, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "ParsePlainState", "arg_names": [], "import_names": [], "rhs_call_name": "ParsePlainState", "annotation": ""}, "snippet": " self.ParsePlainState(state)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99159:FunctionDef_L203_C2", "label": "ParseJsonState", "type": "function", "loc": [203, 211], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99159:ClassDef_L176_C0", "vector": [2, 1, 0.6787, 0.0295, 1, 0.65, 0.8, 406, 0, 2, 0, 0, 0, 0, 3], "semantic": {"name": "ParseJsonState", "arg_names": ["self", "state"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def ParseJsonState(self, state):\n \"\"\"Parse a state parameter that is JSON.\n\n Args:\n state: State parameter to parse\n \"\"\"\n state_data = json.loads(state)\n self.action = state_data['action']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99159:Expr_L204_C4", "label": "expression", "type": "expression", "loc": [204, 208], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99159:FunctionDef_L203_C2", "vector": [8, 2, 0.6754, 0.0164, 2, 0.5, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Parse a state parameter that is JSON.\n\n Args:\n state: State parameter to parse\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99159:Assign_L209_C4", "label": "state_data = loads()", "type": "assigned_variable", "loc": [209, 209], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99159:FunctionDef_L203_C2", "vector": [14, 2, 0.6852, 0.0033, 2, 0.5, 0.3333, 203, 3, 1, 0, 0, 88, 10, 1], "semantic": {"name": "state_data", "arg_names": [], "import_names": [], "rhs_call_name": "loads", "annotation": ""}, "snippet": " state_data = json.loads(state)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99159:Assign_L210_C4", "label": "self.action =", "type": "assigned_variable", "loc": [210, 210], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99159:FunctionDef_L203_C2", "vector": [14, 2, 0.6885, 0.0033, 2, 0.5, 0.6667, 222, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.action", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.action = state_data['action']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99159:Assign_L211_C4", "label": "self.ids = map()", "type": "assigned_variable", "loc": [211, 211], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99159:FunctionDef_L203_C2", "vector": [14, 2, 0.6918, 0.0033, 2, 0.5, 1.0, 806, 3, 2, 0, 0, 53, 10, 2], "semantic": {"name": "self.ids", "arg_names": [], "import_names": [], "rhs_call_name": "map", "annotation": ""}, "snippet": " self.ids = map(str, state_data.get('ids', []))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99159:FunctionDef_L213_C2", "label": "ParsePlainState", "type": "function", "loc": [213, 224], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99159:ClassDef_L176_C0", "vector": [2, 1, 0.7164, 0.0393, 1, 0.65, 1.0, 786, 0, 2, 0, 0, 0, 0, 0], "semantic": {"name": "ParsePlainState", "arg_names": ["self", "state"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def ParsePlainState(self, state):\n \"\"\"Parse a state parameter that is a plain resource id or missing.\n\n Args:\n state: State parameter to parse\n \"\"\"\n if state:\n self.action = 'open'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99159:Expr_L214_C4", "label": "expression", "type": "expression", "loc": [214, 218], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99159:FunctionDef_L213_C2", "vector": [8, 2, 0.7082, 0.0164, 2, 0.04, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Parse a state parameter that is a plain resource id or missing.\n\n Args:\n state: State parameter to parse\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99159:If_L219_C4", "label": "if", "type": "if", "loc": [219, 224], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99159:FunctionDef_L213_C2", "vector": [4, 2, 0.7262, 0.0197, 2, 0.04, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if state:\n self.action = 'open'\n self.ids = [state]\n else:\n self.action = 'create'\n self.ids = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99159:Assign_L220_C6", "label": "self.action =", "type": "assigned_variable", "loc": [220, 220], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99159:If_L219_C4", "vector": [14, 3, 0.7213, 0.0033, 3, 0.4, 0.0, 222, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "self.action", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.action = 'open'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99159:Assign_L221_C6", "label": "self.ids =", "type": "assigned_variable", "loc": [221, 221], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99159:If_L219_C4", "vector": [14, 3, 0.7246, 0.0033, 3, 0.4, 0.3333, 806, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "self.ids", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.ids = [state]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99159:Assign_L223_C6", "label": "self.action =", "type": "assigned_variable", "loc": [223, 223], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99159:If_L219_C4", "vector": [14, 3, 0.7311, 0.0033, 3, 0.4, 0.6667, 222, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "self.action", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.action = 'create'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99159:Assign_L224_C6", "label": "self.ids =", "type": "assigned_variable", "loc": [224, 224], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99159:If_L219_C4", "vector": [14, 3, 0.7344, 0.0033, 3, 0.4, 1.0, 806, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "self.ids", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.ids = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99159:ClassDef_L227_C0", "label": "MediaInMemoryUpload", "type": "class", "loc": [227, 295], "level": 0, "parent": null, "vector": [3, 0, 0.8557, 0.2262, 0, 0.66, 0.9667, 833, 0, 6, 0, 0, 102, 0, 1], "semantic": {"name": "MediaInMemoryUpload", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class MediaInMemoryUpload(MediaUpload):\n \"\"\"MediaUpload for a chunk of bytes.\n\n Construct a MediaFileUpload and pass as the media_body parameter of the\n method. For example, if we had a service that allowed plain text:\n \"\"\"\n\n def __init__(self, body, mimetype='application/octet-stream',"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99159:Expr_L228_C2", "label": "expression", "type": "expression", "loc": [228, 232], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99159:ClassDef_L227_C0", "vector": [8, 1, 0.7541, 0.0164, 1, 0.35, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"MediaUpload for a chunk of bytes.\n\n Construct a MediaFileUpload and pass as the media_body parameter of the\n method. For example, if we had a service that allowed plain text:\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99159:FunctionDef_L234_C2", "label": "__init__", "type": "function", "loc": [234, 250], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99159:ClassDef_L227_C0", "vector": [2, 1, 0.7934, 0.0557, 1, 0.35, 0.1667, 555, 0, 5, 0, 0, 0, 0, 0], "semantic": {"name": "__init__", "arg_names": ["self", "body", "mimetype", "chunksize", "resumable"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, body, mimetype='application/octet-stream',\n chunksize=256*1024, resumable=False):\n \"\"\"Create a new MediaBytesUpload.\n\n Args:\n body: string, Bytes of body content.\n mimetype: string, Mime-type of the file or default of\n 'application/octet-stream'."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99159:Expr_L236_C4", "label": "expression", "type": "expression", "loc": [236, 246], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99159:FunctionDef_L234_C2", "vector": [8, 2, 0.7902, 0.0361, 2, 0.71, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Create a new MediaBytesUpload.\n\n Args:\n body: string, Bytes of body content.\n mimetype: string, Mime-type of the file or default of\n 'application/octet-stream'.\n chunksize: int, File will be uploaded in chunks of this many bytes. Only\n used if resumable=True."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99159:Assign_L247_C4", "label": "self._body =", "type": "assigned_variable", "loc": [247, 247], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99159:FunctionDef_L234_C2", "vector": [14, 2, 0.8098, 0.0033, 2, 0.71, 0.25, 36, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self._body", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self._body = body"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99159:Assign_L248_C4", "label": "self._mimetype =", "type": "assigned_variable", "loc": [248, 248], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99159:FunctionDef_L234_C2", "vector": [14, 2, 0.8131, 0.0033, 2, 0.71, 0.5, 699, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self._mimetype", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self._mimetype = mimetype"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99159:Assign_L249_C4", "label": "self._resumable =", "type": "assigned_variable", "loc": [249, 249], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99159:FunctionDef_L234_C2", "vector": [14, 2, 0.8164, 0.0033, 2, 0.71, 0.75, 847, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self._resumable", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self._resumable = resumable"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99159:Assign_L250_C4", "label": "self._chunksize =", "type": "assigned_variable", "loc": [250, 250], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99159:FunctionDef_L234_C2", "vector": [14, 2, 0.8197, 0.0033, 2, 0.71, 1.0, 383, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self._chunksize", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self._chunksize = chunksize"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99159:FunctionDef_L252_C2", "label": "chunksize", "type": "function", "loc": [252, 258], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99159:ClassDef_L227_C0", "vector": [2, 1, 0.8361, 0.023, 1, 0.35, 0.3333, 120, 0, 1, 1, 0, 0, 0, 0], "semantic": {"name": "chunksize", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def chunksize(self):\n \"\"\"Chunk size for resumable uploads.\n\n Returns:\n Chunk size in bytes.\n \"\"\"\n return self._chunksize"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99159:Expr_L253_C4", "label": "expression", "type": "expression", "loc": [253, 257], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99159:FunctionDef_L252_C2", "vector": [8, 2, 0.8361, 0.0164, 2, 0.15, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Chunk size for resumable uploads.\n\n Returns:\n Chunk size in bytes.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99159:Return_L258_C4", "label": "return", "type": "return", "loc": [258, 258], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99159:FunctionDef_L252_C2", "vector": [13, 2, 0.8459, 0.0033, 2, 0.15, 1.0, 0, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self._chunksize"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99159:FunctionDef_L260_C2", "label": "mimetype", "type": "function", "loc": [260, 266], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99159:ClassDef_L227_C0", "vector": [2, 1, 0.8623, 0.023, 1, 0.35, 0.5, 290, 0, 1, 1, 0, 0, 0, 0], "semantic": {"name": "mimetype", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def mimetype(self):\n \"\"\"Mime type of the body.\n\n Returns:\n Mime type.\n \"\"\"\n return self._mimetype"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99159:Expr_L261_C4", "label": "expression", "type": "expression", "loc": [261, 265], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99159:FunctionDef_L260_C2", "vector": [8, 2, 0.8623, 0.0164, 2, 0.02, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Mime type of the body.\n\n Returns:\n Mime type.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99159:Return_L266_C4", "label": "return", "type": "return", "loc": [266, 266], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99159:FunctionDef_L260_C2", "vector": [13, 2, 0.8721, 0.0033, 2, 0.02, 1.0, 0, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self._mimetype"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99159:FunctionDef_L268_C2", "label": "size", "type": "function", "loc": [268, 274], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99159:ClassDef_L227_C0", "vector": [2, 1, 0.8885, 0.023, 1, 0.35, 0.6667, 714, 0, 1, 1, 0, 0, 0, 1], "semantic": {"name": "size", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def size(self):\n \"\"\"Size of upload.\n\n Returns:\n Size of the body.\n \"\"\"\n return len(self._body)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99159:Expr_L269_C4", "label": "expression", "type": "expression", "loc": [269, 273], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99159:FunctionDef_L268_C2", "vector": [8, 2, 0.8885, 0.0164, 2, 0.71, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Size of upload.\n\n Returns:\n Size of the body.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99159:Return_L274_C4", "label": "return", "type": "return", "loc": [274, 274], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99159:FunctionDef_L268_C2", "vector": [13, 2, 0.8984, 0.0033, 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 len(self._body)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99159:FunctionDef_L276_C2", "label": "resumable", "type": "function", "loc": [276, 282], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99159:ClassDef_L227_C0", "vector": [2, 1, 0.9148, 0.023, 1, 0.35, 0.8333, 471, 0, 1, 1, 0, 0, 0, 0], "semantic": {"name": "resumable", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def resumable(self):\n \"\"\"Whether this upload is resumable.\n\n Returns:\n True if resumable upload or False.\n \"\"\"\n return self._resumable"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99159:Expr_L277_C4", "label": "expression", "type": "expression", "loc": [277, 281], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99159:FunctionDef_L276_C2", "vector": [8, 2, 0.9148, 0.0164, 2, 0.95, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Whether this upload is resumable.\n\n Returns:\n True if resumable upload or False.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99159:Return_L282_C4", "label": "return", "type": "return", "loc": [282, 282], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99159:FunctionDef_L276_C2", "vector": [13, 2, 0.9246, 0.0033, 2, 0.95, 1.0, 0, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self._resumable"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99159:FunctionDef_L284_C2", "label": "getbytes", "type": "function", "loc": [284, 295], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99159:ClassDef_L227_C0", "vector": [2, 1, 0.9492, 0.0393, 1, 0.35, 1.0, 626, 0, 3, 1, 0, 0, 0, 0], "semantic": {"name": "getbytes", "arg_names": ["self", "begin", "length"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def getbytes(self, begin, length):\n \"\"\"Get bytes from the media.\n\n Args:\n begin: int, offset from beginning of file.\n length: int, number of bytes to read, starting at begin.\n\n Returns:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99159:Expr_L285_C4", "label": "expression", "type": "expression", "loc": [285, 294], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99159:FunctionDef_L284_C2", "vector": [8, 2, 0.9492, 0.0328, 2, 0.13, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Get bytes from the media.\n\n Args:\n begin: int, offset from beginning of file.\n length: int, number of bytes to read, starting at begin.\n\n Returns:\n A string of bytes read. May be shorter than length if EOF was reached"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99159:Return_L295_C4", "label": "return", "type": "return", "loc": [295, 295], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99159:FunctionDef_L284_C2", "vector": [13, 2, 0.9672, 0.0033, 2, 0.13, 1.0, 0, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self._body[begin:begin + length]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99159:FunctionDef_L298_C0", "label": "RenderTemplate", "type": "function", "loc": [298, 305], "level": 0, "parent": null, "vector": [2, 0, 0.9885, 0.0262, 0, 0.66, 1.0, 734, 0, 2, 1, 0, 0, 0, 1], "semantic": {"name": "RenderTemplate", "arg_names": ["name", "context"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def RenderTemplate(name, **context):\n \"\"\"Render a named template in a context.\n\n Args:\n name: Template name.\n context: Keyword arguments to render as template variables.\n \"\"\"\n return template.render(name, context)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99159:Expr_L299_C2", "label": "expression", "type": "expression", "loc": [299, 304], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99159:FunctionDef_L298_C0", "vector": [8, 1, 0.9885, 0.0197, 1, 0.72, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Render a named template in a context.\n\n Args:\n name: Template name.\n context: Keyword arguments to render as template variables.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99159:Return_L305_C2", "label": "return", "type": "return", "loc": [305, 305], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99159:FunctionDef_L298_C0", "vector": [13, 1, 1.0, 0.0033, 1, 0.72, 1.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return template.render(name, context)"}]
[{"f": "ajibawa-2023/Python-Code-Large/train/row_99159:ClassDef_L45_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99159:Expr_L46_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99159:ClassDef_L45_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99159:Assign_L47_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99159:FunctionDef_L50_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99159:Expr_L51_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99159:FunctionDef_L50_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99159:Assign_L58_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99159:FunctionDef_L50_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99159:Assign_L59_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99159:FunctionDef_L50_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99159:Return_L60_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99159:FunctionDef_L63_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99159:Expr_L64_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99159:FunctionDef_L63_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99159:Assign_L71_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99159:FunctionDef_L63_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99159:If_L72_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99159:If_L72_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99159:Assign_L73_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99159:If_L72_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99159:Assign_L74_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99159:If_L72_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99159:Assign_L75_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99159:If_L72_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99159:Assign_L76_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99159:If_L72_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99159:Expr_L77_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99159:If_L72_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99159:Expr_L78_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99159:If_L72_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99159:Return_L79_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99159:FunctionDef_L82_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99159:Expr_L83_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99159:FunctionDef_L82_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99159:Assign_L90_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99159:FunctionDef_L82_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99159:If_L91_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99159:If_L91_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99159:Assign_L92_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99159:If_L91_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99159:If_L93_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99159:If_L93_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99159:Return_L94_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99159:FunctionDef_L97_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99159:Expr_L98_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99159:FunctionDef_L97_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99159:Assign_L106_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99159:FunctionDef_L97_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99159:Expr_L107_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99159:FunctionDef_L97_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99159:Return_L108_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99159:FunctionDef_L111_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99159:Expr_L112_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99159:FunctionDef_L111_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99159:Assign_L117_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99159:FunctionDef_L111_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99159:Assign_L118_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99159:FunctionDef_L111_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99159:Assign_L119_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99159:FunctionDef_L111_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99159:Expr_L120_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99159:FunctionDef_L123_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99159:Expr_L124_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99159:FunctionDef_L123_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99159:Assign_L131_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99159:FunctionDef_L123_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99159:Assign_L132_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99159:FunctionDef_L123_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99159:Assign_L133_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99159:FunctionDef_L123_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99159:If_L134_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99159:If_L134_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99159:Return_L135_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99159:If_L134_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99159:Expr_L137_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99159:FunctionDef_L140_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99159:Expr_L141_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99159:FunctionDef_L140_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99159:FunctionDef_L148_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99159:FunctionDef_L148_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99159:Assign_L149_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99159:FunctionDef_L148_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99159:Assign_L150_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99159:FunctionDef_L148_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99159:Assign_L151_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99159:FunctionDef_L148_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99159:Expr_L152_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99159:FunctionDef_L140_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99159:Return_L153_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99159:FunctionDef_L156_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99159:Expr_L157_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99159:FunctionDef_L156_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99159:FunctionDef_L164_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99159:FunctionDef_L164_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99159:Assign_L165_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99159:FunctionDef_L164_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99159:If_L166_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99159:If_L166_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99159:Assign_L167_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99159:If_L166_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99159:Assign_L169_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99159:FunctionDef_L164_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99159:Assign_L170_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99159:FunctionDef_L164_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99159:Assign_L171_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99159:FunctionDef_L164_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99159:Expr_L172_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99159:FunctionDef_L156_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99159:Return_L173_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99159:ClassDef_L176_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99159:Expr_L177_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99159:ClassDef_L176_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99159:FunctionDef_L179_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99159:FunctionDef_L179_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99159:Expr_L180_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99159:ClassDef_L176_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99159:FunctionDef_L183_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99159:FunctionDef_L183_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99159:Expr_L184_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99159:FunctionDef_L183_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99159:Return_L190_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99159:ClassDef_L176_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99159:FunctionDef_L192_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99159:FunctionDef_L192_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99159:Expr_L193_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99159:FunctionDef_L192_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99159:If_L198_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99159:If_L198_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99159:Expr_L199_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99159:If_L198_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99159:Expr_L201_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99159:ClassDef_L176_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99159:FunctionDef_L203_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99159:FunctionDef_L203_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99159:Expr_L204_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99159:FunctionDef_L203_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99159:Assign_L209_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99159:FunctionDef_L203_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99159:Assign_L210_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99159:FunctionDef_L203_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99159:Assign_L211_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99159:ClassDef_L176_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99159:FunctionDef_L213_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99159:FunctionDef_L213_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99159:Expr_L214_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99159:FunctionDef_L213_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99159:If_L219_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99159:If_L219_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99159:Assign_L220_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99159:If_L219_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99159:Assign_L221_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99159:If_L219_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99159:Assign_L223_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99159:If_L219_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99159:Assign_L224_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99159:ClassDef_L227_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99159:Expr_L228_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99159:ClassDef_L227_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99159:FunctionDef_L234_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99159:FunctionDef_L234_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99159:Expr_L236_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99159:FunctionDef_L234_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99159:Assign_L247_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99159:FunctionDef_L234_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99159:Assign_L248_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99159:FunctionDef_L234_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99159:Assign_L249_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99159:FunctionDef_L234_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99159:Assign_L250_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99159:ClassDef_L227_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99159:FunctionDef_L252_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99159:FunctionDef_L252_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99159:Expr_L253_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99159:FunctionDef_L252_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99159:Return_L258_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99159:ClassDef_L227_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99159:FunctionDef_L260_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99159:FunctionDef_L260_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99159:Expr_L261_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99159:FunctionDef_L260_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99159:Return_L266_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99159:ClassDef_L227_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99159:FunctionDef_L268_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99159:FunctionDef_L268_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99159:Expr_L269_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99159:FunctionDef_L268_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99159:Return_L274_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99159:ClassDef_L227_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99159:FunctionDef_L276_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99159:FunctionDef_L276_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99159:Expr_L277_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99159:FunctionDef_L276_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99159:Return_L282_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99159:ClassDef_L227_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99159:FunctionDef_L284_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99159:FunctionDef_L284_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99159:Expr_L285_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99159:FunctionDef_L284_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99159:Return_L295_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99159:FunctionDef_L298_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99159:Expr_L299_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99159:FunctionDef_L298_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99159:Return_L305_C2"}]
# This is the version of this source code. manual_verstr = "1.5" auto_build_num = "211" verstr = manual_verstr + "." + auto_build_num try: from pyutil.version_class import Version as pyutil_Version __version__ = pyutil_Version(verstr) except (ImportError, ValueError): # Maybe there is no pyutil installed. from distutils.version import LooseVersion as distutils_Version __version__ = distutils_Version(verstr)
ajibawa-2023/Python-Code-Large/train/row_99161
8
18
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_99161:Assign_L3_C0", "label": "manual_verstr =", "type": "assigned_variable", "loc": [3, 3], "level": 0, "parent": null, "vector": [14, 0, 0.1667, 0.0556, 0, 0.66, 0.0, 189, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "manual_verstr", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "manual_verstr = \"1.5\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99161:Assign_L7_C0", "label": "auto_build_num =", "type": "assigned_variable", "loc": [7, 7], "level": 0, "parent": null, "vector": [14, 0, 0.3889, 0.0556, 0, 0.66, 0.3333, 295, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "auto_build_num", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "auto_build_num = \"211\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99161:Assign_L11_C0", "label": "verstr =", "type": "assigned_variable", "loc": [11, 11], "level": 0, "parent": null, "vector": [14, 0, 0.6111, 0.0556, 0, 0.66, 0.6667, 565, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "verstr", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "verstr = manual_verstr + \".\" + auto_build_num"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99161:Try_L12_C0", "label": "try", "type": "try", "loc": [12, 18], "level": 0, "parent": null, "vector": [7, 0, 0.8333, 0.3889, 0, 0.66, 1.0, 0, 0, 1, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "try:\n from pyutil.version_class import Version as pyutil_Version\n __version__ = pyutil_Version(verstr)\nexcept (ImportError, ValueError):\n # Maybe there is no pyutil installed.\n from distutils.version import LooseVersion as distutils_Version\n __version__ = distutils_Version(verstr)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99161:ImportFrom_L13_C4", "label": "from pyutil.version_class import pyutil_Version", "type": "import", "loc": [13, 13], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99161:Try_L12_C0", "vector": [1, 1, 0.7222, 0.0556, 1, 0.51, 0.0, 483, 0, 1, 0, 0, 483, 0, 0], "semantic": {"name": "pyutil.version_class", "arg_names": [], "import_names": ["pyutil_Version"], "rhs_call_name": "", "annotation": ""}, "snippet": " from pyutil.version_class import Version as pyutil_Version"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99161:Assign_L14_C4", "label": "__version__ = pyutil_Version()", "type": "assigned_variable", "loc": [14, 14], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99161:Try_L12_C0", "vector": [14, 1, 0.7778, 0.0556, 1, 0.51, 1.0, 162, 3, 1, 0, 0, 996, 10, 1], "semantic": {"name": "__version__", "arg_names": [], "import_names": [], "rhs_call_name": "pyutil_Version", "annotation": ""}, "snippet": " __version__ = pyutil_Version(verstr)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99161:ImportFrom_L17_C4", "label": "from distutils.version import distutils_Version", "type": "import", "loc": [17, 17], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99161:Try_L12_C0", "vector": [1, 1, 0.9444, 0.0556, 1, 0.51, 0.0, 42, 0, 1, 0, 0, 42, 0, 0], "semantic": {"name": "distutils.version", "arg_names": [], "import_names": ["distutils_Version"], "rhs_call_name": "", "annotation": ""}, "snippet": " from distutils.version import LooseVersion as distutils_Version"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99161:Assign_L18_C4", "label": "__version__ = distutils_Version()", "type": "assigned_variable", "loc": [18, 18], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99161:Try_L12_C0", "vector": [14, 1, 1.0, 0.0556, 1, 0.51, 1.0, 162, 3, 1, 0, 0, 884, 10, 1], "semantic": {"name": "__version__", "arg_names": [], "import_names": [], "rhs_call_name": "distutils_Version", "annotation": ""}, "snippet": " __version__ = distutils_Version(verstr)"}]
[{"f": "ajibawa-2023/Python-Code-Large/train/row_99161:Try_L12_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99161:ImportFrom_L13_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99161:Try_L12_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99161:Assign_L14_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99161:Try_L12_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99161:ImportFrom_L17_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99161:Try_L12_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99161:Assign_L18_C4"}]
""" The MIT License Copyright (c) 2007-2010 Leah Culver, Joe Stump, Mark Paschal, Vic Fryzel Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. """ import oauth2 import imaplib class IMAP4_SSL(imaplib.IMAP4_SSL): """IMAP wrapper for imaplib.IMAP4_SSL that implements XOAUTH.""" def authenticate(self, url, consumer, token): if consumer is not None and not isinstance(consumer, oauth2.Consumer): raise ValueError("Invalid consumer.") if token is not None and not isinstance(token, oauth2.Token): raise ValueError("Invalid token.") imaplib.IMAP4_SSL.authenticate(self, 'XOAUTH', lambda x: oauth2.build_xoauth_string(url, consumer, token))
ajibawa-2023/Python-Code-Large/train/row_99162
9
40
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_99162:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 23], "level": 0, "parent": null, "vector": [8, 0, 0.3, 0.575, 0, 0.66, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\"\"\"\nThe MIT License\n\nCopyright (c) 2007-2010 Leah Culver, Joe Stump, Mark Paschal, Vic Fryzel\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99162:Import_L25_C0", "label": "oauth2 import oauth2", "type": "import", "loc": [25, 25], "level": 0, "parent": null, "vector": [1, 0, 0.625, 0.025, 0, 0.66, 0.3333, 311, 0, 1, 0, 0, 311, 0, 0], "semantic": {"name": "oauth2", "arg_names": [], "import_names": ["oauth2"], "rhs_call_name": "", "annotation": ""}, "snippet": "import oauth2"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99162:Import_L26_C0", "label": "imaplib import imaplib", "type": "import", "loc": [26, 26], "level": 0, "parent": null, "vector": [1, 0, 0.65, 0.025, 0, 0.66, 0.6667, 129, 0, 1, 0, 0, 129, 0, 0], "semantic": {"name": "imaplib", "arg_names": [], "import_names": ["imaplib"], "rhs_call_name": "", "annotation": ""}, "snippet": "import imaplib"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99162:ClassDef_L29_C0", "label": "IMAP4_SSL", "type": "class", "loc": [29, 40], "level": 0, "parent": null, "vector": [3, 0, 0.8625, 0.3, 0, 0.66, 1.0, 215, 0, 1, 0, 0, 962, 0, 6], "semantic": {"name": "IMAP4_SSL", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class IMAP4_SSL(imaplib.IMAP4_SSL):\n \"\"\"IMAP wrapper for imaplib.IMAP4_SSL that implements XOAUTH.\"\"\"\n\n def authenticate(self, url, consumer, token):\n if consumer is not None and not isinstance(consumer, oauth2.Consumer):\n raise ValueError(\"Invalid consumer.\")\n\n if token is not None and not isinstance(token, oauth2.Token):"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99162:Expr_L30_C4", "label": "expression", "type": "expression", "loc": [30, 30], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99162:ClassDef_L29_C0", "vector": [8, 1, 0.75, 0.025, 1, 0.95, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"IMAP wrapper for imaplib.IMAP4_SSL that implements XOAUTH.\"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99162:FunctionDef_L32_C4", "label": "authenticate", "type": "function", "loc": [32, 40], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99162:ClassDef_L29_C0", "vector": [2, 1, 0.9, 0.225, 1, 0.95, 1.0, 751, 0, 4, 0, 0, 0, 0, 6], "semantic": {"name": "authenticate", "arg_names": ["self", "url", "consumer", "token"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def authenticate(self, url, consumer, token):\n if consumer is not None and not isinstance(consumer, oauth2.Consumer):\n raise ValueError(\"Invalid consumer.\")\n\n if token is not None and not isinstance(token, oauth2.Token):\n raise ValueError(\"Invalid token.\")\n\n imaplib.IMAP4_SSL.authenticate(self, 'XOAUTH',"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99162:If_L33_C8", "label": "if", "type": "if", "loc": [33, 34], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99162:FunctionDef_L32_C4", "vector": [4, 2, 0.8375, 0.05, 2, 0.35, 0.0, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if consumer is not None and not isinstance(consumer, oauth2.Consumer):\n raise ValueError(\"Invalid consumer.\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99162:If_L36_C8", "label": "if", "type": "if", "loc": [36, 37], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99162:FunctionDef_L32_C4", "vector": [4, 2, 0.9125, 0.05, 2, 0.35, 0.5, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if token is not None and not isinstance(token, oauth2.Token):\n raise ValueError(\"Invalid token.\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99162:Expr_L39_C8", "label": "authenticate()", "type": "expression", "loc": [39, 40], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99162:FunctionDef_L32_C4", "vector": [8, 2, 0.9875, 0.05, 2, 0.35, 1.0, 751, 3, 3, 0, 0, 0, 0, 2], "semantic": {"name": "authenticate", "arg_names": [], "import_names": [], "rhs_call_name": "authenticate", "annotation": ""}, "snippet": " imaplib.IMAP4_SSL.authenticate(self, 'XOAUTH',\n lambda x: oauth2.build_xoauth_string(url, consumer, token))"}]
[{"f": "ajibawa-2023/Python-Code-Large/train/row_99162:ClassDef_L29_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99162:Expr_L30_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99162:ClassDef_L29_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99162:FunctionDef_L32_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99162:FunctionDef_L32_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99162:If_L33_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99162:FunctionDef_L32_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99162:If_L36_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99162:FunctionDef_L32_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99162:Expr_L39_C8"}]